CEPS  24.01
Cardiac ElectroPhysiology Simulator
FEHeatAssembler Class Reference

Detailed Description

Assembles the heat problem matrix for a given set of finite elements. here the diffusion coefficient is dependant of time and/or space.

See also
SAFunc

The time factor defined in the class multiplies the mass matrix, so it should be homogeneous to 1/dt

Definition at line 41 of file FEHeatAssembler.hpp.

#include <FEHeatAssembler.hpp>

Inheritance diagram for FEHeatAssembler:
[legend]

Public Member Functions

 FEHeatAssembler (FiniteElements *fe, CepsBool isBoundary=false, const CepsSet< CepsAttribute > &attributes={CepsUniversal}, const CepsVector< Unknown * > &unknowns={})
 Constructor with finite elements. More...
 
- Public Member Functions inherited from FEDivKGradAssembler
 FEDivKGradAssembler ()
 Default constructor (for virtual inheritance) More...
 
 FEDivKGradAssembler (FiniteElements *fe, CepsBool isBoundary=false, const CepsSet< CepsAttribute > &attributes={CepsUniversal}, const CepsVector< Unknown * > &unknowns={})
 Constructor with finite elements. More...
 
virtual ~FEDivKGradAssembler ()
 Destructor. More...
 
void setKForUnknown (Unknown *u, CepsMathScalar k)
 Register the diffusion coefficient (x,t,...) for given unknown. More...
 
void setKForUnknown (Unknown *u, SAFunc< CepsMathScalar > *k)
 Register the diffusion coefficient (x,t,...) for given unknown. More...
 
void setKForUnknown (Unknown *u, CepsMathTensor k)
 Register the diffusion coefficient (x,t,...) for given unknown. More...
 
void setKForUnknown (Unknown *u, SAFunc< CepsMathTensor > *k)
 Register the diffusion coefficient (x,t,...) for given unknown. More...
 
CepsBool isChangingBetweenTimes (CepsReal t1, CepsReal t2) const override
 Tells if this assembler changes between the two times. More...
 
- Public Member Functions inherited from FEAssembler
 FEAssembler ()
 default constructor used for virtual inheritance More...
 
 FEAssembler (FiniteElements *fe, CepsBool isBoundary=false, const CepsSet< CepsAttribute > &attributes={CepsUniversal}, const CepsVector< Unknown * > &unknowns={})
 Constructor with finite elements structure. More...
 
 ~FEAssembler () override
 Destructor. More...
 
void assemble (CepsReal t=0., CepsBool finalize=true) override
 Main assembly call. Fills the linear system pointed by the class. More...
 
- Public Member Functions inherited from AbstractAssembler
 AbstractAssembler ()
 Default constructor (used for virtual inheritance) More...
 
 AbstractAssembler (AbstractDiscretization *discr, const CepsSet< CepsAttribute > &attributes={CepsUniversal}, const CepsVector< Unknown * > &unknowns={})
 Basic constructor If the given attributes is empty, the assembler will assemble everywhere (CepsUniversal) Similar for unknowns: no unknown specified means assembly will be for all unknowns. More...
 
 AbstractAssembler (const AbstractAssembler &that)=delete
 No copy constructor. More...
 
AbstractAssembleroperator= (const AbstractAssembler &that)=delete
 No assignement operator. More...
 
virtual ~AbstractAssembler ()
 Destructor. More...
 
virtual void assembleForZeroDDof (DegreeOfFreedom *dof, CepsReal t=0.)
 Assembly routine for zeroD dofs. Does nothing by default, redefine in derived classes. More...
 
CepsBool isAssemblingMatrix () const
 True if ptr to matrix has been set. More...
 
DistributedMatrixgetMatrix ()
 The matrix to assemble. More...
 
void setMatrix (DistributedMatrix *mat)
 The matrix to assemble. More...
 
CepsBool isAssemblingVector () const
 True if ptr to vector has been set. More...
 
DistributedVectorgetVector ()
 The vector to assemble. More...
 
void setVector (DistributedVector *vec)
 The vector to assemble. More...
 
void setScaleFactor (CepsReal scaleFactor)
 Factor that multiplies all coefficients to put in linear system. More...
 
CepsReal getScaleFactor () const
 Factor that multiplies all coefficients to put in linear system. More...
 
void setAssemblingFlag (const CepsAssemblingFlag &value)
 Part to assemble in an assembler, see values of CepsAssemblingFlag. More...
 
CepsAssemblingFlag getAssemblingFlag () const
 Get part to assemble in an assembler, see values of CepsAssemblingFlag. More...
 
