MFEM v2.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes
FiniteElementSpace Class Reference

Abstract finite element space. More...

#include <fespace.hpp>

Inheritance diagram for FiniteElementSpace:
Inheritance graph
[legend]
Collaboration diagram for FiniteElementSpace:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 FiniteElementSpace (Mesh *m, const FiniteElementCollection *f, int dim=1, int order=Ordering::byNODES)
MeshGetMesh () const
 Returns the mesh.
NURBSExtensionGetNURBSext ()
int GetVDim () const
 Returns vector dimension.
int GetOrder (int i) const
 Returns the order of the i'th finite element.
int GetNDofs () const
 Returns number of degrees of freedom.
int GetVSize () const
int GetOrdering () const
 Return the ordering method.
const FiniteElementCollectionFEColl () const
int GetNVDofs () const
int GetNEDofs () const
int GetNFDofs () const
int GetNE () const
 Returns number of elements in the mesh.
int GetNV () const
 Returns number of nodes in the mesh.
int GetNBE () const
 Returns number of boundary elements in the mesh.
int GetElementType (int i) const
 Returns the type of element i.
void GetElementVertices (int i, Array< int > &vertices) const
 Returns the vertices of element i.
int GetBdrElementType (int i) const
 Returns the type of boundary element i.
ElementTransformationGetElementTransformation (int i) const
 Returns ElementTransformation for the i'th element.
void GetElementTransformation (int i, IsoparametricTransformation *ElTr)
ElementTransformationGetBdrElementTransformation (int i) const
 Returns ElementTransformation for the i'th boundary element.
int GetAttribute (int i)
int GetBdrAttribute (int i)
virtual void GetElementDofs (int i, Array< int > &dofs) const
 Returns indexes of degrees of freedom in array dofs for i'th element.
virtual void GetBdrElementDofs (int i, Array< int > &dofs) const
 Returns indexes of degrees of freedom for i'th boundary element.
void GetFaceDofs (int i, Array< int > &dofs) const
void GetEdgeDofs (int i, Array< int > &dofs) const
void GetElementInteriorDofs (int i, Array< int > &dofs) const
void GetEdgeInteriorDofs (int i, Array< int > &dofs) const
void DofsToVDofs (Array< int > &dofs) const
void DofsToVDofs (int vd, Array< int > &dofs) const
int DofToVDof (int dof, int vd) const
int VDofToDof (int vdof) const
void GetElementVDofs (int i, Array< int > &dofs) const
 Returns indexes of degrees of freedom in array dofs for i'th element.
void GetBdrElementVDofs (int i, Array< int > &dofs) const
 Returns indexes of degrees of freedom for i'th boundary element.
void GetFaceVDofs (int iF, Array< int > &dofs) const
 Returns indexes of degrees of freedom for i'th face element.
void GetEdgeVDofs (int iE, Array< int > &dofs) const
 Returns indexes of degrees of freedom for i'th edge.
void GetElementInteriorVDofs (int i, Array< int > &vdofs) const
void GetEdgeInteriorVDofs (int i, Array< int > &vdofs) const
void BuildElementToDofTable ()
void BuildDofToArrays ()
const TableGetElementToDofTable () const
int GetElementForDof (int i)
int GetLocalDofForDof (int i)
const FiniteElementGetFE (int i) const
 Returns pointer to the FiniteElement associated with i'th element.
const FiniteElementGetBE (int i) const
 Returns pointer to the FiniteElement for the i'th boundary element.
SparseMatrixGlobalRestrictionMatrix (FiniteElementSpace *cfes, int one_vdim=-1)
virtual void GetEssentialVDofs (Array< int > &bdr_attr_is_ess, Array< int > &ess_dofs)
 Determine the boundary degrees of freedom.
