rheolef  6.3
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
rheolef::form_basic< T, M > Class Template Reference

form - representation of a finite element bilinear form More...

#include <form.h>

Collaboration diagram for rheolef::form_basic< T, M >:
Collaboration graph
[legend]

Public Types

typedef csr< T, M >::size_type size_type
typedef T value_type
typedef scalar_traits< T >::type float_type
typedef geo_basic< float_type, M > geo_type
typedef space_basic
< float_type, M > 
space_type

Public Member Functions

 form_basic ()
 form_basic (const form_basic< T, M > &)
 form_basic (const space_type &X, const space_type &Y, const std::string &name="", const quadrature_option_type &qopt=quadrature_option_type(quadrature_option_type::max_family, 0))
 form_basic (const space_type &X, const space_type &Y, const std::string &name, const field_basic< T, M > &weight, const quadrature_option_type &qopt=quadrature_option_type(quadrature_option_type::max_family, 0))
 form_basic (const space_type &X, const space_type &Y, const std::string &name, const band_basic< T, M > &bh, const quadrature_option_type &qopt=quadrature_option_type(quadrature_option_type::max_family, 0))
template<class Function >
 form_basic (const space_type &X, const space_type &Y, const std::string &name, Function weight, const quadrature_option_type &qopt=quadrature_option_type(quadrature_option_type::max_family, 0))
 form_basic (const space_type &X, const space_type &Y, const std::string &name, const geo_basic< T, M > &gamma, const quadrature_option_type &qopt=quadrature_option_type(quadrature_option_type::max_family, 0))
 form_basic (const space_type &X, const space_type &Y, const std::string &name, const geo_basic< T, M > &gamma, const field_basic< T, M > &weight, const quadrature_option_type &qopt=quadrature_option_type(quadrature_option_type::max_family, 0))
template<class Function >
 form_basic (const space_type &X, const space_type &Y, const std::string &name, const geo_basic< T, M > &gamma, Function weight, const quadrature_option_type &qopt=quadrature_option_type(quadrature_option_type::max_family, 0))
 form_basic (const std::initializer_list< form_concat_value< T, M > > &init_list)
 form_basic (const std::initializer_list< form_concat_line< T, M > > &init_list)
const space_typeget_first_space () const
const space_typeget_second_space () const
const geo_typeget_geo () const
const communicator & comm () const
form_basic< T, M > operator+ (const form_basic< T, M > &b) const
form_basic< T, M > operator- (const form_basic< T, M > &b) const
form_basic< T, M > operator* (const form_basic< T, M > &b) const
form_basic< T, M > & operator*= (const T &lambda)
field_basic< T, M > operator* (const field_basic< T, M > &xh) const
field_basic< T, M > trans_mult (const field_basic< T, M > &yh) const
float_type operator() (const field_basic< T, M > &uh, const field_basic< T, M > &vh) const
odiststreamput (odiststream &ops, bool show_partition=true) const
void dump (std::string name) const
const csr< T, M > & uu () const
const csr< T, M > & ub () const
const csr< T, M > & bu () const
const csr< T, M > & bb () const
csr< T, M > & set_uu ()
csr< T, M > & set_ub ()
csr< T, M > & set_bu ()
csr< T, M > & set_bb ()

Protected Member Functions

void assembly (const form_element< T, M > &form_e, const geo_basic< T, M > &X_geo, const geo_basic< T, M > &Y_geo, bool X_geo_is_background=true)
template<class WeightFunction >
void form_init (const std::string &name, bool has_weight, WeightFunction weight, const quadrature_option_type &qopt)
template<class WeightFunction >
void form_init_on_domain (const std::string &name, const geo_basic< T, M > &gamma, bool has_weight, WeightFunction weight, const geo_basic< T, M > &w_omega, const quadrature_option_type &qopt)

Protected Attributes

space_type _X
space_type _Y
csr< T, M > _uu
csr< T, M > _ub
csr< T, M > _bu
csr< T, M > _bb

Detailed Description

template<class T, class M>
class rheolef::form_basic< T, M >

form - representation of a finite element bilinear form

The form class groups four sparse matrix, associated to a bilinear form on two finite element spaces:

a: U*V ----> IR
(u,v) |---> a(u,v)

The operator A associated to the bilinear form is defined by:

A: U ----> V'
u |---> A(u)

where u and v are fields (see field), and A(u) is such that a(u,v)=<A(u),v> for all u in U and v in V and where <.,.> denotes the duality product between V and V'. Since V is a finite dimensional spaces, the duality product is the euclidian product in IR^dim(V).

Since both U and V are finite dimensional spaces, the linear operator can be represented by a matrix. The form class is represented by four sparse matrix in csr format (see csr), associated to unknown and blocked degrees of freedom of origin and destination spaces (see space).

EXAMPLE

The operator A associated to a bilinear form a(.,.) by the relation (Au,v) = a(u,v) could be applied by using a sample matrix notation A*u, as shown by the following code:

