|
rheolef
6.3
|
field - piecewise polynomial finite element field
More...
#include <field.h>

Classes | |
| class | const_iterator |
| class | iterator |
Public Types | |
| typedef std::size_t | size_type |
| typedef M | memory_type |
| typedef T | scalar_type |
| typedef float_traits< T >::type | float_type |
| typedef T | value_type |
| typedef space_constant::valued_type | valued_type |
| typedef geo_basic< float_type, M > | geo_type |
| typedef space_basic < float_type, M > | space_type |
Public Member Functions | |
| field_basic () | |
| field_basic (const space_type &V, const T &init_value=std::numeric_limits< T >::max()) | |
| void | resize (const space_type &V, const T &init_value=std::numeric_limits< T >::max()) |
| field_basic (const field_indirect< T, M > &) | |
| field_basic< T, M > & | operator= (const field_indirect< T, M > &) |
| field_basic (const field_indirect_const< T, M > &) | |
| field_basic< T, M > & | operator= (const field_indirect_const< T, M > &) |
| field_basic (const field_component< T, M > &) | |
| field_basic< T, M > & | operator= (const field_component< T, M > &) |
| field_basic (const field_component_const< T, M > &) | |
| field_basic< T, M > & | operator= (const field_component_const< T, M > &) |
| template<class Expr > | |
| field_basic (const field_expr< Expr > &) | |
| template<class Expr > | |
| field_basic< T, M > & | operator= (const field_expr< Expr > &) |
| field_basic< T, M > & | operator= (const T &) |
| field_basic (const std::initializer_list< field_concat_value< T, M > > &init_list) | |
| field_basic< T, M > & | operator= (const std::initializer_list< field_concat_value< T, M > > &init_list) |
| const space_type & | get_space () const |
| const geo_type & | get_geo () const |
| std::string | stamp () const |
| std::string | get_approx () const |
| valued_type | valued_tag () const |
| const std::string & | valued () const |
| const vec< T, M > & | u () const |
| const vec< T, M > & | b () const |
| vec< T, M > & | set_u () |
| vec< T, M > & | set_b () |
| T | min () const |
| T | max () const |
| T | max_abs () const |
| T | min_abs () const |
| field_indirect< T, M > | operator[] (const geo_basic< T, M > &dom) |
| field_indirect_const< T, M > | operator[] (const geo_basic< T, M > &dom) const |
| field_indirect< T, M > | operator[] (std::string dom_name) |
| field_indirect_const< T, M > | operator[] (std::string dom_name) const |
| size_type | size () const |
| field_component< T, M > | operator[] (size_type i_comp) |
| field_component_const< T, M > | operator[] (size_type i_comp) const |
| field_component< T, M > | operator() (size_type i_comp, size_type j_comp) |
| field_component_const< T, M > | operator() (size_type i_comp, size_type j_comp) const |
| const distributor & | ownership () const |
| const communicator & | comm () const |
| size_type | ndof () const |
| size_type | dis_ndof () const |
| T & | dof (size_type idof) |
| const T & | dof (size_type idof) const |
| const T & | dis_dof (size_type dis_idof) const |
| iterator | begin_dof () |
| iterator | end_dof () |
| const_iterator | begin_dof () const |
| const_iterator | end_dof () const |
| idiststream & | get (idiststream &ips) |
| odiststream & | put (odiststream &ops) const |
| odiststream & | put_field (odiststream &ops) const |
| T | dis_evaluate (const point_basic< T > &x, size_type i_comp=0) const |
| T | operator() (const point_basic< T > &x) const |
| point | vector_evaluate (const point_basic< T > &x) const |
| T | evaluate (const geo_element &K, const point_basic< T > &hat_xq, size_type i_comp=0) const |
| void | dis_dof_update () const |
Protected Member Functions | |
| void | dis_dof_update_internal () const |
| void | dis_dof_update_needed () const |
Protected Attributes | |
| space_type | _V |
| vec< T, M > | _u |
| vec< T, M > | _b |
| bool | _dis_dof_update_needed |
field - piecewise polynomial finite element field
Store degrees of freedom associated to a mesh and a piecewise polynomial approximation, with respect to the numbering defined by the underlying space.
This class contains two vectors, namely unknown and blocked degrees of freedoms, and the associated finite element space. Blocked and unknown degrees of freedom can be set by using domain name indexation:
INTERPOLATION
Interpolation of a function u in a field uh with respect to the interpolation writes:
LINEAR ALGEBRA
Linear algebra, such as uh+vh, uh-vh and lambda*uh + mu*vh, where lambda and mu are of type Float, are supported. The duality product between two fields lh and vh writes simply dual(lh,vh): for discrete fields, it corresponds to a simple Euclidian dot product in IR^n. The application of a bilinear form (see form) writes m(uh,vh) and is equivalent to dual(m*uh,vh).
NON-LINEAR ALGEBRA
Non-linear operations, such as sqrt(uh) or 1/uh are also available. Notice that non-linear operations do not returns in general picewise polynomials: the value returned by sqrt(uh) may be filtered by interpolate,
the Lagrange interpolant, to becomes a piecewise polynomial: All standard unary and binary math functions abs, cos, sin... are available on fields. Also sqr(uh), the square of a field, and min(uh,vh), max(uh,vh) are provided. Binary functions can be used also with a scalar, as in
For applying a user-provided function to a field, use the compose function:
The composition supports also general unary and binary class-functions. Also, the multiplication uh*vh and the division uh/vh returns a result that is not in the same discrete finite element space: its result may be filtered by the interpolate operator:
Any function or class function can be used in nonlinear expressions: the function is interpolated in the specified finite element space.
ACCESS BY DOMAIN
The restriction of a field to a geometric domain, says "boundary" writes uh["boundary"]: it represents the trace of the field on the boundary:
Extraction of the trace as a field is also possible:
The space associated to the trace writes wh.get_space() and is equivalent to space(omega["boundary"], "P1"). See see space.
VECTOR VALUED FIELD
A vector-valued field contains several components, as:
The norm function returns the euclidian norm of the vector-valuated field at each degree of freedom: its result is a scalar field.
TENSOR VALUED FIELD
A tensor-valued field can be constructed and used as:
The norm function returns the euclidian norm of the tensor-valuated field at each degree of freedom: its result is a scalar field. Notice that, as tensor-valued fields are symmetric, extra-diagonals are counted twice.
GENERAL MULTI-COMPONENT INTERFACE
A general multi-component field writes:
Remark the hierarchical multi-component field structure: the first-component is tensor-valued and the second-one is vector-valued. There is no limitation upon the hierarchical number of levels in use.
For any field xh, the string xh.valued() returns "scalar" for a scalar field and "vector" for a vector-valued one. Other possible valued are "tensor" and "other". The xh.size() returns the number of field components. When the field is scalar, it returns zero by convention, and xh[0] is undefined. A vector-valued field has d components, where d=omega.dimension(). A tensor-valued field has d*(d+1)/2 components, where d=omega.dimension().
BLOCKED AND UNBLOCKED ARRAYS
The field class contains two arrays of degrees-of-freedom (dof) associated respectively to blocked and unknown dofs. Blocked dofs corresponds to Dirichlet boundary conditions, as specified by space (See see space). For simpliity, direct public access to these array is allowed, as uh.b and uh.u: see see vec.
LOW-LEVEL DEGREE-OF-FREEDOM ACCESS
The field class provides a STL-like container interface for accessing the degrees-of-freedom (dof) of a finite element field uh. The number of dofs is uh.ndof() and any dof can be accessed via uh.dof(idof). A non-local dof at the partition interface can be obtain via uh.dis_dof(dis_idof) where dis_idof is the (global) distribued index assoiated to the distribution uh.ownership().
For performances, a STL-like iterator interface is available, with uh.begin_dof() and uh.end_dof() returns iterators to the arrays of dofs on the current processor. See see array for more about distributed arrays.
For convenience, uh.max(), uh.min() and uh.max_abs() retuns respectively the maximum, minimum and maximum of the absolute value of the degrees of freedom.
FILE FORMAT
TODO
IMPLEMENTATION NOTE
The field expression use the expression template technics in order to avoid temporaries when evaluating complex expressions.
| typedef std::size_t rheolef::field_basic< T, M >::size_type |
| typedef M rheolef::field_basic< T, M >::memory_type |
| typedef T rheolef::field_basic< T, M >::scalar_type |
| typedef float_traits<T>::type rheolef::field_basic< T, M >::float_type |
| typedef T rheolef::field_basic< T, M >::value_type |
| typedef space_constant::valued_type rheolef::field_basic< T, M >::valued_type |
| typedef geo_basic<float_type,M> rheolef::field_basic< T, M >::geo_type |
| typedef space_basic<float_type,M> rheolef::field_basic< T, M >::space_type |
|
inline |
|
explicit |
|
inline |
Definition at line 136 of file field_indirect.h.
|
inline |
Definition at line 289 of file field_indirect.h.
|
inline |
Definition at line 279 of file field_component.h.
|
inline |
Definition at line 289 of file field_component.h.
|
inline |
Definition at line 438 of file field_expr.h.
|
inline |
Definition at line 87 of file field_concat.h.
| void rheolef::field_basic< T, M >::resize | ( | const space_type & | V, |
| const T & | init_value = std::numeric_limits<T>::max() |
||
| ) |
|
inline |
Definition at line 121 of file field_indirect.h.
|
inline |
Definition at line 300 of file field_indirect.h.
|
inline |
Definition at line 273 of file field_component.h.
|
inline |
Definition at line 238 of file field_component.h.
|
inline |
Definition at line 405 of file field_expr.h.
|
inline |
|
inline |
Definition at line 95 of file field_concat.h.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 105 of file field_indirect.h.
|
inline |
Definition at line 276 of file field_indirect.h.
|
inline |
Definition at line 113 of file field_indirect.h.
|
inline |
Definition at line 283 of file field_indirect.h.
|
inline |
|
inline |
Definition at line 216 of file field_component.h.
|
inline |
Definition at line 231 of file field_component.h.
| field_component< T, M > rheolef::field_basic< T, M >::operator() | ( | size_type | i_comp, |
| size_type | j_comp | ||
| ) |
| field_component_const< T, M > rheolef::field_basic< T, M >::operator() | ( | size_type | i_comp, |
| size_type | j_comp | ||
| ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| const T & rheolef::field_basic< T, M >::dis_dof | ( | size_type | dis_idof | ) | const |
|
inline |
|
inline |
|
inline |
|
inline |
| idiststream & rheolef::field_basic< T, M >::get | ( | idiststream & | ips | ) |
| odiststream & rheolef::field_basic< T, M >::put | ( | odiststream & | ops | ) | const |
| odiststream & rheolef::field_basic< T, M >::put_field | ( | odiststream & | ops | ) | const |
| T rheolef::field_basic< T, M >::dis_evaluate | ( | const point_basic< T > & | x, |
| size_type | i_comp = 0 |
||
| ) | const |
|
inline |
| point rheolef::field_basic< T, M >::vector_evaluate | ( | const point_basic< T > & | x | ) | const |
| T rheolef::field_basic< T, M >::evaluate | ( | const geo_element & | K, |
| const point_basic< T > & | hat_xq, | ||
| size_type | i_comp = 0 |
||
| ) | const |
| void rheolef::field_basic< T, M >::dis_dof_update | ( | ) | const |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |