27 void partial_mesh_fem::clear(
void)
28 { mesh_fem::clear(); is_adapted =
false; }
30 partial_mesh_fem::partial_mesh_fem(
const mesh_fem &mef)
31 : mesh_fem(mef.linked_mesh()), mf(mef)
32 { is_adapted =
false; }
36 partial_mesh_fem::partial_mesh_fem(
const mesh_fem *mef)
37 : mesh_fem(*(mef ? &(mef->linked_mesh()) : &(void_mesh__))), mf(*mef)
38 { is_adapted =
false; }
40 DAL_SIMPLE_KEY(special_partialmf_key,
pfem);
42 const dal::bit_vector &rejected_elt) {
45 if (!(mi.is_equal(mf.get_qdims()))) {
48 dof_enumeration_made =
false; touch(); v_num = act_counter();
52 fe_convex.setminus(rejected_elt);
54 gmm::row_matrix<gmm::rsvector<scalar_type> >
55 RR(kept_dofs.card(), mf.
nb_dof());
57 for (dal::bv_visitor i(kept_dofs); !i.finished(); ++i, ++j)
58 RR(j, i) = scalar_type(1);
60 R_ = REDUCTION_MATRIX(kept_dofs.card(), mf.
nb_basic_dof());
61 E_ = EXTENSION_MATRIX(mf.
nb_basic_dof(), kept_dofs.card());
64 gmm::row_matrix<gmm::rsvector<scalar_type> >
68 gmm::row_matrix<gmm::rsvector<scalar_type> >
74 gmm::copy(RR, R_); gmm::copy(gmm::transposed(RR), E_);
78 is_adapted =
true; touch(); v_num = act_counter();
99 gmm::stream_standard_locale sl(ost);
100 ost <<
'\n' <<
"BEGIN MESH_FEM" <<
'\n' <<
'\n';
101 mf.write_basic_to_file(ost);
102 write_reduction_matrices_to_file(ost);
103 ost <<
"END MESH_FEM" <<
'\n';
107 bool with_mesh)
const {
108 std::ofstream o(name.c_str());
109 GMM_ASSERT1(o,
"impossible to open file '" << name <<
"'");
110 o <<
"% GETFEM MESH_FEM FILE " <<
'\n';
111 o <<
"% GETFEM VERSION " << GETFEM_VERSION <<
'\n' <<
'\n' <<
'\n';
119 unsigned N = m.dim();
120 if (P ==
unsigned(-1)) P = N;
123 bgeot::pgeotrans_precomp pgp2 = 0;
125 getfem::pfem_precomp pfp = 0;
126 pintegration_method pim1 = 0;
129 std::vector<scalar_type> area_supports(mf.
nb_basic_dof());
130 dal::bit_vector kept_dofs;
132 for (dal::bv_visitor cv(mim.
convex_index()); !cv.finished(); ++cv) {
133 m.points_of_convex(cv, G);
136 if (pim ==
im_none())
continue;
138 GMM_ASSERT1(pim->type() == IM_APPROX,
139 "Works only with approximate integration");
140 papprox_integration pai2= pim->approx_method();
141 static papprox_integration pai2_old = 0;
142 if (pgt_old != pgt || pai2 != pai2_old) {
144 pgp2 = bgeot::geotrans_precomp(pgt, pai2->pintegration_points(),pim);
146 if (pai2 != pai2_old || pf != pf_old) {
158 for (
size_type i = 0; i < pai2->nb_points_on_convex(); ++i) {
159 for (
unsigned d = 0; d < pf->nb_dof(cv); ++d) {
165 += pai2->coeff(i) * c2.
J() * gmm::sqr(pfp->val(i)[d]);
173 std::vector<scalar_type> areas2(mf.
nb_dof());
174 std::vector<scalar_type> area_supports2(mf.
nb_dof());
182 gmm::copy(areas, areas2);
183 gmm::copy(area_supports, area_supports2);
187 if (area_supports2[i] > pow(1e-14 * areas2[i], scalar_type(P) / N))