15 #include "../config/config.hpp"
16 #include "../linalg/sparsemat.hpp"
17 #include "../mesh/mesh.hpp"
35 static inline int Map(
int ndofs,
int vdim,
int dof,
int vd);
41 template <>
inline int
42 Ordering::Map<Ordering::byNODES>(
int ndofs,
int vdim,
int dof,
int vd)
44 MFEM_ASSERT(dof < ndofs && -1-dof < ndofs && 0 <= vd && vd < vdim,
"");
45 return (dof >= 0) ? dof+ndofs*vd : dof-ndofs*vd;
48 template <>
inline int
49 Ordering::Map<Ordering::byVDIM>(
int ndofs,
int vdim,
int dof,
int vd)
51 MFEM_ASSERT(dof < ndofs && -1-dof < ndofs && 0 <= vd && vd < vdim,
"");
52 return (dof >= 0) ? vd+vdim*dof : -1-(vd+vdim*(-1-dof));
343 virtual void Update(
bool want_transform =
true);
359 void Save(std::ostream &out)
const;
Abstract class for Finite Elements.
Ordering::Type GetOrdering() const
Return the ordering method.
void GetVertexVDofs(int i, Array< int > &vdofs) const
int GetAttribute(int i) const
int GetNDofs() const
Returns number of degrees of freedom.
int ndofs
Number of degrees of freedom. Number of unknowns are ndofs*vdim.
int GetBdrAttribute(int i) const
Return the attribute of boundary element i.
const Table & GetBdrElementToDofTable() const
void GetElementInteriorVDofs(int i, Array< int > &vdofs) const
int DofToVDof(int dof, int vd, int ndofs=-1) const
virtual void Update(bool want_transform=true)
static int Map(int ndofs, int vdim, int dof, int vd)
void GetElementVertices(int i, Array< int > &vertices) const
Returns the vertices of element i.
void BuildElementToDofTable() const
SparseMatrix * RefinementMatrix(int old_ndofs, const Table *old_elem_dof)
Calculate GridFunction interpolation matrix after mesh refinement.
int GetNBE() const
Returns number of boundary elements.
SparseMatrix * DerefinementMatrix(int old_ndofs, const Table *old_elem_dof)
Calculate GridFunction restriction matrix after mesh derefinement.
void GetElementVDofs(int i, Array< int > &vdofs) const
Returns indexes of degrees of freedom in array dofs for i'th element.
virtual void GetEssentialVDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_vdofs) const
int VDofToDof(int vdof) const
virtual void GetEssentialTrueDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_tdof_list)
int GetFaceOrder(int i) const
Returns the order of the i'th face finite element.
void GetEdgeFaceDofs(int type, int index, Array< int > &dofs)
int vdim
Vector dimension (number of unknowns per degree of freedom).
int GetNumElementInteriorDofs(int i) const
const FiniteElement * GetTraceElement(int i, int geom_type) const
Return the trace element from element 'i' to the given 'geom_type'.
int GetBdrAttribute(int i) const
int GetNE() const
Returns number of elements.
int GetBdrElementType(int i) const
Returns the type of boundary element i.
void GetElementVertices(int i, Array< int > &dofs) const
Returns the indices of the dofs of element i.
void RebuildElementToDofTable()
int GetNV() const
Returns number of nodes in the mesh.
const FiniteElement * GetFaceElement(int i) const
void GetConformingInterpolation()
Calculate the cP and cR matrices for a nonconforming mesh.
const FiniteElementCollection * fec
NURBSExtension * GetNURBSext()
Array< int > dof_elem_array
static void MarkerToList(const Array< int > &marker, Array< int > &list)
Convert a Boolean marker array to a list containing all marked indices.
virtual void GetFaceDofs(int i, Array< int > &dofs) const
ElementTransformation * GetBdrElementTransformation(int i)
Returns the transformation defining the i-th boundary element.
void ConvertFromConformingVDofs(const Array< int > &cdofs, Array< int > &dofs)
int GetNE() const
Returns number of elements in the mesh.
void GetVertexDofs(int i, Array< int > &dofs) const
bool Nonconforming() const
const FiniteElement * GetEdgeElement(int i) const
const SparseMatrix * GetConformingRestriction()
int GetNBE() const
Returns number of boundary elements in the mesh.
Mesh * GetMesh() const
Returns the mesh.
Operator * T
Transformation to apply to GridFunctions after space Update().
SparseMatrix * cR
Conforming restriction matrix such that cR.cP=I.
SparseMatrix * D2Const_GlobalRestrictionMatrix(FiniteElementSpace *cfes)
SparseMatrix * D2C_GlobalRestrictionMatrix(FiniteElementSpace *cfes)
virtual void GetElementDofs(int i, Array< int > &dofs) const
Returns indexes of degrees of freedom in array dofs for i'th element.
NURBSExtension * StealNURBSext()
ElementTransformation * GetBdrElementTransformation(int i) const
Returns ElementTransformation for the i'th boundary element.
void GetElementTransformation(int i, IsoparametricTransformation *ElTr)
Array< int > dof_ldof_array
int GetElementType(int i) const
Returns the type of element i.
const SparseMatrix * GetConformingProlongation()
int GetVDim() const
Returns vector dimension.
virtual const SparseMatrix * GetRestrictionMatrix()
void GetEdgeDofs(int i, Array< int > &dofs) const
int GetBdrElementType(int i) const
Returns the type of boundary element i.
void GetElementInteriorDofs(int i, Array< int > &dofs) const
int GetLocalDofForDof(int i)
static void DofsToVDofs(int ndofs, int vdim, Array< int > &dofs)
int GetElementForDof(int i)
ElementTransformation * GetElementTransformation(int i) const
Returns ElementTransformation for the i'th element.
virtual ~FiniteElementSpace()
SparseMatrix * H2L_GlobalRestrictionMatrix(FiniteElementSpace *lfes)
int GetOrder(int i) const
Returns the order of the i'th finite element.
void MakeVDimMatrix(SparseMatrix &mat) const
void GetEdgeInteriorVDofs(int i, Array< int > &vdofs) const
int GetElementBaseGeometry(int i=0) const
int GetElementType(int i) const
Returns the type of element i.
FiniteElementSpace(Mesh *mesh, const FiniteElementCollection *fec, int vdim=1, int ordering=Ordering::byNODES)
bool Nonconforming() const
virtual void GetBdrElementDofs(int i, Array< int > &dofs) const
Returns indexes of degrees of freedom for i'th boundary element.
void ConvertToConformingVDofs(const Array< int > &dofs, Array< int > &cdofs)
virtual int GetTrueVSize()
Return the number of vector true (conforming) dofs.
Mesh * mesh
The mesh that FE space lives on.
void GetElementTransformation(int i, IsoparametricTransformation *ElTr)
void GetEdgeInteriorDofs(int i, Array< int > &dofs) const
const FiniteElement * GetFE(int i) const
Returns pointer to the FiniteElement associated with i'th element.
const Operator * GetUpdateOperator()
Get the GridFunction update matrix.
void SetUpdateOperatorOwner(bool own)
Set the ownership of the update operator: if set to false, the Operator returned by GetUpdateOperator...
void GetFaceVDofs(int i, Array< int > &vdofs) const
Returns indexes of degrees of freedom for i'th face element (2D and 3D).
void GetEdgeVDofs(int i, Array< int > &vdofs) const
Returns indexes of degrees of freedom for i'th edge.
static void ListToMarker(const Array< int > &list, int marker_size, Array< int > &marker, int mark_val=-1)
const FiniteElementCollection * FEColl() const
virtual void UpdatesFinished()
Free GridFunction transformation matrix (if any), to save memory.
const Table & GetElementToDofTable() const
const FiniteElement * GetBE(int i) const
Returns pointer to the FiniteElement for the i'th boundary element.
NURBSExtension * NURBSext
void GetBdrElementVDofs(int i, Array< int > &vdofs) const
Returns indexes of degrees of freedom for i'th boundary element.
virtual int DofForGeometry(int GeomType) const =0
long GetSequence() const
Return update counter (see Mesh::sequence)
Rank 3 tensor (array of matrices)
void Save(std::ostream &out) const
int GetAttribute(int i) const
Return the attribute of element i.
static void AdjustVDofs(Array< int > &vdofs)
void GetLocalDerefinementMatrices(int geom, const CoarseFineTransformations &dt, DenseTensor &localR)
void DofsToVDofs(Array< int > &dofs, int ndofs=-1) const