void EliminateEssentialBCFromGRM (FiniteElementSpace *cfes, Array< int > &bdr_attr_is_ess, SparseMatrix *R)
SparseMatrixGlobalRestrictionMatrix (FiniteElementSpace *cfes, Array< int > &bdr_attr_is_ess, int one_vdim=-1)
 Generate the global restriction matrix with eliminated essential bc.
SparseMatrixD2C_GlobalRestrictionMatrix (FiniteElementSpace *cfes)
SparseMatrixD2Const_GlobalRestrictionMatrix (FiniteElementSpace *cfes)
SparseMatrixH2L_GlobalRestrictionMatrix (FiniteElementSpace *lfes)
virtual void Update ()
virtual FiniteElementSpaceSaveUpdate ()
 Return a copy of the current FE space and update.
void Save (ostream &out) const
virtual ~FiniteElementSpace ()

Static Public Member Functions

static void AdjustVDofs (Array< int > &vdofs)

Protected Member Functions

void UpdateNURBS ()
void Constructor ()
void Destructor ()
 FiniteElementSpace (FiniteElementSpace &)
void ConstructRefinementData (int k, int cdofs, RefinementType type)
 Constructs new refinement data using coarse element k as a template.
DenseMatrixLocalInterpolation (int k, int cdofs, RefinementType type, Array< int > &rows)
 Generates the local interpolation matrix for coarse element k.

Protected Attributes

Meshmesh
 The mesh that FE space lives on.
int vdim
 Vector dimension (number of unknowns per degree of freedom).
int ndofs
 Number of degrees of freedom. Number of unknowns are ndofs*vdim.
int ordering
const FiniteElementCollectionfec
int nvdofs
int nedofs
int nfdofs
int nbdofs
int * fdofs
int * bdofs
Array< RefinementData * > RefData
 Collection of currently known refinement data.
Tableelem_dof
TablebdrElem_dof
Array< int > dof_elem_array
Array< int > dof_ldof_array
NURBSExtensionNURBSext
int own_ext

Detailed Description

Abstract finite element space.

Definition at line 52 of file fespace.hpp.


Constructor & Destructor Documentation

FiniteElementSpace::FiniteElementSpace ( FiniteElementSpace fes) [protected]
FiniteElementSpace::FiniteElementSpace ( Mesh m,
const FiniteElementCollection f,
int  dim = 1,
int  order = Ordering::byNODES 
)
FiniteElementSpace::~FiniteElementSpace ( ) [virtual]

Definition at line 799 of file fespace.cpp.

References Destructor(), RefData, and Array< T >::Size().


Member Function Documentation

void FiniteElementSpace::AdjustVDofs ( Array< int > &  vdofs) [static]

Definition at line 101 of file fespace.cpp.

References Array< T >::Size().

void FiniteElementSpace::BuildDofToArrays ( )
void FiniteElementSpace::BuildElementToDofTable ( )

Definition at line 150 of file fespace.cpp.

References elem_dof, GetElementDofs(), GetNE(), mesh, and Array< T >::Size().

Referenced by BuildDofToArrays().

void FiniteElementSpace::Constructor ( ) [protected]
void FiniteElementSpace::ConstructRefinementData ( int  k,
int  cdofs,
RefinementType  type 
) [protected]

Constructs new refinement data using coarse element k as a template.

Definition at line 846 of file fespace.cpp.

References Array< T >::Append(), fec, Mesh::GetElementBaseGeometry(), GetElementDofs(), RefinementData::I, mesh, nedofs, RefData, Array< T >::Size(), and Array< T >::Union().

SparseMatrix * FiniteElementSpace::D2C_GlobalRestrictionMatrix ( FiniteElementSpace cfes)

Generate the global restriction matrix from a discontinuous FE space to the continuous FE space of the same polynomial degree.

Definition at line 325 of file fespace.cpp.

References GetElementVDofs(), GetNE(), GetVSize(), mesh, mfem_error(), and Array< T >::Size().

