41 #ifndef GETFEM_ERROR_ESTIMATE
42 #define GETFEM_ERROR_ESTIMATE
50 template <
typename VECT1,
typename VECT2>
51 void error_estimate(
const mesh_im &mim,
const mesh_fem &mf,
52 const VECT1 &UU, VECT2 &err,
55 const mesh &m = mim.linked_mesh();
57 GMM_ASSERT3(&m == &mf.linked_mesh() &&
58 gmm::vect_size(err) >= m.nb_allocated_convex(),
"");
62 getfem::ga_workspace workspace;
65 getfem::base_vector Z(nbdof);
66 getfem::base_vector U(gmm::vect_size(UU));
68 workspace.add_fem_constant(
"u", mf, U);
69 workspace.add_fem_variable(
"z", mf0, gmm::sub_interval(0, nbdof), Z);
70 workspace.add_expression
72 "*Norm_sqr(Grad_u.Normal-Interpolate(Grad_u,neighbor_element).Normal)"
73 "*(Test_z+Interpolate(Test_z,neighbor_element))", mim, inner_faces);
74 workspace.set_assembled_vector(Z);
75 workspace.assembly(1);
78 for (mr_visitor cv1(rg); !cv1.finished(); ++cv1)
79 err[cv1.cv()] = Z[mf0.ind_basic_dof_of_element(cv1.cv())[0]];
82 #ifdef EXPERIMENTAL_PURPOSE_ONLY
85 void error_estimate_nitsche(
const mesh_im & mim,
94 scalar_type vertical_force,
static mesh_region all_convexes()
provide a default value for the mesh_region parameters of assembly procedures etc.
A language for generic assembly of pde boundary value problems.
Define the getfem::mesh_fem class.
Define the getfem::mesh_im class (integration of getfem::mesh_fem).
void copy(const L1 &l1, L2 &l2)
*/
void clear(L &l)
clear (fill with zeros) a vector or matrix.
mesh_region APIDECL inner_faces_of_mesh(const mesh &m, const mesh_region &mr=mesh_region::all_convexes())
Select all the faces sharing at least two element of the given mesh region.
size_t size_type
used as the common size type in the library
GEneric Tool for Finite Element Methods.
const mesh_fem & classical_mesh_fem(const mesh &mesh, dim_type degree, dim_type qdim=1, bool complete=false)
Gives the descriptor of a classical finite element method of degree K on mesh.