NeoPZ
Public Member Functions | Protected Attributes | List of all members
TPZMatWithMem< TMEM, TFather > Class Template Reference

Implements an abstract class implementing the memory features. More...

#include <TPZMatWithMem.h>

Inheritance diagram for TPZMatWithMem< TMEM, TFather >:
[legend]
Collaboration diagram for TPZMatWithMem< TMEM, TFather >:
[legend]

Public Member Functions

 TPZMatWithMem ()
 Default constructor. More...
 
 TPZMatWithMem (int id)
 Creates a material object and inserts it in the vector of material pointers of the mesh. More...
 
 TPZMatWithMem (const TPZMatWithMem< TMEM, TFather > &mat)
 Creates a material object based on the referred object and inserts it in the vector of material pointers of the mesh. More...
 
virtual ~TPZMatWithMem ()
 
virtual std::string Name () override
 Returns the name of the material. More...
 
virtual void PrintMem (std::ostream &out=std::cout, const int memory=0)
 Prints out the data associated with the material. More...
 
virtual void Print (std::ostream &out) override
 Prints out the data associated with the material. More...
 
virtual TMEM & MemItem (const int i) const
 
int ClassId () const override
 Unique identifier for serialization purposes. More...
 
void Write (TPZStream &buf, int withclassid) const override
 
void Read (TPZStream &buf, void *context) override
 
std::shared_ptr< TPZAdmChunkVector< TMEM > > & GetMemory ()
 
void SetMemory (std::shared_ptr< TPZAdmChunkVector< TMEM >> &memory)
 
virtual int PushMemItem (int sourceIndex=-1) override
 Pushes a new entry in the context of materials with memory. More...
 
virtual void FreeMemItem (int index) override
 Frees an entry in the material with memory internal history storage. More...
 
void ResetMemItem (int index)
 
void ResetMemory ()
 Reset all memory items. More...
 
virtual void SetDefaultMem (TMEM &defaultMem)
 Sets the default memory settings for initialization. More...
 
virtual TMEM & GetDefaultMemory ()
 Access the default memory settings for initislization. More...
 
virtual void SetUpdateMem (bool update=1)
 Sets/Unsets the internal memory data to be updated in the next assemble/contribute call. More...
 
virtual bool GetUpdateMem ()
 Gets the internal memory data to be updated in the next assemble/contribute call. More...
 

Protected Attributes

std::shared_ptr< TPZAdmChunkVector< TMEM > > fMemory
 Shared pointer to material memory. More...
 
TMEM fDefaultMem
 Default memory settings. More...
 
bool fUpdateMem
 Flag to indicate whether the memory data are to be updated in an assemble loop. More...
 

Detailed Description

template<class TMEM, class TFather = TPZMaterial>
class TPZMatWithMem< TMEM, TFather >

Implements an abstract class implementing the memory features.

Materials that aim to use memory shoud be derived from this class.

Definition at line 23 of file TPZMatWithMem.h.

Constructor & Destructor Documentation

◆ TPZMatWithMem() [1/3]

template<class TMEM , class TFather >
TPZMatWithMem< TMEM, TFather >::TPZMatWithMem ( )

Default constructor.

Definition at line 119 of file TPZMatWithMem.h.

◆ TPZMatWithMem() [2/3]

template<class TMEM , class TFather >
TPZMatWithMem< TMEM, TFather >::TPZMatWithMem ( int  id)

Creates a material object and inserts it in the vector of material pointers of the mesh.

Upon return vectorindex contains the index of the material object within the vector

Definition at line 126 of file TPZMatWithMem.h.

◆ TPZMatWithMem() [3/3]

template<class TMEM, class TFather>
TPZMatWithMem< TMEM, TFather >::TPZMatWithMem ( const TPZMatWithMem< TMEM, TFather > &  mat)

Creates a material object based on the referred object and inserts it in the vector of material pointers of the mesh.

Upon return vectorindex contains the index of the material object within the vector

Definition at line 133 of file TPZMatWithMem.h.

◆ ~TPZMatWithMem()

template<class TMEM , class TFather >
TPZMatWithMem< TMEM, TFather >::~TPZMatWithMem ( )
virtual

Definition at line 141 of file TPZMatWithMem.h.

Member Function Documentation

◆ ClassId()

template<class TMEM , class TFather >
int TPZMatWithMem< TMEM, TFather >::ClassId ( ) const
override

Unique identifier for serialization purposes.

Definition at line 177 of file TPZMatWithMem.h.

Referenced by TPZMatElastoPlastic< T, TMEM >::ClassId(), and TPZMatWithMem< TPZFMatrix< REAL >, TPZElasticity3D >::Name().

◆ FreeMemItem()

template<class TMEM , class TFather >
void TPZMatWithMem< TMEM, TFather >::FreeMemItem ( int  index)
overridevirtual

Frees an entry in the material with memory internal history storage.

Definition at line 227 of file TPZMatWithMem.h.

Referenced by TPZMatWithMem< TPZFMatrix< REAL >, TPZElasticity3D >::Name().

◆ GetDefaultMemory()

template<class TMEM, class TFather = TPZMaterial>
virtual TMEM& TPZMatWithMem< TMEM, TFather >::GetDefaultMemory ( )
inlinevirtual

Access the default memory settings for initislization.

Definition at line 95 of file TPZMatWithMem.h.

