12 using namespace MoFEM;
14 static char help[] =
"...\n\n";
21 const std::vector<unsigned char> &
mArker;
37 auto get_boundary_marker_directly_from_range = [&]() {
38 std::vector<unsigned char> ents_marker_used_for_testing;
42 for (
size_t side = 0; side != getNumberOfNodesOnElement(); ++side) {
44 ents_marker_used_for_testing[3 * side + 0] =
45 skinEnts.find(ent) != skinEnts.end() ? 1 : 0;
46 ents_marker_used_for_testing[3 * side + 2] =
47 ents_marker_used_for_testing[3 * side + 0];
53 bool is_on_boundary = skinEnts.find(ent) != skinEnts.end();
54 for (
size_t dof = 0; dof != nb_dofs; ++dof)
56 ents_marker_used_for_testing[dof] = is_on_boundary ? 1 : 0;
59 return ents_marker_used_for_testing;
62 auto test_marker = get_boundary_marker_directly_from_range();
63 for (
size_t n = 0;
n != nb_dofs; ++
n) {
65 if (test_marker[
n] != mArker[local_index])
67 "Wrong boundary marker");
74 int main(
int argc,
char *argv[]) {
90 DMType dm_name =
"DMMOFEM";
94 CHKERR simple_interface->getOptions();
95 CHKERR simple_interface->loadFile(
"");
96 CHKERR simple_interface->addDomainField(
"FIELD1",
H1,
98 CHKERR simple_interface->setFieldOrder(
"FIELD1",
order);
99 CHKERR simple_interface->setUp();
101 auto get_ents_on_mesh_skin = [&]() {
106 CHKERR skin.find_skin(0, faces,
false, skin_edges);
108 CHKERR moab.get_connectivity(skin_edges, skin_verts,
true);
109 skin_edges.merge(skin_verts);
113 auto mark_boundary_dofs = [&](
Range &skin_edges) {
115 std::vector<unsigned char>
marker;
116 problem_manager->markDofs(simple_interface->getProblemName(),
ROW,
119 problem_manager->modifyMarkDofs(simple_interface->getProblemName(),
ROW,
125 auto skin_ents = get_ents_on_mesh_skin();
130 auto marker = mark_boundary_dofs(skin_ents);
132 boost::shared_ptr<FaceEle> fe(
new FaceEle(m_field));
133 fe->getOpPtrVector().push_back(
new OpFace(skin_ents,
marker));
135 auto dm = simple_interface->getDM();