75 auto set_gauss_pts = [
this]() {
78 const size_t nb_gauss_pts = gaussPts.size2();
79 dataH1.dataOnEntities[MBVERTEX][0].getN(
NOBASE).resize(nb_gauss_pts, 4);
81 &*dataH1.dataOnEntities[MBVERTEX][0].getN(
NOBASE).data().begin();
83 &gaussPts(2, 0), nb_gauss_pts);
87 std::bitset<4> singular_nodes_ids;
90 for (
int nn = 0; nn != 4; nn++) {
92 singular_nodes_ids.set(nn);
95 auto it_map_ref_coords =
mapRefCoords.find(singular_nodes_ids.to_ulong());
117 gaussPts.resize(4, nb_gauss_pts,
false);
118 cblas_dcopy(nb_gauss_pts, &
QUAD_3D_TABLE[rule]->points[1], 4, &gaussPts(0, 0),
120 cblas_dcopy(nb_gauss_pts, &
QUAD_3D_TABLE[rule]->points[2], 4, &gaussPts(1, 0),
122 cblas_dcopy(nb_gauss_pts, &
QUAD_3D_TABLE[rule]->points[3], 4, &gaussPts(2, 0),
124 cblas_dcopy(nb_gauss_pts,
QUAD_3D_TABLE[rule]->weights, 1, &gaussPts(3, 0),
126 dataH1.dataOnEntities[MBVERTEX][0].getN(
NOBASE).resize(nb_gauss_pts, 4,
129 &*dataH1.dataOnEntities[MBVERTEX][0].getN(
NOBASE).data().begin();
130 cblas_dcopy(4 * nb_gauss_pts,
QUAD_3D_TABLE[rule]->points, 1, shape_ptr, 1);
148 double base_coords[] = {0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1};
150 for (
int nn = 0; nn != 4; nn++)
151 CHKERR moab_ref.create_vertex(&base_coords[3 * nn], nodes[nn]);
152 CHKERR moab_ref.create_element(MBTET, nodes, 4, tet);
158 Range singular_nodes;
159 for (
int nn = 0; nn != 4; nn++) {
162 CHKERR moab_ref.side_element(tet, 0, nn, ent);
163 singular_nodes.insert(ent);
168 if (singular_nodes.size() > 1) {
169 CHKERR moab_ref.create_meshset(MESHSET_SET, meshset);
170 for (
int ee = 0; ee != 6; ee++) {
173 CHKERR moab_ref.side_element(tet, 1, ee, ent);
174 CHKERR moab_ref.add_entities(meshset, &ent, 1);
181 for (
int ll = 0; ll != max_level; ll++) {
185 ->getEntitiesByTypeAndRefLevel(
BitRefLevel().set(ll),
188 CHKERR moab_ref.get_adjacencies(singular_nodes, 1,
true, ref_edges,
189 moab::Interface::UNION);
190 ref_edges = intersect(ref_edges, edges);
191 if (singular_nodes.size() > 1) {
193 CHKERR moab_ref.get_entities_by_type(meshset, MBEDGE, ents,
true);
194 ref_edges = intersect(ref_edges, ents);
198 ->getEntitiesByTypeAndRefLevel(
BitRefLevel().set(ll),
204 if (singular_nodes.size() > 1) {
206 ->updateMeshsetByEntitiesChildren(
207 meshset,
BitRefLevel().set(ll + 1), meshset, MBEDGE,
true);
213 ->getEntitiesByTypeAndRefLevel(
BitRefLevel().set(max_level),
215 refCoords.resize(tets.size(), 12,
false);
217 for (Range::iterator tit = tets.begin(); tit != tets.end(); tit++, tt++) {
220 CHKERR moab_ref.get_connectivity(*tit, conn, num_nodes,
false);
226 CHKERR moab_ref.create_meshset(MESHSET_SET, out_meshset);
227 CHKERR moab_ref.add_entities(out_meshset, tets);
228 std::string file_name =
229 "ref_tet_" + boost::lexical_cast<std::string>(nInTheLoop) +
".vtk";
230 CHKERR moab_ref.write_file(file_name.c_str(),
"VTK",
"", &out_meshset, 1);
231 CHKERR moab_ref.delete_entities(&out_meshset, 1);
237 const size_t nb_gauss_pts = gaussPts.size2();
241 for (
size_t tt = 0; tt !=
refCoords.size1(); tt++) {
245 for (
size_t ggg = 0; ggg != nb_gauss_pts; ++ggg, ++gg) {
246 for (
int dd = 0;
dd != 3;
dd++) {
248 shape_n(ggg, 1) * tet_coords[3 * 1 +
dd] +
249 shape_n(ggg, 2) * tet_coords[3 * 2 +
dd] +
250 shape_n(ggg, 3) * tet_coords[3 * 3 +
dd];