#include <residualestimator.hpp>
Laplacian Solver using continuous approximation spaces solve \( -\Delta u = f \) on \(\Omega\) and \( u= g \) on \(\Gamma \)
Dim | the geometric dimension of the problem (e.g. Dim=1, 2 or 3) |
Order | the approximation order |
Public Types | |
typedef boost::shared_ptr < backend_type > | backend_ptrtype |
linear algebra backend factory shared_ptr<> type | |
typedef Backend< value_type > | backend_type |
linear algebra backend factory | |
typedef bases< Lagrange< Order, Scalar > > | basis_type |
the basis type of our approximation space | |
typedef Simplex< Dim > | convex_type |
geometry entities type composing the mesh, here Simplex in Dimension Dim of Order 1 | |
typedef space_type::element_type | element_type |
an element type of the approximation function space | |
typedef boost::shared_ptr < export_type > | export_ptrtype |
the exporter factory (shared_ptr<> type) | |
typedef Exporter< mesh_type, 1 > | export_type |
the exporter factory type | |
typedef boost::shared_ptr < mesh_type > | mesh_ptrtype |
mesh shared_ptr<> type | |
typedef Mesh< convex_type > | mesh_type |
mesh type | |
typedef p0_space_type::element_type | p0_element_type |
an element type of the \(P_0\) discontinuous function space | |
typedef boost::shared_ptr < p0_space_type > | p0_space_ptrtype |
typedef FunctionSpace < mesh_type, bases< Lagrange < 0, Scalar, Discontinuous > > > | p0_space_type |
function space that holds piecewise constant ( \(P_0\)) functions (e.g. to store material properties or partitioning | |
typedef bases< Lagrange < 1, Scalar > > | p1_basis_type |
the basis type of our approximation space | |
typedef p1_space_type::element_type | p1_element_type |
typedef boost::shared_ptr < p1_space_type > | p1_space_ptrtype |
typedef FunctionSpace < mesh_type, p1_basis_type > | p1_space_type |
typedef boost::shared_ptr < space_type > | space_ptrtype |
the approximation function space type (shared_ptr<> type) | |
typedef FunctionSpace < mesh_type, basis_type > | space_type |
the approximation function space type | |
typedef backend_type::sparse_matrix_ptrtype | sparse_matrix_ptrtype |
sparse matrix type associated with backend (shared_ptr<> type) | |
typedef backend_type::sparse_matrix_type | sparse_matrix_type |
sparse matrix type associated with backend | |
typedef double | value_type |
numerical type is double | |
typedef backend_type::vector_ptrtype | vector_ptrtype |
vector type associated with backend (shared_ptr<> type) | |
typedef backend_type::vector_type | vector_type |
vector type associated with backend | |
Public Member Functions | |
ResidualEstimator (AboutData const &about) | |
void | run () |
void | run (const double *X, unsigned long P, double *Y, unsigned long N) |
|
inline |
Constructor
void ResidualEstimator< Dim, Order >::run | ( | const double * | X, |
unsigned long | P, | ||
double * | Y, | ||
unsigned long | N | ||
) |
The function space and some associated elements(functions) are then defined
define \(g\) the expression of the exact solution and \(f\) the expression of the right hand side such that \(g\) is the exact solution
deduce from expression the type of g (thanks to keyword 'auto')
deduce from expression the type of laplacian (thanks to keyword 'auto')
Construction of the right hand side. F is the vector that holds the algebraic representation of the right habd side of the problem
create the matrix that will hold the algebraic representation of the left hand side
assemble \(\int_\Omega \nu \nabla u \cdot \nabla v\)
weak dirichlet conditions treatment for the boundaries marked 1 and 3
assemble \(\int_{\partial \Omega} \frac{\gamma}{h} u v\)
strong(algebraic) dirichlet conditions treatment for the boundaries marked 1 and 3
solve the system
solve \( D u = F \)
compute the \(L_2\) norm of the error
save the results project the exact solution