AbstractPdeProblemgetProblem () const
 Link to PDE problem. More...
 
- Public Member Functions inherited from ceps::HoldsAttributes
 HoldsAttributes (const CepsSet< CepsAttribute > &attributes)
 Constructor with any number of attributes. More...
 
 HoldsAttributes (const CepsVector< CepsAttribute > &attributes)
 Constructor with any number of attributes. More...
 
 HoldsAttributes (CepsAttribute *attributes, const CepsUInt &n)
 Constructor with any number of attributes. More...
 
 HoldsAttributes ()=default
 Default constructor. More...
 
 HoldsAttributes (const HoldsAttributes &)=default
 Assignement operator. More...
 
 HoldsAttributes (HoldsAttributes &&) noexcept=default
 Copy constructor. More...
 
virtual ~HoldsAttributes ()=default
 Destructor. More...
 
HoldsAttributesoperator= (const HoldsAttributes &)=default
 Assignment operator. More...
 
HoldsAttributesoperator= (HoldsAttributes &&) noexcept=default
 Assignment operator. More...
 
CepsUInt getNumberOfAttributes () const
 Returns number of attributes of the entity. More...
 
CepsSet< CepsAttribute > & getAttributes ()
 Returns the attributes of the entity. More...
 
const CepsSet< CepsAttribute > & getAttributes () const
 Returns the attributes of the entity, const version. More...
 
void setAttributes (const CepsVector< CepsAttribute > &attributes)
 Sets the attributes of the entity. More...
 
void setAttributes (const CepsSet< CepsAttribute > &attributes)
 Sets the attributes of the entity. More...
 
void setAttributes (const CepsAttribute *attributes, const CepsUInt &n)
 Sets the attributes of the entity. More...
 
template<class _It >
void setAttributes (_It first, _It last)
 Sets the attributes of the entity. More...
 
void addAttribute (const CepsAttribute &name)
 Adds an attribute to the entity. More...
 
void addAttributes (const CepsVector< CepsAttribute > &attributes)
 Adds several attributes to the entity. More...
 
void addAttributes (const CepsSet< CepsAttribute > &attributes)
 Adds several attributes to the entity. More...
 
void addAttributes (const CepsAttribute *attributes, const CepsUInt &n)
 Adds several attributes to the entity. More...
 
template<class _It >
void addAttributes (_It first, _It last)
 Adds several attributes to the entity. More...
 
void removeAttribute (const CepsAttribute &name)
 Removes an attribute from the entity. More...
 
void removeAttributes (const CepsSet< CepsAttribute > &attributes)
 Removes several attributes from the entity. More...
 
void removeAttributes (const CepsVector< CepsAttribute > &attributes)
 Removes several attributes from the entity. More...
 
void removeAttributes (const CepsAttribute *attributes, const CepsUInt &n)
 Removes several attributes from the entity. More...
 
template<class _It >
void removeAttributes (_It first, _It last)
 Removes several attributes from the entity. More...
 
void clearAttributes ()
 Removes all attributes from the entity. More...
 
CepsBool hasAttribute (const CepsAttribute &name) const
 Tells if the entity has the attribute in argument. More...
 
CepsBool hasAllAttributes (const CepsVector< CepsAttribute > &attributes) const
 Tells if the entity has all the attributes in argument. More...
 
CepsBool hasAllAttributes (const CepsAttribute *attributes, const CepsUInt &n) const
 Tells if the entity has all the attributes in argument. More...
 
template<class _It >
CepsBool hasAllAttributes (_It first, _It last) const
 Tells if the entity has all the attributes in argument. More...
 
CepsBool hasOneOfAttributes (const CepsSet< CepsAttribute > &attributes) const
 Tells if the entity has one of the attributes in argument. More...
 
CepsBool hasOneOfAttributes (const CepsVector< CepsAttribute > &attributes) const
 Tells if the entity has one of the attributes in argument. More...
 
CepsBool hasOneOfAttributes (const CepsAttribute *attributes, const CepsUInt &n) const
 Tells if the entity has one of the attributes in argument. More...
 
template<class _It >
CepsBool hasOneOfAttributes (_It first, _It last) const
 Tells if the entity has one of the attributes in argument. More...
 
CepsBool hasUniversalAttribute () const
 Detect if the current entity has the attribute universal. More...
 
void reset ()
 Equivalent to HoldsAttributes::clear() More...
 
- Public Member Functions inherited from CepsObject
 CepsObject ()=default
 default constructor More...
 
 CepsObject (const CepsObject &)=default
 Copy constructor. More...
 
