hp2D::hpAdaptiveSpace< F > Class Template Referenceabstract

hp-adaptive space with 2D elements. More...

#include <hpAdaptiveSpace.hh>

Inheritance diagram for hp2D::hpAdaptiveSpace< F >:
concepts::SpaceOnCoarseCells< 2, F > concepts::AdaptiveSpace< F, concepts::AdaptiveAdjustP< 2 > > concepts::Subspace concepts::SpaceOnCells< F > concepts::Space< F >

Public Types

typedef concepts::Scan< hp2D::Element< F > > Scan
 
typedef Scan< ElementWithCell< F > > Scanner
 
typedef F t_type
 
typedef ElementWithCell< F > type
 

Public Member Functions

virtual void adjust (const concepts::Element< F > &elm, const concepts::AdaptiveAdjustP< 2 > &a)
 Adjusts the space in the next rebuild step for this element. More...
 
const std::set< concepts::Cell2 * > allCells () const
 
virtual const std::set< typename CellType< dimC >::cell * > allCells () const=0
 
std::pair< bool, uint > available () const
 Returns 0 if the space has to be rebuilt with rebuild(), otherwise the number of the build. More...
 
uint dim ()
 
virtual uint dim () const
 Returns the dimension of the space. More...
 
virtual uint getOutputDimension () const
 Returns the default output dimension, when we consider plotting a real-valued operator on this space. More...
 
concepts::SubspaceHelper< F, SpacePreBuilder > & helper ()
 
const concepts::SubspaceHelper< F, SpacePreBuilder > & helper () const
 
 hpAdaptiveSpace (concepts::Mesh2 &msh, uint l, uint p, concepts::BoundaryConditions *bc=0, concepts::CellConditions *cc=0)
 Constructor. More...
 
 hpAdaptiveSpace (const hpAdaptiveSpace &spc)
 Copy constructor. More...
 
 hpAdaptiveSpace (hpFull &prebuild, concepts::BoundaryConditions *bc=0, concepts::CellConditions *cc=0, uint spcNo=0, uint *offset=0, uint *idx=0)
 Constructor for using same mesh and distribution of degrees of freedom object as another space. More...
 
virtual uint & lastIdx ()
 Returns last global index of the space. More...
 
virtual const uint & lastIdx () const
 
uint nelm ()
 
virtual uint nelm () const
 Returns the number of elements in the space. More...
 
virtual uint offset () const
 Returns the offset. More...
 
hpFullprebuild ()
 
hpFullprebuild () const
 
void rebuild (bool sameIndices=false)
 Rebuilds the mesh and the elements due to adjustment orders. More...
 
virtual void recomputeShapefunctions ()=0
 Recompute shape functions, e.g. More...
 
Scanscan ()
 
virtual Scanscan () const
 Returns a scanner to iterate over the elements of the space. More...
 
void set_bc (const concepts::BoundaryConditions *bc)
 Reset boundary conditions to bc
More...
 
virtual ~hpAdaptiveSpace ()
 

Protected Member Functions

virtual concepts::TColumn< F > * applySmatrices_ (const concepts::Element< F > &elm, uint i, const concepts::TColumn< F > *T0, const concepts::TColumn< F > *T1)=0
 Apply i -th S matrix to T-Columns T0 and T1 of cell, where i is the number of child of cell. More...
 
virtual std::ostream & info (std::ostream &os) const
 
virtual Element< F > * newElement_ (concepts::Cell2 &cell, ushort *pMax, concepts::TColumn< F > *T0, concepts::TColumn< F > *T1) const =0
 Creates and returns an element for cell. More...
 

Protected Attributes

uint idxEdge_
 
uint idxInner_
 
uint idxVtx_
 Number of indices on entities, just for statistics. More...
 
uint nelm_
 Number of elements currently active in the mesh. More...
 
uint offset_
 Initially given offset, holden for control, if in there are changes in the previous subspace. More...
 
hpFull *const prebuild_
 Mesh and degrees of freedoms. More...
 
concepts::SubspaceHelper< F, SpacePreBuilderspc_
 Helper class for building elements with space pre builder, boundary conditions and index. More...
 
bool zeroDim_
 Control, if dimension at last build is zero. More...
 

Strategies to Build the Degrees of Freedom

bool ownPrebuild_
 If prebuild object is created here and not given. More...
 
