concepts::PiecewiseConstFormula< F > Class Template Referenceabstract
Piecewise constant function defined by the attribute of a cell. More...
#include <formula.hh>
Public Types | |
typedef concepts::Realtype< Real >::type | G |
typedef Real | value_type |
Public Member Functions | |
virtual PiecewiseConstFormula< F > * | clone () const |
Virtual constructor. More... | |
virtual PiecewiseFormulaBase< Real > * | clone () const=0 |
Virtual constructor. More... | |
virtual Real & | dflt_value () |
Gives default value. More... | |
virtual const Real & | dflt_value () const |
Gives default value. More... | |
virtual F | operator() (const Connector &cell, const Real p, const Real t=0.0) const |
Gives the constant in an particular cell. More... | |
virtual F | operator() (const Connector &cell, const Real2d &p, const Real t=0.0) const |
virtual F | operator() (const Connector &cell, const Real3d &p, const Real t=0.0) const |
virtual Real | operator() (const ElementWithCell< concepts::Realtype< Real >::type > &elm, const Real p, const Real t=0.0) const=0 |
Evaluates the formula. More... | |
virtual Real | operator() (const ElementWithCell< concepts::Realtype< Real >::type > &elm, const Real2d &p, const Real t=0.0) const=0 |
Evaluates the formula. More... | |
virtual Real | operator() (const ElementWithCell< concepts::Realtype< Real >::type > &elm, const Real3d &p, const Real t=0.0) const=0 |
Evaluates the formula. More... | |
virtual Real | operator() (const ElementWithCell< G > &elm, const Real p, const Real t=0.0) const |
virtual Real | operator() (const ElementWithCell< G > &elm, const Real2d &p, const Real t=0.0) const |
virtual Real | operator() (const ElementWithCell< G > &elm, const Real3d &p, const Real t=0.0) const |
template<class H > | |
PiecewiseConstFormula< F > & | operator*= (const H &factor) |
virtual F & | operator[] (const uint attrib) |
Set the constant in an particular cell. More... | |
virtual const F & | operator[] (const uint attrib) const |
PiecewiseConstFormula (const F dflt_value=0) | |
Constructor with default value dflt_value . More... | |
PiecewiseConstFormula (const HashMap< F > formula, const F dflt_value=0) | |
Constructor with given mapping formula and default value dflt_value . More... | |
PiecewiseConstFormula (const std::map< int, F > formula, const F dflt_value=0) | |
Constructor with given mapping formula and default value dflt_value . More... | |
virtual | ~PiecewiseConstFormula () |
Protected Member Functions | |
virtual std::ostream & | info (std::ostream &os) const |
Returns information in an output stream. More... | |
Protected Attributes | |
HashMap< F > | formula_ |
Mapping from the elements on to the constants. More... | |
Private Attributes | |
Real | dflt_value_ |
default value More... | |
Detailed Description
template<typename F = Real>
class concepts::PiecewiseConstFormula< F >
Piecewise constant function defined by the attribute of a cell.
This is a proper function for piecewise constant material coefficients, which are most needed in linear and bilinear forms.
Because in linear and bilinear forms are loops over the elements, the appropiate topological cell (connector), respectively the attribute, is known and so it's possible to avoid the searching und to use operator()
with attrib
as input.
In refined meshes the children of a cell gets the same constant due to the handing down the attributes.
If the constant is asked for an element, which can't be find in the list, the default value set in the constructor, is taken. If the default value is not given, it is created by the constructor of the type F
, this is mostly 0.
- Examples
- BGT_0.cc, and exactDtN.cc.
Definition at line 84 of file formula.hh.
Member Typedef Documentation
◆ G
|
inherited |
Definition at line 45 of file piecewiseFormula.hh.
◆ value_type
|
inherited |
Definition at line 37 of file elementFormula.hh.
Constructor & Destructor Documentation
◆ PiecewiseConstFormula() [1/3]
concepts::PiecewiseConstFormula< F >::PiecewiseConstFormula | ( | const F | dflt_value = 0 | ) |
Constructor with default value dflt_value
.
◆ PiecewiseConstFormula() [2/3]
concepts::PiecewiseConstFormula< F >::PiecewiseConstFormula | ( | const HashMap< F > | formula, |
const F | dflt_value = 0 |
||
) |
Constructor with given mapping formula
and default value dflt_value
.
◆ PiecewiseConstFormula() [3/3]
concepts::PiecewiseConstFormula< F >::PiecewiseConstFormula | ( | const std::map< int, F > | formula, |
const F | dflt_value = 0 |
||
) |
Constructor with given mapping formula
and default value dflt_value
.
◆ ~PiecewiseConstFormula()
|
virtual |
Member Function Documentation
◆ clone() [1/2]
|
virtual |
Virtual constructor.
Returns a pointer to a copy of itself. The caller is responsible to destroy this copy.
Implements concepts::Cloneable.
◆ clone() [2/2]
|
pure virtualinherited |
Virtual constructor.
Returns a pointer to a copy of itself. The caller is responsible to destroy this copy.
Implements concepts::ElementFormula< Real, concepts::Realtype< Real >::type >.
Implemented in concepts::PiecewiseFormulaFun< Real, Real >, concepts::PiecewiseFormula< Real >, and concepts::PiecewiseConstFormula< Real >.
◆ dflt_value() [1/2]
|
inlinevirtualinherited |
Gives default value.
Definition at line 83 of file piecewiseFormula.hh.
◆ dflt_value() [2/2]
|
inlinevirtualinherited |
Gives default value.
Definition at line 81 of file piecewiseFormula.hh.
◆ info()
|
protectedvirtual |
Returns information in an output stream.
Reimplemented from concepts::PiecewiseFormulaBase< Real >.
◆ operator()() [1/9]
|
inlinevirtual |
Gives the constant in an particular cell.
Implements concepts::PiecewiseFormulaBase< Real >.
Definition at line 100 of file formula.hh.
◆ operator()() [2/9]
|
inlinevirtual |
Implements concepts::PiecewiseFormulaBase< Real >.
Definition at line 104 of file formula.hh.
◆ operator()() [3/9]
|
inlinevirtual |
Implements concepts::PiecewiseFormulaBase< Real >.
Definition at line 117 of file formula.hh.
◆ operator()() [4/9]
|
pure virtualinherited |
◆ operator()() [5/9]
|
pure virtualinherited |
◆ operator()() [6/9]
|
pure virtualinherited |
◆ operator()() [7/9]
|
inlinevirtualinherited |
Definition at line 52 of file piecewiseFormula.hh.
◆ operator()() [8/9]
|
inlinevirtualinherited |
Definition at line 57 of file piecewiseFormula.hh.
◆ operator()() [9/9]
|
inlinevirtualinherited |
Definition at line 63 of file piecewiseFormula.hh.
◆ operator*=()
PiecewiseConstFormula< F > & concepts::PiecewiseConstFormula< F >::operator*= | ( | const H & | factor | ) |
Definition at line 139 of file formula.hh.
◆ operator[]() [1/2]
|
virtual |
◆ operator[]() [2/2]
|
virtual |
Member Data Documentation
◆ dflt_value_
|
privateinherited |
default value
Definition at line 88 of file piecewiseFormula.hh.
◆ formula_
|
protected |
Mapping from the elements on to the constants.
Definition at line 133 of file formula.hh.
The documentation for this class was generated from the following file:
- geometry/formula.hh