137#ifndef __BCMANAGER_HPP__
138#define __BCMANAGER_HPP__
413 struct BCs : boost::enable_shared_from_this<BCs> {
418 using DofsView = std::vector<boost::weak_ptr<NumeredDofEntity>>;
433 return boost::shared_ptr<Range>(shared_from_this(), &
bcEnts);
446 return boost::shared_ptr<Range>(shared_from_this(), &
bcEnts);
459 return boost::shared_ptr<std::vector<unsigned char>>(shared_from_this(),
492 const std::string block_name,
514 const std::string block_name,
517 bool is_distributed_mesh =
true);
537 const std::string block_name,
539 int hi,
bool get_low_dim_ents =
true,
540 bool is_distributed_mesh =
true);
559 const std::string block_name,
561 int hi,
bool get_low_dim_ents =
true);
580 template <
typename T>
583 bool get_low_dim_ents =
true,
584 bool block_name_field_prefix =
false,
585 bool is_distributed_mesh =
true);
602 template <
typename T>
605 bool get_low_dim_ents =
true,
606 bool block_name_field_prefix =
false);
624 template <
typename T>
626 const std::string block_name,
628 bool get_low_dim_ents =
true,
629 bool is_distributed_mesh =
true);
646 template <
typename T>
648 const std::string block_name,
650 bool get_low_dim_ents =
true);
673 using BcMarkerPtr = boost::shared_ptr<std::vector<char unsigned>>;
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);
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);
781 const std::vector<BcMarkerPtr> &boundary_markers_ptr_vec);
795 inline auto checkBlock(
const std::pair<
string, boost::shared_ptr<BCs>> &bc,
797 return std::regex_match(bc.first, reg);
813 checkBlock(
const std::pair<std::string, boost::shared_ptr<BCs>> &bc,
815 auto full_name = std::string(
"(.*)_") + name + std::string(
"(.*)");
837 getBlockIS(
const std::string block_prefix,
const std::string block_name,
838 const std::string
field_name,
const std::string problem_name,
858 getBlockIS(
const std::string problem_name,
const std::string block_name,
869 static std::pair<std::string, std::string>
871 const std::string prb_name);
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);
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);
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);
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);
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);
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);
921 const std::string problem_name,
const std::string
field_name,
922 bool get_low_dim_ents,
bool block_name_field_prefix);
926 const std::string problem_name,
const std::string
field_name,
927 bool get_low_dim_ents,
bool block_name_field_prefix);
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);
937 const std::string problem_name,
const std::string
field_name,
938 const std::string block_name,
bool get_low_dim_ents);
942 const std::string problem_name,
const std::string
field_name,
943 bool get_low_dim_ents,
bool block_name_field_prefix);
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);
953 const std::string problem_name,
const std::string
field_name,
954 bool get_low_dim_ents,
bool block_name_field_prefix);
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);
964 const std::string problem_name,
const std::string
field_name,
965 bool get_low_dim_ents,
bool block_name_field_prefix);
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);
975 const std::string problem_name,
const std::string
field_name,
976 bool get_low_dim_ents,
bool block_name_field_prefix);
980 const std::string problem_name,
const std::string
field_name,
981 bool get_low_dim_ents,
bool block_name_field_prefix);
985 const std::string problem_name,
const std::string
field_name,
986 bool get_low_dim_ents,
bool block_name_field_prefix);
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);
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);
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);
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);
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);
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);
1027 const std::string problem_name,
const std::string
field_name,
1028 bool get_low_dim_ents,
bool block_name_field_prefix);
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);
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.
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.
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
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.
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.
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.
intrusive_ptr for managing petsc objects
base class for all interface classes