SparseMatrix * FiniteElementSpace::D2Const_GlobalRestrictionMatrix ( FiniteElementSpace cfes)

Generate the global restriction matrix from a discontinuous FE space to the piecewise constant FE space.

Definition at line 353 of file fespace.cpp.

References GetElementDofs(), GetNDofs(), GetNE(), mesh, mfem_error(), ndofs, and Array< T >::Size().

void FiniteElementSpace::Destructor ( ) [protected]
void FiniteElementSpace::DofsToVDofs ( int  vd,
Array< int > &  dofs 
) const

Definition at line 55 of file fespace.cpp.

References Ordering::byNODES, ndofs, ordering, Array< T >::Size(), and vdim.

void FiniteElementSpace::DofsToVDofs ( Array< int > &  dofs) const
int FiniteElementSpace::DofToVDof ( int  dof,
int  vd 
) const

Definition at line 83 of file fespace.cpp.

References Ordering::byNODES, ndofs, ordering, and vdim.

Referenced by GridFunction::ProjectCoefficient().

void FiniteElementSpace::EliminateEssentialBCFromGRM ( FiniteElementSpace cfes,
Array< int > &  bdr_attr_is_ess,
SparseMatrix R 
)

Definition at line 288 of file fespace.cpp.

References Array< T >::Size(), and Mesh::TWO_LEVEL_COARSE.

const FiniteElementCollection* FiniteElementSpace::FEColl ( ) const [inline]

Definition at line 123 of file fespace.hpp.

References fec.

Referenced by GridFunction::GridFunction(), Mesh::Load(), and Mesh::PrintVTK().

int FiniteElementSpace::GetAttribute ( int  i) [inline]
int FiniteElementSpace::GetBdrAttribute ( int  i) [inline]
void FiniteElementSpace::GetBdrElementDofs ( int  i,
Array< int > &  dofs 
) const [virtual]
ElementTransformation* FiniteElementSpace::GetBdrElementTransformation ( int  i) const [inline]
int FiniteElementSpace::GetBdrElementType ( int  i) const [inline]

Returns the type of boundary element i.

Definition at line 147 of file fespace.hpp.

References GetBdrElementType(), and mesh.

Referenced by GetBdrElementType().

void FiniteElementSpace::GetBdrElementVDofs ( int  i,
Array< int > &  dofs 
) const

Returns indexes of degrees of freedom for i'th boundary element.

Definition at line 118 of file fespace.cpp.

References DofsToVDofs(), and GetBdrElementDofs().

Referenced by Mesh::GetBdrElementTransformation(), GridFunction::GetBdrValuesFrom(), GetEssentialVDofs(), and GridFunction::ProjectBdrCoefficient().

const FiniteElement * FiniteElementSpace::GetBE ( int  i) const
void FiniteElementSpace::GetEdgeDofs ( int  i,
Array< int > &  dofs 
) const

Returns the indexes of the degrees of freedom for i'th edge including the dofs for the vertices of the edge.

Definition at line 737 of file fespace.cpp.

References FiniteElementCollection::DofForGeometry(), fec, Mesh::GetEdgeVertices(), mesh, nvdofs, Geometry::POINT, Geometry::SEGMENT, and Array< T >::SetSize().

Referenced by GetEdgeVDofs().

void FiniteElementSpace::GetEdgeInteriorDofs ( int  i,
Array< int > &  dofs 
) const

Definition at line 768 of file fespace.cpp.

References fec, nvdofs, Geometry::SEGMENT, and Array< T >::SetSize().

Referenced by GetEdgeInteriorVDofs().

void FiniteElementSpace::GetEdgeInteriorVDofs ( int  i,
Array< int > &  vdofs 
) const

Definition at line 143 of file fespace.cpp.

References DofsToVDofs(), and GetEdgeInteriorDofs().

void FiniteElementSpace::GetEdgeVDofs ( int  iE,
Array< int > &  dofs 
) const