uint dofBuild_
 Number of the build of prebuild_ at last call of rebuild() More...
 
uint build_
 Number of the build. More...
 
concepts::Joiner< Element< F > *, 1 > * elm_
 Linked list of the elements. More...
 
std::unique_ptr< const BuildTColumnsBase< F > > buildVertexDofs_
 Strategy to build the vertex degrees of freedom. More...
 
std::unique_ptr< const BuildTColumnsBase< F > > buildEdgeDofs_
 Strategy to build the edge degrees of freedom. More...
 
std::unique_ptr< const BuildTColumnsBase< F > > buildInnerDofs_
 Strategy to build the inner degrees of freedom. More...
 
bool notAvailable_
 Flag indicating some reasons the space is not available. More...
 
void setBuildVertexDofs_ (const BuildTColumnsBase< F > *b)
 Change the strategy how the degrees of freedom for the vertices are built. More...
 
void setBuildEdgeDofs_ (const BuildTColumnsBase< F > *b)
 Change the strategy how the degrees of freedom for the edge are built. More...
 
void setBuildInnerDofs_ (const BuildTColumnsBase< F > *b)
 Change the strategy how the degrees of freedom for the interior are built. More...
 
void buildElements_ (concepts::Cell2 &cell, ushort *Pmax, concepts::TColumn< F > *T0=0)
 If prebuild object is created here and not given. More...
 
template<class G >
void setVtxPassive_ (G &cntr, bool forChildren=false, bool always=false)
 Set vertices passive. More...
 
void setEdgePassive_ (const concepts::Connector1 &cntr)
 Set this edge and all children edges passive. More...
 

Detailed Description

template<class F>
class hp2D::hpAdaptiveSpace< F >

hp-adaptive space with 2D elements.

Author
Kersten Schmidt, 2005

Definition at line 33 of file hpAdaptiveSpace.hh.

Member Typedef Documentation

◆ Scan

template<class F >
typedef concepts::Scan<hp2D::Element<F> > hp2D::hpAdaptiveSpace< F >::Scan

Definition at line 38 of file hpAdaptiveSpace.hh.

◆ Scanner

template<class F >
typedef Scan<ElementWithCell<F> > concepts::SpaceOnCells< F >::Scanner
inherited

Definition at line 84 of file space.hh.

◆ t_type

template<class F >
typedef F hp2D::hpAdaptiveSpace< F >::t_type

Definition at line 39 of file hpAdaptiveSpace.hh.

◆ type

template<class F >
typedef ElementWithCell<F> concepts::SpaceOnCells< F >::type
inherited

Definition at line 83 of file space.hh.

Constructor & Destructor Documentation

◆ hpAdaptiveSpace() [1/3]

