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));
313 int component = -1)
const;
362 virtual void Update(
bool want_transform =
true);
378 void Save(std::ostream &
out)
const;
422 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.
Class for an integration rule - an Array of IntegrationPoint.
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
const SparseMatrix * GetConformingProlongation() 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.
int GetSize()
Return the total number of quadrature points.
int VDofToDof(int vdof) const
int GetFaceOrder(int i) const
Returns the order of the i'th face finite element.
virtual void GetEssentialVDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_vdofs, int component=-1) const
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
virtual void GetEssentialTrueDofs(const Array< int > &bdr_attr_is_ess, Array< int > &ess_tdof_list, int component=-1)
int GetNE() const
Returns number of elements.
int GetBdrElementType(int i) const
Returns the type of boundary element i.
void RebuildElementToDofTable()
int GetNV() const
Returns number of nodes in the mesh.
const FiniteElement * GetFaceElement(int i) const
const IntegrationRule * int_rule[Geometry::NumGeom]
const FiniteElementCollection * fec
NURBSExtension * GetNURBSext()
int GetConformingVSize() const
void GetEdgeFaceDofs(int type, int index, Array< int > &dofs) const
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.
void GetFaceInteriorDofs(int i, Array< int > &dofs) const
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)
const SparseMatrix * GetConformingRestriction() const
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
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()
int GetElementForDof(int i) const
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.
virtual int GetTrueVSize() const
Return the number of vector true (conforming) dofs.
int GetVDim() const
Returns vector dimension.
virtual const SparseMatrix * GetRestrictionMatrix()
const IntegrationRule & GetElementIntRule(int idx)
Get the IntegrationRule associated with mesh element idx.
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
static void DofsToVDofs(int ndofs, int vdim, Array< int > &dofs)
ElementTransformation * GetElementTransformation(int i) const
Returns ElementTransformation for the i'th element.
int GetLocalDofForDof(int i) const
virtual ~FiniteElementSpace()
SparseMatrix * H2L_GlobalRestrictionMatrix(FiniteElementSpace *lfes)
virtual ~QuadratureSpace()
int GetOrder(int i) const
Returns the order of the i'th finite element.
void Save(std::ostream &out) const
Write the QuadratureSpace to the stream out.
void MakeVDimMatrix(SparseMatrix &mat) const
void GetEdgeInteriorVDofs(int i, Array< int > &vdofs) const
virtual const Operator * GetProlongationMatrix()
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.
int GetNV() const
Returns number of vertices. Vertices are only at the corners of elements, where you would expect them...
void ConvertToConformingVDofs(const Array< int > &dofs, Array< int > &cdofs)
Mesh * mesh
The mesh that FE space lives on.
void GetElementTransformation(int i, IsoparametricTransformation *ElTr)
void ReorderElementToDofTable()
Reorder the scalar DOFs based on the element ordering.
int GetNConformingDofs() const
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.
QuadratureSpace(Mesh *mesh_, int order_)
Create a QuadratureSpace based on the global rules from IntRules.
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
void GetConformingInterpolation() const
Calculate the cP and cR matrices for a nonconforming mesh.
Class representing the storage layout of a QuadratureFunction.
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
OutStream out(std::cout)
Global stream used by the library for standard output. Initially it uses the same std::streambuf as s...
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.
Class representing a function through its values (scalar or vector) at quadrature points...
void GetElementVertices(int i, Array< int > &v) const
Returns the indices of the vertices 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