geo omega("square");
space V (omega,"P1");
form a (V,V,"grad_grad");
field uh = interpolate (fct, V);
field vh = a*uh;
cout << v;

The form-field vh=a*uh operation is equivalent to the following matrix-vector operations:

vh.set_u() = a.uu()*uh.u() + a.ub()*uh.b();
vh.set_b() = a.bu()*uh.u() + a.bb()*uh.b();

ALGEBRA

Forms, as matrices (see csr), support linear algebra: Adding or substracting two forms writes a+b and a-b, respectively, and multiplying a form by a field uh writes a*uh. Thus, any linear combination of forms is available.

WEIGHTED FORM

A weighted form is a form with an extra weight function w(x), e.g.:

/
|
a(uh,vh) = | grad(uh).grad(vh) w(x) dx
|
/ Omega

In the present implementation, w can be any field, function or class-function or any nonlinear field expression (see field). As the integration cannot be performed exactly in general, a quadrature formula can be supplied. This feature is extensively used when solving nonlinear problems.

See Also
csr, field, space.

Definition at line 98 of file form.h.

Member Typedef Documentation

template<class T, class M>
typedef csr<T,M>::size_type rheolef::form_basic< T, M >::size_type

Definition at line 101 of file form.h.

template<class T, class M>
typedef T rheolef::form_basic< T, M >::value_type

Definition at line 102 of file form.h.

template<class T, class M>
typedef scalar_traits<T>::type rheolef::form_basic< T, M >::float_type

Definition at line 103 of file form.h.

template<class T, class M>
typedef geo_basic<float_type,M> rheolef::form_basic< T, M >::geo_type

Definition at line 104 of file form.h.

template<class T, class M>
typedef space_basic<float_type,M> rheolef::form_basic< T, M >::space_type

Definition at line 105 of file form.h.

Constructor & Destructor Documentation

template<class T , class M >
endcode rheolef::form_basic< T, M >::form_basic ( )
inline

Definition at line 225 of file form.h.

template<class T, class M>
rheolef::form_basic< T, M >::form_basic ( const form_basic< T, M > &  a)
inline

Definition at line 231 of file form.h.

template<class T, class M>
rheolef::form_basic< T, M >::form_basic ( const space_type X,
const space_type Y,
const std::string &  name = "",
const quadrature_option_type qopt = quadrature_option_type(quadrature_option_type::max_family,0) 
)

Definition at line 16 of file form.cc.

template<class T, class M>
rheolef::form_basic< T, M >::form_basic ( const space_type X,
const space_type Y,
const std::string &  name,
const field_basic< T, M > &  weight,
const quadrature_option_type qopt = quadrature_option_type(quadrature_option_type::max_family,0) 
)

Definition at line 31 of file form.cc.

template<class T, class M>
rheolef::form_basic< T, M >::form_basic ( const space_type X,
const space_type Y,
const std::string &  name,
const band_basic< T, M > &  bh,
const quadrature_option_type qopt = quadrature_option_type(quadrature_option_type::max_family,0) 
)

Definition at line 93 of file form.cc.

template<class T , class M >
template<class Function >
rheolef::form_basic< T, M >::form_basic ( const space_type X,
const space_type Y,
const std::string &  name,
Function  weight,
const quadrature_option_type qopt = quadrature_option_type(quadrature_option_type::max_family,0) 
)
inline

Definition at line 55 of file form_weighted.h.

template<class T, class M>
rheolef::form_basic< T, M >::form_basic ( const space_type X,
const space_type Y,
const std::string &  name,
const geo_basic< T, M > &  gamma,
const quadrature_option_type qopt = quadrature_option_type(quadrature_option_type::max_family,0) 
)

Definition at line 47 of file form.cc.

template<class T, class M>
rheolef::form_basic< T, M >::form_basic ( const space_type X,
const space_type Y,
const std::string &  name,
const geo_basic< T, M > &  gamma,
const field_basic< T, M > &  weight,
const quadrature_option_type qopt = quadrature_option_type(quadrature_option_type::max_family,0) 
)

Definition at line 65 of file form.cc.

template<class T, class M>
template<class Function >
rheolef::form_basic< T, M >::form_basic ( const space_type X,
const space_type Y,
const std::string &  name,
const geo_basic< T, M > &  gamma,
Function  weight,
const quadrature_option_type qopt = quadrature_option_type(quadrature_option_type::max_family,0) 
)

Definition at line 88 of file form_weighted.h.

template<class T, class M>
rheolef::form_basic< T, M >::form_basic ( const std::initializer_list< form_concat_value< T, M > > &  init_list)
inline

Definition at line 165 of file form_concat.h.

template<class T, class M>
rheolef::form_basic< T, M >::form_basic ( const std::initializer_list< form_concat_line< T, M > > &  init_list)
inline

Definition at line 261 of file form_concat.h.

Member Function Documentation

template<class T , class M >
const form_basic< T, M >::space_type & rheolef::form_basic< T, M >::get_first_space ( ) const
inline

Definition at line 238 of file form.h.

