form(3)
NAME
form - representation of a finite element operator
DESCRIPTION
The form class groups four sparse matrix, associated to a bilinear form
on finite element space. This class is represented by four sparse
matrix, associated to unknown and blocked degrees of freedom of origin
and destination spaces (see space(3)).
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 m("square");
space V(m,"P1");
form a(V,V,"grad_grad");
field x(V);
x = fct;
field y = a*x;
cout << plotmtv << y; - This block-matrix operation is equivalent to:
y.u = a.uu*x.u + a.ub*x.b;
y.b = a.bu*x.u + a.bb*x.b;
IMPLEMENTATION
- class form {
public :
// typedefs: - typedef csr<Float>::size_type size_type;
- // allocator/deallocator:
form ();
form (const space& X, const space& Y);// locked_boundaries means that special vector BCs are applied, // see space::lock_components()- form (const space& X, const space& Y, const std::string& op_name,
bool locked_boundaries=false);
- form (const space& X, const space& Y, const std::string& op_name, const domain& d);
// Currently weighted forms in P2 spaces use a quadrature formula which is // limited to double precision floats.
- form (const space& X, const space& Y, const std::string& op_name, const field& wh,
bool use_coordinate_system_weight=true);
- form (const space& X, const space& Y, const std::string& op_name,
const domain& d, const field& wh, bool use_coordinate_system_weight=true);
- form (const space& X, const std::string& op_name);
form (const form_diag& X); - // accessors:
const geo& get_geo() const;
const space& get_first_space() const;
const space& get_second_space() const;
size_type nrow() const;
size_type ncol() const;
bool for_locked_boundaries() const { return _for_locked_boundaries; }- // linear algebra:
Float operator () (const class field&, const class field&) const;
friend class field operator * (const form& a, const class field& x);
field trans_mult (const field& x) const;
friend form trans(const form&);
friend form operator * (const Float& lambda, const form&);
friend form operator + (const form&, const form&);
friend form operator - (const form&);
friend form operator - (const form&, const form&);
friend form operator * (const form&, const form&);
friend form operator * (const form&, const form_diag&);
friend form operator * (const form_diag&, const form&);- // input/output:
friend std::ostream& operator << (std::ostream& s, const form& a);
friend class form_manip;- // data
protected: - space X_;
space Y_;
bool _for_locked_boundaries; - public :
- csr<Float> uu;
csr<Float> ub;
csr<Float> bu;
csr<Float> bb; - };
form form_nul(const space& X, const space& Y) ;