Returns indexes of degrees of freedom for i'th edge.

Definition at line 130 of file fespace.cpp.

References DofsToVDofs(), and GetEdgeDofs().

void FiniteElementSpace::GetElementDofs ( int  i,
Array< int > &  dofs 
) const [virtual]
int FiniteElementSpace::GetElementForDof ( int  i) [inline]

Definition at line 218 of file fespace.hpp.

References dof_elem_array.

Referenced by GridFunction::ProjectCoefficient().

void FiniteElementSpace::GetElementInteriorDofs ( int  i,
Array< int > &  dofs 
) const

Definition at line 756 of file fespace.cpp.

References bdofs, fec, mesh, nedofs, nfdofs, nvdofs, and Array< T >::SetSize().

Referenced by GetElementInteriorVDofs().

void FiniteElementSpace::GetElementInteriorVDofs ( int  i,
Array< int > &  vdofs 
) const

Definition at line 136 of file fespace.cpp.

References DofsToVDofs(), and GetElementInteriorDofs().

const Table& FiniteElementSpace::GetElementToDofTable ( ) const [inline]

Definition at line 216 of file fespace.hpp.

References elem_dof.

ElementTransformation* FiniteElementSpace::GetElementTransformation ( int  i) const [inline]
void FiniteElementSpace::GetElementTransformation ( int  i,
IsoparametricTransformation ElTr 
) [inline]

Returns the transformation defining the i-th element in the user-defined variable.

Definition at line 156 of file fespace.hpp.

References Mesh::GetElementTransformation(), and mesh.

int FiniteElementSpace::GetElementType ( int  i) const [inline]

Returns the type of element i.

Definition at line 139 of file fespace.hpp.

References GetElementType(), and mesh.

Referenced by GetElementType().

void FiniteElementSpace::GetElementVDofs ( int  i,
Array< int > &  dofs 
) const
void FiniteElementSpace::GetElementVertices ( int  i,
Array< int > &  vertices 
) const [inline]

Returns the vertices of element i.

Definition at line 143 of file fespace.hpp.

References GetElementVertices(), and mesh.

Referenced by GetElementVertices(), GridFunction::GetNodalValues(), and GridFunction::GetVectorFieldNodalValues().

void FiniteElementSpace::GetEssentialVDofs ( Array< int > &  bdr_attr_is_ess,
Array< int > &  ess_dofs 
) [virtual]

Determine the boundary degrees of freedom.

Reimplemented in ParFiniteElementSpace.

Definition at line 266 of file fespace.cpp.

References GetBdrAttribute(), GetBdrElementVDofs(), GetNBE(), GetVSize(), Array< T >::SetSize(), and Array< T >::Size().

void FiniteElementSpace::GetFaceDofs ( int  i,
Array< int > &  dofs 
) const

Returns the indexes of the degrees of freedom for i'th face including the dofs for the edges and the vertices of the face.

Definition at line 707 of file fespace.cpp.

References FiniteElementCollection::DofForGeometry(), fdofs, fec, Mesh::GetFaceEdges(), Mesh::GetFaceVertices(), mesh, nedofs, nvdofs, Geometry::POINT, Geometry::SEGMENT, Array< T >::SetSize(), and Array< T >::Size().

Referenced by GetFaceVDofs().

void FiniteElementSpace::GetFaceVDofs ( int  iF,
Array< int > &  dofs 
) const

Returns indexes of degrees of freedom for i'th face element.

Definition at line 124 of file fespace.cpp.

References DofsToVDofs(), and GetFaceDofs().

const FiniteElement * FiniteElementSpace::GetFE ( int  i) const
int FiniteElementSpace::GetLocalDofForDof ( int  i) [inline]

Definition at line 219 of file fespace.hpp.

References dof_ldof_array.

Referenced by GridFunction::ProjectCoefficient().