virtual ~CepsObject ()=default
 Destructor. More...
 
CepsObjectoperator= (const CepsObject &)=default
 Assignment operator. More...
 
CepsObjecttoBaseObject ()
 Returns a pointer to CepsObject class. More...
 
const CepsObjecttoBaseObject () const
 Returns a pointer to CepsObject class, const version. More...
 
ProfilergetProfiler () const
 Access to profiler. More...
 

Protected Member Functions

virtual void computeBlocksOnElementAtQuadPoint (FEBase *element, CepsReal3D xQ, CepsReal t, const CepsMathDynamic1D &phi, const CepsMathDynamic2D &gradPhi) override
 The function that is called to get the coefficients of the submatrix on a given finite element. This function MUST start with a call to setupSubmatrixOnElementForUnknowns, and MUST add something to m_bMat or m_bVec to be effective. More...
 
- Protected Member Functions inherited from FEDivKGradAssembler
CepsVector< CepsMathTensorgetDiffusionTensorsForUnknowns (const CepsVector< Unknown * > &us, FEBase *elem, CepsReal3D x, CepsReal t) const
 Returns tensors with the correct k tensor type. To be defined in child classes. More...
 
- Protected Member Functions inherited from FEAssembler
void prepareQuadratures ()
 Precompute phi and grad phi at quadrature points. More...
 
void init ()
 Set the element iterator to the right place. More...
 
void next ()
 Move to next element, selected by attribute. More...
 
CepsBool finished ()
 Tells if end of loop is reached. More...
 
void assembleForCurrentElement (CepsReal t)
 Computes the submatrix and subvector for the currently selected element and add its contribution to the system. More...
 
CepsVector< Unknown * > extractUnknownsFrom (const CepsVector< Unknown * > &us, FEBase *elem) const
 From a vector of unknowns, get the ones defined on that element. More...
 
void setupBlocksOnElementForUnknown (FEBase *elem, Unknown *unknown)
 Get all the dofs on an element related to the given unknowns. This routine MUST be called before sumBlockContribution. It resizes and zeroes the internal submatrix and dofs index mapping (between submatrix and global matrix). Even if a single unknown is given, the output is the same as for several unknowns. More...
 
virtual void setupBlocksOnElementForUnknowns (FEBase *elem, const CepsVector< Unknown * > &unknowns)
 Get all the dofs on an element related to the given unknowns. This routine MUST be called before addBlockContribution. It resizes and zeroes the internal submatrix and dofs index mapping (between submatrix and global matrix). The dofs are regrouped by unknown, each group being of size the number of FE nodes of the element. More...
 
void sumBlockContribution (CepsReal weight)
 Adds w*m_bMat to m_bMatTemp, same for vectors. The weight should be jacobian*quad weight for which computeMatrixOnElement has been called. More...
 
virtual void addZeroDMatBlockContribution (CepsReal value, DegreeOfFreedom *a, DegreeOfFreedom *b)
 Add a 0D contribution into the matrix. More...
 
void addZeroDMatBlockContributions (const CepsVector< CepsReal > &values, DegreeOfFreedom *a, const CepsVector< DegreeOfFreedom * > &b, CepsReal factor=1.0)
 Add 0D contributions into the matrix. More...
 
virtual void addZeroDVecBlockContribution (CepsReal value, DegreeOfFreedom *dof)
 Add a 0D contribution into the vector. More...
 
void addBlockContribution ()
 Add the content of the block matrices in the global matrix, and the content of the block vectors in the the global vector. More...
 
virtual void addMatrixBlockContribution ()
 Add the content of the block matrices in the global matrix. More...
 
virtual void addVectorBlockContribution ()
 Add the content of the block vectors in the the global vector. More...
 

Additional Inherited Members

- Protected Attributes inherited from FEDivKGradAssembler
CepsMap< CepsUnknownIndex, CepsMathScalarm_cstScalars
 Diffusion coefficient. More...
 
CepsMap< CepsUnknownIndex, SAFunc< CepsMathScalar > * > m_fctScalars
 Diffusion coefficient. More...
 
CepsMap< CepsUnknownIndex, CepsMathTensorm_cstTensors
 Diffusion coefficient. More...
 
CepsMap< CepsUnknownIndex, SAFunc< CepsMathTensor > * > m_fctTensors
 Diffusion coefficient. More...
 
CepsBool m_isTimeDependant
 Enforce time dependencie. More...
 
- Protected Attributes inherited from FEAssembler
FiniteElementsm_fe
 Pointer to finite elements structure. More...
 
CepsBool m_boundaryOnly
 Flag for localization of what to assemble. More...
 
CepsVector< FEBase * >::iterator m_elem
 Iterator on elements. It will loop through elements for dim3, dim2 then dim1 of m_fe. More...
 
CepsVector< FEBase * > * m_toParse
 The vector of elements to parse;. More...
 
CepsMap< CepsCellType, CepsArray4< IntegrationTools * > > m_tools
 Integration tools. More...
 
CepsVector< CepsVector< CepsMathDynamic2D > > m_bMat
 Block submatrices. The first two vectors account for unknowns: if assembly on element if for unknowns {u1,u2}, then m_bMat[0][1] is for the contributions of u2 on lines for u1. Each submatrix is of size NxN where N is the number of FE Nodes in the elements (not dofs) The *SumQuads one is to compute for all quadrature points. More...
 
CepsVector< CepsVector< CepsMathDynamic2D > > m_bMatSumQuads
 Block submatrices. The first two vectors account for unknowns: if assembly on element if for unknowns {u1,u2}, then m_bMat[0][1] is for the contributions of u2 on lines for u1. Each submatrix is of size NxN where N is the number of FE Nodes in the elements (not dofs) The *SumQuads one is to compute for all quadrature points. More...
 
CepsVector< CepsVector< CepsBool > > m_addMatBlock
 Prevents additions of blocks for interactions between unknowns that have not been set. More...
 
CepsVector< CepsMathDynamic1Dm_bVec
 Block vector,. More...
 
CepsVector< CepsMathDynamic1Dm_bVecSumQuads
 Block vector,. More...
 
CepsVector< CepsBoolm_addVecBlock
 Prevents additions of blocks for interactions between unknowns that have not been set. More...
 
CepsBool m_newBlocksNeeded
 Flag to ensure that the blocks are resized only once. More...
 
CepsVector< CepsVector< CepsDofGlobalIndex > > m_dofsBlockMapping
 Mapping between lines of submatrix m_bMat m_bVec and global matrix indices. More...
 
CepsVector< CepsVector< DegreeOfFreedom * > > m_dofsBlock
 Degrees of freedom corresponding to elementary matrix rows. More...
 
- Protected Attributes inherited from AbstractAssembler
AbstractPdeProblemm_problem
 Direct link to problem, you may write getXXXProblem methods in derived classes that return the right kind of PdeProblem pointer. More...
 
DistributedMatrixm_gMat
 Global matrix. More...
 
DistributedVectorm_gVec
 Global Vector. More...
 
CepsReal m_scaleFactor
 Scale factor. More...
 
CepsVector< Unknown * > m_unknownsWL
 White list of unknowns. More...
 
CepsAssemblingFlag m_assemblingFlag
 Switch from an assembling to another (see CepsAssemblingFlag) More...
 
- Protected Attributes inherited from ceps::HoldsAttributes
CepsSet< CepsAttributem_attributes
 The attributes held by the entity. More...
 
- Static Protected Attributes inherited from CepsObject
static Profiler m_profiler
 The same profiler for each big object. More...
 

Constructor & Destructor Documentation

◆ FEHeatAssembler()

FEHeatAssembler::FEHeatAssembler ( FiniteElements fe,
CepsBool  isBoundary = false,
const CepsSet< CepsAttribute > &  attributes = {CepsUniversal},
const CepsVector< Unknown * > &  unknowns = {} 
)
explicit

Constructor with finite elements.

Definition at line 32 of file FEHeatAssembler.cpp.

Member Function Documentation

◆ computeBlocksOnElementAtQuadPoint()

void FEHeatAssembler::computeBlocksOnElementAtQuadPoint ( FEBase element,
CepsReal3D  xQ,
CepsReal  t,
const CepsMathDynamic1D phi,
const CepsMathDynamic2D gradPhi 
)
overrideprotectedvirtual

The function that is called to get the coefficients of the submatrix on a given finite element. This function MUST start with a call to setupSubmatrixOnElementForUnknowns, and MUST add something to m_bMat or m_bVec to be effective.

Parameters
elementThe element on which to assemble
xQQuadrature point where to evaluate submatrix
tCurrent time for function evaluation if needed
phiThe values of all basis functions at quadrature point xQ
gradPhiThe values of all basis function derivatives at quadrature point xQ

Reimplemented from FEDivKGradAssembler.

Reimplemented in FEPacemakerBidomainAssembler, FEMonodomainIntraAssembler, FEMonodomainAssembler, FEExtendedBidomainAssembler, FEBilayerMonodomainAssembler, and FEBidomainAssembler.

Definition at line 43 of file FEHeatAssembler.cpp.


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