19 template <
class T,
int N>
59 TPZ_BCDefine() : fBCVal2(), fForcingFunction(NULL), fForcingFunctionExact(NULL),fTimeDependentForcingFunction(NULL),
60 fTimedependentFunctionExact(NULL), fBCForcingFunction(NULL),fTimedependentBCForcingFunction(NULL)
65 fTimedependentFunctionExact(NULL), fBCForcingFunction(NULL),fTimedependentBCForcingFunction(NULL)
69 TPZ_BCDefine(
const TPZ_BCDefine &cp) : fBCVal2(cp.fBCVal2), fForcingFunction(cp.fForcingFunction),fForcingFunctionExact(cp.fForcingFunctionExact),
70 fTimeDependentForcingFunction(cp.fTimeDependentForcingFunction), fTimedependentFunctionExact(cp.fTimedependentFunctionExact),
71 fBCForcingFunction(cp.fBCForcingFunction),fTimedependentBCForcingFunction(cp.fTimedependentBCForcingFunction)
141 std::cout << __PRETTY_FUNCTION__ <<
" Creating boundary condition with NULL material" << std::endl;
144 fMaterial = material;
173 fBCs[loadcase].fForcingFunction = func;
183 fBCs[loadcase].fForcingFunctionExact = func;
193 fBCs[loadcase].fTimeDependentForcingFunction = func;
203 fBCs[loadcase].fTimedependentFunctionExact = func;
213 fBCs[loadcase].fBCForcingFunction = func;
223 fBCs[loadcase].fTimedependentBCForcingFunction = func;
233 return fBCs[loadcase].fTimedependentBCForcingFunction;
257 if (loadcase == 0 || loadcase > fBCs.
size() ) {
260 return fBCs[loadcase-1].fBCVal2;
267 fBCs.
Resize(val2vec.size()-1);
268 fBCVal2 = val2vec[0];
269 for (
int i=0; i<val2vec.size()-1; i++) {
270 fBCs[i] = val2vec[i+1];
276 return 1+fBCs.
size();
284 void Print(std::ostream & out = std::cout)
override {
285 out <<
" Boundary condition number = " <<
Id() <<
"\n";
286 out <<
" boundary condition type = " << fType <<
"\n";
287 out <<
" val1 = \n"; fBCVal1.
Print(
"fBCVal1",out);
288 out <<
" val2 = \n"; fBCVal2.
Print(
"fBCVal2",out);
290 else out <<
"has no forcing function\n";
386 virtual void Clone(std::map<int, TPZMaterial * > &matvec)
override;
401 virtual int ClassId()
const override;
404 virtual void Write(
TPZStream &buf,
int withclassid)
const override;
413 int &errorid)
override;
418 int &errorid)
override {
virtual int NFluxes() override
Returns the number of components which form the flux function.
void ContributeInterfaceErrors(TPZMaterialData &data, TPZMaterialData &dataleft, TPZMaterialData &dataright, REAL weight, TPZVec< STATE > &nkL, TPZVec< STATE > &nkR, int &errorid) override
Defines the interface which material objects need to implement for discontinuous Galerkin formulation...
TPZBndCond(int matid)
Default constructor.
void Flux(TPZVec< REAL > &x, TPZVec< STATE > &Sol, TPZFMatrix< STATE > &DSol, TPZFMatrix< REAL > &axes, TPZVec< STATE > &flux) override
Computes the value of the flux function to be used by ZZ error estimator.
TPZ_BCDefine & operator=(const TPZ_BCDefine &cp)
void SetMaterial(TPZMaterial *mat)
TPZAutoPointer< TPZFunction< STATE > > fBCForcingFunction
Pointer to bc forcing function, it is a variable boundary condition at differential equation...
Implements a vector class which allows to use external storage provided by the user. Utility.
virtual int NEvalErrors() override
Returns the number of norm errors. Default is 3: energy, L2 and H1.
virtual void ContributeInterfaceBCErrors(TPZMaterialData &data, TPZMaterialData &dataleft, REAL weight, TPZVec< STATE > &nk, TPZBndCond &bc, int &errorid) override
clarg::argBool bc("-bc", "binary checkpoints", false)
TPZAutoPointer< TPZFunction< STATE > > fBCForcingFunction
Pointer to bc forcing function, it is a variable boundary condition at differential equation...
TPZVec< TPZ_BCDefine > fBCs
TPZBndCond(TPZBndCond &bc)
Copy constructor.
Templated vector implementation.
~TPZBndCond()
Default destructor.
TPZAutoPointer< TPZFunction< STATE > > fTimeDependentForcingFunction
Pointer to time dependent forcing function, it is the right member at differential equation...
void SetBCForcingFunction(TPZAutoPointer< TPZFunction< STATE > > fp)
Sets a procedure as variable boundary condition.
virtual void Errors(TPZVec< REAL > &x, TPZVec< STATE > &sol, TPZFMatrix< STATE > &dsol, TPZFMatrix< REAL > &axes, TPZVec< STATE > &flux, TPZVec< STATE > &uexact, TPZFMatrix< STATE > &duexact, TPZVec< REAL > &val) override
Computes the error due to the difference between the interpolated flux and the flux computed based o...
void ContributeErrors(TPZMaterialData &data, REAL weight, TPZVec< REAL > &nk, int &errorid) override
virtual int Dimension() const =0
Returns the integrable dimension of the material.
virtual int NStateVariables() const =0
Returns the number of state variables associated with the material.
This class implements a simple vector storage scheme for a templated class T. Utility.
REAL val(STATE &number)
Returns value of the variable.
TPZAutoPointer< TPZFunction< STATE > > fForcingFunctionExact
Pointer to exact solution function, needed to calculate exact error.
TPZFMatrix< STATE > & Val2(int loadcase=0)
This abstract class defines the behaviour which each derived class needs to implement.
TPZAutoPointer< TPZFunction< STATE > > fTimedependentFunctionExact
Pointer to time dependent exact solution function, needed to calculate exact error.
TPZAutoPointer< TPZFunction< STATE > > fTimedependentBCForcingFunction
Pointer to time dependent bc forcing function, it is a variable boundary condition at differential eq...
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
It computes a contribution to the stiffness matrix and load vector at one integration point...
int64_t size() const
Returns the number of elements of the vector.
void SetForcingFunctionExact(TPZAutoPointer< TPZFunction< STATE > > fp)
Sets a procedure as exact solution for the problem.
virtual void Resize(const int64_t newsize, const T &object)
Resizes the vector object reallocating the necessary storage, copying the existing objects to the new...
TPZAutoPointer< TPZFunction< STATE > > GetTimedependentBCForcingFunction(int loadcase)
virtual void ContributeInterface(TPZMaterialData &data, TPZMaterialData &dataleft, TPZMaterialData &dataright, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
It computes a contribution to stiffness matrix and load vector at one integration point...
virtual int NEvalErrors()
Returns the number of norm errors. Default is 3: energy, L2 and H1.
void UpdateBCValues(TPZManVector< REAL, 3 > &x)
virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
It computes a contribution to the stiffness matrix and load vector at one BC integration point...
virtual int NStateVariables() const override
Returns the number of state variables associated with the material.
int ClassId() const override
Define the class id associated with the class.
TPZFNMatrix< 9, STATE > fBCVal1
first value of boundary condition
TPZBndCond()
Default constructor.
virtual int NFluxes()
Returns the number of components which form the flux function.
Contains TPZMatrixclass which implements full matrix (using column major representation).
#define DebugStop()
Returns a message to user put a breakpoint in.
TPZAutoPointer< TPZFunction< STATE > > fForcingFunctionExact
Pointer to exact solution function, needed to calculate exact error.
TPZAutoPointer< TPZFunction< STATE > > fTimedependentBCForcingFunction
Pointer to time dependent bc forcing function, it is a variable boundary condition at differential eq...
This class defines the boundary condition for TPZMaterial objects.
void SetTimeDependentForcingFunction(TPZAutoPointer< TPZFunction< STATE > > fp)
Sets a procedure as time dependent source function for the material.
Free store vector implementation.
void SetTimeDependentForcingFunction(int loadcase, TPZAutoPointer< TPZFunction< STATE > > func)
TPZ_BCDefine(const TPZ_BCDefine &cp)
virtual void ContributeBCInterface(TPZMaterialData &data, TPZMaterialData &dataleft, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
It computes a contribution to stiffness matrix and load vector at one BC integration point...
virtual void InterfaceJump(TPZVec< REAL > &x, TPZSolVec &leftu, TPZSolVec &rightu, TPZSolVec &jump) override
Compute interface jumps.
void SetTimeDependentFunctionExact(int loadcase, TPZAutoPointer< TPZFunction< STATE > > func)
TPZBndCond(TPZBndCond ©, TPZMaterial *ref)
Contains declaration of the TPZAutoPointer class which has Increment and Decrement actions are mutexe...
TPZFMatrix< STATE > & Val1()
void(* fValFunction)(TPZVec< REAL > &loc, TPZFMatrix< STATE > &Val1, TPZVec< STATE > &Val2, int &BCType)
Function to allow fBCVal1 to be variable.
TPZMaterial * fMaterial
pointer to material which created bc
void Print(std::ostream &out=std::cout) override
Prints out the data associated with the material.
virtual int HasForcingFunction()
Directive that gives true if the material has a forcing function.
virtual void FillDataRequirementsInterface(TPZMaterialData &data, TPZVec< TPZMaterialData > &datavec_left, TPZVec< TPZMaterialData > &datavec_right) override
This method defines which parameters need to be initialized in order to compute the contribution of i...
int fType
boundary condition type
void SetTimedependentBCForcingFunction(TPZAutoPointer< TPZFunction< STATE > > fp)
Sets a procedure as time variable boundary condition.
TPZAutoPointer< TPZFunction< STATE > > fTimedependentFunctionExact
Pointer to time dependent exact solution function, needed to calculate exact error.
virtual int MinimumNumberofLoadCases() override
returns the minimum number of load cases for this material
TPZAutoPointer< TPZFunction< STATE > > fForcingFunction
Pointer to forcing function, it is the right member at differential equation.
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
void SetValFunction(void(*fp)(TPZVec< REAL > &loc, TPZFMatrix< STATE > &Val1, TPZVec< STATE > &Val2, int &BCType))
TPZFNMatrix< 6, STATE > fBCVal2
second value of boundary condition
virtual void FillDataRequirements(TPZMaterialData &data) override
Calls the aggregate material correspondent function.
void SetBCForcingFunction(int loadcase, TPZAutoPointer< TPZFunction< STATE > > func)
int Dimension() const override
Returns the integrable dimension of the material.
void SetForcingFunction(TPZAutoPointer< TPZFunction< STATE > > fp)
Sets a procedure as source function for the material.
void Read(TPZStream &buf, void *context) override
read objects from the stream
virtual void Clone(std::map< int, TPZMaterial * > &matvec) override
Creates a copy of the material object and put it in the vector which is passed on.
TPZBndCond(TPZMaterial *material, int id, int type, TPZFMatrix< STATE > &val1, TPZFMatrix< STATE > &val2)
TPZAutoPointer< TPZFunction< STATE > > fForcingFunction
Pointer to forcing function, it is the right member at differential equation.
void Fill(const T ©, const int64_t from=0, const int64_t numelem=-1)
Will fill the elements of the vector with a copy object.
void SetTimedependentBCForcingFunction(int loadcase, TPZAutoPointer< TPZFunction< STATE > > func)
void SetForcingFunctionExact(int loadcase, TPZAutoPointer< TPZFunction< STATE > > func)
virtual void Print(std::ostream &out) const
void SetTimeDependentFunctionExact(TPZAutoPointer< TPZFunction< STATE > > fp)
Sets a procedure as time dependent exact solution for the problem.
Defines the interface for saving and reading data. Persistency.
Contains the declaration of TPZFlopCounter class and TPZCounter struct.
Contains the TPZDiscontinuousGalerkin class which implements the interface for discontinuous Galerkin...
This class defines the interface to save and restore objects from TPZStream objects. Persistency.
void SetLoadCases(TPZVec< TPZFMatrix< STATE > > &val2vec)
TPZFNMatrix< 3, STATE > fBCVal2
second value of boundary condition
void SetForcingFunction(int loadcase, TPZAutoPointer< TPZFunction< STATE > > func)
TPZ_BCDefine(TPZFMatrix< STATE > Val2)
TPZMaterial * Material() const
TPZAutoPointer< TPZFunction< STATE > > fTimeDependentForcingFunction
Pointer to time dependent forcing function, it is the right member at differential equation...
This class implements a reference counter mechanism to administer a dynamically allocated object...