8 #ifndef TPZBndCondWithMem_h 9 #define TPZBndCondWithMem_h 35 TPZBndCondWithMem(
TPZMaterial * material,
int matid,
int type,
TPZFMatrix<STATE> &val1,
TPZFMatrix<STATE> &val2) :
TPZBndCond(material,matid,type,val1,val2),
fMemory(new
TPZAdmChunkVector<TMEM>()),
fDefaultMem(),
fUpdateMem(false) {
46 virtual std::string
Name()
override {
47 return "TPZBndCondWithMem<TMEM>";
50 virtual void Print(std::ostream &out)
override;
52 virtual TMEM &
MemItem(
const int i)
const;
61 std::shared_ptr<TPZAdmChunkVector<TMEM>> &
GetMemory();
65 virtual int PushMemItem(
int sourceIndex = -1)
override;
74 int nmem =
fMemory->NElements();
75 for (
unsigned int im = 0; im < nmem; im++) {
84 void Clone(std::map<int, TPZMaterial * > &matvec)
override {
91 refmaterial->
Clone(matvec);
92 refmatid = refmaterial->
Id();
93 newrefmaterial = matvec[refmatid];
95 std::map<int, TPZMaterial * >::iterator matit;
96 matit = matvec.find(matid);
97 if(matit == matvec.end())
100 matvec[matid] = newmat;
149 std::shared_ptr<TPZAdmChunkVector<TMEM>>
fMemory;
int ClassId() const override
Unique identifier for serialization purposes.
void UpdateBCValues(TPZVec< TPZMaterialData > &datavec)
clarg::argBool bc("-bc", "binary checkpoints", false)
TPZBndCondWithMem(TPZBndCondWithMem< TMEM > &bc, TPZMaterial *ref)
std::shared_ptr< TPZAdmChunkVector< TMEM > > fMemory
Shared pointer to material memory.
This class implements a simple vector storage scheme for a templated class T. Utility.
Implements a chunk vector with free store administration. Utility.
virtual void Contribute(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ek, TPZFMatrix< STATE > &ef) override
Contribute methods.
TPZBndCondWithMem(int matid)
virtual void SetUpdateMem(bool update=1)
TPZBndCondWithMem(TPZMaterial *material, int matid, int type, TPZFMatrix< STATE > &val1, TPZFMatrix< STATE > &val2)
void Write(TPZStream &buf, int withclassid) const override
Saves the element data to a stream.
virtual int PushMemItem(int sourceIndex=-1) override
Pushes a new entry in the context of materials with memory, returning its index at the internal stora...
virtual std::string Name() override
Returns the name of the material.
This abstract class defines the behaviour which each derived class needs to implement.
virtual void ContributeBCInterface(TPZMaterialData &data, TPZMaterialData &dataleft, REAL weight, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
It computes a contribution to residual vector at one BC integration point.
Contains the TPZBndCond class which implements a boundary condition for TPZMaterial objects...
TPZBndCondWithMem(TPZBndCondWithMem< TMEM > &bc)
~TPZBndCondWithMem()
Default destructor.
#define DebugStop()
Returns a message to user put a breakpoint in.
virtual void ContributeBC(TPZMaterialData &data, REAL weight, TPZFMatrix< STATE > &ef, TPZBndCond &bc) override
It computes a contribution to the stiffness matrix and load vector at one BC integration point...
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...
This class defines the boundary condition for TPZMaterial objects.
std::shared_ptr< TPZAdmChunkVector< TMEM > > & GetMemory()
virtual void Print(std::ostream &out) override
Prints out the data associated with the material.
virtual void FreeMemItem(int index) override
Frees an entry in the material with memory internal history storage.
void SetMemory(std::shared_ptr< TPZAdmChunkVector< TMEM >> &memory)
virtual void SetDefaultMem(TMEM &defaultMem)
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...
void ResetMemItem(int index)
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.
void Read(TPZStream &buf, void *context) override
Reads the element data from a stream.
virtual void ContributeInterface(TPZMaterialData &data, TPZMaterialData &dataleft, TPZMaterialData &dataright, REAL weight, TPZFMatrix< STATE > &ef) override
It computes a contribution to residual vector at one integration point.
virtual void Clone(std::map< int, TPZMaterial * > &matvec)
Creates a copy of the material object and put it in the vector which is passed on.
TMEM fDefaultMem
Default memory settings.
virtual void ContributeInterface(TPZMaterialData &data, TPZVec< TPZMaterialData > &dataleft, TPZVec< 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...
Defines the interface for saving and reading data. Persistency.
bool fUpdateMem
Flag to indicate whether the memory data are to be updated in an assemble loop.
virtual TMEM & MemItem(const int i) const
TPZMaterial * Material() const
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...