CepsCellType
Enum for different shapes of cells.
CepsIndex CepsUnknownIndex
For unknowns.
std::map< _Key, _Tp, _Compare, _Alloc > CepsMap
C++ map.
std::set< _Type, _Compare, _Alloc > CepsSet
C++ set.
std::vector< _Type, _Alloc > CepsVector
C++ vector.
CepsIndex CepsGlobalIndex
Many uses. Has to be signed for PETSc.
std::make_unsigned_t< CepsInt > CepsUInt
Unsigned version on CepsInt.
float CepsReal
Need single precision floating point.
CepsInt CepsIndex
Index rowid etc.
std::shared_ptr< DistributedHaloVector > DHVecPtr
Typedef for pointer on Distributed Halo CepsVector.
std::shared_ptr< DistributedMatrix > DMatPtr
Short typedef for pointer on dist matrix.
std::shared_ptr< DistributedVector > DVecPtr
Short typedef for pointer on distributed vector.
CepsReal getDomainMeasure(const CepsVector< FEBase * > &cells, const CepsSet< CepsAttribute > &attributes, CepsBool onlyOfThisProc=false)
Compute the measure of a set of a cells.
Abstract Class for all numerical method (FE, FD, FV etc)
Base class for creating PDEs to solve.
A degree of freedom for any kind of problem The dof can be associated to a geometrical element or not...
Abstract class for finite elements.
A nodal point on a finite element. It is different from a geom node as it may have different properti...
Holds all finite elements corresponding to each geometrical element.
FENode * getFENode(CepsGlobalIndex nID)
Link to a single node.
CepsReal dotProduct(DHVecPtr u, DHVecPtr v, CepsBool boundary=false, const CepsSet< CepsAttribute > &attrs={}, const CepsVector< Unknown * > &unknowns={}) final
returns where is the mass matrix
DMatPtr m_mass
Mass matrix, computed at instantiation.
void initializeRefElements()
Configure reference elements.
CepsHash3 getNodeHash(const FENode *n) const
Get the hash value from the coordinates of the node.
CepsVector< FEBase * > & getBoundaryFiniteElements()
Get vector containing all finite elements of the maximum valid dim.
ReferenceFE * getReferenceElementOfDim(CepsCellType type, CepsUInt dim) const
Access to reference elements.
CepsVector< DegreeOfFreedom * > getDofsOnElement(FEBase *elem)
ALl the dofs defined on an element.
CepsUInt getNumberOfOwnedFENodes() const
Local number of nodes belonging to this process, halo nodes NOT included.
void createNewNode(FEBase *el, CepsUInt indexDof, CepsBool isBoundary, Mesh *mesh)
Allocate new node that it is not a geometrical node.
void buildElements()
main routine of FiniteElements called in the constructor
~FiniteElements() override
Destructor.
FiniteElements()=delete
Default Constuctor deleted.
const CepsVector< FENode * > & getHaloFENodes()
vector of halo nodes
CepsVector< FEBase * > & getFiniteElements()
Get vector containing all finite elements of the maximum valid dim.
CepsBool isHaloFENode(CepsGlobalIndex globalID) const
Tells if node is halo by current CPU.
void setSpatialUnknownsDofsInteractions() override
Build dofs neighboring list for spatial unknowns. Different in FE (same element dofs) and VF,...
CepsIndex getDofSpatialId(const DegreeOfFreedom *dof) const override
Return the Geom Node Id for a node (not the FENode index returned by dof->getGeomId())
DistributedInfos< FEBase * > * m_bdrElems
Holds 1D-3D finite boundary elements.
DMatPtr m_stiff
Stiffness matrix, computed at instantiation.
const CepsVector< FENode * > & getOwnedFENodes()
vector of owned nodes
DistributedInfos< FENode *, CepsHash3 > * m_nodes
Holds nodes.
DistributedInfos< FEBase * > * m_volElems
Holds 1D-3D finite elements.
CepsVector< DegreeOfFreedom * > getDofsOnElementForUnknowns(FEBase *elem, const CepsVector< Unknown * > &us)
All dofs defined on an element, considering unknowns us.
void checkNeighborsBeforeAssign(FEBase *fElem, FEBase *nElem, CepsUInt nID, CepsBool boundary, CepsBool &foundSameDof)
Checks if a FE node already exists in a neighbor element.
void extractValuesForUnknown(const CepsUnknownIndex &uId, DVecPtr vec, CepsVector< CepsIndex > &indices, CepsVector< CepsReal > &values, CepsBool sendToMaster=false, CepsBool returnGeomIndices=false) override
Slicing method that extracts the data corresponding to a specific unknown.
FiniteElements(const FiniteElements &)=delete
Copy Constructor deleted.
CepsReal h1Norm(DHVecPtr v, CepsBool boundary=false, const CepsSet< CepsAttribute > &attrs={}, const CepsVector< Unknown * > &unknowns={}) override
sqrt(stiffproduct(v,v))
CepsUInt m_maxValidDim
Get the maximum valid dimension.
CepsReal stiffProduct(DHVecPtr u, DHVecPtr v, CepsBool boundary=false, const CepsSet< CepsAttribute > &attrs={}, const CepsVector< Unknown * > &unknowns={})
returns where is the stiffness matrix
void buildDofsTree() override
Builds the degrees of freedom tree from the PDE data, uses previously build elements and nodes....
CepsMap< CepsCellType, CepsArray4< ReferenceFE * > > m_refElems
Reference elements (point, segment, tri, tetra)
CepsUInt getNumberOfHaloFENodes() const
Global number of owned nodes.
void computeNeighbors()
Compute Neighbors.
CepsUInt m_order
Order used to build elements.
DMatPtr getStiffnessMatrix() const
Pointer on stiffness matrix.
DMatPtr getMassMatrix() const
Pointer on mass matrix.
CepsBool isOwnedFENode(CepsGlobalIndex globalID) const
Tells if node is owned by current CPU.
Geometrical information of 1,2 or 3D distributed cells.
Base class for reference finite elements.
A triple hash to be used for coordinates (multiplied *10^12 then truncated)