Mesh* FiniteElementSpace::GetMesh ( ) const [inline]
int FiniteElementSpace::GetNBE ( ) const [inline]
int FiniteElementSpace::GetNDofs ( ) const [inline]

Returns number of degrees of freedom.

Definition at line 116 of file fespace.hpp.

References ndofs.

Referenced by D2Const_GlobalRestrictionMatrix(), GridFunction::GridFunction(), H2L_GlobalRestrictionMatrix(), Mesh::PrintVTK(), and GridFunction::ReorderByNodes().

int FiniteElementSpace::GetNE ( ) const [inline]
int FiniteElementSpace::GetNEDofs ( ) const [inline]

Definition at line 126 of file fespace.hpp.

References nedofs.

Referenced by GridFunction::GridFunction().

int FiniteElementSpace::GetNFDofs ( ) const [inline]

Definition at line 127 of file fespace.hpp.

References nfdofs.

Referenced by GridFunction::GridFunction().

NURBSExtension* FiniteElementSpace::GetNURBSext ( ) [inline]

Definition at line 107 of file fespace.hpp.

References NURBSext.

int FiniteElementSpace::GetNV ( ) const [inline]

Returns number of nodes in the mesh.

Definition at line 133 of file fespace.hpp.

References GetNV(), and mesh.

Referenced by GridFunction::GetNodalValues(), GetNV(), and GridFunction::GetVectorFieldNodalValues().

int FiniteElementSpace::GetNVDofs ( ) const [inline]

Definition at line 125 of file fespace.hpp.

References nvdofs.

Referenced by GridFunction::GridFunction().

int FiniteElementSpace::GetOrder ( int  i) const

Returns the order of the i'th finite element.

Definition at line 17 of file fespace.cpp.

References fec, FiniteElementCollection::FiniteElementForGeometry(), Mesh::GetElementBaseGeometry(), FiniteElement::GetOrder(), and mesh.

int FiniteElementSpace::GetOrdering ( ) const [inline]

Return the ordering method.

Definition at line 121 of file fespace.hpp.

References ordering.

Referenced by MixedBilinearForm::GetBlocks(), GridFunction::GridFunction(), GridFunction::ReorderByNodes(), and GridFunction::Save().

int FiniteElementSpace::GetVDim ( ) const [inline]
int FiniteElementSpace::GetVSize ( ) const [inline]
SparseMatrix * FiniteElementSpace::GlobalRestrictionMatrix ( FiniteElementSpace cfes,
Array< int > &  bdr_attr_is_ess,
int  one_vdim = -1 
)

Generate the global restriction matrix with eliminated essential bc.

Definition at line 314 of file fespace.cpp.

SparseMatrix * FiniteElementSpace::GlobalRestrictionMatrix ( FiniteElementSpace cfes,
int  one_vdim = -1 
)

Return the restriction matrix from this FE space to the coarse FE space 'cfes'. Both FE spaces must use the same FE collection and be defined on the same Mesh which must be in TWO_LEVEL_* state. When vdim > 1, 'one_vdim' specifies whether the restriction matrix built should be the scalar restriction (one_vdim=1) or the full vector restriction (one_vdim=0); if one_vdim=-1 then the behavior depends on the ordering of this FE space: if ordering=byNodes then the scalar restriction matrix is built and if ordering=byVDim -- the full vector restriction matrix.

Definition at line 224 of file fespace.cpp.

References Ordering::byNODES, Array< T >::GetSubArray(), Array< T >::Size(), Mesh::TWO_LEVEL_COARSE, and Mesh::TWO_LEVEL_FINE.

Referenced by Mesh::UpdateNodes().

SparseMatrix * FiniteElementSpace::H2L_GlobalRestrictionMatrix ( FiniteElementSpace lfes)

Construct the restriction matrix from the FE space given by (*this) to the lower degree FE space given by (*lfes) which is defined on the same mesh.

Definition at line 382 of file fespace.cpp.

