A 2D hp FEM space with continuous, piecewise polynomial basis functions. More...
#include <space.hh>


Public Types | |
| typedef concepts::Scan < hp2D::Element< Real > > | Scan |
| typedef Scan< ElementWithCell < Real > > | Scanner |
Public Member Functions | |
| virtual void | adjust (const concepts::Element< Real > &elm, const concepts::AdaptiveAdjustP< 2 > &a) |
| virtual void | adjust (const Element< Real > &elm, const concepts::AdaptiveAdjustP< 2 > &a)=0 |
| Adjusts the space in the next rebuild step for this element. | |
| uint | connectedIdx (const concepts::Attribute &a) const |
| Gives the number of connected dofs for one attribute. | |
| Scan * | constScan () const |
| Returns constant scanner over elements of last build, In contrast to scan(), this method also workes, if the space would need a rebuild, i.e. | |
| uint | dim () |
| virtual uint | dim () const |
| Returns the dimension of the space. | |
| virtual uint | nelm () const |
| Returns the number of elements in the space. | |
| uint | nelm () |
| Space | rebuild () |
| Rebuilds the space. | |
| void | recomputeShapefunctions () |
| Recompute shape functions, e.g. | |
| virtual Scan * | scan () const |
| Returns a scanner to iterate over the elements of the space. | |
| Scan * | scan () |
| Space (concepts::Mesh2 &msh, uint l, uint p, concepts::BoundaryConditions *bc=0) | |
| Constructor. | |
| Space (const Space &spc) | |
| Copy constructor. | |
| virtual | ~Space () |
Strategies to Build the Degrees of Freedom | |
| void | buildVertexDofs (const BuildDofsBase &b) |
| Change the strategy how the degrees of freedom for the vertices are built. | |
| void | buildEdgeDofs (const BuildDofsBase &b) |
| Change the strategy how the degrees of freedom for the edge are built. | |
| void | buildInnerDofs (const BuildDofsBase &b) |
| Change the strategy how the degrees of freedom for the interior are built. | |
Protected Member Functions | |
| virtual std::ostream & | info (std::ostream &os) const |
| Returns information in an output stream. | |
Private Member Functions | |
| bool | activeCell_ (concepts::Cell &cell) |
| Checks if a cell is in active region. | |
| void | buildElements_ (concepts::Quad2d &cell, ushort *Pmax, concepts::TColumn< Real > *T0=0) |
| Creates the elements and their T matrices. | |
| void | buildEmptyElements_ (concepts::Quad2d &cell) |
| void | computePmax_ (const concepts::Connector2 &cntr, ushort Pmax[2]) const |
Computes the maximal polynomial degree of cell in each direction. | |
| void | createCellList_ (const concepts::Connector &cntr, const concepts::CellData *father) |
Initially fills cellList_ (recusively) | |
| void | createVtxEdgList_ (const concepts::Connector2 &cell) |
Initially fills edgeListVtx_ and vertexList_. | |
| void | deactivate_ (const concepts::Edge &edg) |
| void | deactivate_ (const concepts::Vertex &vtx) |
| void | enforceBC_ (const concepts::Connector2 &cell) |
| Enforce Dirichlet boundary conditions. | |
| void | enrichElm_ (const concepts::Quad2d &cell, int *p) |
| Enriches the polynomial degrees. | |
| void | matlabstatus_ () |
| void | meshAndPoly_ (concepts::Quad2d &cell, concepts::Level< 2 > &L, int *P) |
| Adjusts the mesh and the polynomial degree. | |
| void | minimumRule_ (const concepts::Connector2 &cntr, const concepts::Connector1 &edge) |
| Used to enforce the minimum rule. | |
| void | recomputeSmatrices_ (const Quad< Real > &elm) |
| Checks if the S matrices need to be recomputed and does so if necessary. | |
| Space (const Space &spc, uint i) | |
| Copy constructor used to return a snapshot of the old space from rebuild() | |
| void | status_ () |
| Gives the cells and edges with given polynomial degree (for debugging) | |
Private Attributes | |
| __gnu_cxx::hash_map< uint, concepts::AdaptiveAdjustP< 2 > > | adj_ |
| Hash table of the adjustment information of the elements. | |
| concepts::BoundaryConditions * | bc_ |
| Boundary conditions. | |
| std::auto_ptr< BuildDofsBase > | buildEdgeDofs_ |
| Strategy to build the edge degrees of freedom. | |
| std::auto_ptr< BuildDofsBase > | buildInnerDofs_ |
| Strategy to build the inner degrees of freedom. | |
| std::auto_ptr< BuildDofsBase > | buildVertexDofs_ |
| Strategy to build the vertex degrees of freedom. | |
| std::map< uint, concepts::CellData > | cellList_ |
| List of cells. | |
| __gnu_cxx::hash_map< uint, concepts::AdaptiveControl<> > | ctrl0_ |
| Hash table of the control information for the vertices. | |
| std::auto_ptr < __gnu_cxx::hash_map< uint, concepts::AdaptiveControlP< 1 > > > | ctrl1_ |
| Hash table of the control information for the edges. | |
| __gnu_cxx::hash_map< uint, concepts::AdaptiveControlP< 2 > > | ctrl2_ |
| Hash table of the control information for the 2D elements. | |
| __gnu_cxx::hash_map< uint, concepts::AdaptiveControl<> > | ctrlc0_ |
| Hash table for connected vertex dofs (mapping from attribute) | |
| uint | dim_ |
| Dimension of the FE space. | |
| std::map< uint, concepts::EdgeData > | edgeList_ |
| List of edges. | |
| concepts::Joiner< Element < Real > *, 1 > * | elm_ |
| Linked list of the elements. | |
| concepts::Mesh2 & | msh_ |
| Mesh. | |
| uint | nelm_ |
| Number of elements currently active in the mesh. | |
| bool | rebuild_ |
| If true: the elements have to be rebuilt. | |
| std::auto_ptr < concepts::SMatrix1D > | S1left_ |
| S matrices in 1D. | |
| std::auto_ptr < concepts::SMatrix1D > | S1right_ |
| std::auto_ptr < concepts::SMatrixBase< Real > > | Smatrices2H_ [2] |
| S matrices for horizontal subdivision. | |
| std::auto_ptr < concepts::SMatrixBase< Real > > | Smatrices2V_ [2] |
| S matrices for vertical subdivision. | |
| std::auto_ptr < concepts::SMatrixBase< Real > > | Smatrices4_ [4] |
| S matrices for subdivision into 4 quads. | |
| std::map< uint, concepts::VertexData > | vertexList_ |
| List of vertices. | |
| __gnu_cxx::hash_map< uint, const concepts::Attribute * > | vtxConnect_ |
| Hash table for connected vertex dofs (mapping from cell key) | |
Friends | |
| class | BuildDofsBase |
A 2D hp FEM space with continuous, piecewise polynomial basis functions.
Currently, only hexahedrons and conforming meshes are possible.
BGT_0.cc, hpFEM2d-simple.cc, and hpFEM2d.cc.
| typedef concepts::Scan<hp2D::Element<Real> > hp2D::Space::Scan |
typedef Scan<ElementWithCell<Real > > concepts::SpaceOnCells< Real >::Scanner [inherited] |
Reimplemented from concepts::Space< Real >.
Reimplemented in linDG3D::FvdgSpace.
| hp2D::Space::Space | ( | concepts::Mesh2 & | msh, |
| uint | l, | ||
| uint | p, | ||
| concepts::BoundaryConditions * | bc = 0 |
||
| ) |
Constructor.
Scans the mesh and sets the cells in the mesh active and the level of refinement and the polynomial degree in all cells to the given values. rebuild_ is set to true, ie. if the mesh is used it will firstly be rebuilt.
| msh | The domain of interest partitioned into a mesh. |
| l | Level of refinement |
| p | Degree of the polynomials to be used. |
| bc | Boundary conditions |
| hp2D::Space::Space | ( | const Space & | spc | ) |
Copy constructor.
Copies mesh, boundary conditions and ctrl2_ (information about refinements and polynomial degrees of the elements).
| virtual hp2D::Space::~Space | ( | ) | [virtual] |
| hp2D::Space::Space | ( | const Space & | spc, |
| uint | i | ||
| ) | [private] |
Copy constructor used to return a snapshot of the old space from rebuild()
| spc | To be copied |
| i | Dummy argument to select this copy constructor |
| bool hp2D::Space::activeCell_ | ( | concepts::Cell & | cell | ) | [private] |
Checks if a cell is in active region.
A whole region can be deactivated by setting the attribute of the cells in the region to be of Dirichlet boundary condition. In this region empty elements. Thats necessary for vectorial spaces, which live on the same mesh, so that the spaces in all dimension have the same number of elements.
The edges of the nonactive regions could be active, that means that the shape functions lie only on one side of the edge. The edges of the region can be deactivated by usual setting of Dirichlet boundary condition.
| virtual void hp2D::Space::adjust | ( | const concepts::Element< Real > & | elm, |
| const concepts::AdaptiveAdjustP< 2 > & | a | ||
| ) | [virtual] |
| virtual void concepts::AdaptiveSpace< Real , concepts::AdaptiveAdjustP< 2 > >::adjust | ( | const Element< Real > & | elm, |
| const concepts::AdaptiveAdjustP< 2 > & | a | ||
| ) | [pure virtual, inherited] |
Adjusts the space in the next rebuild step for this element.
| void hp2D::Space::buildEdgeDofs | ( | const BuildDofsBase & | b | ) |
Change the strategy how the degrees of freedom for the edge are built.
The default strategy is BuildEdgeDofs. You can change this strategy any time you chose.
buildEdgeDofs_ is reset with a clone of b.
| b | New strategy |
| void hp2D::Space::buildElements_ | ( | concepts::Quad2d & | cell, |
| ushort * | Pmax, | ||
| concepts::TColumn< Real > * | T0 = 0 |
||
| ) | [private] |
Creates the elements and their T matrices.
This routine is called recursively until the finest level is reached. If there have degrees of freedom to be assigned on higher level, the according T columns are adapted using the S matrices. On the finest level, the elements are created and the T matrix is created from the T columns.
| cell | The current cell |
| Pmax | Request for maximal polynomial degree, array with 2 entries |
| T0 | Precomputed T columns which belong to a parent of the cell |
Pmax is an array of 2 integers | void hp2D::Space::buildEmptyElements_ | ( | concepts::Quad2d & | cell | ) | [private] |
| void hp2D::Space::buildInnerDofs | ( | const BuildDofsBase & | b | ) |
Change the strategy how the degrees of freedom for the interior are built.
The default strategy is BuildInnerDofsLinTrunk. You can change this strategy any time you chose.
buildInnerDofs_ is reset with a clone of b.
| b | New strategy |
| void hp2D::Space::buildVertexDofs | ( | const BuildDofsBase & | b | ) |
Change the strategy how the degrees of freedom for the vertices are built.
The default strategy is BuildVertexDofs. You can change this strategy any time you chose.
buildVertexDofs_ is reset with a clone of b.
| b | New strategy |
| void hp2D::Space::computePmax_ | ( | const concepts::Connector2 & | cntr, |
| ushort | Pmax[2] | ||
| ) | const [private] |
Computes the maximal polynomial degree of cell in each direction.
Takes into account higher polynomial degrees on faces and edges compared to the interior.
| uint hp2D::Space::connectedIdx | ( | const concepts::Attribute & | a | ) | const |
Gives the number of connected dofs for one attribute.
| Space::Scan * hp2D::Space::constScan | ( | ) | const [inline] |
| void hp2D::Space::createCellList_ | ( | const concepts::Connector & | cntr, |
| const concepts::CellData * | father | ||
| ) | [private] |
Initially fills cellList_ (recusively)
| void hp2D::Space::createVtxEdgList_ | ( | const concepts::Connector2 & | cell | ) | [private] |
Initially fills edgeListVtx_ and vertexList_.
| void hp2D::Space::deactivate_ | ( | const concepts::Vertex & | vtx | ) | [private] |
| void hp2D::Space::deactivate_ | ( | const concepts::Edge & | edg | ) | [private] |
| uint hp2D::Space::dim | ( | ) | const [inline, virtual] |
Returns the dimension of the space.
Implements concepts::Space< Real >.
| uint hp2D::Space::dim | ( | ) | [inline] |
| void hp2D::Space::enforceBC_ | ( | const concepts::Connector2 & | cell | ) | [private] |
Enforce Dirichlet boundary conditions.
This routine is called by meshAndPoly_ on every cell.
| cell | Cell |
| void hp2D::Space::enrichElm_ | ( | const concepts::Quad2d & | cell, |
| int * | p | ||
| ) | [private] |
Enriches the polynomial degrees.
This enrichement is necessary for the edges to be able to create conforming global basis functions.
In refined cells, some of the small edges might have a polynomial degree which is too low to represent a part of a basis function which is defined on a larger element.
To achieve this, the cells are traversed top down until the level of the elements is reached. During the traversal, the needed polynomial degree for the small elements is computed and enforced on the element level (only on the edges).
p is an array of 6 integers | virtual std::ostream& hp2D::Space::info | ( | std::ostream & | os | ) | const [protected, virtual] |
Returns information in an output stream.
Reimplemented from concepts::SpaceOnCells< Real >.
| void hp2D::Space::matlabstatus_ | ( | ) | [private] |
| void hp2D::Space::meshAndPoly_ | ( | concepts::Quad2d & | cell, |
| concepts::Level< 2 > & | L, | ||
| int * | P | ||
| ) | [private] |
Adjusts the mesh and the polynomial degree.
On the old mesh, the adjustment information is taken. This leads to mesh refinements or coarsening and a certain polynomial degree distribution.
The polynomial degree is fixed on the finest level (where the elements are eventually built) and given to the coarser levels (for edges and the interior of the cell). This is done bottom up.
Finally, the boundary conditions are enforced on every cell using enforceBC_
| cell | Cell |
| L | The desired level |
| P | The desired polynomial degree |
P is an array of 3 integers | void hp2D::Space::minimumRule_ | ( | const concepts::Connector2 & | cntr, |
| const concepts::Connector1 & | edge | ||
| ) | [private] |
Used to enforce the minimum rule.
The minimum rule states that the polynomial degree on a edge has to be the minimum of the adjacent elements.
This routine recursively calls itself and asserts that all the elements adjacent to edge enforce their polynomial degree on edge. This is done if the cell is member of the space. Otherwise, minimumRule_ is called with the children of cell.
| uint hp2D::Space::nelm | ( | ) | const [inline, virtual] |
Returns the number of elements in the space.
Implements concepts::Space< Real >.
| uint hp2D::Space::nelm | ( | ) | [inline] |
| Space hp2D::Space::rebuild | ( | ) |
Rebuilds the space.
First the old list of Finite Elements in the space is removed (not the elements in the topology!). Then the control information for the vertices, edges and faces is cleared (the information on the 2D elements is retained). For every cell in the original mesh, rebuild0_ and rebuild1_ are called. From the mesh, they build the space and store the elements in elm_. An essential part of the generated information are the T matrices. They describe how the local shape functions are glued together to form the global shape functions.
rebuild0_ marks the elements with the right values and rebuild1_ really does the work.
| void hp2D::Space::recomputeShapefunctions | ( | ) |
Recompute shape functions, e.g.
for other abscissas redefined through setIntegrationRule
| void hp2D::Space::recomputeSmatrices_ | ( | const Quad< Real > & | elm | ) | [private] |
Checks if the S matrices need to be recomputed and does so if necessary.
| elm | Element which the S matrices are needed for (the polynomial degrees are important) |
| Space::Scan * hp2D::Space::scan | ( | ) | const [inline, virtual] |
Returns a scanner to iterate over the elements of the space.
Implements concepts::SpaceOnCells< Real >.
| Space::Scan * hp2D::Space::scan | ( | ) | [inline] |
| void hp2D::Space::status_ | ( | ) | [private] |
Gives the cells and edges with given polynomial degree (for debugging)
friend class BuildDofsBase [friend] |
__gnu_cxx::hash_map<uint, concepts::AdaptiveAdjustP<2> > hp2D::Space::adj_ [private] |
concepts::BoundaryConditions* hp2D::Space::bc_ [private] |
std::auto_ptr<BuildDofsBase> hp2D::Space::buildEdgeDofs_ [private] |
std::auto_ptr<BuildDofsBase> hp2D::Space::buildInnerDofs_ [private] |
std::auto_ptr<BuildDofsBase> hp2D::Space::buildVertexDofs_ [private] |
std::map<uint, concepts::CellData> hp2D::Space::cellList_ [private] |
__gnu_cxx::hash_map<uint, concepts::AdaptiveControl<> > hp2D::Space::ctrl0_ [private] |
std::auto_ptr<__gnu_cxx::hash_map< uint, concepts::AdaptiveControlP<1> > > hp2D::Space::ctrl1_ [private] |
__gnu_cxx::hash_map<uint, concepts::AdaptiveControlP<2> > hp2D::Space::ctrl2_ [private] |
__gnu_cxx::hash_map<uint, concepts::AdaptiveControl<> > hp2D::Space::ctrlc0_ [private] |
uint hp2D::Space::dim_ [private] |
std::map<uint, concepts::EdgeData> hp2D::Space::edgeList_ [private] |
concepts::Joiner<Element<Real>*, 1>* hp2D::Space::elm_ [private] |
concepts::Mesh2& hp2D::Space::msh_ [private] |
uint hp2D::Space::nelm_ [private] |
bool hp2D::Space::rebuild_ [private] |
std::auto_ptr<concepts::SMatrix1D> hp2D::Space::S1left_ [private] |
std::auto_ptr<concepts::SMatrix1D> hp2D::Space::S1right_ [private] |
std::auto_ptr<concepts::SMatrixBase<Real> > hp2D::Space::Smatrices2H_[2] [private] |
S matrices for horizontal subdivision.
std::auto_ptr<concepts::SMatrixBase<Real> > hp2D::Space::Smatrices2V_[2] [private] |
S matrices for vertical subdivision.
std::auto_ptr<concepts::SMatrixBase<Real> > hp2D::Space::Smatrices4_[4] [private] |
S matrices for subdivision into 4 quads.
std::map<uint, concepts::VertexData> hp2D::Space::vertexList_ [private] |
__gnu_cxx::hash_map<uint, const concepts::Attribute*> hp2D::Space::vtxConnect_ [private] |