75 std::vector<std::pair<int, int>> ents;
76 gmsh::model::getEntities(ents, 3);
78 vol_tag = ents.back().second;
81 std::ostringstream oss;
82 oss <<
"buildAnnulus3DInCurrentModel: boolean cut did not produce a volume (ov size = "
84 throw std::runtime_error(oss.str());
88 const int p = gmsh::model::occ::addPoint(c.
d_x, c.
d_y, c.
d_z, h);
89 gmsh::model::occ::synchronize();
90 gmsh::model::mesh::embed(0, {p}, 3, vol_tag);
91 gmsh::model::occ::synchronize();
99 const auto &lo = outer.d_vertices[0];
101 gmsh::model::occ::addBox(lo.d_x, lo.d_y, lo.d_z, outer.d_Lx, outer.d_Ly, outer.d_Lz);
102 gmsh::model::occ::synchronize();
104 const auto &li = inner.d_vertices[0];
106 gmsh::model::occ::addBox(li.d_x, li.d_y, li.d_z, inner.d_Lx, inner.d_Ly, inner.d_Lz);
107 gmsh::model::occ::synchronize();
109 std::vector<std::pair<int, int>> ov;
110 std::vector<std::vector<std::pair<int, int>>> ovv;
111 gmsh::model::occ::cut({{3, out_vol}}, {{3, in_vol}}, ov, ovv, -1,
true,
true);
112 gmsh::model::occ::synchronize();
113 gmsh::model::occ::removeAllDuplicates();
114 gmsh::model::occ::synchronize();
125 gmsh::model::occ::addSphere(outer.d_x.d_x, outer.d_x.d_y, outer.d_x.d_z, outer.d_r);
126 gmsh::model::occ::synchronize();
128 gmsh::model::occ::addSphere(inner.d_x.d_x, inner.d_x.d_y, inner.d_x.d_z, inner.d_r);
129 gmsh::model::occ::synchronize();
131 std::vector<std::pair<int, int>> ov;
132 std::vector<std::vector<std::pair<int, int>>> ovv;
133 gmsh::model::occ::cut({{3, out_vol}}, {{3, in_vol}}, ov, ovv, -1,
true,
true);
134 gmsh::model::occ::synchronize();
135 gmsh::model::occ::removeAllDuplicates();
136 gmsh::model::occ::synchronize();