Finite Element Tools

DofNumbering

class DofNumbering

Public Functions

DofNumbering()
CMuscatIndex GetSize() const
bool GetFromConnectivity() const
void SetFromConnectivity(const bool &val)
bool GetDiscontinuous() const
void SetDiscontinuous(const bool &val)
void ComputeNumberingFromConnectivity(Mesh &mesh)
void ComputeNumberingNoSharedDof(Mesh &mesh, const Space &space, ElementFilterBase &elementFilter)

Compute the numbering for all the shape function for discontinues (not shared shape functions)

Parameters:
  • mesh – the mesh to work on

  • space – the space

  • elementFilter – the element selection to work on

void ComputeNumberingGeneral(Mesh &mesh, const Space &space, ElementFilterBase &elementFilter)
bool HasNumberingFor(const ElementType elemtype) const
void InitNumberingFor(const ElementType elemtype, const CMuscatIndex &nbOfElement, const CMuscatIndex &nbOfShapeFuntions)
MapMatrixIDD &GetNumberingFor(const ElementType elemtype)
const MapMatrixIDD &GetNumberingFor(const ElementType elemtype) const
template<typename T>
inline void SetNumbering(const ElementType elementType, T &numbering)
inline std::map<ElementType, std::shared_ptr<MapMatrixIDD>>::const_iterator begin() const
inline std::map<ElementType, std::shared_ptr<MapMatrixIDD>>::const_iterator end() const
CMuscatIndex GetDofOfkey(const DofKey &key)
CMuscatIndex GetDofOfPoint(const CMuscatIndex &pid)
CMuscatIndex GetSizeOfDofToPoint()
MatrixID1 &GetdoftopointLeft()
MatrixID1 &GetdoftopointRight()
void computeDofToPoint()
void computeDofToCell(Mesh &mesh)
CMuscatIndex GetSizeOfDofToCell()
MatrixID1 &GetdoftocellLeft()
MatrixID1 &GetdoftocellRight()
template<typename S>
inline DofKey GetKeyFor(const ElementType elemtype, const CMuscatIndex &elid, const int &sf, const ElementsContainer &data, const DofAttachment &da, const S &elcoon) const
std::string ToStr() const

Integration Rules

class ElementaryQuadrature

Public Functions

inline CMuscatIndex GetNumberOfPoints() const
template<typename PT, typename WT>
inline void SetPointsWeights(const PT &points, const WT &weights)

Public Members

MatrixDDD p
MatrixDDD weights
ElementType elementType
class MeshQuadrature

Public Functions

inline const ElementaryQuadrature &GetIR(const ElementType &key) const

Public Members

std::map<ElementType, ElementaryQuadrature> storage
std::map<std::string, MeshQuadrature> Muscat::IntegrationRulesAlmanac = GetPythonDefinedIntegrationRules()
std::map<std::string, MeshQuadrature> Muscat::GetPythonDefinedIntegrationRules()

Finite Element Spaces

const Space &Muscat::GetFESpaceFor(const std::string &spaceName)
const std::vector<std::string> Muscat::GetAvailableSpaces()

Integration

struct LocalSpace

Public Functions

DEFINE_SETGET_VECTOR_SHARED_MAP_MatrixDD1(ShapeVal, valN)
DEFINE_SETGET_VECTOR_SHARED_MAP_MatrixDDD(ShapeDerVal, valdphidxi)
inline void Init(const int &dim, const int &NumberOfShapeFunctions, const int &numberOfIntegrationPoints)
inline void resize(const int s)
inline LocalSpace()
inline MapMatrixDD1 &GetNxNyNz()
inline MatrixDDD &GetBxByBz()
template<typename T>
inline void SetActiveIntegrationPoint(const int &ip, T &Jinv)

Public Members

int dimensionality
int numberOfShapeFunctions
int numberOfIntegrationPoints
int activeIntegrationPoint
std::vector<std::shared_ptr<MapMatrixDD1>> valN
std::vector<std::shared_ptr<MapMatrixDDD>> valdphidxi
MatrixDDD BxByBz
struct MonoElementsIntegralCpp

