This is an automated email from the git hooks/post-receive script. logari81 pushed a commit to branch master in repository getfem.
The following commit(s) were added to refs/heads/master by this push: new 05989af Add projected_fem::projected_target_region() function 05989af is described below commit 05989af44c2e90fade549070462b3201e59e6a6e Author: Andriy Andreykiv <a...@plaxis.com> AuthorDate: Wed Mar 10 16:59:10 2021 +0100 Add projected_fem::projected_target_region() function --- src/getfem/getfem_projected_fem.h | 4 ++++ src/getfem_projected_fem.cc | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/src/getfem/getfem_projected_fem.h b/src/getfem/getfem_projected_fem.h index ae216b9..840362f 100644 --- a/src/getfem/getfem_projected_fem.h +++ b/src/getfem/getfem_projected_fem.h @@ -141,6 +141,10 @@ namespace getfem { /** return the list of convexes of the projected mesh_fem which * contain at least one gauss point (should be all convexes)! */ dal::bit_vector projected_convexes() const; + + /** faces and convexes from the target region + * that contain at least one Gauss point that is projected by the source */ + mesh_region projected_target_region() const; /** return the min/max/mean number of gauss points in the convexes * of the projected mesh_fem */ diff --git a/src/getfem_projected_fem.cc b/src/getfem_projected_fem.cc index fa73548..a5f0d68 100644 --- a/src/getfem_projected_fem.cc +++ b/src/getfem_projected_fem.cc @@ -795,6 +795,28 @@ namespace getfem { return bv; } + mesh_region projected_fem::projected_target_region() const { + context_check(); + mesh_region projected_target; + for (mr_visitor v(rg_target); !v.finished(); ++v) { + pintegration_method pim = mim_target.int_method_of_element(v.cv()); + papprox_integration pai = pim->approx_method(); + size_type start_pt = v.is_face() ? pai->ind_first_point_on_face(v.f()) : 0; + size_type nb_pts = v.is_face() ? pai->nb_points_on_face(v.f()) + : pai->nb_points_on_convex(); + bool isProjectedOn = false; + for (size_type ip = 0; ip != nb_pts; ++ip) { + auto &proj_data = elements.at(v.cv()).gausspt[start_pt + ip]; + if (proj_data.iflags) { + isProjectedOn = true; + break; + } + } + if (isProjectedOn) projected_target.add(v.cv(), v.f()); + } + return projected_target; + } + void projected_fem::gauss_pts_stats(unsigned &ming, unsigned &maxg, scalar_type &meang) const { std::vector<unsigned> v(mf_source.linked_mesh().nb_allocated_convex());