v0.15.0
Loading...
Searching...
No Matches
MeshsetsManager.hpp
Go to the documentation of this file.
1/** \file MeshsetsManager.hpp
2 * \brief Interface for managing mesh sets containing materials and boundary conditions
3 * \ingroup mofem_meshset_mng
4 *
5 * The MeshsetsManager provides a comprehensive, format-agnostic interface for handling
6 * mesh sets within the MoFEM finite element framework. It serves as the foundational
7 * data management layer for boundary conditions and material properties, supporting
8 * multiple meshing software formats and integration patterns.
9 *
10 * Key functionality includes:
11 * - Generic meshset management compatible with CUBIT, Gmsh, Salome/MED, and other formats
12 * - MOAB-based efficient storage and parallel processing of meshset data
13 * - Integration with BcManager for high-level boundary condition application
14 * - Support for NODESET (vertex groups), SIDESET (surface groups), and BLOCKSET (volume groups)
15 * - Material property and boundary condition data association
16 * - Configuration file loading and parallel data synchronization
17 * - Multi-format tag translation and meshset discovery
18 *
19 * Format Support:
20 * - CUBIT/Coreform: Native support for nodesets, sidesets, and blocksets
21 * - Gmsh: Physical group translation to MoFEM meshsets
22 * - Salome/MED: Mesh group and CAD-based boundary definitions
23 * - Exodus II, ANSYS, Abaqus: Standard finite element format compatibility
24 * - Custom formats: Extensible tag-based approach for new meshing software
25 *
26 * The interface bridges the gap between mesh generation software conventions and
27 * MoFEM's finite element infrastructure, providing a unified approach to boundary
28 * condition and material management regardless of the original mesh source.
29 *
30 */
31
32#ifndef __MESHSETSMANAGER_HPP__
33#define __MESHSETSMANAGER_HPP__
34
35namespace MoFEM {
36
37typedef CubitMeshSet_multiIndex::index<CubitMeshsetType_mi_tag>::type
39
40typedef CubitMeshSet_multiIndex::index<CubitMeshsetMaskedType_mi_tag>::type
42
43typedef CubitMeshSet_multiIndex::index<CubitMeshsets_name>::type
45
46typedef CubitMeshSet_multiIndex::index<CubitMeshsetType_mi_tag>::type
48
49/**
50 * \brief Iterator that loops over all the Cubit MeshSets in a moFEM field
51 * \ingroup mofem_meshset_mng
52
53 *
54 * \param MESHSET_MANAGER meshset manager (works as well with Interface)
55 * \param iterator
56 */
57#define _IT_CUBITMESHSETS_FOR_LOOP_(MESHSET_MANAGER, IT) \
58 CubitMeshSet_multiIndex::iterator IT = \
59 MESHSET_MANAGER.get_meshsets_manager_ptr()->getBegin(); \
60 IT != MESHSET_MANAGER.get_meshsets_manager_ptr()->getEnd(); \
61 IT++
62
63/**
64* \brief Iterator that loops over a specific Cubit MeshSet in a moFEM field
65* \ingroup mofem_meshset_mng
66
67*
68* \param mField moFEM Field
69* \param see CubitBC (NODESET, SIDESET or BLOCKSET and more)
70* \param iterator
71*/
72#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, \
73 CUBITBCTYPE, IT) \
74 CubitMeshsetByType::iterator IT = \
75 MESHSET_MANAGER.get_meshsets_manager_ptr()->getBegin(CUBITBCTYPE); \
76 IT != MESHSET_MANAGER.get_meshsets_manager_ptr()->getEnd(CUBITBCTYPE); \
77 IT++
78
79/**
80* \brief Iterator that loops over a specific Cubit MeshSet having a particular
81BC meshset in a moFEM field
82* \ingroup mofem_meshset_mng
83
84*
85* \param MESHSET_MANAGER meshset manager (works as well with Interface)
86* \param see CubitBC (NODESET, SIDESET or BLOCKSET and more)
87* \param iterator
88*
89* Example: \code
90for(_IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(mField,NODESET|DISPLACEMENTSET,it) {
91...
92* } \endcode
93*/
94#define _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, \
95 IT) \
96 CubitMeshsetByMask::iterator IT = \
97 MESHSET_MANAGER.get_meshsets_manager_ptr()->getBySetTypeBegin( \
98 CUBITBCTYPE); \
99 IT != MESHSET_MANAGER.get_meshsets_manager_ptr()->getBySetTypeEnd( \
100 CUBITBCTYPE); \
101 IT++
102
103/**
104* \brief Iterator that loops over Cubit BlockSet having a particular name
105* \ingroup mofem_meshset_mng
106
107
108* \param MESHSET_MANAGER meshset manager (works as well with Interface)
109* \param NAME name
110* \param IT iterator
111*
112* Example: \code
113for(_IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(mField,"SOME_BLOCK_NAME",it) {
114...
115* } \endcode
116*/
117#define _IT_CUBITMESHSETS_BY_NAME_FOR_LOOP_(MESHSET_MANAGER, NAME, IT) \
118 CubitMeshsetByName::iterator IT = \
119 MESHSET_MANAGER.get_meshsets_manager_ptr()->getBegin(NAME); \
120 IT != MESHSET_MANAGER.get_meshsets_manager_ptr()->getEnd(NAME); \
121 IT++
122
123/** \brief Interface for managing meshsets containing materials and boundary
124 * conditions
125 * \ingroup mofem_meshset_mng
126 *
127 * The MeshsetsManager provides comprehensive functionality for creating, managing,
128 * and querying mesh sets (materials, boundary conditions, and blocks) within the
129 * MoFEM framework. It serves as the foundation for higher-level boundary condition
130 * management and integrates seamlessly with various meshing software formats.
131 *
132 * \section mm_bc_connection Connection to BcManager
133 *
134 * The MeshsetsManager acts as the data layer for the BcManager interface:
135 * - **Data Storage**: MeshsetsManager stores meshset definitions, attributes, and entity associations
136 * - **BcManager Interface**: BcManager provides high-level boundary condition application using MeshsetsManager data
137 * - **Workflow Integration**: MeshsetsManager discovers and organizes meshsets, BcManager applies them to finite element problems
138 * - **Data Consistency**: Both interfaces ensure synchronized boundary condition data across parallel processes
139 *
140 * \section mm_moab_integration MOAB Meshset Integration
141 *
142 * MeshsetsManager leverages MOAB's native meshset capabilities:
143 * - **MOAB Meshsets**: Uses MOAB::EntitySet as the underlying container for mesh entities
144 * - **Tag System**: Utilizes MOAB tags for meshset identification and data storage
145 * - **Entity Management**: Manages collections of vertices, edges, faces, and volumes within meshsets
146 * - **Memory Efficiency**: Benefits from MOAB's optimized storage and query mechanisms
147 * - **Parallel Support**: Inherits MOAB's parallel meshset handling for distributed computations
148 *
149 * \section mm_cubit_concepts CUBIT/Coreform Meshset Types
150 *
151 * \subsection mm_nodeset NODESET
152 * - **Purpose**: Groups of vertices/nodes for applying nodal boundary conditions
153 * - **Usage**: Displacement constraints, temperature, concentrated forces, point sources
154 * - **CUBIT Creation**: Select vertices → Create Nodeset → Assign boundary conditions
155 * - **Examples**: Fixed supports, prescribed displacements, temperature constraints
156 *
157 * \subsection mm_sideset SIDESET
158 * - **Purpose**: Groups of faces/surfaces for applying surface boundary conditions
159 * - **Usage**: Pressure loads, heat flux, traction forces, interface conditions
160 * - **CUBIT Creation**: Select surfaces → Create Sideset → Assign surface conditions
161 * - **Examples**: Pressure on surfaces, heat transfer boundaries, contact interfaces
162 *
163 * \subsection mm_blockset BLOCKSET
164 * - **Purpose**: Groups of volumes/elements for material property assignment
165 * - **Usage**: Material definitions, element types, constitutive models
166 * - **CUBIT Creation**: Select volumes → Create Block → Assign material properties
167 * - **Examples**: Steel regions, concrete blocks, fluid domains, different element types
168 *
169 * \section mm_generic_approach Generic Multi-Format Support
170 *
171 * The MeshsetsManager approach is **not restricted to CUBIT** and supports multiple meshing formats:
172 *
173 * \subsection mm_gmsh Gmsh Integration
174 * - **Physical Groups**: Gmsh physical groups map to MoFEM meshsets
175 * - **Tag Translation**: Converts Gmsh physical tags to MOAB meshset tags
176 * - **Entity Types**: Supports Gmsh's point, line, surface, and volume physical groups
177 * - **Boundary Conditions**: Gmsh boundary markers become MoFEM boundary condition meshsets
178 *
179 * \subsection mm_salome Salome/MED Format Support
180 * - **MED Groups**: Salome mesh groups translate to MoFEM meshsets
181 * - **CAD Integration**: Preserves CAD-based boundary and material definitions
182 * - **Multi-Physics**: Supports Salome's multi-physics mesh organization
183 * - **CGNS Compatibility**: Handles complex boundary condition hierarchies
184 *
185 * \subsection mm_other_formats Other Format Support
186 * - **Exodus II**: Supports element blocks, node sets, and side sets
187 * - **ANSYS**: Converts component definitions to meshsets
188 * - **Abaqus**: Translates element sets and node sets
189 * - **Custom Formats**: Generic tag-based approach accommodates new formats
190 *
191 * \section mm_workflow Typical Multi-Format Workflow
192 *
193 * 1. **Mesh Import**: Load mesh with native format-specific group definitions
194 * 2. **Tag Discovery**: MeshsetsManager discovers and categorizes existing tags
195 * 3. **Meshset Creation**: Convert format-specific groups to unified meshset representation
196 * 4. **Data Association**: Attach material properties and boundary condition data
197 * 5. **Validation**: Verify meshset consistency and completeness
198 * 6. **Problem Setup**: Use meshsets for finite element problem definition
199 *
200 * \section mm_capabilities Key Capabilities
201 * - Creating and managing meshsets from various meshing software
202 * - Setting material properties and boundary condition data
203 * - Querying meshset contents and properties across different formats
204 * - Loading/saving meshset configurations with format preservation
205 * - Broadcasting meshset data across MPI processes
206 * - Generic tag-based approach for extensibility to new formats
207 */
209
210 /**
211 * \brief Query interface for MeshsetsManager
212 *
213 * @param type_index type index for the interface to query
214 * @param iface pointer to store the interface
215 * @return MoFEMErrorCode Error code indicating success or failure
216 */
217 MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
218 UnknownInterface **iface) const;
219
220 MoFEM::Core &cOre; ///< Reference to MoFEM Core interface
221
222 /**
223 * \brief Constructor for MeshsetsManager
224 *
225 * @param core reference to MoFEM Core interface for accessing mesh and field data
226 */
227 MeshsetsManager(const MoFEM::Core &core);
228 virtual ~MeshsetsManager() = default;
229
230 /**
231 * \brief Get tag handles used on meshsets
232 * \ingroup mofem_meshset_mng
233 *
234 * Retrieves MOAB tag handles for meshset identification and data storage.
235 * These tags follow CUBIT/MOAB conventions for nodesets, sidesets, and blocksets.
236 * The function initializes internal tag handles for subsequent meshset operations.
237 *
238 * @param verb verbosity level for output (-1 = default, higher values = more verbose)
239 * @return MoFEMErrorCode Error code indicating success or failure
240 */
241 MoFEMErrorCode getTags(int verb = -1);
242
243 /**
244 * \brief Static version of getTags for external MOAB interface
245 * \ingroup mofem_meshset_mng
246 *
247 * @param moab reference to MOAB interface
248 * @param nsTag reference to store nodeset tag handle
249 * @param ssTag reference to store sideset tag handle
250 * @param nsTag_data reference to store nodeset data tag handle
251 * @param ssTag_data reference to store sideset data tag handle
252 * @param bhTag reference to store blockset tag handle
253 * @param bhTag_header reference to store blockset header tag handle
254 * @param verb verbosity level for output
255 * @return MoFEMErrorCode Error code indicating success or failure
256 */
257 static MoFEMErrorCode getTags(moab::Interface &moab, Tag &nsTag, Tag &ssTag,
259 Tag &bhTag_header, int verb = -1);
260
261 /**
262 * \brief get tag handle used to store "id" of NODESET
263 */
264 inline Tag get_nsTag() const { return nsTag; }
265
266 /**
267 * \brief get tag handle used to store "id" of SIDESET
268 */
269 inline Tag get_ssTag() const { return ssTag; }
270
271 /**
272 * \brief get tag handle used to store boundary data on NODESET
273 */
274 inline Tag get_nsTag_data() const { return nsTag_data; }
275
276 /**
277 * \brief get tag handle used to store boundary data on SIDESET
278 */
279 inline Tag get_ssTag_data() const { return ssTag_data; }
280
281 /**
282 * \brief get tag handle used to store "id" of BLOCKSET
283 */
284 inline Tag get_bhTag() const { return bhTag; }
285
286 /**
287 * \brief get tag handle used to store of block set header (Used by Cubit)
288 */
289 inline Tag get_bhTag_header() const { return bhTag_header; }
290
291 /**
292 * \brief return pointer to meshset manager
293 */
295
296 /**
297 * \brief return pointer to meshset manager
298 */
299 const MeshsetsManager *get_meshsets_manager_ptr() const { return this; }
300
301 /**
302 * \brief Clear the multi-index container
303 * \ingroup mofem_meshset_mng
304 *
305 * Removes all stored meshset data from the internal container.
306 * Useful for reinitialization or memory cleanup.
307 *
308 * @return MoFEMErrorCode Error code indicating success or failure
309 */
311
312 /**
313 * \brief Initialize container from mesh data
314 * \ingroup mofem_meshset_mng
315 *
316 * Reads meshset information from the mesh database and populates the
317 * internal multi-index container. This includes discovering nodesets,
318 * sidesets, and blocksets with their associated tags and data.
319 *
320 * @param verb verbosity level for output
321 * @return MoFEMErrorCode Error code indicating success or failure
322 */
324
325 /**
326 * @brief Read meshsets from mesh database
327 * \ingroup mofem_meshset_mng
328 *
329 * Scans the mesh for existing meshsets and populates the manager's
330 * internal data structures. This is typically called after mesh loading
331 * to discover all available nodesets, sidesets, and blocksets.
332 *
333 * @param verb verbosity level for output
334 * @return MoFEMErrorCode Error code indicating success or failure
335 */
337
338 /**
339 * @brief Broadcast meshsets across MPI processes
340 * \ingroup mofem_meshset_mng
341 *
342 * Synchronizes meshset information across all MPI processes to ensure
343 * consistent meshset data in parallel computations. Typically called
344 * after meshset modifications on specific processes.
345 *
346 * @param verb verbosity level for output
347 * @return MoFEMErrorCode Error code indicating success or failure
348 */
350
351 template <class CUBIT_BC_DATA_TYPE>
352 MoFEMErrorCode printBcSet(CUBIT_BC_DATA_TYPE &data,
353 unsigned long int type) const;
354
355 /**
356 * \brief Print meshsets with displacement boundary conditions
357 * \ingroup mofem_meshset_mng
358 *
359 * Outputs information about all meshsets containing displacement boundary
360 * condition data, including constraint flags and prescribed values.
361 *
362 * @return MoFEMErrorCode Error code indicating success or failure
363 */
365
366 /**
367 * \brief Print meshsets with pressure boundary conditions
368 * \ingroup mofem_meshset_mng
369 *
370 * Outputs information about all meshsets containing pressure boundary
371 * condition data, including pressure magnitudes and application flags.
372 *
373 * @return MoFEMErrorCode Error code indicating success or failure
374 */
376
377 /**
378 * \brief Print meshsets with force boundary conditions
379 * \ingroup mofem_meshset_mng
380 *
381 * Outputs information about all meshsets containing force boundary
382 * condition data, including force and moment components.
383 *
384 * @return MoFEMErrorCode Error code indicating success or failure
385 */
387
388 /**
389 * \brief Print meshsets with temperature boundary conditions
390 * \ingroup mofem_meshset_mng
391 *
392 * Outputs information about all meshsets containing temperature boundary
393 * condition data, including prescribed temperature values.
394 *
395 * @return MoFEMErrorCode Error code indicating success or failure
396 */
398
399 /**
400 * \brief Print meshsets with heat flux boundary conditions
401 * \ingroup mofem_meshset_mng
402 *
403 * Outputs information about all meshsets containing heat flux boundary
404 * condition data, including flux magnitudes and directions.
405 *
406 * @return MoFEMErrorCode Error code indicating success or failure
407 */
409
410 /**
411 * \brief Print meshsets with material properties
412 * \ingroup mofem_meshset_mng
413 *
414 * Outputs information about all meshsets containing material data,
415 * including material parameters and constitutive model information.
416 *
417 * @return MoFEMErrorCode Error code indicating success or failure
418 */
420
424
425 /**
426 * \ingroup mofem_meshset_mng
427 * \brief get begin iterator of cubit meshset of given type (instead you can
428 * use _IT_CUBITMESHSETS_TYPE_FOR_LOOP_(MFIELD,CUBITBCTYPE,IT)
429 *
430 * for(_IT_CUBITMESHSETS_FOR_LOOP_(mField,it) {
431 * ...
432 * }
433 *
434 */
435 inline CubitMeshSet_multiIndex::iterator getBegin() const {
436 return cubitMeshsets.begin();
437 }
438
439 /**
440 * \ingroup mofem_meshset_mng
441 * \brief get begin iterator of cubit meshset of given type (instead you can
442 * use _IT_CUBITMESHSETS_TYPE_FOR_LOOP_(MFIELD,CUBITBCTYPE,IT)
443 *
444 * for(_IT_CUBITMESHSETS_FOR_LOOP_(mField,it) {
445 * ...
446 * }
447 *
448 */
449 CubitMeshSet_multiIndex::iterator getEnd() const {
450 return cubitMeshsets.end();
451 }
452
453 /**
454 * \brief get begin iterator of cubit meshset of given type (instead you can
455 use _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MFIELD,CUBITBCTYPE,IT)
456 * \ingroup mofem_meshset_mng
457
458 *
459 *
460 for(_IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(mField,NODESET|DISPLACEMENTSET,it)
461 {
462 * ...
463 * }
464 *
465 * \param type of meshset (NODESET, SIDESET or BLOCKSET and more)
466 */
467 inline CubitMeshsetByType::iterator
468 getBegin(const unsigned int cubit_bc_type) const {
469 return cubitMeshsets.get<CubitMeshsetType_mi_tag>().lower_bound(
470 cubit_bc_type);
471 }
472
473 /**
474 * \brief get begin iterator of cubit meshset of given type (instead you can
475 use _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MFIELD,CUBITBCTYPE,IT)
476 * \ingroup mofem_meshset_mng
477
478 *
479 *
480 for(_IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(mField,NODESET|DISPLACEMENTSET,it)
481 {
482 * ...
483 * }
484 *
485 * \param type of meshset (NODESET, SIDESET or BLOCKSET and more)
486 */
487 inline CubitMeshsetByType::iterator
488 getEnd(const unsigned int cubit_bc_type) const {
489 return cubitMeshsets.get<CubitMeshsetType_mi_tag>().upper_bound(
490 cubit_bc_type);
491 }
492
493 /**
494 * \brief get end iterator of cubit meshset of given type (instead you can
495 use _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MFIELD,CUBITBCTYPE,IT)
496 * \ingroup mofem_meshset_mng
497
498 *
499 * for(_IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(mField,NODESET,it) {
500 * ...
501 * }
502 *
503 * \param type of meshset (NODESET, SIDESET or BLOCKSET and more)
504 */
505 inline CubitMeshsetByMask::iterator
506 getBySetTypeBegin(const unsigned int cubit_bc_type) const {
507 return cubitMeshsets.get<CubitMeshsetMaskedType_mi_tag>().lower_bound(
508 cubit_bc_type);
509 }
510
511 /**
512 * \brief get end iterator of cubit meshset of given type (instead you can
513 use _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MFIELD,CUBITBCTYPE,IT)
514 * \ingroup mofem_meshset_mng
515
516 *
517 * for(_IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(mField,NODESET,it) {
518 * ...
519 * }
520 *
521 * \param type of meshset (NODESET, SIDESET or BLOCKSET and more)
522 */
523 inline CubitMeshsetByMask::iterator
524 getBySetTypeEnd(const unsigned int cubit_bc_type) const {
525 return cubitMeshsets.get<CubitMeshsetMaskedType_mi_tag>().upper_bound(
526 cubit_bc_type);
527 }
528
529 /**
530 * \brief get begin iterator of cubit meshset of given type (instead you can
531 use _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(MFIELD,CUBITBCTYPE,IT)
532 * \ingroup mofem_meshset_mng
533
534 *
535 *
536 for(_IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(mField,NODESET|DISPLACEMENTSET,it)
537 {
538 * ...
539 * }
540 *
541 * \param type of meshset (NODESET, SIDESET or BLOCKSET and more)
542 */
543 inline CubitMeshsetByName::iterator getBegin(const std::string &name) const {
544 return cubitMeshsets.get<CubitMeshsets_name>().lower_bound(name);
545 }
546
547 /**
548 * \brief get begin iterator of cubit meshset of given type (instead you can
549 use _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(MFIELD,CUBITBCTYPE,IT)
550 * \ingroup mofem_meshset_mng
551
552 *
553 *
554 for(_IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(mField,NODESET|DISPLACEMENTSET,it)
555 {
556 * ...
557 * }
558 *
559 * \param type of meshset (NODESET, SIDESET or BLOCKSET and more)
560 */
561 inline CubitMeshsetByName::iterator getEnd(const std::string &name) const {
562 return cubitMeshsets.get<CubitMeshsets_name>().upper_bound(name);
563 }
564
565 /**
566 * \brief Check for CUBIT meshset by ID and type
567 * \ingroup mofem_meshset_mng
568 *
569 * Verifies if a meshset with the specified CUBIT ID and type exists
570 * in the manager's database. Useful for validation before accessing
571 * meshset properties or entities.
572 *
573 * \todo All cubit interface functions should be outsourced to dedicated
574 * interface
575 *
576 * @param ms_id CUBIT ID of the meshset (BLOCKSET/SIDESET/NODESET)
577 * @param cubit_bc_type type of meshset (NODESET, SIDESET, BLOCKSET, etc.)
578 * @return bool true if meshset exists, false otherwise
579 */
580 bool checkMeshset(const int ms_id, const CubitBCType cubit_bc_type) const;
581
582 /**
583 * \brief Check if meshset with given name exists
584 * \ingroup mofem_meshset_mng
585 *
586 * Searches for meshsets by name and optionally returns the count of
587 * matching meshsets. Multiple meshsets can have the same name.
588 *
589 * @param name name of the meshset to search for
590 * @param number_of_meshsets_ptr optional pointer to store count of matching meshsets
591 * @return bool true if at least one meshset with the name exists, false otherwise
592 */
593 bool checkMeshset(const string name,
594 int *const number_of_meshsets_ptr = NULL) const;
595
596 /**
597 * \brief Add CUBIT meshset to manager
598 * \ingroup mofem_meshset_mng
599 *
600 * Creates a new meshset entry in the manager's database with the specified
601 * CUBIT type and ID. The meshset can be given an optional name for easier
602 * identification and access.
603 *
604 * @param cubit_bc_type type of meshset (NODESET, SIDESET, BLOCKSET, etc.)
605 * @param ms_id CUBIT ID for the meshset
606 * @param name optional name for the meshset (empty string if not specified)
607 * @return MoFEMErrorCode Error code indicating success or failure
608 */
609 MoFEMErrorCode addMeshset(const CubitBCType cubit_bc_type, const int ms_id,
610 const std::string name = "");
611
612 /**
613 * \brief Add entities to CUBIT meshset
614 * \ingroup mofem_meshset_mng
615 *
616 * Adds a range of mesh entities to an existing meshset. The entities
617 * become part of the meshset for subsequent operations like applying
618 * boundary conditions or material properties.
619 *
620 * @param cubit_bc_type type of meshset (NODESET, SIDESET, BLOCKSET, etc.)
621 * @param ms_id CUBIT ID of the target meshset
622 * @param ents range of entities to add to the meshset
623 * @return MoFEMErrorCode Error code indicating success or failure
624 */
626 const int ms_id, const Range &ents);
627
628 /**
629 * \brief Add entities to CUBIT meshset (array version)
630 * \ingroup mofem_meshset_mng
631 *
632 * Adds an array of mesh entities to an existing meshset. This version
633 * accepts entities as a C-style array with explicit count.
634 *
635 * @param cubit_bc_type type of meshset (NODESET, SIDESET, BLOCKSET, etc.)
636 * @param ms_id CUBIT ID of the target meshset
637 * @param ents pointer to array of entity handles
638 * @param nb_ents number of entities in the array
639 * @return MoFEMErrorCode Error code indicating success or failure
640 */
642 const int ms_id, const EntityHandle *ents,
643 const int nb_ents);
644
645 /**
646 * \brief Set attributes for CUBIT meshset
647 * \ingroup mofem_meshset_mng
648 *
649 * Assigns attribute values to a meshset. Attributes are typically used
650 * for material properties or other numerical parameters associated with
651 * the meshset entities.
652 *
653 * @param cubit_bc_type type of meshset (BLOCKSET, NODESET, SIDESET, etc.)
654 * @param ms_id CUBIT ID of the target meshset
655 * @param attributes vector of attribute values to assign
656 * @param name optional name to assign to the meshset
657 * @return MoFEMErrorCode Error code indicating success or failure
658 */
659 MoFEMErrorCode setAttributes(const CubitBCType cubit_bc_type, const int ms_id,
660 const std::vector<double> &attributes,
661 const std::string name = "");
662
663 DEPRECATED inline auto setAtributes(const CubitBCType cubit_bc_type,
664 const int ms_id,
665 const std::vector<double> &attributes,
666 const std::string name = "") {
667 return setAttributes(cubit_bc_type, ms_id,
668 std::vector<double>(attributes), name);
669 }
670
671 /**
672 * \brief Set attributes using data structure
673 * \ingroup mofem_meshset_mng
674 *
675 * Assigns material or other attributes to a meshset using a structured
676 * data object. This provides a more organized way to handle complex
677 * attribute data with proper typing and validation.
678 *
679 * @param cubit_bc_type type of meshset (BLOCKSET, NODESET, SIDESET, etc.)
680 * @param ms_id CUBIT ID of the target meshset
681 * @param data structured data containing attribute information
682 * @param name optional name to assign to the meshset
683 * @return MoFEMErrorCode Error code indicating success or failure
684 */
686 const int ms_id,
687 const GenericAttributeData &data,
688 const std::string name = "");
689
691 const CubitBCType cubit_bc_type, const int ms_id,
692 const GenericAttributeData &data, const std::string name = "") {
693 return setAttributesByDataStructure(cubit_bc_type, ms_id, data, name);
694 }
695
696
697 /**
698 * \brief Set boundary condition data for meshset
699 * \ingroup mofem_meshset_mng
700 *
701 * Assigns boundary condition data to a meshset. This includes constraint
702 * information, prescribed values, and application flags for various
703 * boundary condition types (displacement, force, pressure, etc.).
704 *
705 * @param cubit_bc_type type of meshset (BLOCKSET, NODESET, SIDESET, etc.)
706 * @param ms_id CUBIT ID of the target meshset
707 * @param data boundary condition data structure
708 * @return MoFEMErrorCode Error code indicating success or failure
709 */
710 MoFEMErrorCode setBcData(const CubitBCType cubit_bc_type, const int ms_id,
711 const GenericCubitBcData &data);
712
713 /**
714 * \brief delete cubit meshset
715 * \ingroup mofem_bc
716
717 *
718 * \param see CubitBC (NODESET, SIDESET or BLOCKSET and more)
719 * \param ms_id id of the BLOCKSET/SIDESET/BLOCKSET: from CUBIT
720 *
721 */
722 MoFEMErrorCode deleteMeshset(const CubitBCType cubit_bc_type, const int ms_id,
723 const MoFEMTypes bh = MF_EXIST);
724
725 /**
726 * \brief get cubit meshset
727 * \ingroup mofem_meshset_mng
728 *
729 *
730 */
732 getCubitMeshsetPtr(const int ms_id, const CubitBCType cubit_bc_type,
733 const CubitMeshSets **cubit_meshset_ptr) const;
734
735 /**
736 * \brief get cubit meshset
737 * \ingroup mofem_meshset_mng
738 *
739 *
740 */
741 const CubitMeshSets *
742 getCubitMeshsetPtr(const int ms_id, const CubitBCType cubit_bc_type) const;
743
744 /**
745 * @brief Get vector of pointer by bc type
746 *
747 * \ingroup mofem_meshset_mng
748 *
749 * @param std::vector<const CubitMeshSets *>
750 * @return MoFEMErrorCode
751 */
753 getCubitMeshsetPtr(const CubitBCType cubit_bc_type,
754 std::vector<const CubitMeshSets *> &vec_ptr) const;
755
756/**
757 * @brief Get vector of pointer by bc type
758 *
759 * \ingroup mofem_meshset_mng
760 *
761 * @return MoFEMErrorCode
762 */
763 std::vector<const CubitMeshSets *>
764 getCubitMeshsetPtr(const CubitBCType cubit_bc_type) const;
765
766 /**
767 * \brief get cubit meshset
768 *
769 * \ingroup mofem_meshset_mng
770 */
772 getCubitMeshsetPtr(const string name,
773 const CubitMeshSets **cubit_meshset_ptr) const;
774
775 /**
776 * @brief Get vector of pointer to blocksets with name satisfying regular
777 * expression.
778 *
779 * \ingroup mofem_meshset_mng
780 *
781 * @param reg_exp_name
782 * @param std::vector<const CubitMeshSets *>
783 * @return MoFEMErrorCode
784 */
786 getCubitMeshsetPtr(const std::regex reg_exp_name,
787 std::vector<const CubitMeshSets *> &vec_ptr) const;
788
789 /**
790 * @brief Get vector of pointer to blocksets with name satisfying regular
791 * expression.
792 *
793 * \ingroup mofem_meshset_mng
794 *
795 * \code
796 for (auto m :
797 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(std::regex(
798
799 (boost::format("%s(.*)") % block_name).str()
800
801 ))
802
803 ) {
804 MOFEM_LOG("WORLD", Sev::inform) << m->getName();
805
806 Range ents;
807 m_field.get_moab().get_entities_by_dimension(
808 m->getMeshset(), 0, ents, false);
809
810 auto print_ents = [](boost::shared_ptr<FieldEntity> ent_ptr) {
811 MoFEMFunctionBegin;
812 if(!(ent_ptr->getPStatus() & PSTATUS_NOT_OWNED)) {
813 MOFEM_LOG("SYNC", Sev::inform) << ent_ptr->getName() << ": " <<
814 ent_ptr->getEntFieldData();
815 }
816 MoFEMFunctionReturn(0);
817 };
818
819 CHKERR m_field.getInterface<FieldBlas>()->fieldLambdaOnEntities(
820 print_ents, "VELOCITIES", &ents);
821 CHKERR m_field.getInterface<FieldBlas>()->fieldLambdaOnEntities(
822 print_ents, "DISPLACEMENTS", &ents);
823 MOFEM_LOG_SEVERITY_SYNC(m_field.get_comm(), Sev::ifrom);
824 }
825 * \endcode
826 *
827 * @param reg_exp_name
828 * @return std::vector<const CubitMeshSets *>
829 */
830 std::vector<const CubitMeshSets *>
831 getCubitMeshsetPtr(const std::regex reg_exp_name) const;
832
833 /**
834 * \brief get entities from CUBIT/meshset of a particular entity dimension
835 * \ingroup mofem_meshset_mng
836
837 * Nodeset can contain nodes, edges, triangles and tets. This applies to
838 other meshsets too.
839 * The nodeset's meshset contain the nodes in the MIDDLE of the surface or
840 volume which is done by default in Cubit,
841 * Hence if all nodes on a particular nodeset are required,
842 * one should get all triangles or tetrahedrons for which the nodeset was
843 create in Cubit,
844 * and get all the connectivities of tris/tets.
845
846 * \param ms_id id of the BLOCKSET/SIDESET/BLOCKSET: from CUBIT
847 * \param see CubitBC (NODESET, SIDESET or BLOCKSET and more)
848 * \param dimensions (0 - Nodes, 1 - Edges, 2 - Faces, 3 -
849 Volume(tetrahedral))
850 * \param Range containing the retrieved entities
851 * \param recursive If true, meshsets containing meshsets are queried
852 recursively. Returns the contents of meshsets, but not the meshsets
853 themselves if true.
854 */
856 const unsigned int cubit_bc_type,
857 const int dimension, Range &entities,
858 const bool recursive = true) const;
859
860 /**
861 * \brief get entities related to CUBIT/meshset,
862 * \ingroup mofem_meshset_mng
863
864 * NODESET will get Vertices only, even if the NODESET contains edges, tris
865 and tets
866 * SIDESET will get Tris, BLOCKSET will get Tets, DISPLACEMENTSET and
867 FORCESET are stored in NODESET, PRESSURESET is stored in Sideset.
868
869 * \param ms_id id of the BLOCKSET/SIDESET/BLOCKSET: from CUBIT
870 * \param see CubitBC (NODESET, SIDESET or BLOCKSET and more)
871 * \param Range containing the retrieved entities related to the
872 * \param recursive If true, meshsets containing meshsets are queried
873 recursively. Returns the contents of meshsets, but not the meshsets
874 themselves if true.
875 */
877 const unsigned int cubit_bc_type,
878 Range &entities,
879 const bool recursive = true) const;
880
881 /**
882 * \ingroup mofem_meshset_mng
883 * \brief get meshset from CUBIT Id and CUBIT type
884 *
885 * \param ms_id id of the BLOCKSET/SIDESET/BLOCKSET: from CUBIT
886 * \param see CubitBC (NODESET, SIDESET or BLOCKSET and more)
887 * \param meshset where to store the retrieved entities
888 */
889 MoFEMErrorCode getMeshset(const int ms_id, const unsigned int cubit_bc_type,
890 EntityHandle &meshset) const;
891
892 /**
893 * @brief Check if meshset constains entities
894 *
895 * @param ms_id
896 * @param cubit_bc_type
897 * @param entities
898 * @param num_entities
899 * @param operation_type
900 * @return true
901 * @return false
902 */
904 const int ms_id, const unsigned int cubit_bc_type,
905 const EntityHandle *entities, int num_entities,
906 const int operation_type = moab::Interface::INTERSECT);
907
908 /**
909 * \ingroup mofem_meshset_mng
910 * \brief get all CUBIT meshsets by CUBIT type
911 *
912 * \param see CubitBC (NODESET, SIDESET or BLOCKSET and more).
913 * \param meshsets is range of meshsets
914 */
915 MoFEMErrorCode getMeshsetsByType(const unsigned int cubit_bc_type,
916 Range &meshsets) const;
917
918 /**
919 * \brief add blocksets reading config file
920
921 Example of config file
922 \code
923
924 [block_1001]
925
926 # Example applying attributes to blockset
927
928 id=2001
929 add=BLOCKSET
930 user1=1.0 # attribute value 1
931 user2=2.0 # you can set up to 10 attributes (if needed could be easily
932 extended to more, let us know)
933 user3=3.0
934
935 [block_1002]
936
937 # Example applying material block (isotropic elastic material)
938
939 id=2002
940 add=BLOCKSET
941 name=MAT_ELASTIC
942 young=10
943 poisson=0.25
944 thermalexpansion=0
945
946 [block_1003]
947
948 # Example applying displacement constrains
949
950 id=2003
951 add=NODESET
952
953 # Each flag means that boundary consition on displacements is set.
954 disp_flag1=1 # Setting constrains in x- direction
955 disp_flag2=1 # Setting constrains in y- direction
956 disp_flag3=1 # Setting constrains in z- direction
957 disp_flag4=1 # Setting constrains on rotation over x- axis
958 disp_flag5=1 # Setting constrains on rotation over y- axis
959 disp_flag6=1 # Setting constrains on rotation over z-axis
960 disp_ux=1 # value of disp in x- direction
961 disp_uy=2
962 disp_uz=3
963 disp_rx=4 # value of rotation in y-direction
964 disp_ry=5
965 disp_rz=6
966
967 # Note above values could be interpreted differently if needed.
968
969 [block_1004]
970
971 # Example applying force boundary conditions
972
973 id=2004
974 add=NODESET
975 force_magnitude=1
976 moment_magnitude=1
977 force_fx=1
978 force_fy=1
979 force_fz=1
980 moment_mx=1
981 moment_my=1
982 moment_mz=1
983
984 [block_1005]
985
986 # Example applying pressure boundary conditions
987
988 id=2005
989 add=SIDESET
990 pressure_flag2=1 # 0: Pressure is interpreted as pure pressure 1:
991 pressure is interpreted as total force
992 pressure_magnitude=1
993
994 # Example applying temperature boundary conditions
995
996 [block_1006]
997
998 id=2006
999 add=NODESET
1000 temperature_flag1=1 # 0: N/A, 1: temperature value applied
1001 temperature_t=1
1002
1003 [block_1007]
1004
1005 id=2007
1006 add=SIDESET
1007 heatflux_flag1=1 # 0: N/A, 1: heat flux applied
1008 heatflux_magnitude=1
1009
1010 [block_1008]
1011
1012 # Example applying material block (isotropic thermal material)
1013
1014 id=2008
1015 add=BLOCKSET
1016 name=MAT_THERMAL # Hast to be set for Thermal Mat
1017 conductivity=1
1018 capacity=1
1019
1020 [block_1009]
1021
1022 # Example applying interface
1023 id=2009
1024 add=SIDESET
1025 interface_type=1
1026
1027 [block_1010]
1028
1029 # Example applying material block for interface element
1030
1031 id=2010
1032 add=BLOCKSET
1033 name=MAT_INTERF
1034 interface_alpha = 1
1035 interface_beta = 0
1036 interface_ft = 1
1037 interface_Gf = 1
1038
1039
1040 [block_1009]
1041
1042 # Example applying material block (isotropic trans iso material)
1043
1044 id=2011
1045 add=BLOCKSET
1046 name=MAT_ELASTIC_TRANS_ISO
1047 Youngp=1
1048 Youngz=2
1049 Poissonp=3
1050 Poissonpz=4
1051 Shearzp=5
1052
1053 [SET_ATTR_foo]
1054
1055 # Example set atttributes to block name "foo"
1056 number_of_attributes=3
1057 user1=1
1058 user2=2
1059 user3=3
1060
1061 \endcode
1062
1063 * @param file_name path to configuration file containing meshset definitions
1064 * @param clean_file_options whether to clean existing file options before loading
1065 * @return MoFEMErrorCode Error code indicating success or failure
1066 */
1067 MoFEMErrorCode setMeshsetFromFile(const string file_name,
1068 const bool clean_file_options = true);
1069
1070 /**
1071 * \brief Load meshset configuration from command line specified file
1072 * \ingroup mofem_meshset_mng
1073 *
1074 * Reads the configuration file name from the command line option
1075 * '-meshsets_config' and loads meshset definitions from that file.
1076 * This provides a convenient way to specify meshset configurations
1077 * at runtime without hardcoding file paths.
1078 *
1079 * Command line usage: -meshsets_config filename.cfg
1080 *
1081 * @return MoFEMErrorCode Error code indicating success or failure
1082 */
1084
1085 /**
1086 * @brief save cubit meshset entities on the moab mesh
1087 *
1088 * @param ms_id id of the cubit meshset (NODESET SIDESET BLOCKSET)
1089 * @param cubit_bc_type type of a cubit mesheset
1090 * @param file_name optional name for the file
1091 * @param file_type optional file type for moab (VTK MOAB)
1092 * @param options optional parameters for moab writer (PARALLEL=WRITE_PART)
1093 * @return MoFEMErrorCode
1094 */
1096 saveMeshsetToFile(const int ms_id, const unsigned int cubit_bc_type,
1097 const std::string file_name = "out_meshset.vtk",
1098 const std::string file_type = "VTK",
1099 const std::string options = "") const;
1100
1101 /**
1102 * @brief save cubit meshset entities on the moab mesh
1103 *
1104 * @param ms_id id of the cubit meshset
1105 * @param cubit_bc_type type of a cubit mesheset (NODESET SIDESET BLOCKSET)
1106 * @param dim dimension of the entities
1107 * @param file_name optional name for the file
1108 * @param file_type optional file type for moab (VTK MOAB)
1109 * @param options optional parameters for moab writer (PARALLEL=WRITE_PART)
1110 * @return MoFEMErrorCode
1111 */
1113 const int ms_id, const unsigned int cubit_bc_type, const int dim,
1114 const std::string file_name = "out_meshset.vtk",
1115 const bool recursive = false, const std::string file_type = "VTK",
1116 const std::string options = "") const;
1117
1118 /**
1119 * \brief Get config file options, use with care
1120 * @return error code
1121 */
1122 inline boost::shared_ptr<boost::program_options::options_description> &
1126
1127 /**
1128 * @brief Update all blocksets, sidesets and node sets
1129 *
1130 * @param bit
1131 * @return MoFEMErrorCode
1132 */
1134
1135 static bool broadcastMeshsetsOn; ///< if true meshsets are synchronised
1136 ///< between processors
1137
1138 static void sortMeshsets(std::vector<const CubitMeshSets *> &vec_ptr);
1139
1140protected:
1147
1148 // cubit
1150 boost::shared_ptr<boost::program_options::options_description>
1151 configFileOptionsPtr; ///< config file options
1152
1153};
1154
1155template <class CUBIT_BC_DATA_TYPE>
1157 unsigned long int type) const {
1159 const MoFEM::Interface &m_field = cOre;
1160 const moab::Interface &moab = m_field.get_moab();
1161 for (auto it : getCubitMeshsetPtr(type)) {
1162 CHKERR it->getBcDataStructure(data);
1163 MOFEM_LOG("MeshsetMngWorld", Sev::inform) << *it;
1164 MOFEM_LOG("MeshsetMngWorld", Sev::inform) << data;
1165 MOFEM_LOG("MeshsetMngWorld", Sev::inform) << "name " << it->getName();
1166 for (EntityType t = MBVERTEX; t != MBENTITYSET; ++t) {
1167 int nb;
1168 CHKERR moab.get_number_entities_by_type(it->meshset, t, nb, true);
1169 if (nb > 0) {
1170 MOFEM_LOG("MeshsetMngSync", Sev::inform)
1171 << "msId " << it->getMeshsetId() << " number of "
1172 << moab::CN::EntityTypeName(t) << " " << nb;
1173 }
1174 }
1175 MOFEM_LOG_SEVERITY_SYNC(m_field.get_comm(), Sev::inform);
1176 }
1178}
1179
1180} // namespace MoFEM
1181
1182#endif //__MESHSETSMANAGER_HPP__
1183
1184/**
1185 * \defgroup mofem_meshset_mng MeshsetsManager
1186 * \brief Interface for meshsets with entities with data and boundary conditions
1187 *
1188 * \ingroup mofem
1189 **/
#define MOFEM_LOG_SEVERITY_SYNC(comm, severity)
Synchronise "SYNC" on curtain severity level.
@ DEFAULT_VERBOSITY
MoFEMTypes
Those types control how functions respond on arguments, f.e. error handling.
@ MF_EXIST
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define DEPRECATED
Definition definitions.h:17
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
MoFEMErrorCode deleteMeshset(const CubitBCType cubit_bc_type, const int ms_id, const MoFEMTypes bh=MF_EXIST)
delete cubit meshset
#define MOFEM_LOG(channel, severity)
Log.
MoFEMErrorCode printForceSet() const
Print meshsets with force boundary conditions.
CubitMeshsetByType::iterator getEnd(const unsigned int cubit_bc_type) const
get begin iterator of cubit meshset of given type (instead you can use IT_CUBITMESHSETS_BY_BCDATA_TYP...
CubitMeshsetByName::iterator getEnd(const std::string &name) const
get begin iterator of cubit meshset of given type (instead you can use IT_CUBITMESHSETS_BY_SET_TYPE_F...
MoFEMErrorCode getMeshset(const int ms_id, const unsigned int cubit_bc_type, EntityHandle &meshset) const
get meshset from CUBIT Id and CUBIT type
MoFEMErrorCode setBcData(const CubitBCType cubit_bc_type, const int ms_id, const GenericCubitBcData &data)
Set boundary condition data for meshset.
MoFEMErrorCode broadcastMeshsets(int verb=DEFAULT_VERBOSITY)
Broadcast meshsets across MPI processes.
MoFEMErrorCode initialiseDatabaseFromMesh(int verb=DEFAULT_VERBOSITY)
Initialize container from mesh data.
MoFEMErrorCode clearMap()
Clear the multi-index container.
MoFEMErrorCode setAttributes(const CubitBCType cubit_bc_type, const int ms_id, const std::vector< double > &attributes, const std::string name="")
Set attributes for CUBIT meshset.
MoFEMErrorCode addEntitiesToMeshset(const CubitBCType cubit_bc_type, const int ms_id, const Range &ents)
Add entities to CUBIT meshset.
bool checkMeshset(const int ms_id, const CubitBCType cubit_bc_type) const
Check for CUBIT meshset by ID and type.
CubitMeshSet_multiIndex::iterator getBegin() const
get begin iterator of cubit meshset of given type (instead you can use IT_CUBITMESHSETS_TYPE_FOR_LOOP...
MoFEMErrorCode printPressureSet() const
Print meshsets with pressure boundary conditions.
MoFEMErrorCode printMaterialsSet() const
Print meshsets with material properties.
CubitMeshsetByMask::iterator getBySetTypeEnd(const unsigned int cubit_bc_type) const
get end iterator of cubit meshset of given type (instead you can use IT_CUBITMESHSETS_BY_BCDATA_TYPE_...
MoFEMErrorCode setMeshsetFromFile()
Load meshset configuration from command line specified file.
MoFEMErrorCode addMeshset(const CubitBCType cubit_bc_type, const int ms_id, const std::string name="")
Add CUBIT meshset to manager.
CubitMeshsetByName::iterator getBegin(const std::string &name) const
get begin iterator of cubit meshset of given type (instead you can use IT_CUBITMESHSETS_BY_SET_TYPE_F...
MoFEMErrorCode getMeshsetsByType(const unsigned int cubit_bc_type, Range &meshsets) const
get all CUBIT meshsets by CUBIT type
MoFEMErrorCode getCubitMeshsetPtr(const int ms_id, const CubitBCType cubit_bc_type, const CubitMeshSets **cubit_meshset_ptr) const
get cubit meshset
CubitMeshsetByType::iterator getBegin(const unsigned int cubit_bc_type) const
get begin iterator of cubit meshset of given type (instead you can use IT_CUBITMESHSETS_BY_BCDATA_TYP...
MoFEMErrorCode getEntitiesByDimension(const int ms_id, const unsigned int cubit_bc_type, const int dimension, Range &entities, const bool recursive=true) const
get entities from CUBIT/meshset of a particular entity dimension
MoFEMErrorCode readMeshsets(int verb=DEFAULT_VERBOSITY)
Read meshsets from mesh database.
MoFEMErrorCode printHeatFluxSet() const
Print meshsets with heat flux boundary conditions.
MoFEMErrorCode printTemperatureSet() const
Print meshsets with temperature boundary conditions.
MoFEMErrorCode getTags(int verb=-1)
Get tag handles used on meshsets.
MoFEMErrorCode setAttributesByDataStructure(const CubitBCType cubit_bc_type, const int ms_id, const GenericAttributeData &data, const std::string name="")
Set attributes using data structure.
CubitMeshsetByMask::iterator getBySetTypeBegin(const unsigned int cubit_bc_type) const
get end iterator of cubit meshset of given type (instead you can use IT_CUBITMESHSETS_BY_BCDATA_TYPE_...
MoFEMErrorCode printDisplacementSet() const
Print meshsets with displacement boundary conditions.
CubitMeshSet_multiIndex::iterator getEnd() const
get begin iterator of cubit meshset of given type (instead you can use IT_CUBITMESHSETS_TYPE_FOR_LOOP...
auto bit
set bit
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
std::bitset< 32 > CubitBCType
Definition Types.hpp:52
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition Types.hpp:40
implementation of Data Operators for Forces and Sources
Definition Common.hpp:10
CubitMeshSet_multiIndex::index< CubitMeshsetType_mi_tag >::type CubitMeshsetById
CubitMeshSet_multiIndex::index< CubitMeshsetMaskedType_mi_tag >::type CubitMeshsetByMask
CubitMeshSet_multiIndex::index< CubitMeshsets_name >::type CubitMeshsetByName
multi_index_container< CubitMeshSets, indexed_by< hashed_unique< tag< Meshset_mi_tag >, member< CubitMeshSets, EntityHandle, &CubitMeshSets::meshset > >, ordered_non_unique< tag< CubitMeshsetType_mi_tag >, const_mem_fun< CubitMeshSets, unsigned long int, &CubitMeshSets::getBcTypeULong > >, ordered_non_unique< tag< CubitMeshsetMaskedType_mi_tag >, const_mem_fun< CubitMeshSets, unsigned long int, &CubitMeshSets::getMaskedBcTypeULong > >, ordered_non_unique< tag< CubitMeshsets_name >, const_mem_fun< CubitMeshSets, std::string, &CubitMeshSets::getName > >, hashed_unique< tag< Composite_Cubit_msId_And_MeshsetType_mi_tag >, composite_key< CubitMeshSets, const_mem_fun< CubitMeshSets, int, &CubitMeshSets::getMeshsetId >, const_mem_fun< CubitMeshSets, unsigned long int, &CubitMeshSets::getMaskedBcTypeULong > > > > > CubitMeshSet_multiIndex
Stores data about meshsets (see CubitMeshSets) storing data about boundary conditions,...
CubitMeshSet_multiIndex::index< CubitMeshsetType_mi_tag >::type CubitMeshsetByType
constexpr double t
plate stiffness
Definition plate.cpp:58
virtual moab::Interface & get_moab()=0
virtual MPI_Comm & get_comm() const =0
Core (interface) class.
Definition Core.hpp:82
this struct keeps basic methods for moab meshset about material and boundary conditions
MultiIndex Tag for field id.
Deprecated interface functions.
Generic attribute data structure.
Generic bc data structure.
Definition BCData.hpp:16
Interface for managing meshsets containing materials and boundary conditions.
MoFEMErrorCode saveMeshsetToFile(const int ms_id, const unsigned int cubit_bc_type, const std::string file_name="out_meshset.vtk", const std::string file_type="VTK", const std::string options="") const
save cubit meshset entities on the moab mesh
const MeshsetsManager * get_meshsets_manager_ptr() const
return pointer to meshset manager
Tag get_bhTag() const
get tag handle used to store "id" of BLOCKSET
DEPRECATED auto setAtributesByDataStructure(const CubitBCType cubit_bc_type, const int ms_id, const GenericAttributeData &data, const std::string name="")
MeshsetsManager * get_meshsets_manager_ptr()
return pointer to meshset manager
DEPRECATED auto setAtributes(const CubitBCType cubit_bc_type, const int ms_id, const std::vector< double > &attributes, const std::string name="")
bool checkIfMeshsetContainsEntities(const int ms_id, const unsigned int cubit_bc_type, const EntityHandle *entities, int num_entities, const int operation_type=moab::Interface::INTERSECT)
Check if meshset constains entities.
static void sortMeshsets(std::vector< const CubitMeshSets * > &vec_ptr)
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Query interface for MeshsetsManager.
MoFEMErrorCode updateAllMeshsetsByEntitiesChildren(const BitRefLevel &bit)
Update all blocksets, sidesets and node sets.
boost::shared_ptr< boost::program_options::options_description > & getConfigFileOptionsPtr()
Get config file options, use with care.
MoFEMErrorCode printBcSet(CUBIT_BC_DATA_TYPE &data, unsigned long int type) const
CubitMeshSet_multiIndex & getMeshsetsMultindex()
Tag get_bhTag_header() const
get tag handle used to store of block set header (Used by Cubit)
Tag get_nsTag() const
get tag handle used to store "id" of NODESET
Tag get_nsTag_data() const
get tag handle used to store boundary data on NODESET
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets
virtual ~MeshsetsManager()=default
Tag get_ssTag_data() const
get tag handle used to store boundary data on SIDESET
Tag get_ssTag() const
get tag handle used to store "id" of SIDESET
MoFEM::Core & cOre
Reference to MoFEM Core interface.
boost::shared_ptr< boost::program_options::options_description > configFileOptionsPtr
config file options
base class for all interface classes