template<class T , class M >
const form_basic< T, M >::space_type & rheolef::form_basic< T, M >::get_second_space ( ) const
inline

Definition at line 245 of file form.h.

template<class T , class M >
const form_basic< T, M >::geo_type & rheolef::form_basic< T, M >::get_geo ( ) const
inline

Definition at line 252 of file form.h.

template<class T , class M >
const communicator & rheolef::form_basic< T, M >::comm ( ) const
inline

Definition at line 259 of file form.h.

template<class T, class M>
form_basic< T, M > rheolef::form_basic< T, M >::operator+ ( const form_basic< T, M > &  b) const
inline

Definition at line 266 of file form.h.

template<class T, class M>
form_basic< T, M > rheolef::form_basic< T, M >::operator- ( const form_basic< T, M > &  b) const
inline

Definition at line 278 of file form.h.

template<class T, class M>
form_basic< T, M > rheolef::form_basic< T, M >::operator* ( const form_basic< T, M > &  b) const
inline

Definition at line 290 of file form.h.

template<class T, class M >
form_basic< T, M > & rheolef::form_basic< T, M >::operator*= ( const T &  lambda)
inline

Definition at line 302 of file form.h.

template<class T, class M>
field_basic< T, M > rheolef::form_basic< T, M >::operator* ( const field_basic< T, M > &  xh) const

Definition at line 118 of file form.cc.

template<class T, class M>
field_basic< T, M > rheolef::form_basic< T, M >::trans_mult ( const field_basic< T, M > &  yh) const

Definition at line 127 of file form.cc.

template<class T, class M>
form_basic< T, M >::float_type rheolef::form_basic< T, M >::operator() ( const field_basic< T, M > &  uh,
const field_basic< T, M > &  vh 
) const

Definition at line 136 of file form.cc.

template<class T , class M >
odiststream & rheolef::form_basic< T, M >::put ( odiststream ops,
bool  show_partition = true 
) const

Definition at line 222 of file form.cc.

template<class T , class M >
void rheolef::form_basic< T, M >::dump ( std::string  name) const

Definition at line 248 of file form.cc.

template<class T, class M>
const csr<T,M>& rheolef::form_basic< T, M >::uu ( ) const
inline

Definition at line 179 of file form.h.

template<class T, class M>
const csr<T,M>& rheolef::form_basic< T, M >::ub ( ) const
inline

Definition at line 180 of file form.h.

template<class T, class M>
const csr<T,M>& rheolef::form_basic< T, M >::bu ( ) const
inline

Definition at line 181 of file form.h.

template<class T, class M>
const csr<T,M>& rheolef::form_basic< T, M >::bb ( ) const
inline

Definition at line 182 of file form.h.

template<class T, class M>
csr<T,M>& rheolef::form_basic< T, M >::set_uu ( )
inline

Definition at line 183 of file form.h.

template<class T, class M>
csr<T,M>& rheolef::form_basic< T, M >::set_ub ( )
inline

Definition at line 184 of file form.h.

template<class T, class M>
csr<T,M>& rheolef::form_basic< T, M >::set_bu ( )
inline

Definition at line 185 of file form.h.

template<class T, class M>
csr<T,M>& rheolef::form_basic< T, M >::set_bb ( )
inline

Definition at line 186 of file form.h.

template<class T, class M>
void rheolef::form_basic< T, M >::assembly ( const form_element< T, M > &  form_e,
const geo_basic< T, M > &  X_geo,
const geo_basic< T, M > &  Y_geo,
bool  X_geo_is_background = true 
)
protected

Definition at line 6 of file form_assembly.h.

template<class T , class M >
template<class WeightFunction >
void rheolef::form_basic< T, M >::form_init ( const std::string &  name,
bool  has_weight,
WeightFunction  weight,
const quadrature_option_type qopt 
)
protected

Definition at line 9 of file form_weighted.h.

template<class T, class M>
template<class WeightFunction >
void rheolef::form_basic< T, M >::form_init_on_domain ( const std::string &  name,
const geo_basic< T, M > &  gamma,
bool  has_weight,
WeightFunction  weight,
const geo_basic< T, M > &  w_omega,
const quadrature_option_type qopt 
)
protected

Definition at line 73 of file form_weighted.h.

Member Data Documentation

template<class T, class M>
space_type rheolef::form_basic< T, M >::_X
protected

Definition at line 189 of file form.h.

template<class T, class M>
space_type rheolef::form_basic< T, M >::_Y
protected

Definition at line 190 of file form.h.

template<class T, class M>
csr<T,M> rheolef::form_basic< T, M >::_uu
protected

Definition at line 191 of file form.h.

template<class T, class M>
csr<T,M> rheolef::form_basic< T, M >::_ub
protected

Definition at line 192 of file form.h.

template<class T, class M>
csr<T,M> rheolef::form_basic< T, M >::_bu
protected

Definition at line 193 of file form.h.

template<class T, class M>
csr<T,M> rheolef::form_basic< T, M >::_bb
protected

Definition at line 194 of file form.h.


The documentation for this class was generated from the following files: