Construction of Local Stiffness Matrices
The calculation of local stiffness matrices is done by using the library Colsamm. In this library bilinear forms are defined by the functions
v_(), w_()
These functions represent the functions
in
a bilinear form
.
To describe a bilinear form, Colsamm provides the following
construction
Differential operators of first order
grad( .), d_dx(. ), d_dy(. ), d_dz(. ),
Constants in an expression can directly be used or one constructs a constant object as follows:
Double_ a(1.0); Double_ b(2.0);
Functions can be used as follows:
func(f)
where f is a user defined function of type:
double f(double x, double y, double z); // or complex return value
Using this notation, one can construct local stiffness matrices as follows:
Local_stiffness_matrix<double> local_stiff_m(grid); local_stiff_m.Calculate(expression_bilinear_form);
where expression_bilinear_form is an expression describing the integrand in the bilinear form using the notation in Colsamm.
Example: The local stiffness matrix of Poisson's equation can be calculated as follows:
Local_stiffness_matrix<double> Laplace(grid); Laplace.Calculate(grad(v_())*grad(w_()));
Now, Laplace contains the local stiffness matrix corresponding to
Using Fast Expression Templates
The library Colsamm provides the application of fast expression templates. In certain cases, this can increase the performance. To apply fast expression templates one has to change a parameter in Colsamm.h for using the header files Stencil.h, ... . Then, constants and functions have to be enumerated by a template parameter.
Last modified: Mon Feb 7 16:19:57 MET 2000