Public Functions

DEFINE_SETGET_SHARED_MAP_MatrixDDD(Nodes, nodes)
DEFINE_SETGET_SHARED_MAP_MatrixIDD(Connectivity, connectivity)
DEFINE_SETGET_VECTOR_SHARED_MAP_MatrixIDD(LocalNumberings, lnumbering)
DEFINE_SETGET_VECTOR_SHARED_MAP_MatrixDD1(FEValues, values)
DEFINE_SETGET_VECTOR_SHARED_MAP_MatrixDDD(IPValues, ipvalues)
inline void SetLocalOffsets(const int &maxSizeUDof, const std::vector<int> &ludof, const std::vector<int> &luNumberingindex, const int &maxSizeTDof, const std::vector<int> &ltdof, const std::vector<int> &ltNumberingindex)
inline void Reset()
inline void SetGeoSpace(const int &i)
inline void SetNumberOfSpaces(const int &i)
inline void InitSpaceS(const int s, const int dim, const int NumberOfShapeFunctions, const int numberOfIntegrationPoints)
template<typename T>
inline void SetSpaceShapeVal(const int spaceNumber, const int integrationPoint, T &pd)
template<typename T>
inline void SetSpaceShapeDerVal(const int spaceNumber, const int integrationPoint, T &pd)
inline void SetNumberOfNumberings(int i)
void SetNumberOfValues(int i)
void SetNumberOfIPValues(int i)
void SetNumberOfUnknownFields(const int &n)
void SetUnknownOffset(const int &n, const int &s)
void SetTotalUnknownDofs(const int &n)
void SetNumberOfTestFields(const int &n)
void SetTotalTestDofs(const int &n)
void SetTestOffset(const int &n, const int &s)
void SetNumberOfConstants(const CMuscatIndex &n)
void SetConstants(const int &n, const CMuscatFloat &val)
void SetComputeNormal(const bool &val)
void SetNumberOfIntegrationPoints(const int &n)
void SetIntegrationPointI(const int &n, const CMuscatFloat &weights, const CMuscatFloat &p0, const CMuscatFloat &p1, const CMuscatFloat &p2)
void ProcessWeakForm(WeakForm *wform)
void Integrate(WeakForm *wform, const CMuscatIndex &size, const CMuscatIndex *pidstotreat)
template<unsigned int SpaceDim, unsigned int ElementDim>
void IntegrateSpaceDimElementDim(WeakForm *wform, const CMuscatIndex &idstotreat_s, const CMuscatIndex *pidstotreat)
template<unsigned int SpaceDim, unsigned int ElementDim, bool isSimplex>
void IntegrateSpaceDimElementDimIsSimple(WeakForm *wform, const CMuscatIndex &idstotreat_s, const CMuscatIndex *pidstotreat)

Public Members

int totalUnknownDofs = {0}
MatrixID1 unknownDofsOffset
MatrixID1 unknownDofsNumbering
MatrixID1 localUnknownDofsOffset
int maxsizelocalUnknownDofs
int totalTestDofs = {0}
MatrixID1 testDofsOffset
MatrixID1 testDofsNumbering
MatrixID1 localTestDofsOffset
int maxsizelocalTestDofs
MatrixDD1 constants
MatrixDD1 iw
MatrixDD3 ip
int totalvijcpt = {0}
CMuscatFloat *vK
CMuscatIndex *iK
CMuscatIndex *jK
CMuscatFloat *F
bool hasnormal = {false}
bool onlyEvaluation
bool onlyUpper = {false}
std::shared_ptr<MapMatrixDDD> nodes
std::shared_ptr<MapMatrixIDD> connectivity
int geoSpaceNumber
std::vector<LocalSpace> lspaces
std::vector<std::shared_ptr<MapMatrixIDD>> lnumbering
std::vector<std::shared_ptr<MapMatrixDD1>> values
std::vector<std::shared_ptr<MapMatrixDDD>> ipvalues

Weak form classes

struct WeakTerm

Public Functions

inline WeakTerm()

Public Members

std::string fieldName

Name (used only to communicate with the user)

std::string derCoordName