template<class F >
hp2D::hpAdaptiveSpace< F >::hpAdaptiveSpace ( concepts::Mesh2 msh,
uint  l,
uint  p,
concepts::BoundaryConditions bc = 0,
concepts::CellConditions cc = 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.

Parameters
mshThe domain of interest partitioned into a mesh.
lLevel of refinement
pDegree of the polynomials to be used.
bcBoundary conditions
ccCell conditionss

◆ hpAdaptiveSpace() [2/3]

template<class F >
hp2D::hpAdaptiveSpace< F >::hpAdaptiveSpace ( hpFull prebuild,
concepts::BoundaryConditions bc = 0,
concepts::CellConditions cc = 0,
uint  spcNo = 0,
uint *  offset = 0,
uint *  idx = 0 
)

Constructor for using same mesh and distribution of degrees of freedom object as another space.

The global indices are sorted by the topological entities, on which the degrees of freedoms lie. Spaces could have no common entities, e.g. first space has Dirichlet boundary and this has only dof on the boundary. If they have common entities, like in mixed problems, the global indices per topological entity can be uniquely given by spcNo.

Parameters
prebuildspace pre builder
bcBoundary conditions
ccCell conditions
spcNoNumber to distinguish between global indices on same topological entity.
offsetLast index of previous space.
idxpointer to index, when wanting a common index. If non zero you should set the parameter "all" in the bilinear form to true.

◆ hpAdaptiveSpace() [3/3]

template<class F >
hp2D::hpAdaptiveSpace< F >::hpAdaptiveSpace ( const hpAdaptiveSpace< F > &  spc)

Copy constructor.

Copies mesh, boundary conditions and ctrl2_ (information about refinements and polynomial degrees of the elements).

◆ ~hpAdaptiveSpace()

template<class F >
virtual hp2D::hpAdaptiveSpace< F >::~hpAdaptiveSpace ( )
virtual

Member Function Documentation

◆ adjust()

template<class F >
virtual void hp2D::hpAdaptiveSpace< F >::adjust ( const concepts::Element< F > &  elm,
const concepts::AdaptiveAdjustP< 2 > &  a 
)
virtual

Adjusts the space in the next rebuild step for this element.

Implements concepts::AdaptiveSpace< F, concepts::AdaptiveAdjustP< 2 > >.

◆ allCells() [1/2]

template<class F >
const std::set<concepts::Cell2* > hp2D::hpAdaptiveSpace< F >::allCells ( ) const
inline

Definition at line 126 of file hpAdaptiveSpace.hh.

◆ allCells() [2/2]

virtual const std::set<typename CellType<dimC>::cell * > concepts::SpaceOnCoarseCells< dimC, F >::allCells
pure virtualinherited

◆ applySmatrices_()

template<class F >
virtual concepts::TColumn<F>* hp2D::hpAdaptiveSpace< F >::applySmatrices_ ( const concepts::Element< F > &  elm,
uint  i,
const concepts::TColumn< F > *  T0,
const concepts::TColumn< F > *  T1 
)
protectedpure virtual

Apply i -th S matrix to T-Columns T0 and T1 of cell, where i is the number of child of cell.

Returns resulting T-Columns.

Implemented in hp2D::hpAdaptiveSpaceHCurl, hp2D::hpAdaptiveSpaceL2, and hp2D::hpAdaptiveSpaceH1.

◆ available()

template<class F >
std::pair<bool, uint> hp2D::hpAdaptiveSpace< F >::available ( ) const

Returns 0 if the space has to be rebuilt with rebuild(), otherwise the number of the build.

This number helps in the decision of availability.

◆ buildElements_()

template<class F >
void hp2D::hpAdaptiveSpace< F >::buildElements_ ( concepts::Cell2 cell,
ushort *  Pmax,
concepts::TColumn< F > *  T0 = 0 
)
private

If prebuild object is created here and not given.

◆ dim() [1/2]

template<class F >
uint hp2D::hpAdaptiveSpace< F >::dim
inline

Definition at line 270 of file hpAdaptiveSpace.hh.

◆ dim() [2/2]

template<class F >
uint hp2D::hpAdaptiveSpace< F >::dim ( ) const
inlinevirtual

Returns the dimension of the space.

Implements concepts::SpaceOnCells< F >.

Definition at line 249 of file hpAdaptiveSpace.hh.

◆ getOutputDimension()

template<class F >
virtual uint concepts::Space< F >::getOutputDimension ( ) const
inlinevirtualinherited

Returns the default output dimension, when we consider plotting a real-valued operator on this space.

Definition at line 50 of file space.hh.

◆ helper() [1/2]

template<class F >
concepts::SubspaceHelper<F, SpacePreBuilder>& hp2D::hpAdaptiveSpace< F >::helper ( )
inline

Definition at line 91 of file hpAdaptiveSpace.hh.

◆ helper() [2/2]

template<class F >
const concepts::SubspaceHelper<F, SpacePreBuilder>& hp2D::hpAdaptiveSpace< F >::helper ( ) const
inline

Definition at line 89 of file hpAdaptiveSpace.hh.

◆ info()

template<class F >
virtual std::ostream& hp2D::hpAdaptiveSpace< F >::info ( std::ostream &  os) const
protectedvirtual

◆ lastIdx() [1/2]

template<class F >
virtual uint& hp2D::hpAdaptiveSpace< F >::lastIdx ( )
inlinevirtual

Returns last global index of the space.

Implements concepts::Subspace.

Definition at line 92 of file hpAdaptiveSpace.hh.

◆ lastIdx() [2/2]

template<class F >
virtual const uint& hp2D::hpAdaptiveSpace< F >::lastIdx ( ) const
inlinevirtual

Definition at line 93 of file hpAdaptiveSpace.hh.

◆ nelm() [1/2]

template<class F >
uint hp2D::hpAdaptiveSpace< F >::nelm
inline

Definition at line 276 of file hpAdaptiveSpace.hh.

◆ nelm() [2/2]

template<class F >
uint hp2D::hpAdaptiveSpace< F >::nelm ( ) const
inlinevirtual

Returns the number of elements in the space.

Implements concepts::SpaceOnCells< F >.

Definition at line 256 of file hpAdaptiveSpace.hh.

◆ newElement_()

template<class F >
virtual Element<F>* hp2D::hpAdaptiveSpace< F >::newElement_ ( concepts::Cell2 cell,
ushort *  pMax,
concepts::TColumn< F > *  T0,
concepts::TColumn< F > *  T1 
) const
protectedpure virtual

Creates and returns an element for cell.

Has to be implemented in the derived classes.

Implemented in hp2D::hpAdaptiveSpaceHCurl, hp2D::hpAdaptiveSpaceL2, and hp2D::hpAdaptiveSpaceH1.

◆ offset()

template<class F >
virtual uint hp2D::hpAdaptiveSpace< F >::offset ( ) const
inlinevirtual

Returns the offset.

Implements concepts::Subspace.

Definition at line 94 of file hpAdaptiveSpace.hh.

◆ prebuild() [1/2]

template<class F >
hpFull& hp2D::hpAdaptiveSpace< F >::prebuild ( )
inline

Definition at line 86 of file hpAdaptiveSpace.hh.

◆ prebuild() [2/2]

template<class F >
hpFull& hp2D::hpAdaptiveSpace< F >::prebuild ( ) const
inline

Definition at line 87 of file hpAdaptiveSpace.hh.

◆ rebuild()

template<class F >
void hp2D::hpAdaptiveSpace< F >::rebuild ( bool  sameIndices = false)

Rebuilds the mesh and the elements due to adjustment orders.

Parameters
sameIndicesIf true, the already existing indices (stored in the space pre builder) won't be cleared. That is useful for domain decomposition for example.

◆ recomputeShapefunctions()

template<class F >
virtual void hp2D::hpAdaptiveSpace< F >::recomputeShapefunctions ( )
pure virtual

Recompute shape functions, e.g.

for other abscissas redefined through setIntegrationRule

Implemented in hp2D::hpAdaptiveSpaceHCurl, hp2D::hpAdaptiveSpaceL2, and hp2D::hpAdaptiveSpaceH1.

◆ scan() [1/2]

template<class F >
hpAdaptiveSpace< F >::Scan * hp2D::hpAdaptiveSpace< F >::scan
inline

Definition at line 282 of file hpAdaptiveSpace.hh.

◆ scan() [2/2]

template<class F >
hpAdaptiveSpace< F >::Scan * hp2D::hpAdaptiveSpace< F >::scan ( ) const
inlinevirtual

Returns a scanner to iterate over the elements of the space.

Implements concepts::SpaceOnCells< F >.

Definition at line 263 of file hpAdaptiveSpace.hh.

◆ set_bc()

template<class F >
void hp2D::hpAdaptiveSpace< F >::set_bc ( const concepts::BoundaryConditions bc)
inline

Reset boundary conditions to bc

Definition at line 122 of file hpAdaptiveSpace.hh.

◆ setBuildEdgeDofs_()

template<class F >
void hp2D::hpAdaptiveSpace< F >::setBuildEdgeDofs_ ( const BuildTColumnsBase< F > *  b)
protected

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.

Parameters
bNew strategy

◆ setBuildInnerDofs_()

template<class F >
void hp2D::hpAdaptiveSpace< F >::setBuildInnerDofs_ ( const BuildTColumnsBase< F > *  b)
protected

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.

Parameters
bNew strategy

◆ setBuildVertexDofs_()

template<class F >
void hp2D::hpAdaptiveSpace< F >::setBuildVertexDofs_ ( const BuildTColumnsBase< F > *  b)
protected

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.

Parameters
bNew strategy

◆ setEdgePassive_()

template<class F >
void hp2D::hpAdaptiveSpace< F >::setEdgePassive_ ( const concepts::Connector1 cntr)
private

Set this edge and all children edges passive.

◆ setVtxPassive_()

template<class F >
template<class G >
void hp2D::hpAdaptiveSpace< F >::setVtxPassive_ ( G &  cntr,
bool  forChildren = false,
bool  always = false 
)
private

Set vertices passive.

  • For dirichlet vertices of a cell. (always = false, forChildren = false)
  • For vertices of a dirichlet edge, also inside edge. (always = false, forChildren = true)
  • All vertices of cells. (always = true, forChildren = false)

Member Data Documentation

◆ build_

template<class F >
uint hp2D::hpAdaptiveSpace< F >::build_
private

Number of the build.

Definition at line 212 of file hpAdaptiveSpace.hh.

◆ buildEdgeDofs_

template<class F >
std::unique_ptr<const BuildTColumnsBase<F> > hp2D::hpAdaptiveSpace< F >::buildEdgeDofs_
private

Strategy to build the edge degrees of freedom.

Can be changed with buildEdgeDofs.

Definition at line 222 of file hpAdaptiveSpace.hh.

◆ buildInnerDofs_

template<class F >
std::unique_ptr<const BuildTColumnsBase<F> > hp2D::hpAdaptiveSpace< F >::buildInnerDofs_
private

Strategy to build the inner degrees of freedom.

Can be changed with buildInnerDofs.

Definition at line 226 of file hpAdaptiveSpace.hh.

◆ buildVertexDofs_

template<class F >
std::unique_ptr<const BuildTColumnsBase<F> > hp2D::hpAdaptiveSpace< F >::buildVertexDofs_
private

Strategy to build the vertex degrees of freedom.

Can be changed with buildVertexDofs.

Definition at line 218 of file hpAdaptiveSpace.hh.

◆ dofBuild_

template<class F >
uint hp2D::hpAdaptiveSpace< F >::dofBuild_
private

Number of the build of prebuild_ at last call of rebuild()

Definition at line 210 of file hpAdaptiveSpace.hh.

◆ elm_

template<class F >
concepts::Joiner<Element<F>*, 1>* hp2D::hpAdaptiveSpace< F >::elm_
private

Linked list of the elements.

Definition at line 214 of file hpAdaptiveSpace.hh.

◆ idxEdge_

template<class F >
uint hp2D::hpAdaptiveSpace< F >::idxEdge_
protected

Definition at line 158 of file hpAdaptiveSpace.hh.

◆ idxInner_

template<class F >
uint hp2D::hpAdaptiveSpace< F >::idxInner_
protected

Definition at line 158 of file hpAdaptiveSpace.hh.

◆ idxVtx_

template<class F >
uint hp2D::hpAdaptiveSpace< F >::idxVtx_
protected

Number of indices on entities, just for statistics.

Definition at line 158 of file hpAdaptiveSpace.hh.

◆ nelm_

template<class F >
uint hp2D::hpAdaptiveSpace< F >::nelm_
protected

Number of elements currently active in the mesh.

Definition at line 145 of file hpAdaptiveSpace.hh.

◆ notAvailable_

template<class F >
bool hp2D::hpAdaptiveSpace< F >::notAvailable_
private

Flag indicating some reasons the space is not available.

Definition at line 228 of file hpAdaptiveSpace.hh.

◆ offset_

template<class F >
uint hp2D::hpAdaptiveSpace< F >::offset_
protected

Initially given offset, holden for control, if in there are changes in the previous subspace.

Definition at line 150 of file hpAdaptiveSpace.hh.

◆ ownPrebuild_

template<class F >
bool hp2D::hpAdaptiveSpace< F >::ownPrebuild_
private

If prebuild object is created here and not given.

Definition at line 208 of file hpAdaptiveSpace.hh.

◆ prebuild_

template<class F >
hpFull* const hp2D::hpAdaptiveSpace< F >::prebuild_
protected

Mesh and degrees of freedoms.

Definition at line 137 of file hpAdaptiveSpace.hh.

◆ spc_

template<class F >
concepts::SubspaceHelper<F, SpacePreBuilder> hp2D::hpAdaptiveSpace< F >::spc_
protected

Helper class for building elements with space pre builder, boundary conditions and index.

Definition at line 142 of file hpAdaptiveSpace.hh.

◆ zeroDim_

template<class F >
bool hp2D::hpAdaptiveSpace< F >::zeroDim_
protected

Control, if dimension at last build is zero.

That is needed to distinguish from not built state, if the index counter is reset.

Definition at line 155 of file hpAdaptiveSpace.hh.


The documentation for this class was generated from the following file:
Page URL: http://wiki.math.ethz.ch/bin/view/Concepts/WebHome
21 August 2020
© 2020 Eidgenössische Technische Hochschule Zürich