◆ GetMemory()

template<class TMEM , class TFather >
std::shared_ptr< TPZAdmChunkVector< TMEM > > & TPZMatWithMem< TMEM, TFather >::GetMemory ( )

◆ GetUpdateMem()

template<class TMEM , class TFather >
bool TPZMatWithMem< TMEM, TFather >::GetUpdateMem ( )
virtual

Gets the internal memory data to be updated in the next assemble/contribute call.

Definition at line 242 of file TPZMatWithMem.h.

Referenced by TPZMatWithMem< TPZFMatrix< REAL >, TPZElasticity3D >::GetDefaultMemory().

◆ MemItem()

template<class TMEM , class TFather >
TMEM & TPZMatWithMem< TMEM, TFather >::MemItem ( const int  i) const
virtual

◆ Name()

template<class TMEM, class TFather = TPZMaterial>
virtual std::string TPZMatWithMem< TMEM, TFather >::Name ( )
inlineoverridevirtual

Returns the name of the material.

Reimplemented in TPZMatElastoPlastic< T, TMEM >, TPZMatPorous< T, TMEM >, and TPZMatElastoPlastic2D< T, TMEM >.

Definition at line 43 of file TPZMatWithMem.h.

◆ Print()

template<class TMEM , class TFather >
void TPZMatWithMem< TMEM, TFather >::Print ( std::ostream &  out)
overridevirtual

Prints out the data associated with the material.

Reimplemented in TPZMatElastoPlastic< T, TMEM >, and TPZMatElastoPlastic2D< T, TMEM >.

Definition at line 145 of file TPZMatWithMem.h.

Referenced by TPZMatWithMem< TPZFMatrix< REAL >, TPZElasticity3D >::Name(), and TPZMatElastoPlastic< T, TMEM >::Print().

◆ PrintMem()

template<class TMEM , class TFather >
void TPZMatWithMem< TMEM, TFather >::PrintMem ( std::ostream &  out = std::cout,
const int  memory = 0 
)
virtual

Prints out the data associated with the material.

Definition at line 161 of file TPZMatWithMem.h.

Referenced by TPZMatWithMem< TPZFMatrix< REAL >, TPZElasticity3D >::Name(), and TPZMatElastoPlastic< T, TMEM >::Print().

◆ PushMemItem()

template<class TMEM , class TFather >
int TPZMatWithMem< TMEM, TFather >::PushMemItem ( int  sourceIndex = -1)
overridevirtual

Pushes a new entry in the context of materials with memory.

Returns
Returning its index at the internal storage stackTo be implemented only in the proper materials.

Definition at line 216 of file TPZMatWithMem.h.

Referenced by InsertViscoElasticity(), and TPZMatWithMem< TPZFMatrix< REAL >, TPZElasticity3D >::Name().

◆ Read()

template<class TMEM , class TFather >
void TPZMatWithMem< TMEM, TFather >::Read ( TPZStream buf,
void *  context 
)
override

◆ ResetMemItem()

template<class TMEM, class TFather = TPZMaterial>
void TPZMatWithMem< TMEM, TFather >::ResetMemItem ( int  index)
inline

◆ ResetMemory()

template<class TMEM, class TFather = TPZMaterial>
void TPZMatWithMem< TMEM, TFather >::ResetMemory ( )
inline

Reset all memory items.

Definition at line 84 of file TPZMatWithMem.h.

◆ SetDefaultMem()

template<class TMEM, class TFather >
void TPZMatWithMem< TMEM, TFather >::SetDefaultMem ( TMEM &  defaultMem)
virtual

Sets the default memory settings for initialization.

Definition at line 232 of file TPZMatWithMem.h.

Referenced by InsertViscoElasticity(), and TPZMatWithMem< TPZFMatrix< REAL >, TPZElasticity3D >::ResetMemory().

◆ SetMemory()

template<class TMEM, class TFather >
void TPZMatWithMem< TMEM, TFather >::SetMemory ( std::shared_ptr< TPZAdmChunkVector< TMEM >> &  memory)

◆ SetUpdateMem()

template<class TMEM , class TFather >
void TPZMatWithMem< TMEM, TFather >::SetUpdateMem ( bool  update = 1)
virtual

Sets/Unsets the internal memory data to be updated in the next assemble/contribute call.

Definition at line 237 of file TPZMatWithMem.h.

Referenced by TPZMatWithMem< TPZFMatrix< REAL >, TPZElasticity3D >::GetDefaultMemory(), main(), PYBIND11_MODULE(), and TPZElastoPlasticAnalysis::SetUpdateMem().

◆ Write()

template<class TMEM , class TFather >
void TPZMatWithMem< TMEM, TFather >::Write ( TPZStream buf,
int  withclassid 
) const
override

Member Data Documentation

◆ fDefaultMem

template<class TMEM, class TFather = TPZMaterial>
TMEM TPZMatWithMem< TMEM, TFather >::fDefaultMem
protected

◆ fMemory

template<class TMEM, class TFather = TPZMaterial>
std::shared_ptr<TPZAdmChunkVector<TMEM> > TPZMatWithMem< TMEM, TFather >::fMemory
protected

◆ fUpdateMem

template<class TMEM, class TFather = TPZMaterial>
bool TPZMatWithMem< TMEM, TFather >::fUpdateMem
protected

The documentation for this class was generated from the following file: