#include <SimpleAssembler.hpp>
Public Member Functions | |
template<class fem_types, class simple_equation_t> | |
void | assemble (const simple_equation_t &simple_equation, const Grid< fem_types > &grid, ublas::compressed_matrix< float_t > &stiffness_matrix, ublas::vector< float_t > &force_vector) const |
template<class fem_types, class simple_equation_t> | |
void | assemble_stiffness_matrix (const simple_equation_t &simple_equation, const Grid< fem_types > &grid, ublas::compressed_matrix< float_t > &stiffness_matrix) const |
template<class fem_types, class simple_equation_t> | |
void | assemble_force_vector (const simple_equation_t &simple_equation, const Grid< fem_types > &grid, ublas::vector< float_t > &force_vector) const |
The SimpleAssembler class provides functions to assemble the stiffness matrix and force vector for a given equation and a given grid. In contrast to Assembler, SimpleAssembler requires the equation to implement SimpleEquationInterface.
void imaging::SimpleAssembler::assemble | ( | const simple_equation_t & | simple_equation, | |
const Grid< fem_types > & | grid, | |||
ublas::compressed_matrix< float_t > & | stiffness_matrix, | |||
ublas::vector< float_t > & | force_vector | |||
) | const [inline] |
Assembles the stiffness matrix and the force vector for simple_equation on grid. This is done in one big loop and thus faster than calling assemble_stiffness_matrix() and assemble_force_vector() separately. For performance reasons the type of simple_equation is a template parameter.
The class simple_equation_t must implement all the functions defined in SimpleEquationInterface. It is also advised to derive simple_equation_t from SimpleEquationInterface.
The sparse matrix stiffness_matrix must be square and its size equal to the total number of nodes of the grid, as obtained from Grid::n_nodes(). It can greatly improve the performance of this function, if the matrix is pre-filled with zeros at positions where non-zero entries are expected. The position of the non-zeros entries depend on the geometry of the FE problem. Some grid construction functions provide an appropriate pre-filling of the stiffness matrix.
References imaging::Assembler::assemble().
void imaging::SimpleAssembler::assemble_stiffness_matrix | ( | const simple_equation_t & | simple_equation, | |
const Grid< fem_types > & | grid, | |||
ublas::compressed_matrix< float_t > & | stiffness_matrix | |||
) | const [inline] |
Assembles the stiffness matrix for simple_equation
on grid
. If you want to assembly both, stiffness matrix and force vector, use assemble() to save computation time. For performance reasons the type of simple_equation is a template parameter.
The class simple_equation_t must implement all the functions defined in EquationInterface. It is also advised to derive simple_equation_t from EquationInterface.
The sparse matrix stiffness_matrix must be square and its size equal to the total number of nodes of the grid, as obtained from Grid::n_nodes(). It can greatly improve the performance of this function, if the matrix is pre-filled with zeros at positions where non-zero entries are expected. The position of the non-zeros entries depend on the geometry of the FE problem. Some grid construction functions provide an appropriate pre-filling of the stiffness matrix.
References imaging::Assembler::assemble_stiffness_matrix().
void imaging::SimpleAssembler::assemble_force_vector | ( | const simple_equation_t & | simple_equation, | |
const Grid< fem_types > & | grid, | |||
ublas::vector< float_t > & | force_vector | |||
) | const [inline] |
Assembles the force vector for simple_equation
on grid
. If you want to assembly both, stiffness matrix and force vector, use assemble() to save computation time. For performance reasons the type of simple_equation is a template parameter.
The class simple_equation_t must implement all the functions defined in EquationInterface. It is also advised to derive simple_equation_t from EquationInterface.
The sparse matrix stiffness_matrix must be square and its size equal to the total number of nodes of the grid, as obtained from Grid::n_nodes(). It can greatly improve the performance of this function, if the matrix is pre-filled with zeros at positions where non-zero entries are expected. The position of the non-zeros entries depend on the geometry of the FE problem. Some grid construction functions provide an appropriate pre-filling of the stiffness matrix.
References imaging::Assembler::assemble_force_vector().