CepsArray< CepsMap< CepsGlobalIndex, CepsVector< DegreeOfFreedom * > >, CepsLocationFlagSize > DegreeOfFreedomTree
Data structure that classifies all the degrees of freedom.
CepsLocationFlag
DataLocation: an enum that will be used by various elements of the code (pde, readers,...
constexpr CepsUInt CepsLocationFlagSize
Size of enum CepsLocationFlag.
CepsIndex CepsUnknownIndex
For unknowns.
std::array< _Type, _N > CepsArray
C++ arrays.
std::map< _Key, _Tp, _Compare, _Alloc > CepsMap
C++ map.
std::set< _Type, _Compare, _Alloc > CepsSet
C++ set.
std::vector< _Type, _Alloc > CepsVector
C++ vector.
CepsGlobalIndex CepsDofGlobalIndex
Indices of degrees of freedom.
CepsIndex CepsGlobalIndex
Many uses. Has to be signed for PETSc.
float CepsReal
Need single precision floating point.
CepsUInt CepsProcId
For CPU indices.
CepsArray3< CepsReal > CepsReal3D
Three real scalars, used like this for compatibility in polynomials.
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.
Abstract Class for all numerical method (FE, FD, FV etc)
DHVecPtr newDofHaloVector() const
Get a new vector from the factory, with halo data.
const DegreeOfFreedomTree & getDegreeOfFreedomTree() const
The sorted degrees of freedom.
void extractValuesForUnknownInternal(const CepsUnknownIndex &uId, DVecPtr vec, CepsVector< CepsIndex > &indices, CepsVector< CepsReal > &values, CepsBool sendToMaster, CepsBool returnGeomIndices, std::function< CepsBool(DegreeOfFreedom *)> &selector)
Slicing method that extracts the data corresponding to a specific unknown.
virtual void extractValuesForUnknown(const CepsUnknownIndex &uId, DVecPtr vec, CepsVector< CepsIndex > &indices, CepsVector< CepsReal > &values, CepsBool sendToMaster=false, CepsBool returnGeomIndices=false)=0
Slicing method that extracts the data corresponding to a specific unknown.
DistributedInfos< DegreeOfFreedom * > * getDistributedDofs() const
Get the stored Degree Of Freedom repartition.
AbstractPdeProblem * m_problem
[not owned] Pointer on the pde problem
const CepsMap< CepsUnknownIndex, CepsVector< DegreeOfFreedom * > > & getDegreesOfFreedomForUnknown()
Dofs sorted by unknown.
AbstractPdeProblem * getProblem() const
Return link to pde problem.
DistributedFactory * m_dofsFactory
[owned] The factory that builds vectors and matrices
CepsBool isDofSpatial(CepsGlobalIndex globalDofId) const
Check if the Unknow is a spatial one (typically CepsLocationFlag != ZeroD)
virtual CepsReal dotProduct(DHVecPtr u, DHVecPtr v, CepsBool boundary=false, const CepsSet< CepsAttribute > &attrs={}, const CepsVector< Unknown * > &unknowns={})=0
Returns the dot product of two vectors of degrees of freedom.
void createDofsForZeroDUnknowns()
Adds one dof for each zeroD unknown, must be called after all other dofs are distributed.
void evaluateFunctionOnDofs(ceps::Function< CepsReal(CepsStandardArgs)> *func, DHVecPtr v, CepsReal t=0.) const
Fills vector v with values of function func at owned and halo dofs and time t.
CepsMap< CepsDofGlobalIndex, CepsSet< CepsDofGlobalIndex > > m_extraAdjacencyToRecv
A map to correct the missing adjacency that can occur in rare occasions in 3D.
~AbstractDiscretization() override
Destructor.
CepsBool m_dofsBuilt
Tells if the class has setup all the dofs.
AbstractDiscretization()=delete
Deleted default constructor.
CepsReal l1Norm(DHVecPtr v, CepsBool boundary=false, const CepsSet< CepsAttribute > &attrs={}, const CepsVector< Unknown * > &unknowns={})
L1-norm of a given vector.
CepsReal getZeroDValue(Unknown *u, DHVecPtr sol)
Get the value of a 0D unknown into a solution vector.
AbstractDiscretization(const AbstractDiscretization &that)=delete
Deleted Copy constructor (objects are too big, and not really useful)
virtual void setZeroDUnknownsDofsInteractions()
Updates neighboring lists with interaction with 0D unknowns.
Geometry * getGeometry() const
Get the stored Geometry.
CepsMap< CepsUnknownIndex, CepsVector< DegreeOfFreedom * > > m_dofsForUnknown
Reverse mapping of dofs, with unknown index as key.
DVecPtr newDofVector() const
Get a new vector from the factory.
void buildDofsDistributedInfo()
Builds the degrees of freedom distribution from the dofs tree.
DistributedInfos< DegreeOfFreedom * > * m_distributedDofs
[owned] Pointer on the dofs structure
void findClosestDof(const CepsReal3D &x, Unknown *u, CepsDofGlobalIndex &dofId, CepsProcId &owner)
Set dofId to that if the closest to position x, also sets owner.
DistributedFactory * getDofsFactory() const
Get the stored DistributedFactory.
Geometry * m_geometry
[not owned] Pointer on the geometry
CepsReal l2Norm(DHVecPtr v, CepsBool boundary=false, const CepsSet< CepsAttribute > &attrs={}, const CepsVector< Unknown * > &unknowns={})
L2-norm of a given vector. Computation of dotproduct depends on the discretization.
DMatPtr newDofMatrix() const
Get a new matrix from the factory.
CepsLocationFlag m_spatialUnknownsLocation
Where unknowns are located. Must be set in child classes.
CepsVector< CepsMap< CepsDofGlobalIndex, CepsSet< CepsDofGlobalIndex > > > m_extraAdjacencyToSend
A map to correct the missing adjacency that can occur in rare occasions in 3D.
void setupDofsFactory()
Prepare the factory that will generate vectors of dofs.
AbstractDiscretization & operator=(const AbstractDiscretization &)=delete
Deleted assignment operator.
CepsVector< DegreeOfFreedom * > getHaloDofs() const
Get the degrees of freedom owned by other processes.
virtual CepsIndex getDofSpatialId(const DegreeOfFreedom *dof) const =0
Return the spatial id (CellId or NodeId) for this row number.
DegreeOfFreedomTree m_dofsTree
[owned] Pointer on the distributed degree of freedom tree
virtual void setSpatialUnknownsDofsInteractions()=0
Build dofs neighboring list for spatial unknowns. Different in FE (same element dofs) and VF,...
virtual CepsReal h1Norm(DHVecPtr v, CepsBool boundary=false, const CepsSet< CepsAttribute > &attrs={}, const CepsVector< Unknown * > &unknowns={})=0
H1-norm of a given vector. Computation depends on the discretization.
virtual void buildDofsTree()=0
Builds the degrees of freedom tree from the PDE data.
CepsVector< DegreeOfFreedom * > getOwnedDofs() const
Get the degrees of freedom owned by process.
void buildDofs()
Builds the degrees of freedom data structures from the PDE data.
virtual void registerSpatialUnkown(Unknown *u)
Changes the location of unknown u to be adapted to the discrectization for example CepsLocationFlag::...
DegreeOfFreedom * getDof(CepsGlobalIndex globalDofId)
Get the dof with given globalID, nullptr if not found.
Base class for creating PDEs to solve.
Base class for other (big) CEPS classes. All classes can get a pointer to this base class and also co...
A degree of freedom for any kind of problem The dof can be associated to a geometrical element or not...
Encapsulates all the geometrical data.
A class used to defined an unknown of a PDE problem The unknown can be defined on a specific region,...
Structure used to pass arguments to SAFunc (see pde directory) The flags of the SAFunc allows extract...
function caller : abstract base, only contains an variadic operator()