v0.15.0
Loading...
Searching...
No Matches
BcManager.hpp
Go to the documentation of this file.
1/** \file BcManager.hpp
2 * \brief High-level boundary condition management interface
3 * \ingroup bc_manager
4 *
5 * The BcManager provides a high-level interface for applying boundary conditions
6 * to finite element problems, working in close integration with MeshsetsManager
7 * to bridge mesh-based boundary condition definitions with finite element
8 * implementations.
9 *
10 * \section bcm_integration MeshsetsManager Integration
11 *
12 * BcManager operates as the application layer above MeshsetsManager:
13 * - **Data Discovery**: MeshsetsManager discovers and organizes boundary condition
14 * meshsets from various mesh formats (CUBIT, Gmsh, Salome, etc.)
15 * - **DOF Management**: BcManager translates meshset information into DOF-level
16 * operations for finite element problem setup
17 * - **Type Safety**: Provides type-safe interfaces for different boundary condition
18 * types while maintaining format independence
19 * - **Problem Integration**: Handles DOF marking, removal, and Index Set creation
20 * for seamless integration with finite element solvers
21 *
22 * \section bcm_essential_natural Essential vs Natural Boundary Conditions
23 *
24 * BcManager supports both essential and natural boundary condition implementations:
25 *
26 * \subsection bcm_essential Essential Boundary Conditions (Dirichlet)
27 * - **Implementation**: Applied by removing constrained DOFs from the system
28 * - **DOF Removal**: `removeBlockDOFsOnEntities()` eliminates constrained DOFs
29 * - **System Modification**: Reduces system size by eliminating known DOFs
30 * - **Examples**: Fixed displacements, prescribed temperatures, velocity constraints
31 * - **Workflow**: Mark DOFs → Remove from system → Apply prescribed values
32 *
33 * \subsection bcm_natural Natural Boundary Conditions (Neumann)
34 * - **Implementation**: Applied through load vectors and surface integrals
35 * - **DOF Marking**: `pushMarkDOFsOnEntities()` identifies affected DOFs
36 * - **Entity Access**: Provides entity ranges for integration operations
37 * - **Examples**: Applied forces, pressure loads, heat flux, traction boundaries
38 * - **Workflow**: Mark DOFs → Integrate over boundaries → Add to load vector
39 *
40 * \section bcm_specializations Template Specializations
41 *
42 * BcManager uses template specializations to handle different boundary condition
43 * types and meshset configurations in a type-safe manner:
44 *
45 * \subsection bcm_meshset_types Meshset Type Specializations
46 * - **BcMeshsetType<DISPLACEMENTSET>**: Displacement boundary conditions on nodesets
47 * - **BcMeshsetType<FORCESET>**: Force boundary conditions on nodesets
48 * - **BcMeshsetType<TEMPERATURESET>**: Temperature boundary conditions on nodesets
49 * - **BcMeshsetType<HEATFLUXSET>**: Heat flux boundary conditions on sidesets
50 * - **BcMeshsetType<PRESSURESET>**: Pressure boundary conditions on sidesets
51 *
52 * \subsection bcm_block_specializations Block-Based Specializations
53 * - **BcDisplacementMeshsetType<BLOCKSET>**: Volume-based displacement constraints
54 * - **BcScalarMeshsetType<BLOCKSET>**: Volume-based scalar field constraints
55 * - **BcForceMeshsetType<BLOCKSET>**: Volume-based force application
56 * - **BcPressureMeshsetType<BLOCKSET>**: Volume-based pressure conditions
57 * - **BcNormalDisplacementMeshsetType<BLOCKSET>**: Normal displacement constraints
58 * - **BcAnalyticalDisplacementMeshsetType<BLOCKSET>**: Analytical displacement functions
59 * - **BcAnalyticalTractionMeshsetType<BLOCKSET>**: Analytical traction functions
60 *
61 * \subsection bcm_data_specializations Data Structure Specializations
62 * - **DisplacementCubitBcData**: CUBIT displacement boundary condition data
63 * - **TemperatureCubitBcData**: CUBIT temperature boundary condition data
64 * - **HeatFluxCubitBcData**: CUBIT heat flux boundary condition data
65 * - **ForceCubitBcData**: CUBIT force boundary condition data
66 * - **PressureCubitBcData**: CUBIT pressure boundary condition data
67 *
68 * \section bcm_specialization_purpose Purpose of Specializations
69 *
70 * \subsection bcm_type_safety Type Safety and Compile-Time Checking
71 *
72 * The template specialization system provides several critical benefits:
73 *
74 * **1. Geometric Entity Differentiation (NODESET vs SIDESET vs BLOCKSET):**
75 * - **NODESET (0D)**: Point-based boundary conditions applied to mesh vertices
76 * - Essential: Dirichlet constraints removing DOF degrees of freedom
77 * - Natural: Concentrated loads applied at specific points
78 * - **SIDESET (2D)**: Surface-based boundary conditions applied to mesh faces
79 * - Essential: Surface-distributed constraints (e.g., zero normal displacement)
80 * - Natural: Pressure loads, heat flux, traction forces requiring surface integration
81 * - **BLOCKSET (3D)**: Volume-based constraints and body forces applied to mesh regions
82 * - Essential: Domain-wide field constraints and material property assignments
83 * - Natural: Body forces, heat sources, manufacturing forces within volumes
84 *
85 * **2. Physics-Specific Type Safety:**
86 * - **DisplacementCubitBcData**: Vector fields with 3 spatial components (Ux, Uy, Uz)
87 * - **TemperatureCubitBcData**: Scalar field with single temperature value
88 * - **ForceCubitBcData**: Vector loading with force magnitude and direction
89 * - **PressureCubitBcData**: Scalar pressure with automatic normal direction calculation
90 * - **HeatFluxCubitBcData**: Scalar flux with surface orientation handling
91 *
92 * **3. Compile-Time Dispatch Benefits:**
93 * - Prevents runtime errors by catching type mismatches during compilation
94 * - Enables optimized code generation for each boundary condition type
95 * - Provides clear separation between essential (constraint) and natural (loading) operations
96 * - Allows physics-specific validation and error checking
97 *
98 * **4. Essential vs Natural BC Implementation Patterns:**
99 * ```cpp
100 * // Essential BC Pattern (DOF removal):
101 * bc_manager.removeBlockDOFsOnEntities<BcMeshsetType<DISPLACEMENTSET>>(
102 * "problem", "DISPLACEMENT", true, false, false);
103 *
104 * // Natural BC Pattern (DOF marking for integration):
105 * bc_manager.pushMarkDOFsOnEntities<BcMeshsetType<FORCESET>>(
106 * "problem", "DISPLACEMENT", true, false);
107 * ```
108 *
109 * **5. BLOCKSET Specializations for Advanced Physics:**
110 * - **Volume Constraints**: Entire material regions with uniform properties
111 * - **Body Forces**: Gravitational, centrifugal, or manufacturing loads
112 * - **Material Interfaces**: Coupling between different physics domains
113 * - **Analytical Functions**: Mathematical expressions for complex loading patterns
114 * - **Multi-Physics Coupling**: Temperature-dependent displacement constraints
115 *
116 * \subsection bcm_geometry_handling Geometry-Specific Handling
117 * - **NODESET Operations**: Point-based constraints and loads (0D entities)
118 * - **SIDESET Operations**: Surface-based conditions and fluxes (2D entities)
119 * - **BLOCKSET Operations**: Volume-based constraints and body forces (3D entities)
120 * - **Bridge Dimensions**: Proper handling of DOF-to-geometry associations
121 *
122 * \subsection bcm_physics_separation Physics-Specific Implementations
123 * - **Mechanical**: Displacement, force, pressure, traction boundary conditions
124 * - **Thermal**: Temperature and heat flux boundary conditions
125 * - **Multi-Physics**: Coupled boundary condition handling across physics domains
126 * - **Analytical**: Mathematical function-based boundary condition application
127 *
128 * \section bcm_workflow Typical Workflow
129 *
130 * 1. **Mesh Loading**: MeshsetsManager discovers boundary condition meshsets
131 * 2. **BC Detection**: BcManager identifies available boundary condition types
132 * 3. **Essential BCs**: Remove constrained DOFs using `removeBlockDOFsOnEntities()`
133 * 4. **Natural BCs**: Mark affected DOFs using `pushMarkDOFsOnEntities()`
134 *
135 */
136
137#ifndef __BCMANAGER_HPP__
138#define __BCMANAGER_HPP__
139
140#include "UnknownInterface.hpp"
141
142namespace MoFEM {
143
144/**
145 * \brief Template specialization system for type-safe boundary condition handling
146 * \ingroup bc_manager
147 *
148 * The following template structures provide compile-time type safety for different
149 * boundary condition types and meshset configurations. Each template specialization
150 * ensures that the correct handling logic is applied based on the boundary condition
151 * type and the geometric entity type (NODESET, SIDESET, BLOCKSET).
152 *
153 * \section template_overview Template System Overview
154 *
155 * The template system serves several critical purposes:
156 * - **Type Safety**: Prevents mixing incompatible boundary condition types
157 * - **Compile-Time Dispatch**: Selects appropriate implementation at compile time
158 * - **Code Organization**: Separates physics-specific and geometry-specific logic
159 * - **Interface Consistency**: Provides uniform interface across different BC types
160 */
161
162/**
163 * \brief Base template for general boundary condition meshset types
164 * \tparam BC CUBIT boundary condition type (DISPLACEMENTSET, FORCESET, etc.)
165 *
166 * This is the primary template for handling boundary conditions defined on
167 * traditional CUBIT meshset types (NODESET, SIDESET). It provides the foundation
168 * for most standard boundary condition operations.
169 */
170template <CubitBC BC> struct BcMeshsetType {};
171
172/**
173 * \brief Template specialization for scalar field boundary conditions
174 * \tparam BC CUBIT boundary condition type for scalar fields
175 *
176 * Specialized handling for scalar field boundary conditions such as temperature,
177 * pressure, or other single-component field constraints. Provides optimized
178 * operations for scalar DOF manipulation.
179 */
180template <CubitBC BC> struct BcScalarMeshsetType {};
181
182/**
183 * \brief Type alias for temperature boundary conditions
184 * \tparam BC CUBIT boundary condition type for temperature
185 *
186 * Convenience alias that maps temperature boundary conditions to the scalar
187 * meshset type specialization, providing a more intuitive interface for
188 * thermal analysis applications.
189 */
190template <CubitBC BC> using BcTemperature = BcScalarMeshsetType<BC>;
191
192/**
193 * \brief Template specialization for displacement boundary conditions
194 * \tparam BC CUBIT boundary condition type for displacements
195 *
196 * Specialized handling for vector displacement boundary conditions, including
197 * support for partial constraints (e.g., fixing only x-direction) and
198 * multi-component displacement fields.
199 */
200template <CubitBC BC> struct BcDisplacementMeshsetType {};
201
202/**
203 * \brief Template specialization for force boundary conditions
204 * \tparam BC CUBIT boundary condition type for forces
205 *
206 * Handles vector force boundary conditions including concentrated forces,
207 * distributed loads, and moment applications. Supports both nodal and
208 * surface-based force applications.
209 */
210template <CubitBC BC> struct BcForceMeshsetType {};
211
212/**
213 * \brief Template specialization for flux boundary conditions
214 * \tparam BC CUBIT boundary condition type for fluxes
215 *
216 * Specialized for flux-type boundary conditions such as heat flux, mass flux,
217 * or other transport phenomena. Typically applied to surface entities
218 * (SIDESET) with appropriate integration procedures.
219 */
220template <CubitBC BC> struct BcFluxMeshsetType {};
221
222/**
223 * \brief Template specialization for normal displacement constraints
224 * \tparam BC CUBIT boundary condition type for normal displacements
225 *
226 * Handles boundary conditions that constrain motion normal to a surface.
227 * Common in contact mechanics, symmetry conditions, and sliding boundary
228 * implementations.
229 */
230template <CubitBC BC> struct BcNormalDisplacementMeshsetType {};
231
232/**
233 * \brief Template specialization for analytical displacement functions
234 * \tparam BC CUBIT boundary condition type for analytical displacements
235 *
236 * Supports boundary conditions defined by mathematical functions rather than
237 * discrete values. Useful for exact solutions, manufactured solutions, and
238 * complex time-dependent boundary conditions.
239 */
240template <CubitBC BC> struct BcAnalyticalDisplacementMeshsetType {};
241
242/**
243 * \brief Template specialization for analytical traction functions
244 * \tparam BC CUBIT boundary condition type for analytical tractions
245 *
246 * Handles traction boundary conditions defined by mathematical functions.
247 * Enables complex loading patterns and time-dependent surface tractions
248 * through analytical expressions.
249 */
250template <CubitBC BC> struct BcAnalyticalTractionMeshsetType {};
251
252/**
253 * \brief Template specialization for pressure boundary conditions
254 * \tparam BC CUBIT boundary condition type for pressure
255 *
256 * Specialized handling for pressure loads applied to surfaces. Includes
257 * support for both uniform and spatially-varying pressure distributions,
258 * with proper normal vector calculations for surface integration.
259 */
260template <CubitBC BC> struct BcPressureMeshsetType {};
261
262/**
263 * \brief Boundary condition manager for finite element problem setup
264 * \ingroup mofem_simple_interface
265 *
266 * The BcManager provides a high-level, type-safe interface for applying boundary
267 * conditions to finite element problems. It serves as the bridge between MeshsetsManager's
268 * mesh-based boundary condition discovery and the actual implementation of Essential
269 * and Natural boundary conditions in finite element computations.
270 *
271 * \section bcm_meshsets_connection Connection to MeshsetsManager
272 *
273 * BcManager operates as the application layer above MeshsetsManager:
274 *
275 * **Data Flow Architecture:**
276 * 1. **MeshsetsManager**: Discovers and organizes meshsets from mesh files
277 * 2. **BcManager**: Translates meshset data into DOF-level operations
278 * 3. **Essential/Natural BC Classes**: Use BcManager data for implementation
279 *
280 * **Information Transfer:**
281 * - **Meshset Discovery**: MeshsetsManager finds boundary condition meshsets
282 * - **Entity Extraction**: BcManager gets entity ranges from meshsets
283 * - **DOF Identification**: BcManager maps entities to specific DOFs
284 * - **Constraint Application**: Essential/Natural BC classes apply constraints
285 *
286 * \section bcm_essential_natural Essential and Natural BC Implementation
287 *
288 * BcManager provides the foundation for both Essential and Natural boundary condition
289 * implementations through different operational modes:
290 *
291 * \subsection bcm_essential_implementation Essential Boundary Conditions (Dirichlet)
292 *
293 * **Implementation Strategy**: Remove constrained DOFs from the finite element system
294 *
295 * **BcManager Role:**
296 * - **DOF Identification**: `pushMarkDOFsOnEntities()` identifies constrained DOFs
297 * - **DOF Removal**: `removeBlockDOFsOnEntities()` eliminates DOFs from system
298 * - **Index Set Creation**: `getBlockIS()` creates PETSc IS for remaining DOFs
299 * - **Problem Modification**: Reduces system size by eliminating known DOFs
300 *
301 * **Typical Essential BC Workflow:**
302 * ```cpp
303 * // 1. Mark DOFs for boundary condition
304 * bc_manager.pushMarkDOFsOnEntities<DisplacementCubitBcData>(
305 * problem_name, field_name);
306 *
307 * // 2. Remove constrained DOFs from system
308 * bc_manager.removeBlockDOFsOnEntities<DisplacementCubitBcData>(
309 * problem_name, field_name);
310 *
311 * // 3. Apply prescribed values to eliminated DOFs
312 * // (handled by Essential BC implementation classes)
313 * ```
314 *
315 * **Examples**: Fixed displacements, prescribed temperatures, velocity constraints
316 *
317 * \subsection bcm_natural_implementation Natural Boundary Conditions (Neumann)
318 *
319 * **Implementation Strategy**: Apply through load vectors and boundary integrals
320 *
321 * **BcManager Role:**
322 * - **DOF Marking**: `pushMarkDOFsOnEntities()` identifies affected DOFs
323 * - **Entity Access**: `getBcStructure()` provides entity ranges for integration
324 * - **Marker Creation**: `getMergedBlocksMarker()` combines multiple BC regions
325 * - **Integration Support**: Maintains DOFs in system for load application
326 *
327 * **Typical Natural BC Workflow:**
328 * ```cpp
329 * // 1. Mark DOFs affected by boundary condition
330 * bc_manager.pushMarkDOFsOnEntities<ForceCubitBcData>(
331 * problem_name, field_name);
332 *
333 * // 2. Get entity range for boundary integration
334 * auto bc_data = bc_manager.getBcStructure(block_name);
335 * auto entities = bc_data->getBcEntsPtr();
336 *
337 * // 3. Integrate over boundary entities
338 * // (handled by Natural BC implementation classes)
339 * ```
340 *
341 * **Examples**: Applied forces, pressure loads, heat flux, traction boundaries
342 *
343 * \section bcm_usage_with_implementations Usage with BC Implementation Classes
344 *
345 * Essential and Natural BC implementation classes use BcManager as their data source:
346 *
347 * **Essential BC Classes Usage:**
348 * - Obtain constrained DOF information from BcManager
349 * - Use DOF removal functionality to modify system matrices
350 * - Access prescribed values from CUBIT boundary condition data structures
351 * - Implement constraint enforcement through system modification
352 *
353 * **Natural BC Classes Usage:**
354 * - Obtain entity ranges for boundary integration from BcManager
355 * - Access load values from CUBIT boundary condition data structures
356 * - Implement load application through boundary element integration
357 * - Add contributions to global load vectors
358 *
359 * \section bcm_template_specializations Template Specialization System
360 *
361 * BcManager uses template specializations to provide type-safe, physics-specific
362 * boundary condition handling:
363 *
364 * **NODESET vs SIDESET vs BLOCKSET Specializations:**
365 * - **NODESET (0D)**: Point-based constraints and loads
366 * - **SIDESET (2D)**: Surface-based conditions and fluxes
367 * - **BLOCKSET (3D)**: Volume-based constraints and body forces
368 *
369 * **Physics-Specific Specializations:**
370 * - **Displacement**: Vector field constraints with component selection
371 * - **Temperature**: Scalar field constraints with thermal properties
372 * - **Force**: Vector loads with proper load transfer
373 * - **Pressure**: Normal surface loads with area integration
374 * - **Flux**: Surface flux conditions with normal projections
375 *
376 * Key capabilities:
377 * - Automatic DOF marking and removal for boundary conditions
378 * - Type-safe boundary condition handling through template specializations
379 * - Integration with CUBIT boundary condition data structures
380 * - Block-based boundary condition management with regex pattern matching
381 * - Index set generation for PETSc solver integration
382 * - Parallel boundary condition synchronization
383 */
385
386 /**
387 * \brief Query interface for BcManager
388 *
389 * @param type_index type index for the interface to query
390 * @param iface pointer to store the interface
391 * @return MoFEMErrorCode Error code indicating success or failure
392 */
393 MoFEMErrorCode query_interface(boost::typeindex::type_index type_index,
394 UnknownInterface **iface) const;
395
396 /**
397 * \brief Constructor for BcManager
398 *
399 * @param core reference to MoFEM Core interface for accessing mesh and field data
400 */
401 BcManager(const MoFEM::Core &core);
402 virtual ~BcManager() = default;
403
404 /**
405 * @brief Data structure storing boundary condition markers and attributes
406 * \ingroup mofem_simple_interface
407 *
408 * The BCs structure encapsulates all data associated with a boundary condition
409 * block, including entity ranges, DOF markers, attributes, and type-specific
410 * boundary condition data. It provides shared pointer access to component data
411 * for efficient memory management and integration with finite element operations.
412 */
413 struct BCs : boost::enable_shared_from_this<BCs> {
414 Range bcEnts; ///< Range of entities in the boundary condition block
415 std::vector<double> bcAttributes; ///< Numerical attributes (material properties, etc.)
416 std::vector<unsigned char> bcMarkers; ///< DOF markers for boundary condition application
417
418 using DofsView = std::vector<boost::weak_ptr<NumeredDofEntity>>;
419 boost::shared_ptr<DofsView> dofsViewPtr; ///< View of DOFs associated with boundary condition
420
421 boost::shared_ptr<DisplacementCubitBcData> dispBcPtr; ///< Displacement boundary condition data
422 boost::shared_ptr<TemperatureCubitBcData> tempBcPtr; ///< Temperature boundary condition data
423 boost::shared_ptr<HeatFluxCubitBcData> heatFluxBcPtr; ///< Heat flux boundary condition data
424 boost::shared_ptr<ForceCubitBcData> forceBcPtr; ///< Force boundary condition data
425 boost::shared_ptr<PressureCubitBcData> pressureBcPtr; ///< Pressure boundary condition data
426
427 /**
428 * \deprecated Use getBcEntsPtr() instead
429 * \brief Get shared pointer to boundary condition entities
430 * @return boost::shared_ptr<Range> Shared pointer to entity range
431 */
432 DEPRECATED inline auto getBcEdgesPtr() {
433 return boost::shared_ptr<Range>(shared_from_this(), &bcEnts);
434 }
435
436 /**
437 * \brief Get shared pointer to boundary condition entities
438 *
439 * Provides safe shared access to the entity range for the boundary condition.
440 * The shared pointer ensures proper lifetime management when the entity range
441 * is used across different parts of the application.
442 *
443 * @return boost::shared_ptr<Range> Shared pointer to entity range
444 */
445 inline auto getBcEntsPtr() {
446 return boost::shared_ptr<Range>(shared_from_this(), &bcEnts);
447 }
448
449 /**
450 * \brief Get shared pointer to boundary condition markers
451 *
452 * Provides safe shared access to the DOF marker vector. Markers are used
453 * to identify which DOFs should be constrained or modified by the boundary
454 * condition during finite element assembly and solving.
455 *
456 * @return boost::shared_ptr<std::vector<unsigned char>> Shared pointer to marker vector
457 */
458 inline auto getBcMarkersPtr() {
459 return boost::shared_ptr<std::vector<unsigned char>>(shared_from_this(),
460 &bcMarkers);
461 }
462 };
463
464 /**
465 * \brief Get command line options for BcManager
466 * \ingroup mofem_simple_interface
467 *
468 * Retrieves configuration options from command line arguments that control
469 * boundary condition processing behavior and integration settings.
470 *
471 * @return MoFEMErrorCode Error code indicating success or failure
472 */
474
475 /**
476 * @brief Mark DOFs on side entities for boundary conditions
477 * \ingroup mofem_simple_interface
478 *
479 * Marks DOFs associated with side entities (faces, edges) of a specified block
480 * for boundary condition application. This is commonly used for surface-based
481 * boundary conditions like pressure, traction, or flux conditions.
482 *
483 * @param problem_name name of the finite element problem
484 * @param block_name name of the boundary condition block/meshset
485 * @param field_name name of the field containing the DOFs
486 * @param bridge_dim dimension of bridge entities connecting DOFs to sides
487 * @param lo lowest coefficient (rank) to mark
488 * @param hi highest coefficient (rank) to mark
489 * @return MoFEMErrorCode Error code indicating success or failure
490 */
491 MoFEMErrorCode pushMarkSideDofs(const std::string problem_name,
492 const std::string block_name,
493 const std::string field_name, int bridge_dim,
494 int lo, int hi);
495
496 /**
497 * @brief Remove DOFs on side entities from problem
498 * \ingroup mofem_simple_interface
499 *
500 * Removes DOFs associated with side entities from the finite element problem.
501 * This is typically used to enforce boundary conditions by eliminating
502 * constrained DOFs from the solution system.
503 *
504 * @param problem_name name of the finite element problem
505 * @param block_name name of the boundary condition block/meshset
506 * @param field_name name of the field containing the DOFs
507 * @param bridge_dim dimension of bridge entities connecting DOFs to sides
508 * @param lo lowest coefficient (rank) to remove
509 * @param hi highest coefficient (rank) to remove
510 * @param is_distributed_mesh true if mesh is distributed across processes
511 * @return MoFEMErrorCode Error code indicating success or failure
512 */
513 MoFEMErrorCode removeSideDOFs(const std::string problem_name,
514 const std::string block_name,
515 const std::string field_name, int bridge_dim,
516 int lo, int hi,
517 bool is_distributed_mesh = true);
518
519 /**
520 * @brief Remove DOFs from problem based on block entities
521 * \ingroup mofem_simple_interface
522 *
523 * Removes DOFs associated with entities in a specified block from the finite
524 * element problem. This is the primary method for enforcing Dirichlet boundary
525 * conditions by eliminating constrained DOFs from the system.
526 *
527 * @param problem_name name of the finite element problem
528 * @param block_name name of the boundary condition block/meshset
529 * @param field_name name of the field containing the DOFs to remove
530 * @param lo lowest coefficient (rank) to remove
531 * @param hi highest coefficient (rank) to remove
532 * @param get_low_dim_ents include lower dimensional entities in the operation
533 * @param is_distributed_mesh true if mesh is distributed across processes
534 * @return MoFEMErrorCode Error code indicating success or failure
535 */
536 MoFEMErrorCode removeBlockDOFsOnEntities(const std::string problem_name,
537 const std::string block_name,
538 const std::string field_name, int lo,
539 int hi, bool get_low_dim_ents = true,
540 bool is_distributed_mesh = true);
541
542 /**
543 * @brief Mark DOFs on block entities for boundary conditions
544 * \ingroup mofem_simple_interface
545 *
546 * Marks DOFs associated with entities in a specified block for boundary
547 * condition processing. This creates internal data structures needed for
548 * subsequent boundary condition application or DOF removal operations.
549 *
550 * @param problem_name name of the finite element problem
551 * @param block_name name of the boundary condition block/meshset
552 * @param field_name name of the field containing the DOFs to mark
553 * @param lo lowest coefficient (rank) to mark
554 * @param hi highest coefficient (rank) to mark
555 * @param get_low_dim_ents include lower dimensional entities in the operation
556 * @return MoFEMErrorCode Error code indicating success or failure
557 */
558 MoFEMErrorCode pushMarkDOFsOnEntities(const std::string problem_name,
559 const std::string block_name,
560 const std::string field_name, int lo,
561 int hi, bool get_low_dim_ents = true);
562
563 /**
564 * @brief Remove DOFs based on boundary condition type template
565 * \ingroup mofem_simple_interface
566 *
567 * Template-based DOF removal that automatically determines the appropriate
568 * meshset type and boundary condition handling based on the template parameter.
569 * Supports various boundary condition types including displacement, temperature,
570 * heat flux, force, and pressure conditions.
571 *
572 * @tparam T boundary condition type template parameter
573 * @param problem_name name of the finite element problem
574 * @param field_name name of the field containing the DOFs
575 * @param get_low_dim_ents include lower dimensional entities
576 * @param block_name_field_prefix use field name as block name prefix
577 * @param is_distributed_mesh true if mesh is distributed across processes
578 * @return MoFEMErrorCode Error code indicating success or failure
579 */
580 template <typename T>
581 MoFEMErrorCode removeBlockDOFsOnEntities(const std::string problem_name,
582 const std::string field_name,
583 bool get_low_dim_ents = true,
584 bool block_name_field_prefix = false,
585 bool is_distributed_mesh = true);
586
587 /**
588 * @brief Mark DOFs based on boundary condition type template
589 * \ingroup mofem_simple_interface
590 *
591 * Template-based DOF marking that automatically determines the appropriate
592 * meshset type and boundary condition handling. Creates internal data structures
593 * for subsequent boundary condition processing operations.
594 *
595 * @tparam T boundary condition type template parameter
596 * @param problem_name name of the finite element problem
597 * @param field_name name of the field containing the DOFs
598 * @param get_low_dim_ents include lower dimensional entities
599 * @param block_name_field_prefix use field name as block name prefix
600 * @return MoFEMErrorCode Error code indicating success or failure
601 */
602 template <typename T>
603 MoFEMErrorCode pushMarkDOFsOnEntities(const std::string problem_name,
604 const std::string field_name,
605 bool get_low_dim_ents = true,
606 bool block_name_field_prefix = false);
607
608 /**
609 * @brief Remove DOFs with explicit block specification
610 * \ingroup mofem_simple_interface
611 *
612 * Template-based DOF removal with explicit block name specification.
613 * Provides fine-grained control over which specific block is processed
614 * while maintaining type-safe boundary condition handling.
615 *
616 * @tparam T boundary condition type template parameter
617 * @param problem_name name of the finite element problem
618 * @param block_name specific name of the boundary condition block
619 * @param field_name name of the field containing the DOFs
620 * @param get_low_dim_ents include lower dimensional entities
621 * @param is_distributed_mesh true if mesh is distributed across processes
622 * @return MoFEMErrorCode Error code indicating success or failure
623 */
624 template <typename T>
625 MoFEMErrorCode removeBlockDOFsOnEntities(const std::string problem_name,
626 const std::string block_name,
627 const std::string field_name,
628 bool get_low_dim_ents = true,
629 bool is_distributed_mesh = true);
630
631 /**
632 * @brief Mark DOFs with explicit block specification
633 * \ingroup mofem_simple_interface
634 *
635 * Template-based DOF marking with explicit block name specification.
636 * Creates internal data structures for the specified boundary condition
637 * block while maintaining type-safe boundary condition handling.
638 *
639 * @tparam T boundary condition type template parameter
640 * @param problem_name name of the finite element problem
641 * @param block_name specific name of the boundary condition block
642 * @param field_name name of the field containing the DOFs
643 * @param get_low_dim_ents include lower dimensional entities
644 * @return MoFEMErrorCode Error code indicating success or failure
645 */
646 template <typename T>
647 MoFEMErrorCode pushMarkDOFsOnEntities(const std::string problem_name,
648 const std::string block_name,
649 const std::string field_name,
650 bool get_low_dim_ents = true);
651
652 /**
653 * @brief Retrieve and remove boundary condition data
654 * \ingroup mofem_simple_interface
655 *
656 * Retrieves the boundary condition data structure for a specified block
657 * and removes it from the internal management system. This is typically
658 * used when transferring boundary condition data to other processing
659 * stages or when cleaning up after boundary condition application.
660 *
661 * @param block_name name of the boundary condition block to retrieve
662 * @return boost::shared_ptr<BCs> Shared pointer to boundary condition data structure
663 */
664 boost::shared_ptr<BCs> popMarkDOFsOnEntities(const std::string block_name);
665
666 /** \todo Add markers for standard BCs from cubit on Nodesets and Sidesets used
667 * by cubit for displacements, forces, etc. Also add function to add blockset
668 * by id and type.
669 */
670
671 using BcMapByBlockName = std::map<string, boost::shared_ptr<BCs>>; ///< Map of boundary condition blocks by name
672
673 using BcMarkerPtr = boost::shared_ptr<std::vector<char unsigned>>; ///< Shared pointer to marker vector
674
675 /**
676 * @brief Get boundary condition structure by identifier
677 * \ingroup mofem_simple_interface
678 *
679 * Retrieves the boundary condition data structure for a specific block
680 * identifier. Provides direct access to the internal boundary condition
681 * management system for advanced operations.
682 *
683 * @param bc_id identifier of the boundary condition block
684 * @return auto Reference to the boundary condition structure
685 */
686 inline auto getBcStructure(const std::string bc_id) {
687 return bcMapByBlockName.at(bc_id);
688 }
689
690 /**
691 * @brief Get the boundary condition map
692 * \ingroup mofem_simple_interface
693 *
694 * Provides access to the complete map of boundary condition blocks
695 * managed by this BcManager instance. Useful for iteration and
696 * bulk operations on multiple boundary conditions.
697 *
698 * @return BcMapByBlockName& Reference to the boundary condition map
699 */
701
702 /**
703 * @brief Merge entity ranges from multiple boundary condition blocks
704 * \ingroup mofem_simple_interface
705 *
706 * Combines entity ranges from multiple boundary condition blocks that match
707 * the provided regular expression patterns. This is useful for creating
708 * composite boundary conditions or applying operations to multiple related
709 * boundary condition blocks simultaneously.
710 *
711 * @param bc_regex_vec vector of regular expressions for block name matching
712 * @return Range Merged range containing entities from all matching blocks
713 */
714 Range getMergedBlocksRange(std::vector<std::regex> bc_regex_vec);
715
716 /**
717 * @brief Merge entity ranges by boundary condition names
718 * \ingroup mofem_simple_interface
719 *
720 * Convenience function that merges entity ranges from boundary condition
721 * blocks with names containing the specified substrings. Automatically
722 * constructs regular expressions for flexible name matching.
723 *
724 * @param bc_names vector of boundary condition name patterns to match
725 * @return Range Merged range containing entities from all matching blocks
726 */
727 inline auto getMergedBlocksRange(std::vector<string> bc_names) {
728 std::vector<std::regex> reg_vec(bc_names.size());
729 for (int i = 0; i != bc_names.size(); ++i) {
730 auto full_name = std::string("(.*)_") + bc_names[i] + std::string("(.*)");
731 reg_vec[i] = std::regex(full_name);
732 }
733 return getMergedBlocksRange(reg_vec);
734 }
735
736 /**
737 * @brief Merge DOF markers from multiple boundary condition blocks
738 * \ingroup mofem_simple_interface
739 *
740 * Combines DOF marker vectors from multiple boundary condition blocks that
741 * match the provided regular expression patterns. The resulting marker vector
742 * represents the union of all DOF constraints from the matching blocks.
743 *
744 * @param bc_regex_vec vector of regular expressions for block name matching
745 * @return BcMarkerPtr Shared pointer to merged marker vector
746 */
747 BcMarkerPtr getMergedBlocksMarker(std::vector<std::regex> bc_regex_vec);
748
749 /**
750 * @brief Merge DOF markers by boundary condition names
751 * \ingroup mofem_simple_interface
752 *
753 * Convenience function that merges DOF marker vectors from boundary condition
754 * blocks with names containing the specified substrings. Useful for combining
755 * markers from related boundary conditions into a single constraint system.
756 *
757 * @param bc_names vector of boundary condition name patterns to match
758 * @return BcMarkerPtr Shared pointer to merged marker vector
759 */
760 inline auto getMergedBlocksMarker(std::vector<string> bc_names) {
761 std::vector<std::regex> reg_vec(bc_names.size());
762 for (int i = 0; i != bc_names.size(); ++i) {
763 auto full_name = std::string("(.*)_") + bc_names[i] + std::string("(.*)");
764 reg_vec[i] = std::regex(full_name);
765 }
766 return getMergedBlocksMarker(reg_vec);
767 }
768
769 /**
770 * @brief Merge pre-existing marker vectors
771 * \ingroup mofem_simple_interface
772 *
773 * Combines multiple existing DOF marker vectors into a single unified marker
774 * vector. This allows for flexible composition of boundary condition constraints
775 * from different sources or processing stages.
776 *
777 * @param boundary_markers_ptr_vec vector of marker pointers to merge
778 * @return BcMarkerPtr Shared pointer to merged marker vector
779 */
781 const std::vector<BcMarkerPtr> &boundary_markers_ptr_vec);
782
783 /**
784 * @brief Check if boundary condition matches regular expression
785 * \ingroup mofem_simple_interface
786 *
787 * Tests whether a boundary condition block name matches the provided
788 * regular expression pattern. This is used internally for filtering
789 * and selecting boundary condition blocks based on naming patterns.
790 *
791 * @param bc map element containing block name and boundary condition data
792 * @param reg regular expression pattern for matching
793 * @return bool true if the block name matches the pattern
794 */
795 inline auto checkBlock(const std::pair<string, boost::shared_ptr<BCs>> &bc,
796 std::regex reg) {
797 return std::regex_match(bc.first, reg);
798 }
799
800 /**
801 * @brief Check if boundary condition matches name pattern
802 * \ingroup mofem_simple_interface
803 *
804 * Tests whether a boundary condition block name contains the specified
805 * substring pattern. Automatically constructs a flexible regular expression
806 * for convenient name-based filtering.
807 *
808 * @param bc map element containing block name and boundary condition data
809 * @param name substring pattern to search for in the block name
810 * @return bool true if the block name contains the pattern
811 */
812 inline auto
813 checkBlock(const std::pair<std::string, boost::shared_ptr<BCs>> &bc,
814 std::string name) {
815 auto full_name = std::string("(.*)_") + name + std::string("(.*)");
816 return checkBlock(bc, std::regex(full_name));
817 }
818
819 /**
820 * @brief Create PETSc Index Set for boundary condition block
821 * \ingroup mofem_simple_interface
822 *
823 * Generates a PETSc Index Set (IS) containing DOF indices for a specified
824 * boundary condition block. The IS can be used for matrix/vector operations,
825 * subproblem creation, and solver configuration in PETSc-based computations.
826 *
827 * @param block_prefix prefix for block name construction
828 * @param block_name name of the boundary condition block
829 * @param field_name name of the field containing the DOFs
830 * @param problem_name name of the finite element problem
831 * @param lo lowest coefficient (rank) to include
832 * @param hi highest coefficient (rank) to include
833 * @param is_expand optional existing IS to expand with new indices
834 * @return SmartPetscObj<IS> Smart pointer to PETSc Index Set
835 */
837 getBlockIS(const std::string block_prefix, const std::string block_name,
838 const std::string field_name, const std::string problem_name,
839 int lo, int hi, SmartPetscObj<IS> is_expand = SmartPetscObj<IS>());
840
841 /**
842 * @brief Create PETSc Index Set for boundary condition block (simplified)
843 * \ingroup mofem_simple_interface
844 *
845 * Simplified version that generates a PETSc Index Set for a boundary condition
846 * block without requiring a separate block prefix. This is the most commonly
847 * used interface for creating IS objects for boundary condition processing.
848 *
849 * @param problem_name name of the finite element problem
850 * @param block_name name of the boundary condition block
851 * @param field_name name of the field containing the DOFs
852 * @param lo lowest coefficient (rank) to include
853 * @param hi highest coefficient (rank) to include
854 * @param is_expand optional existing IS to expand with new indices
855 * @return SmartPetscObj<IS> Smart pointer to PETSc Index Set
856 */
858 getBlockIS(const std::string problem_name, const std::string block_name,
859 const std::string field_name, int lo, int hi,
861
862 /**
863 * @brief Extract block name and block name from block id
864 *
865 * @param block_id
866 * @param prb_name
867 * @return std::pair<std::string, std::string>
868 */
869 static std::pair<std::string, std::string>
870 extractStringFromBlockId(const std::string block_id,
871 const std::string prb_name);
872
873private:
875
877};
878
879template <>
881BcManager::removeBlockDOFsOnEntities<BcMeshsetType<DISPLACEMENTSET>>(
882 const std::string problem_name, const std::string field_name,
883 bool get_low_dim_ents, bool block_name_field_prefix,
884 bool is_distributed_mesh);
885
886template <>
888BcManager::removeBlockDOFsOnEntities<BcMeshsetType<TEMPERATURESET>>(
889 const std::string problem_name, const std::string field_name,
890 bool get_low_dim_ents, bool block_name_field_prefix,
891 bool is_distributed_mesh);
892
893template <>
894MoFEMErrorCode BcManager::removeBlockDOFsOnEntities<BcMeshsetType<HEATFLUXSET>>(
895 const std::string problem_name, const std::string field_name,
896 bool get_low_dim_ents, bool block_name_field_prefix,
897 bool is_distributed_mesh);
898
899template <>
901BcManager::removeBlockDOFsOnEntities<BcDisplacementMeshsetType<BLOCKSET>>(
902 const std::string problem_name, const std::string field_name,
903 bool get_low_dim_ents, bool block_name_field_prefix,
904 bool is_distributed_mesh);
905
906template <>
908BcManager::removeBlockDOFsOnEntities<BcScalarMeshsetType<BLOCKSET>>(
909 const std::string problem_name, const std::string block_name,
910 const std::string field_name, bool get_low_dim_ents,
911 bool is_distributed_mesh);
912
913template <>
915BcManager::pushMarkDOFsOnEntities<BcMeshsetType<DISPLACEMENTSET>>(
916 const std::string problem_name, const std::string field_name,
917 bool get_low_dim_ents, bool block_name_field_prefix);
918
919template <>
920MoFEMErrorCode BcManager::pushMarkDOFsOnEntities<BcMeshsetType<TEMPERATURESET>>(
921 const std::string problem_name, const std::string field_name,
922 bool get_low_dim_ents, bool block_name_field_prefix);
923
924template <>
925MoFEMErrorCode BcManager::pushMarkDOFsOnEntities<BcMeshsetType<HEATFLUXSET>>(
926 const std::string problem_name, const std::string field_name,
927 bool get_low_dim_ents, bool block_name_field_prefix);
928
929template <>
931BcManager::pushMarkDOFsOnEntities<BcDisplacementMeshsetType<BLOCKSET>>(
932 const std::string problem_name, const std::string field_name,
933 bool get_low_dim_ents, bool block_name_field_prefix);
934
935template <>
936MoFEMErrorCode BcManager::pushMarkDOFsOnEntities<BcScalarMeshsetType<BLOCKSET>>(
937 const std::string problem_name, const std::string field_name,
938 const std::string block_name, bool get_low_dim_ents);
939
940template <>
941MoFEMErrorCode BcManager::pushMarkDOFsOnEntities<DisplacementCubitBcData>(
942 const std::string problem_name, const std::string field_name,
943 bool get_low_dim_ents, bool block_name_field_prefix);
944
945template <>
946MoFEMErrorCode BcManager::removeBlockDOFsOnEntities<DisplacementCubitBcData>(
947 const std::string problem_name, const std::string field_name,
948 bool get_low_dim_ents, bool block_name_field_prefix,
949 bool is_distributed_mesh);
950
951template <>
952MoFEMErrorCode BcManager::pushMarkDOFsOnEntities<TemperatureCubitBcData>(
953 const std::string problem_name, const std::string field_name,
954 bool get_low_dim_ents, bool block_name_field_prefix);
955
956template <>
957MoFEMErrorCode BcManager::removeBlockDOFsOnEntities<TemperatureCubitBcData>(
958 const std::string problem_name, const std::string field_name,
959 bool get_low_dim_ents, bool block_name_field_prefix,
960 bool is_distributed_mesh);
961
962template <>
963MoFEMErrorCode BcManager::pushMarkDOFsOnEntities<HeatFluxCubitBcData>(
964 const std::string problem_name, const std::string field_name,
965 bool get_low_dim_ents, bool block_name_field_prefix);
966
967template <>
968MoFEMErrorCode BcManager::removeBlockDOFsOnEntities<HeatFluxCubitBcData>(
969 const std::string problem_name, const std::string field_name,
970 bool get_low_dim_ents, bool block_name_field_prefix,
971 bool is_distributed_mesh);
972
973template <>
974MoFEMErrorCode BcManager::pushMarkDOFsOnEntities<BcMeshsetType<FORCESET>>(
975 const std::string problem_name, const std::string field_name,
976 bool get_low_dim_ents, bool block_name_field_prefix);
977
978template <>
979MoFEMErrorCode BcManager::pushMarkDOFsOnEntities<BcForceMeshsetType<BLOCKSET>>(
980 const std::string problem_name, const std::string field_name,
981 bool get_low_dim_ents, bool block_name_field_prefix);
982
983template <>
984MoFEMErrorCode BcManager::pushMarkDOFsOnEntities<ForceCubitBcData>(
985 const std::string problem_name, const std::string field_name,
986 bool get_low_dim_ents, bool block_name_field_prefix);
987
988template <>
989MoFEMErrorCode BcManager::removeBlockDOFsOnEntities<BcMeshsetType<FORCESET>>(
990 const std::string problem_name, const std::string field_name,
991 bool get_low_dim_ents, bool block_name_field_prefix,
992 bool is_distributed_mesh);
993
994template <>
996BcManager::removeBlockDOFsOnEntities<BcForceMeshsetType<BLOCKSET>>(
997 const std::string problem_name, const std::string field_name,
998 bool get_low_dim_ents, bool block_name_field_prefix,
999 bool is_distributed_mesh);
1000
1001template <>
1002MoFEMErrorCode BcManager::removeBlockDOFsOnEntities<ForceCubitBcData>(
1003 const std::string problem_name, const std::string field_name,
1004 bool get_low_dim_ents, bool block_name_field_prefix,
1005 bool is_distributed_mesh);
1006
1007template <>
1009BcManager::pushMarkDOFsOnEntities<BcNormalDisplacementMeshsetType<BLOCKSET>>(
1010 const std::string problem_name, const std::string field_name,
1011 bool get_low_dim_ents, bool block_name_field_prefix);
1012
1013template <>
1015BcManager::pushMarkDOFsOnEntities<BcAnalyticalDisplacementMeshsetType<BLOCKSET>>(
1016 const std::string problem_name, const std::string field_name,
1017 bool get_low_dim_ents, bool block_name_field_prefix);
1018
1019template <>
1021BcManager::pushMarkDOFsOnEntities<BcAnalyticalTractionMeshsetType<BLOCKSET>>(
1022 const std::string problem_name, const std::string field_name,
1023 bool get_low_dim_ents, bool block_name_field_prefix);
1024
1025template <>
1026MoFEMErrorCode BcManager::pushMarkDOFsOnEntities<BcMeshsetType<PRESSURESET>>(
1027 const std::string problem_name, const std::string field_name,
1028 bool get_low_dim_ents, bool block_name_field_prefix);
1029
1030template <>
1032BcManager::pushMarkDOFsOnEntities<BcPressureMeshsetType<BLOCKSET>>(
1033 const std::string problem_name, const std::string field_name,
1034 bool get_low_dim_ents, bool block_name_field_prefix);
1035
1036} // namespace MoFEM
1037
1038#endif //__BCMANAGER_HPP__
1039
1040/**
1041 * \defgroup bc_manager Manages boundary conditions
1042 * \brief Implementation manages boundary conditions
1043 *
1044 * \ingroup mofem
1045 **/
MoFEM interface.
#define DEPRECATED
Definition definitions.h:17
Range getMergedBlocksRange(std::vector< std::regex > bc_regex_vec)
Merge entity ranges from multiple boundary condition blocks.
auto checkBlock(const std::pair< string, boost::shared_ptr< BCs > > &bc, std::regex reg)
Check if boundary condition matches regular expression.
MoFEMErrorCode removeBlockDOFsOnEntities(const std::string problem_name, const std::string field_name, bool get_low_dim_ents=true, bool block_name_field_prefix=false, bool is_distributed_mesh=true)
Remove DOFs based on boundary condition type template.
MoFEMErrorCode getOptions()
Get command line options for BcManager.
Definition BcManager.cpp:65
BcMarkerPtr getMergedBlocksMarker(std::vector< std::regex > bc_regex_vec)
Merge DOF markers from multiple boundary condition blocks.
MoFEMErrorCode removeSideDOFs(const std::string problem_name, const std::string block_name, const std::string field_name, int bridge_dim, int lo, int hi, bool is_distributed_mesh=true)
Remove DOFs on side entities from problem.
MoFEMErrorCode pushMarkDOFsOnEntities(const std::string problem_name, const std::string block_name, const std::string field_name, bool get_low_dim_ents=true)
Mark DOFs with explicit block specification.
auto getMergedBlocksRange(std::vector< string > bc_names)
Merge entity ranges by boundary condition names.
auto getMergedBlocksMarker(std::vector< string > bc_names)
Merge DOF markers by boundary condition names.
SmartPetscObj< IS > getBlockIS(const std::string block_prefix, const std::string block_name, const std::string field_name, const std::string problem_name, int lo, int hi, SmartPetscObj< IS > is_expand=SmartPetscObj< IS >())
Create PETSc Index Set for boundary condition block.
MoFEMErrorCode removeBlockDOFsOnEntities(const std::string problem_name, const std::string block_name, const std::string field_name, int lo, int hi, bool get_low_dim_ents=true, bool is_distributed_mesh=true)
Remove DOFs from problem based on block entities.
Definition BcManager.cpp:72
MoFEMErrorCode removeBlockDOFsOnEntities(const std::string problem_name, const std::string block_name, const std::string field_name, bool get_low_dim_ents=true, bool is_distributed_mesh=true)
Remove DOFs with explicit block specification.
MoFEMErrorCode pushMarkSideDofs(const std::string problem_name, const std::string block_name, const std::string field_name, int bridge_dim, int lo, int hi)
Mark DOFs on side entities for boundary conditions.
MoFEMErrorCode pushMarkDOFsOnEntities(const std::string problem_name, const std::string field_name, bool get_low_dim_ents=true, bool block_name_field_prefix=false)
Mark DOFs based on boundary condition type template.
auto getBcStructure(const std::string bc_id)
Get boundary condition structure by identifier.
auto checkBlock(const std::pair< std::string, boost::shared_ptr< BCs > > &bc, std::string name)
Check if boundary condition matches name pattern.
BcMarkerPtr getMergedBlocksMarker(const std::vector< BcMarkerPtr > &boundary_markers_ptr_vec)
Merge pre-existing marker vectors.
boost::shared_ptr< BCs > popMarkDOFsOnEntities(const std::string block_name)
Retrieve and remove boundary condition data.
MoFEMErrorCode pushMarkDOFsOnEntities(const std::string problem_name, const std::string block_name, const std::string field_name, int lo, int hi, bool get_low_dim_ents=true)
Mark DOFs on block entities for boundary conditions.
BcMapByBlockName & getBcMapByBlockName()
Get the boundary condition map.
FTensor::Index< 'i', SPACE_DIM > i
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
implementation of Data Operators for Forces and Sources
Definition Common.hpp:10
constexpr auto field_name
Template specialization for analytical displacement functions.
Template specialization for analytical traction functions.
Template specialization for displacement boundary conditions.
Template specialization for flux boundary conditions.
Template specialization for force boundary conditions.
Data structure storing boundary condition markers and attributes.
boost::shared_ptr< ForceCubitBcData > forceBcPtr
Force boundary condition data.
boost::shared_ptr< HeatFluxCubitBcData > heatFluxBcPtr
Heat flux boundary condition data.
auto getBcEntsPtr()
Get shared pointer to boundary condition entities.
boost::shared_ptr< DisplacementCubitBcData > dispBcPtr
Displacement boundary condition data.
std::vector< unsigned char > bcMarkers
DOF markers for boundary condition application.
std::vector< double > bcAttributes
Numerical attributes (material properties, etc.)
Range bcEnts
Range of entities in the boundary condition block.
boost::shared_ptr< PressureCubitBcData > pressureBcPtr
Pressure boundary condition data.
boost::shared_ptr< TemperatureCubitBcData > tempBcPtr
Temperature boundary condition data.
auto getBcMarkersPtr()
Get shared pointer to boundary condition markers.
std::vector< boost::weak_ptr< NumeredDofEntity > > DofsView
boost::shared_ptr< DofsView > dofsViewPtr
View of DOFs associated with boundary condition.
DEPRECATED auto getBcEdgesPtr()
Get shared pointer to boundary condition entities.
Boundary condition manager for finite element problem setup.
boost::shared_ptr< std::vector< char unsigned > > BcMarkerPtr
Shared pointer to marker vector.
static std::pair< std::string, std::string > extractStringFromBlockId(const std::string block_id, const std::string prb_name)
Extract block name and block name from block id.
MoFEM::Core & cOre
BcMapByBlockName bcMapByBlockName
virtual ~BcManager()=default
std::map< string, boost::shared_ptr< BCs > > BcMapByBlockName
Map of boundary condition blocks by name.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
Query interface for BcManager.
Definition BcManager.cpp:34
Template specialization system for type-safe boundary condition handling.
Template specialization for normal displacement constraints.
Template specialization for pressure boundary conditions.
Template specialization for scalar field boundary conditions.
Core (interface) class.
Definition Core.hpp:82
intrusive_ptr for managing petsc objects
base class for all interface classes