name of the derivative coordinate (only used for print)

int derDegree

this can be 0 or 1 (1 for first derivative) (if internalType is normal then derDegree determine the normal component to use Normal[0] for example)

bool constant

True if this weakterm is a constant

bool normal

True if this is a normal field (in this case derDegree contains the normal component)

int spaceIndex_

the space used by this variable

int derCoordIndex_

derivative coordinate if derDegree is 1 (not used here)

int numberingIndex_

which numbering this variable uses

int valuesIndex_

<-&#8212; for EnumTestField and EnumUnknownField this is the index to the offsets ^-&#8212; for EnumConstant the index to the constants vector ^&#8212; for EnumExtraField the index to values ^&#8212; for EnumExtraIPField the index to the ipvalues */

int modeIndex_

this is a reserve variable for model reduction integrators

int internalType

the type of variable

Friends

friend std::ostream &operator<<(std::ostream &stream, const WeakTerm &term)

Stream WeakTerm

struct WeakMonom

Public Functions

inline WeakMonom()

Public Members

double prefactor

constant prefactor of the monomial

std::vector<WeakTerm> prod

factors storage of this monomial

Friends

friend std::ostream &operator<<(std::ostream &stream, const WeakMonom &monom)

Stream WeakMonom

struct WeakForm

Public Functions

inline CMuscatIndex GetNumberOfTerms() const

Function to get the number of terms present in this polynomial

Public Members

std::vector<WeakMonom> form

monomial storage of this polynomial

Friends

friend std::ostream &operator<<(std::ostream &stream, const WeakForm &wf)

Stream WeakForm

Spaces

struct ElementSpace

Finite Element Space for one element.

Public Functions

inline int GetDimensionality() const
CMuscatIndex GetNumberOfShapeFunctions() const
const DofAttachment &GetDofAttachment(const int &dofNumber) const
void AppendDofAttachment(const char &entity, const int &entityNumber, const int &extraKey)
MatrixDD1 GetValOfShapeFunctionsAt(double phi, double xi, double eta) const
MatrixDD1 GetValOfShapeFunctionsAt(const MatrixDDD &phiXiEta) const
MatrixDDD GetValOfShapeFunctionsDerAt(double phi, double xi, double eta) const
MatrixDDD GetValOfShapeFunctionsDerAt(const MatrixDDD &phiXiEta) const
MatrixDDD GetValOfShapeFunctionsDerDerAt(CMuscatIndex i, const MatrixDDD &phiXiEta) const
MatrixDDD GetValOfShapeFunctionsDerDerAt(CMuscatIndex i, double phi, double xi, double eta) const

Public Members

ElementType elementType = {ElementType::Element_NA}
GeoSupport geoSupport = {GeoSupport::GeoNA}
std::vector<DofAttachment> storage
MatrixDDD posN
int dimensionality = {-1}
MatrixDD1 (*SFV)(const double, const double, const double)
MatrixDDD (*SFDV)(const double, const double, const double)
MatrixDDD (*SFDDV)(const CMuscatIndex i, const double, const double, const double)
class Space

Public Functions

CMuscatIndex GetNumberOfShapeFunctionsFor(ElementType elementType) const
void AddDofTo(const ElementType elementType, const char &entity, const int &entityNumber, const int &extraKey)
const ElementSpace &GetSpaceFor(ElementType elementType) const
void Print() const
std::string ToStr()

Public Members

std::string name
SpaceType type
std::map<ElementType, ElementSpace> storage
class SpaceAtIP

Public Functions

inline void SetNumerOfValuesFor(const ElementType elementType, const int size)
inline void SetValuesFor(const ElementType elementType, const int i, const MapMatrixDDD &SFV, const MapMatrixDDD &SFDV)

Public Members

std::string name
SpaceType type
std::map<ElementType, ElementSpaceAtIP> storage
std::map<ElementType, ElementSpaceAtIP> Muscat::EvaluateSpaceAt(const Space &sp, const MeshQuadrature &sir)
ElementSpaceAtIP Muscat::EvaluateSpaceAt(const ElementSpace &es, const ElementaryQuadrature &ir)