References GetElementDofs(), GetFE(), GetNDofs(), GetNE(), mesh, ndofs, DenseMatrix::SetSize(), Vector::SetSize(), and Vector::Size().

DenseMatrix * FiniteElementSpace::LocalInterpolation ( int  k,
int  cdofs,
RefinementType  type,
Array< int > &  rows 
) [protected]

Generates the local interpolation matrix for coarse element k.

Definition at line 196 of file fespace.cpp.

References Array< T >::SetSize(), and Array< T >::Size().

void FiniteElementSpace::Save ( ostream &  out) const

Definition at line 907 of file fespace.cpp.

References fec, FiniteElementCollection::Name(), ordering, and vdim.

Referenced by GridFunction::Save().

FiniteElementSpace * FiniteElementSpace::SaveUpdate ( ) [virtual]

Return a copy of the current FE space and update.

Reimplemented in ParFiniteElementSpace.

Definition at line 839 of file fespace.cpp.

References Constructor(), and FiniteElementSpace().

Referenced by Mesh::UpdateNodes().

void FiniteElementSpace::Update ( ) [virtual]

Reimplemented in ParFiniteElementSpace.

Definition at line 826 of file fespace.cpp.

References Constructor(), Destructor(), NURBSext, and UpdateNURBS().

Referenced by Mesh::UpdateNURBS().

void FiniteElementSpace::UpdateNURBS ( ) [protected]
int FiniteElementSpace::VDofToDof ( int  vdof) const [inline]

Definition at line 191 of file fespace.hpp.

References Ordering::byNODES, ndofs, ordering, and vdim.

Referenced by ParFiniteElementSpace::GetDofSign().


Member Data Documentation

int * FiniteElementSpace::bdofs [protected]

Definition at line 78 of file fespace.hpp.

Referenced by BuildDofToArrays(), Destructor(), FiniteElementSpace(), and GetElementForDof().

Definition at line 78 of file fespace.hpp.

Referenced by BuildDofToArrays(), Destructor(), FiniteElementSpace(), and GetLocalDofForDof().

int* FiniteElementSpace::fdofs [protected]
int FiniteElementSpace::nbdofs [protected]

Definition at line 70 of file fespace.hpp.

Referenced by Constructor(), FiniteElementSpace(), and UpdateNURBS().

int FiniteElementSpace::ndofs [protected]

Number of degrees of freedom. Number of unknowns are ndofs*vdim.

Definition at line 62 of file fespace.hpp.

Referenced by BuildDofToArrays(), Constructor(), D2Const_GlobalRestrictionMatrix(), DofsToVDofs(), DofToVDof(), FiniteElementSpace(), GetNDofs(), GetVSize(), H2L_GlobalRestrictionMatrix(), UpdateNURBS(), and VDofToDof().

int FiniteElementSpace::nedofs [protected]
int FiniteElementSpace::nfdofs [protected]
int FiniteElementSpace::nvdofs [protected]

Type of ordering of dofs. Ordering::byNODES - first nodes, then vector dimension, Ordering::byVDIM - first vector dimension, then nodes

Definition at line 67 of file fespace.hpp.

Referenced by DofsToVDofs(), DofToVDof(), FiniteElementSpace(), GetOrdering(), Save(), and VDofToDof().

int FiniteElementSpace::own_ext [protected]

Definition at line 81 of file fespace.hpp.

Referenced by Destructor(), and FiniteElementSpace().

Collection of currently known refinement data.

Definition at line 74 of file fespace.hpp.

Referenced by ConstructRefinementData(), and ~FiniteElementSpace().

int FiniteElementSpace::vdim [protected]

Vector dimension (number of unknowns per degree of freedom).

Definition at line 59 of file fespace.hpp.

Referenced by DofsToVDofs(), DofToVDof(), FiniteElementSpace(), GetVDim(), GetVSize(), Save(), and VDofToDof().


The documentation for this class was generated from the following files:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines