v0.16.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Public Attributes | List of all members
MoFEM::PrismsFromSurfaceInterface Struct Reference

merge node from two bit levels More...

#include "src/interfaces/PrismsFromSurfaceInterface.hpp"

Inheritance diagram for MoFEM::PrismsFromSurfaceInterface:
[legend]
Collaboration diagram for MoFEM::PrismsFromSurfaceInterface:
[legend]

Public Types

enum  SwapType { NO_SWAP = 0 , SWAP_TRI_NODE_ORDER = 1 , SWAP_TOP_AND_BOT_TRI = 2 }
 List of types of node swapping performed on a created prism Node swapping is required to satisfy the canonical ordering for the prism in case the surface normal is pointing inwards rather than outwards Currently supported options (assuming canonical ordering of nodes 0-5): NO_SWAP : node swapping is not performed SWAP_TRI_NODE_ORDER : swap the order of nodes on prism's triangle faces (1 <-> 2, 4 <-> 5) SWAP_TOP_AND_BOT_TRI : swap nodes between the top and the bottom triangles (0 <-> 3, 1 <-> 4, 2 <-> 5) More...
 

Public Member Functions

MoFEMErrorCode query_interface (boost::typeindex::type_index type_index, UnknownInterface **iface) const
 
 PrismsFromSurfaceInterface (const MoFEM::Core &core)
 
MoFEMErrorCode createPrism (const EntityHandle tri3_nodes[3], const EntityHandle tri4_nodes[3], const SwapType swap_type, EntityHandle &prism)
 Create a prism from two triangle node triplets.
 
MoFEMErrorCode createPrisms (const Range &ents, const SwapType swap_type, Range &prisms, int verb=-1)
 Make prisms from triangles.
 
DEPRECATED MoFEMErrorCode createPrisms (const Range &ents, Range &prisms, int verb=-1)
 
MoFEMErrorCode seedPrismsEntities (Range &prisms, const BitRefLevel &bit, int verb=-1)
 Seed prism entities by bit level.
 
MoFEMErrorCode createPrismsFromPrisms (const Range &prisms, bool from_down, Range &out_prisms, int verb=-1)
 Make prisms by extruding top or bottom prisms.
 
MoFEMErrorCode setThickness (const Range &prisms, const double director3[], const double director4[])
 
MoFEMErrorCode setNormalThickness (const Range &prisms, double thickness3, double thickness4)
 
MoFEMErrorCode updateMeshestByEdgeBlock (const Range &prisms)
 Add quads to bockset.
 
MoFEMErrorCode updateMeshestByTriBlock (const Range &prisms)
 Add prism to bockset.
 
- Public Member Functions inherited from MoFEM::UnknownInterface
template<class IFACE >
MoFEMErrorCode registerInterface (bool error_if_registration_failed=true)
 Register interface.
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE *&iface) const
 Get interface reference to pointer of interface.
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE **const iface) const
 Get interface pointer to pointer of interface.
 
template<class IFACE , typename boost::enable_if< boost::is_pointer< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get interface pointer to pointer of interface.
 
template<class IFACE , typename boost::enable_if< boost::is_reference< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get reference to interface.
 
template<class IFACE >
IFACE * getInterface () const
 Function returning pointer to interface.
 
virtual ~UnknownInterface ()=default
 

Public Attributes

MoFEM::CorecOre
 
std::map< EntityHandle, EntityHandle > createdVertices
 

Additional Inherited Members

- Static Public Member Functions inherited from MoFEM::UnknownInterface
static MoFEMErrorCode getLibVersion (Version &version)
 Get library version.
 
static MoFEMErrorCode getFileVersion (moab::Interface &moab, Version &version)
 Get database major version.
 
static MoFEMErrorCode setFileVersion (moab::Interface &moab, Version version=Version(MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR, MoFEM_VERSION_BUILD))
 Get database major version.
 
static MoFEMErrorCode getInterfaceVersion (Version &version)
 Get database major version.
 

Detailed Description

merge node from two bit levels

Examples
mofem/atom_tests/prism_elements_from_surface.cpp, mofem/atom_tests/prism_polynomial_approximation.cpp, and mofem/tools/extrude_prisms.cpp.

Definition at line 15 of file PrismsFromSurfaceInterface.hpp.

Member Enumeration Documentation

◆ SwapType

List of types of node swapping performed on a created prism Node swapping is required to satisfy the canonical ordering for the prism in case the surface normal is pointing inwards rather than outwards Currently supported options (assuming canonical ordering of nodes 0-5): NO_SWAP : node swapping is not performed SWAP_TRI_NODE_ORDER : swap the order of nodes on prism's triangle faces (1 <-> 2, 4 <-> 5) SWAP_TOP_AND_BOT_TRI : swap nodes between the top and the bottom triangles (0 <-> 3, 1 <-> 4, 2 <-> 5)

Enumerator
NO_SWAP 
SWAP_TRI_NODE_ORDER 
SWAP_TOP_AND_BOT_TRI 

Definition at line 37 of file PrismsFromSurfaceInterface.hpp.

Constructor & Destructor Documentation

◆ PrismsFromSurfaceInterface()

MoFEM::PrismsFromSurfaceInterface::PrismsFromSurfaceInterface ( const MoFEM::Core core)
inline

Definition at line 21 of file PrismsFromSurfaceInterface.hpp.

22 : cOre(const_cast<MoFEM::Core &>(core)) {}
Core (interface) class.
Definition Core.hpp:83

Member Function Documentation

◆ createPrism()

MoFEMErrorCode MoFEM::PrismsFromSurfaceInterface::createPrism ( const EntityHandle  tri3_nodes[3],
const EntityHandle  tri4_nodes[3],
const SwapType  swap_type,
EntityHandle &  prism 
)

Create a prism from two triangle node triplets.

Parameters
tri3_nodesNodes of prism face 3
tri4_nodesNodes of prism face 4
swap_typeOptional canonical-ordering swap
prismReturned prism entity
Returns
Error code

Definition at line 9 of file PrismsFromSurfaceInterface.cpp.

11 {
13 Interface &m_field = cOre;
14
15 EntityHandle prism_nodes[6] = {tri3_nodes[0], tri3_nodes[1], tri3_nodes[2],
16 tri4_nodes[0], tri4_nodes[1], tri4_nodes[2]};
17
18 switch (swap_type) {
20 std::swap(prism_nodes[1], prism_nodes[2]);
21 std::swap(prism_nodes[4], prism_nodes[5]);
22 break;
24 std::swap(prism_nodes[0], prism_nodes[3]);
25 std::swap(prism_nodes[1], prism_nodes[4]);
26 std::swap(prism_nodes[2], prism_nodes[5]);
27 break;
28 case NO_SWAP:
29 default:
30 break;
31 }
32
33 CHKERR m_field.get_moab().create_element(MBPRISM, prism_nodes, 6, prism);
34
36}
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
DeprecatedCoreInterface Interface

◆ createPrisms() [1/2]

MoFEMErrorCode MoFEM::PrismsFromSurfaceInterface::createPrisms ( const Range ents,
const SwapType  swap_type,
Range prisms,
int  verb = -1 
)

Make prisms from triangles.

Parameters
entsRange of triangles
swap_typeDefines how the nodes of the created prism are swapped (required for canonical ordering if the surface normal is pointing inwards)
prismsReturned range of prisms
verbVerbosity level
Returns
Error code
Examples
mofem/atom_tests/prism_elements_from_surface.cpp, and mofem/tools/extrude_prisms.cpp.

Definition at line 51 of file PrismsFromSurfaceInterface.cpp.

52 {
54 Interface &m_field = cOre;
55 Range tris = ents.subset_by_type(MBTRI);
56 for (Range::iterator tit = tris.begin(); tit != tris.end(); tit++) {
57 const EntityHandle *conn;
58 int number_nodes = 0;
59 CHKERR m_field.get_moab().get_connectivity(*tit, conn, number_nodes, false);
60 double coords[3 * number_nodes];
61 CHKERR m_field.get_moab().get_coords(conn, number_nodes, coords);
62 EntityHandle prism_face3[3];
63 EntityHandle prism_face4[3];
64 for (int nn = 0; nn < 3; nn++) {
65 prism_face3[nn] = conn[nn];
66 if (createdVertices.find(conn[nn]) != createdVertices.end()) {
67 prism_face4[nn] = createdVertices[prism_face3[nn]];
68 } else {
69 CHKERR m_field.get_moab().create_vertex(&coords[3 * nn], prism_face4[nn]);
70 createdVertices[conn[nn]] = prism_face4[nn];
71 CHKERR m_field.get_moab().tag_set_data(cOre.get_th_RefParentHandle(),
72 &prism_face4[nn], 1,
73 &prism_face3[nn]);
74 }
75 }
76
77 EntityHandle prism;
78 CHKERR createPrism(prism_face3, prism_face4, swap_type, prism);
79 Range edges;
80 CHKERR m_field.get_moab().get_adjacencies(&prism, 1, 1, true, edges,
81 moab::Interface::UNION);
82 Range faces;
83 CHKERR m_field.get_moab().get_adjacencies(&prism, 1, 2, true, faces,
84 moab::Interface::UNION);
85 prisms.insert(prism);
86 for (int ee = 0; ee <= 2; ee++) {
87 EntityHandle e1;
88 CHKERR m_field.get_moab().side_element(prism, 1, ee, e1);
89 EntityHandle e2;
90 CHKERR m_field.get_moab().side_element(prism, 1, ee + 6, e2);
91 CHKERR m_field.get_moab().tag_set_data(cOre.get_th_RefParentHandle(), &e2,
92 1, &e1);
93 }
94 EntityHandle f3, f4;
95 {
96 CHKERR m_field.get_moab().side_element(prism, 2, 3, f3);
97 CHKERR m_field.get_moab().side_element(prism, 2, 4, f4);
98 CHKERR m_field.get_moab().tag_set_data(cOre.get_th_RefParentHandle(), &f4,
99 1, &f3);
100 }
101 if (number_nodes > 3) {
102 EntityHandle meshset;
103 CHKERR m_field.get_moab().create_meshset(MESHSET_SET, meshset);
104 CHKERR m_field.get_moab().add_entities(meshset, &f4, 1);
105 for (int ee = 0; ee <= 2; ee++) {
106 EntityHandle e2;
107 CHKERR m_field.get_moab().side_element(prism, 1, ee + 6, e2);
108 CHKERR m_field.get_moab().add_entities(meshset, &e2, 1);
109 }
110 CHKERR m_field.get_moab().convert_entities(meshset, true, false, false);
111 CHKERR m_field.get_moab().delete_entities(&meshset, 1);
112 const EntityHandle *conn_f4;
113 int number_nodes_f4 = 0;
114 CHKERR m_field.get_moab().get_connectivity(f4, conn_f4, number_nodes_f4,
115 false);
116 if (number_nodes_f4 != number_nodes) {
117 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
118 "data inconsistency");
119 }
120 CHKERR m_field.get_moab().set_coords(&conn_f4[3], 3, &coords[9]);
121 }
122 }
124}
@ MOFEM_DATA_INCONSISTENCY
Definition definitions.h:31
Tag get_th_RefParentHandle() const
Definition Core.hpp:202
std::map< EntityHandle, EntityHandle > createdVertices
MoFEMErrorCode createPrism(const EntityHandle tri3_nodes[3], const EntityHandle tri4_nodes[3], const SwapType swap_type, EntityHandle &prism)
Create a prism from two triangle node triplets.

◆ createPrisms() [2/2]

DEPRECATED MoFEMErrorCode MoFEM::PrismsFromSurfaceInterface::createPrisms ( const Range ents,
Range prisms,
int  verb = -1 
)
Deprecated:
Use the function with the same name and a parameter swap_type, permitting to swap the order of each triangle's nodes or alternatively swap nodes between top and bottom triangles, which is required for the canonical ordering if surface normal is pointing inwards

Definition at line 44 of file PrismsFromSurfaceInterface.cpp.

45 {
47 CHKERR createPrisms(ents, NO_SWAP, prisms, verb);
49}
MoFEMErrorCode createPrisms(const Range &ents, const SwapType swap_type, Range &prisms, int verb=-1)
Make prisms from triangles.

◆ createPrismsFromPrisms()

MoFEMErrorCode MoFEM::PrismsFromSurfaceInterface::createPrismsFromPrisms ( const Range prisms,
bool  from_down,
Range out_prisms,
int  verb = -1 
)

Make prisms by extruding top or bottom prisms.

Parameters
prismsInput prisms
from_downUse top or down face, if true from f3
out_prismsReturned prisms entities
verbVerbosity level
Returns
Error code
Examples
mofem/atom_tests/prism_elements_from_surface.cpp.

Definition at line 159 of file PrismsFromSurfaceInterface.cpp.

160 {
162 Interface &m_field = cOre;
163 Range tris;
164 for (Range::iterator pit = prisms.begin(); pit != prisms.end(); pit++) {
165 EntityHandle face;
166 if (from_down) {
167 CHKERR m_field.get_moab().side_element(*pit, 2, 3, face);
168 } else {
169 CHKERR m_field.get_moab().side_element(*pit, 2, 4, face);
170 }
171 tris.insert(face);
172 }
173 CHKERR createPrisms(tris, NO_SWAP, out_prisms, verb);
175}

◆ query_interface()

MoFEMErrorCode MoFEM::PrismsFromSurfaceInterface::query_interface ( boost::typeindex::type_index  type_index,
UnknownInterface **  iface 
) const
virtual

Implements MoFEM::UnknownInterface.

Definition at line 38 of file PrismsFromSurfaceInterface.cpp.

39 {
40 *iface = const_cast<PrismsFromSurfaceInterface *>(this);
41 return 0;
42}

◆ seedPrismsEntities()

MoFEMErrorCode MoFEM::PrismsFromSurfaceInterface::seedPrismsEntities ( Range prisms,
const BitRefLevel bit,
int  verb = -1 
)

Seed prism entities by bit level.

Parameters
prismsRange of entities
bitBitRefLevel
verbVerbosity level
Returns
Error code
Examples
mofem/atom_tests/prism_elements_from_surface.cpp, and mofem/atom_tests/prism_polynomial_approximation.cpp.

Definition at line 126 of file PrismsFromSurfaceInterface.cpp.

127 {
128 Interface &m_field = cOre;
129 auto ref_ents_ptr = m_field.get_ref_ents();
131 MPI_Comm comm = m_field.get_comm();
132 RefEntity_multiIndex *refined_entities_ptr;
133 refined_entities_ptr =
134 const_cast<RefEntity_multiIndex *>(ref_ents_ptr);
135 if (!prisms.empty()) {
136 int dim = m_field.get_moab().dimension_from_handle(prisms[0]);
137 for (int dd = 0; dd <= dim; dd++) {
138 Range ents;
139 CHKERR m_field.get_moab().get_adjacencies(prisms, dd, true, ents,
140 moab::Interface::UNION);
141 Range::iterator eit = ents.begin();
142 for (; eit != ents.end(); eit++) {
143 std::pair<RefEntity_multiIndex::iterator, bool> p_ent =
144 refined_entities_ptr->insert(boost::shared_ptr<RefEntity>(
145 new RefEntity(m_field.get_basic_entity_data_ptr(), *eit)));
146 *(const_cast<RefEntity *>(p_ent.first->get())->getBitRefLevelPtr()) |=
147 bit;
148 if (verb >= VERY_VERBOSE) {
149 std::ostringstream ss;
150 ss << *(p_ent.first);
151 PetscSynchronizedPrintf(comm, "%s\n", ss.str().c_str());
152 }
153 }
154 }
155 }
157}
@ VERY_VERBOSE
auto bit
set bit
const Tensor2_symmetric_Expr< const ddTensor0< T, Dim, i, j >, typename promote< T, double >::V, Dim, i, j > dd(const Tensor0< T * > &a, const Index< i, Dim > index1, const Index< j, Dim > index2, const Tensor1< int, Dim > &d_ijk, const Tensor1< double, Dim > &d_xyz)
Definition ddTensor0.hpp:33
multi_index_container< boost::shared_ptr< RefEntity >, indexed_by< ordered_unique< tag< Ent_mi_tag >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getEnt > >, ordered_non_unique< tag< Ent_Ent_mi_tag >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > >, ordered_non_unique< tag< Composite_EntType_and_ParentEntType_mi_tag >, composite_key< RefEntity, const_mem_fun< RefEntity, EntityType, &RefEntity::getEntType >, const_mem_fun< RefEntity, EntityType, &RefEntity::getParentEntType > > >, ordered_non_unique< tag< Composite_ParentEnt_And_EntType_mi_tag >, composite_key< RefEntity, const_mem_fun< RefEntity, EntityType, &RefEntity::getEntType >, const_mem_fun< RefEntity, EntityHandle, &RefEntity::getParentEnt > > > > > RefEntity_multiIndex
RefEntityTmp< 0 > RefEntity
MoFEMErrorCode get_ref_ents(const RefEntity_multiIndex **refined_entities_ptr) const
Get ref entities multi-index from database.
Definition Core.cpp:819

◆ setNormalThickness()

MoFEMErrorCode MoFEM::PrismsFromSurfaceInterface::setNormalThickness ( const Range prisms,
double  thickness3,
double  thickness4 
)

Set normal thickness

Parameters
prismsRange of prisms
thicknessnormal thickness
Returns
Examples
mofem/tools/extrude_prisms.cpp.

Definition at line 211 of file PrismsFromSurfaceInterface.cpp.

212 {
213 Interface &m_field = cOre;
215
216 auto add_normal = [&](std::map<EntityHandle, std::array<double, 3>> &nodes,
217 EntityHandle face) {
219 const EntityHandle *conn;
220 int number_nodes;
221 CHKERR m_field.get_moab().get_connectivity(face, conn, number_nodes, false);
222 std::array<double, 9> coords;
223 CHKERR m_field.get_moab().get_coords(conn, number_nodes, coords.data());
224 std::array<double, 3> normal;
225 CHKERR Tools::getTriNormal(coords.data(), normal.data());
226 double a = sqrt(normal[0] * normal[0] + normal[1] * normal[1] +
227 normal[2] * normal[2]);
228 for (auto d : {0, 1, 2})
229 normal[d] /= a;
230 for (auto n : {0, 1, 2}) {
231 try {
232 for (auto d : {0, 1, 2})
233 nodes.at(conn[n])[d] += normal[d];
234 } catch (...) {
235 nodes.insert(
236 std::pair<EntityHandle, std::array<double, 3>>(conn[n], normal));
237 }
238 }
240 };
241
242 auto apply_map = [&](auto &nodes, double t) {
244 for (auto &m : nodes) {
245 std::array<double, 3> coords;
246 CHKERR m_field.get_moab().get_coords(&m.first, 1, coords.data());
247 auto &normal = m.second;
248 double a = sqrt(normal[0] * normal[0] + normal[1] * normal[1] +
249 normal[2] * normal[2]);
250 for (auto d : {0, 1, 2})
251 coords[d] += (normal[d] / a) * t;
252 CHKERR m_field.get_moab().set_coords(&m.first, 1, coords.data());
253 }
255 };
256
257 map<EntityHandle, std::array<double, 3>> nodes_f3, nodes_f4;
258 for (Range::iterator pit = prisms.begin(); pit != prisms.end(); pit++) {
259 for (int ff = 3; ff <= 4; ff++) {
260 EntityHandle face;
261 CHKERR m_field.get_moab().side_element(*pit, 2, ff, face);
262 if (ff == 3)
263 CHKERR add_normal(nodes_f3, face);
264 else
265 CHKERR add_normal(nodes_f4, face);
266 }
267 }
268
269 CHKERR apply_map(nodes_f3, thickness3);
270 CHKERR apply_map(nodes_f4, thickness4);
271
273}
constexpr double a
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
const double n
refractive index of diffusive medium
constexpr double t
plate stiffness
Definition plate.cpp:58
FTensor::Index< 'm', 3 > m
moab::Interface & get_moab()
Definition Core.hpp:327
static MoFEMErrorCode getTriNormal(const double *coords, double *normal, double *d_normal=nullptr)
Get the Tri Normal objectGet triangle normal.
Definition Tools.cpp:353

◆ setThickness()

MoFEMErrorCode MoFEM::PrismsFromSurfaceInterface::setThickness ( const Range prisms,
const double  director3[],
const double  director4[] 
)

Set uniform thickness

Parameters
prismsRange of prisms
director3Displacement of face 3
director4Displacement of face 4
Returns
Examples
mofem/atom_tests/prism_elements_from_surface.cpp.

Definition at line 177 of file PrismsFromSurfaceInterface.cpp.

178 {
180 Interface &m_field = cOre;
181 Range nodes_f3, nodes_f4;
182 for (Range::iterator pit = prisms.begin(); pit != prisms.end(); pit++) {
183 for (int ff = 3; ff <= 4; ff++) {
184 EntityHandle face;
185 CHKERR m_field.get_moab().side_element(*pit, 2, ff, face);
186 const EntityHandle *conn;
187 int number_nodes = 0;
188 CHKERR m_field.get_moab().get_connectivity(face, conn, number_nodes,
189 false);
190 if (ff == 3) {
191 nodes_f3.insert(&conn[0], &conn[number_nodes]);
192 } else {
193 nodes_f4.insert(&conn[0], &conn[number_nodes]);
194 }
195 }
196 }
197 double coords[3];
198 for (Range::iterator nit = nodes_f3.begin(); nit != nodes_f3.end(); nit++) {
199 CHKERR m_field.get_moab().get_coords(&*nit, 1, coords);
200 cblas_daxpy(3, 1, director3, 1, coords, 1);
201 CHKERR m_field.get_moab().set_coords(&*nit, 1, coords);
202 }
203 for (Range::iterator nit = nodes_f4.begin(); nit != nodes_f4.end(); nit++) {
204 CHKERR m_field.get_moab().get_coords(&*nit, 1, coords);
205 cblas_daxpy(3, 1, director4, 1, coords, 1);
206 CHKERR m_field.get_moab().set_coords(&*nit, 1, coords);
207 }
209}

◆ updateMeshestByEdgeBlock()

MoFEMErrorCode MoFEM::PrismsFromSurfaceInterface::updateMeshestByEdgeBlock ( const Range prisms)

Add quads to bockset.

If quad is adjacent to extruded edge, is added to given blockset

Parameters
prisms
Returns
MoFEMErrorCode
Examples
mofem/tools/extrude_prisms.cpp.

Definition at line 276 of file PrismsFromSurfaceInterface.cpp.

276 {
277 Interface &m_field = cOre;
279 Range prisms_edges;
280 CHKERR m_field.get_moab().get_adjacencies(prisms, 1, true, prisms_edges,
281 moab::Interface::UNION);
282 Range prisms_faces;
283 CHKERR m_field.get_moab().get_adjacencies(prisms, 2, true, prisms_faces,
284 moab::Interface::UNION);
285 for (_IT_CUBITMESHSETS_FOR_LOOP_(m_field, it)) {
286 Range edges;
287 CHKERR m_field.get_moab().get_entities_by_type(it->meshset, MBEDGE, edges,
288 true);
289 edges = intersect(edges, prisms_edges);
290 if (!edges.empty()) {
291 Range edges_faces;
292 CHKERR m_field.get_moab().get_adjacencies(edges, 2, false, edges_faces,
293 moab::Interface::UNION);
294 edges_faces = intersect(edges_faces, prisms_faces.subset_by_type(MBQUAD));
295 EntityHandle meshset = it->getMeshset();
296 CHKERR m_field.get_moab().add_entities(meshset, edges_faces);
297 }
298 }
300}
#define _IT_CUBITMESHSETS_FOR_LOOP_(MESHSET_MANAGER, IT)
Iterator that loops over all the Cubit MeshSets in a moFEM field.

◆ updateMeshestByTriBlock()

MoFEMErrorCode MoFEM::PrismsFromSurfaceInterface::updateMeshestByTriBlock ( const Range prisms)

Add prism to bockset.

If prism is adjacent to extruded triangle, is added to given blockset

Parameters
prisms
Returns
MoFEMErrorCode
Examples
mofem/tools/extrude_prisms.cpp.

Definition at line 303 of file PrismsFromSurfaceInterface.cpp.

303 {
304 Interface &m_field = cOre;
306 Range prisms_tris;
307 CHKERR m_field.get_moab().get_adjacencies(prisms, 2, true, prisms_tris,
308 moab::Interface::UNION);
309 prisms_tris = prisms_tris.subset_by_type(MBTRI);
310 for (_IT_CUBITMESHSETS_FOR_LOOP_(m_field, it)) {
311 Range tris;
312 CHKERR m_field.get_moab().get_entities_by_type(it->meshset, MBTRI, tris,
313 true);
314 tris = intersect(tris, prisms_tris);
315 if (!tris.empty()) {
316 Range tris_ents;
317 CHKERR m_field.get_moab().get_adjacencies(tris, 3, false, tris_ents,
318 moab::Interface::UNION);
319 tris_ents = intersect(tris_ents, prisms);
320 EntityHandle meshset = it->getMeshset();
321 CHKERR m_field.get_moab().add_entities(meshset, tris_ents);
322 }
323 }
325}

Member Data Documentation

◆ cOre

MoFEM::Core& MoFEM::PrismsFromSurfaceInterface::cOre

Definition at line 20 of file PrismsFromSurfaceInterface.hpp.

◆ createdVertices

std::map<EntityHandle, EntityHandle> MoFEM::PrismsFromSurfaceInterface::createdVertices

The documentation for this struct was generated from the following files: