v0.14.0
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
MoFEM::BcManager Struct Reference

Simple interface for fast problem set-up. More...

#include <src/interfaces/BcManager.hpp>

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

Classes

struct  BCs
 Data structure storing bc markers and atributes. More...
 

Public Types

using BcMapByBlockName = std::map< string, boost::shared_ptr< BCs > >
 
using BcMarkerPtr = boost::shared_ptr< std::vector< char unsigned > >
 

Public Member Functions

MoFEMErrorCode query_interface (boost::typeindex::type_index type_index, UnknownInterface **iface) const
 
 BcManager (const MoFEM::Core &core)
 
virtual ~BcManager ()=default
 
MoFEMErrorCode getOptions ()
 get options More...
 
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. More...
 
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 block DOFs. More...
 
template<typename T >
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)
 Mark block DOFs. More...
 
template<typename T >
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 block DOFs. More...
 
template<typename T >
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)
 Mark block DOFs. More...
 
template<typename T >
MoFEMErrorCode pushMarkDOFsOnEntities (const std::string problem_name, const std::string block_name, const std::string field_name, bool get_low_dim_ents=true)
 Mark block DOFs. More...
 
boost::shared_ptr< BCspopMarkDOFsOnEntities (const std::string block_name)
 Get bc data and remove element. More...
 
auto getBcStructure (const std::string bc_id)
 Get the bc structure object. More...
 
BcMapByBlockNamegetBcMapByBlockName ()
 Get the bc map. More...
 
Range getMergedBlocksRange (std::vector< std::regex > bc_regex_vec)
 Merge block ranges. More...
 
auto getMergedBlocksRange (std::vector< string > bc_names)
 Merge block ranges. More...
 
BcMarkerPtr getMergedBlocksMarker (std::vector< std::regex > bc_regex_vec)
 Get the Merged Boundary Marker object. More...
 
auto getMergedBlocksMarker (std::vector< string > bc_names)
 Get the Merged Boundary Marker object. More...
 
BcMarkerPtr getMergedBlocksMarker (const std::vector< BcMarkerPtr > &boundary_markers_ptr_vec)
 Get the Merged Blocks Marker object. More...
 
auto checkBlock (const std::pair< string, boost::shared_ptr< BCs > > &bc, std::regex reg)
 check if given boundary condition name is in the map bc element More...
 
auto checkBlock (const std::pair< std::string, boost::shared_ptr< BCs > > &bc, std::string name)
 check if given boundary condition name is in the map bc element More...
 
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 >())
 Get block IS. More...
 
SmartPetscObj< IS > getBlockIS (const std::string problem_name, const std::string block_name, const std::string field_name, int lo, int hi, SmartPetscObj< IS > is_expand=SmartPetscObj< IS >())
 Get block IS. More...
 
template<>
MoFEMErrorCode removeBlockDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix, bool is_distributed_mesh)
 
template<>
MoFEMErrorCode removeBlockDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix, bool is_distributed_mesh)
 
template<>
MoFEMErrorCode removeBlockDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix, bool is_distributed_mesh)
 
template<>
MoFEMErrorCode removeBlockDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix, bool is_distributed_mesh)
 
template<>
MoFEMErrorCode removeBlockDOFsOnEntities (const std::string problem_name, const std::string block_name, const std::string field_name, bool get_low_dim_ents, bool is_distributed_mesh)
 
template<>
MoFEMErrorCode pushMarkDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix)
 
template<>
MoFEMErrorCode pushMarkDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix)
 
template<>
MoFEMErrorCode pushMarkDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix)
 
template<>
MoFEMErrorCode pushMarkDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix)
 
template<>
MoFEMErrorCode pushMarkDOFsOnEntities (const std::string problem_name, const std::string field_name, const std::string block_name, bool get_low_dim_ents)
 
template<>
MoFEMErrorCode pushMarkDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix)
 
template<>
MoFEMErrorCode removeBlockDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix, bool is_distributed_mesh)
 
template<>
MoFEMErrorCode pushMarkDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix)
 
template<>
MoFEMErrorCode removeBlockDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix, bool is_distributed_mesh)
 
template<>
MoFEMErrorCode pushMarkDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix)
 
template<>
MoFEMErrorCode removeBlockDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix, bool is_distributed_mesh)
 
template<>
MoFEMErrorCode pushMarkDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix)
 
template<>
MoFEMErrorCode pushMarkDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix)
 
template<>
MoFEMErrorCode pushMarkDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix)
 
template<>
MoFEMErrorCode removeBlockDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix, bool is_distributed_mesh)
 
template<>
MoFEMErrorCode removeBlockDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix, bool is_distributed_mesh)
 
template<>
MoFEMErrorCode removeBlockDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix, bool is_distributed_mesh)
 
template<>
MoFEMErrorCode removeBlockDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix, bool is_distributed_mesh)
 
template<>
MoFEMErrorCode removeBlockDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix, bool is_distributed_mesh)
 
template<>
MoFEMErrorCode removeBlockDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix, bool is_distributed_mesh)
 
template<>
MoFEMErrorCode removeBlockDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix, bool is_distributed_mesh)
 
template<>
MoFEMErrorCode removeBlockDOFsOnEntities (const std::string problem_name, const std::string block_name, const std::string field_name, bool get_low_dim_ents, bool is_distributed_mesh)
 
template<>
MoFEMErrorCode pushMarkDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix)
 
template<>
MoFEMErrorCode pushMarkDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix)
 
template<>
MoFEMErrorCode pushMarkDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix)
 
template<>
MoFEMErrorCode pushMarkDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix)
 
template<>
MoFEMErrorCode pushMarkDOFsOnEntities (const std::string problem_name, const std::string block_name, const std::string field_name, bool get_low_dim_ents)
 
template<>
MoFEMErrorCode pushMarkDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix)
 
template<>
MoFEMErrorCode removeBlockDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix, bool is_distributed_mesh)
 
template<>
MoFEMErrorCode pushMarkDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix)
 
template<>
MoFEMErrorCode removeBlockDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix, bool is_distributed_mesh)
 
template<>
MoFEMErrorCode pushMarkDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix)
 
template<>
MoFEMErrorCode removeBlockDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix, bool is_distributed_mesh)
 
template<>
MoFEMErrorCode pushMarkDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix)
 
template<>
MoFEMErrorCode pushMarkDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix)
 
template<>
MoFEMErrorCode pushMarkDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix)
 
template<>
MoFEMErrorCode removeBlockDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix, bool is_distributed_mesh)
 
template<>
MoFEMErrorCode removeBlockDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix, bool is_distributed_mesh)
 
template<>
MoFEMErrorCode removeBlockDOFsOnEntities (const std::string problem_name, const std::string field_name, bool get_low_dim_ents, bool block_name_field_prefix, bool is_distributed_mesh)
 
- Public Member Functions inherited from MoFEM::UnknownInterface
virtual MoFEMErrorCode query_interface (boost::typeindex::type_index type_index, UnknownInterface **iface) const =0
 
template<class IFACE >
MoFEMErrorCode registerInterface (bool error_if_registration_failed=true)
 Register interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE *&iface) const
 Get interface refernce to pointer of interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE **const iface) const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_pointer< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_reference< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get reference to interface. More...
 
template<class IFACE >
IFACE * getInterface () const
 Function returning pointer to interface. More...
 
virtual ~UnknownInterface ()=default
 

Static Public Member Functions

static std::pair< std::string, std::string > extractStringFromBlockId (const std::string block_id, const std::string prb_name)
 Extract block name and block name form block id. More...
 
- Static Public Member Functions inherited from MoFEM::UnknownInterface
static MoFEMErrorCode getLibVersion (Version &version)
 Get library version. More...
 
static MoFEMErrorCode getFileVersion (moab::Interface &moab, Version &version)
 Get database major version. More...
 
static MoFEMErrorCode setFileVersion (moab::Interface &moab, Version version=Version(MoFEM_VERSION_MAJOR, MoFEM_VERSION_MINOR, MoFEM_VERSION_BUILD))
 Get database major version. More...
 
static MoFEMErrorCode getInterfaceVersion (Version &version)
 Get database major version. More...
 

Private Attributes

MoFEM::CorecOre
 
BcMapByBlockName bcMapByBlockName
 

Detailed Description

Simple interface for fast problem set-up.

Examples
EshelbianPlasticity.cpp, dynamic_first_order_con_law.cpp, free_surface.cpp, heat_equation.cpp, nonlinear_elastic.cpp, photon_diffusion.cpp, plastic.cpp, poisson_2d_homogeneous.cpp, shallow_wave.cpp, tensor_divergence_operator.cpp, thermo_elastic.cpp, and wave_equation.cpp.

Definition at line 25 of file BcManager.hpp.

Member Typedef Documentation

◆ BcMapByBlockName

using MoFEM::BcManager::BcMapByBlockName = std::map<string, boost::shared_ptr<BCs> >
Todo:
Add markers for standard BCs from cubit on Nodests and Sidesets used bu cubit for displacements, forces, etc. Also add function to add blockset by id and type.

Definition at line 182 of file BcManager.hpp.

◆ BcMarkerPtr

using MoFEM::BcManager::BcMarkerPtr = boost::shared_ptr<std::vector<char unsigned> >

Definition at line 184 of file BcManager.hpp.

Constructor & Destructor Documentation

◆ BcManager()

MoFEM::BcManager::BcManager ( const MoFEM::Core core)

Definition at line 41 of file BcManager.cpp.

41 : cOre(const_cast<Core &>(core)) {
42
43 if (!LogManager::checkIfChannelExist("BcMngWorld")) {
44 auto core_log = logging::core::get();
45
46 core_log->add_sink(
48 core_log->add_sink(
50 core_log->add_sink(
52
53 LogManager::setLog("BcMngWorld");
54 LogManager::setLog("BcMngSync");
55 LogManager::setLog("BcMngSelf");
56
57 MOFEM_LOG_TAG("BcMngWorld", "BcMng");
58 MOFEM_LOG_TAG("BcMngSync", "BcMng");
59 MOFEM_LOG_TAG("BcMngSelf", "BcMng");
60 }
61
62 MOFEM_LOG("BcMngWorld", Sev::noisy) << "BC manager created";
63}
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
Definition: LogManager.cpp:389
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:339
CoreTmp< 0 > Core
Definition: Core.hpp:1094
MoFEM::Core & cOre
Definition: BcManager.hpp:325
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
Definition: LogManager.cpp:298
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.
Definition: LogManager.cpp:344
static boost::shared_ptr< std::ostream > getStrmSync()
Get the strm sync object.
Definition: LogManager.cpp:348
static bool checkIfChannelExist(const std::string channel)
Check if channel exist.
Definition: LogManager.cpp:399
static boost::shared_ptr< std::ostream > getStrmSelf()
Get the strm self object.
Definition: LogManager.cpp:340

◆ ~BcManager()

virtual MoFEM::BcManager::~BcManager ( )
virtualdefault

Member Function Documentation

◆ checkBlock() [1/2]

auto MoFEM::BcManager::checkBlock ( const std::pair< std::string, boost::shared_ptr< BCs > > &  bc,
std::string  name 
)
inline

check if given boundary condition name is in the map bc element

Parameters
bcelement of the map
namebc name
Returns
auto

Definition at line 274 of file BcManager.hpp.

275 {
276 auto full_name = std::string("(.*)_") + name + std::string("(.*)");
277 return checkBlock(bc, std::regex(full_name));
278 }
auto checkBlock(const std::pair< string, boost::shared_ptr< BCs > > &bc, std::regex reg)
check if given boundary condition name is in the map bc element
Definition: BcManager.hpp:262

◆ checkBlock() [2/2]

auto MoFEM::BcManager::checkBlock ( const std::pair< string, boost::shared_ptr< BCs > > &  bc,
std::regex  reg 
)
inline

check if given boundary condition name is in the map bc element

Parameters
bcelement of the map
regbc regex
Returns
auto

Definition at line 262 of file BcManager.hpp.

263 {
264 return std::regex_match(bc.first, reg);
265 }

◆ extractStringFromBlockId()

std::pair< std::string, std::string > MoFEM::BcManager::extractStringFromBlockId ( const std::string  block_id,
const std::string  prb_name 
)
static

Extract block name and block name form block id.

Parameters
block_id
prb_name
Returns
std::pair<std::string, std::string>

Definition at line 1216 of file BcManager.cpp.

1217 {
1218
1219 // Assumes that field name is consist with letters and numbers.
1220 // No special characters.
1221 auto field_rgx_str =
1222 (boost::format("%s_([a-zA-Z0-9]*)_(.*)") % prb_name).str();
1223 std::regex field_rgx(field_rgx_str);
1224 std::smatch match_field_name;
1225 std::string field_name;
1226 std::string block_name;
1227
1228 if (std::regex_search(block_id, match_field_name, field_rgx)) {
1229 field_name = match_field_name[1];
1230 block_name = match_field_name[2];
1231 } else {
1233 "Field name and block name can not be resolved");
1234 }
1235
1236 return std::make_pair(field_name, block_name);
1237}
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
Definition: definitions.h:595
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
constexpr auto field_name

◆ getBcMapByBlockName()

BcMapByBlockName & MoFEM::BcManager::getBcMapByBlockName ( )
inline

Get the bc map.

Returns
auto
Examples
photon_diffusion.cpp.

Definition at line 200 of file BcManager.hpp.

200{ return bcMapByBlockName; }
BcMapByBlockName bcMapByBlockName
Definition: BcManager.hpp:327

◆ getBcStructure()

auto MoFEM::BcManager::getBcStructure ( const std::string  bc_id)
inline

Get the bc structure object.

Parameters
block_name
Returns
auto

Definition at line 191 of file BcManager.hpp.

191 {
192 return bcMapByBlockName.at(bc_id);
193 }

◆ getBlockIS() [1/2]

SmartPetscObj< IS > MoFEM::BcManager::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>() 
)

Get block IS.

Parameters
block_prefixfor hashmap
block_namefor hash map
field_namefor hash map and IS
problem_namefor IS
lo
hi
is_expandis to extend
Returns
SmartPetscObj<IS>

Definition at line 242 of file BcManager.cpp.

246 {
247 Interface &m_field = cOre;
248
249 const std::string bc_id =
250 block_prefix + "_" + field_name + "_" + block_name + "(.*)";
251
252 Range bc_ents;
253 for (auto bc : getBcMapByBlockName()) {
254 if (std::regex_match(bc.first, std::regex(bc_id))) {
255 bc_ents.merge(*(bc.second->getBcEntsPtr()));
256 MOFEM_LOG("BcMngWorld", Sev::verbose)
257 << "Get entities from block and add to IS. Block name " << bc.first;
258 }
259 }
260
261 SmartPetscObj<IS> is_bc;
262 auto get_is = [&]() {
264 CHKERR m_field.getInterface<CommInterface>()->synchroniseEntities(bc_ents);
265 CHKERR m_field.getInterface<ISManager>()->isCreateProblemFieldAndRank(
266 problem_name, ROW, field_name, lo, hi, is_bc, &bc_ents);
267 if (is_expand) {
268 IS is_tmp;
269 CHKERR ISExpand(is_bc, is_expand, &is_tmp);
270 is_bc = SmartPetscObj<IS>(is_tmp);
271 }
272 CHKERR ISSort(is_bc);
274 };
275
276 if (get_is())
277 CHK_THROW_MESSAGE(MOFEM_DATA_INCONSISTENCY, "IS is not created");
278
279 return is_bc;
280}
@ ROW
Definition: definitions.h:123
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
#define CHKERR
Inline error check.
Definition: definitions.h:535
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1975
BcMapByBlockName & getBcMapByBlockName()
Get the bc map.
Definition: BcManager.hpp:200

◆ getBlockIS() [2/2]

SmartPetscObj< IS > MoFEM::BcManager::getBlockIS ( const std::string  problem_name,
const std::string  block_name,
const std::string  field_name,
int  lo,
int  hi,
SmartPetscObj< IS >  is_expand = SmartPetscObj<IS>() 
)

Get block IS.

Parameters
problem_name
block_name
field_name
lo
hi
is_expandis to extend
Returns
SmartPetscObj<IS>

Definition at line 282 of file BcManager.cpp.

285 {
286 return getBlockIS(problem_name, block_name, field_name, problem_name, lo, hi,
287 is_expand);
288}
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 >())
Get block IS.
Definition: BcManager.cpp:242

◆ getMergedBlocksMarker() [1/3]

BcMarkerPtr MoFEM::BcManager::getMergedBlocksMarker ( const std::vector< BcMarkerPtr > &  boundary_markers_ptr_vec)

Get the Merged Blocks Marker object.

Parameters
boundary_markers_ptr_vecvector of boundary markers to merge
Returns
BcMarkerPtr

◆ getMergedBlocksMarker() [2/3]

BcManager::BcMarkerPtr MoFEM::BcManager::getMergedBlocksMarker ( std::vector< std::regex >  bc_regex_vec)

Get the Merged Boundary Marker object.

Parameters
bc_regex_vecboundary name regex vector
Returns
boundaryMarker

Definition at line 211 of file BcManager.cpp.

211 {
212 BcManager::BcMarkerPtr boundary_marker_ptr;
213 if (bcMapByBlockName.size()) {
214 for (auto b : bcMapByBlockName) {
215 for (auto &reg_name : bc_regex_vec) {
216 if (std::regex_match(b.first, reg_name)) {
217 if (!boundary_marker_ptr)
218 boundary_marker_ptr =
219 boost::make_shared<std::vector<char unsigned>>();
220 boundary_marker_ptr->resize(b.second->bcMarkers.size(), 0);
221 for (int i = 0; i != b.second->bcMarkers.size(); ++i) {
222 (*boundary_marker_ptr)[i] |= b.second->bcMarkers[i];
223 }
224 }
225 }
226 }
227 }
228 return boundary_marker_ptr;
229}
FTensor::Index< 'i', SPACE_DIM > i
boost::shared_ptr< std::vector< char unsigned > > BcMarkerPtr
Definition: BcManager.hpp:184

◆ getMergedBlocksMarker() [3/3]

auto MoFEM::BcManager::getMergedBlocksMarker ( std::vector< string >  bc_names)
inline

Get the Merged Boundary Marker object.

Parameters
bc_namesvector of boundary names
Returns
boundaryMarker

Definition at line 238 of file BcManager.hpp.

238 {
239 std::vector<std::regex> reg_vec(bc_names.size());
240 for (int i = 0; i != bc_names.size(); ++i) {
241 auto full_name = std::string("(.*)_") + bc_names[i] + std::string("(.*)");
242 reg_vec[i] = std::regex(full_name);
243 }
244 return getMergedBlocksMarker(reg_vec);
245 }
BcMarkerPtr getMergedBlocksMarker(std::vector< std::regex > bc_regex_vec)
Get the Merged Boundary Marker object.
Definition: BcManager.cpp:211

◆ getMergedBlocksRange() [1/2]

Range MoFEM::BcManager::getMergedBlocksRange ( std::vector< std::regex >  bc_regex_vec)

Merge block ranges.

Parameters
bc_regex_vec
Returns
Range

Definition at line 196 of file BcManager.cpp.

196 {
197 Range ents;
198 if (bcMapByBlockName.size()) {
199 for (auto b : bcMapByBlockName) {
200 for (auto &reg_name : bc_regex_vec) {
201 if (std::regex_match(b.first, reg_name)) {
202 ents.merge(b.second->bcEnts);
203 }
204 }
205 }
206 }
207 return ents;
208}

◆ getMergedBlocksRange() [2/2]

auto MoFEM::BcManager::getMergedBlocksRange ( std::vector< string >  bc_names)
inline

Merge block ranges.

Parameters
bc_names
Returns
auto

Definition at line 216 of file BcManager.hpp.

216 {
217 std::vector<std::regex> reg_vec(bc_names.size());
218 for (int i = 0; i != bc_names.size(); ++i) {
219 auto full_name = std::string("(.*)_") + bc_names[i] + std::string("(.*)");
220 reg_vec[i] = std::regex(full_name);
221 }
222 return getMergedBlocksRange(reg_vec);
223 }
Range getMergedBlocksRange(std::vector< std::regex > bc_regex_vec)
Merge block ranges.
Definition: BcManager.cpp:196

◆ getOptions()

MoFEMErrorCode MoFEM::BcManager::getOptions ( )

get options

Returns
error code

Definition at line 65 of file BcManager.cpp.

65 {
67 ierr = PetscOptionsBegin(PETSC_COMM_WORLD, "", "BcManager options", "none");
68 ierr = PetscOptionsEnd();
71}
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:483
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76

◆ popMarkDOFsOnEntities()

boost::shared_ptr< BcManager::BCs > MoFEM::BcManager::popMarkDOFsOnEntities ( const std::string  block_name)

Get bc data and remove element.

Parameters
block_name
Returns
boost::shared_ptr<BCs>

Definition at line 186 of file BcManager.cpp.

186 {
187 auto bc_it = bcMapByBlockName.find(block_name);
188 if (bc_it != bcMapByBlockName.end()) {
189 auto bc = bc_it->second;
190 bcMapByBlockName.erase(bc_it);
191 return bc;
192 }
193 return boost::shared_ptr<BCs>();
194}

◆ pushMarkDOFsOnEntities() [1/25]

template<>
MoFEMErrorCode MoFEM::BcManager::pushMarkDOFsOnEntities ( const std::string  problem_name,
const std::string  block_name,
const std::string  field_name,
bool  get_low_dim_ents 
)

Definition at line 1083 of file BcManager.cpp.

1085 {
1087
1088 CHKERR pushMarkDOFsOnEntities(problem_name, block_name, field_name, 0,
1089 MAX_DOFS_ON_ENTITY, get_low_dim_ents);
1090
1091 auto regex_str =
1092 (boost::format("%s_%s_%s(.*)") % problem_name % field_name % block_name)
1093 .str();
1094
1095 for (auto &m : bcMapByBlockName) {
1096
1097 auto &bc_id = m.first;
1098
1099 if (std::regex_match(bc_id, std::regex(regex_str))) {
1100
1101 auto &bc = m.second;
1102 bc->tempBcPtr = boost::make_shared<TemperatureCubitBcData>();
1103 bc->tempBcPtr->data.flag1 = 1;
1104 if (bc->bcAttributes.empty()) {
1105 bc->tempBcPtr->data.value1 = 0;
1106 MOFEM_LOG("BcMngWorld", Sev::warning)
1107 << "Expected one attribute on block but have "
1108 << bc->bcAttributes.size();
1109 } else if (bc->bcAttributes.size() >= 1) {
1110 bc->tempBcPtr->data.value1 = bc->bcAttributes[0];
1111 }
1112 }
1113 }
1114
1116}
#define MAX_DOFS_ON_ENTITY
Maximal number of DOFs on entity.
Definition: definitions.h:236
FTensor::Index< 'm', SPACE_DIM > m
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 block DOFs.
Definition: BcManager.cpp:111

◆ pushMarkDOFsOnEntities() [2/25]

template<typename T >
MoFEMErrorCode MoFEM::BcManager::pushMarkDOFsOnEntities ( const std::string  problem_name,
const std::string  block_name,
const std::string  field_name,
bool  get_low_dim_ents = true 
)

Mark block DOFs.

Parameters
problem_name
field_name
block_name
get_low_dim_entsget lower dimension entities
Returns
MoFEMErrorCode

◆ pushMarkDOFsOnEntities() [3/25]

MoFEMErrorCode MoFEM::BcManager::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 block DOFs.

Parameters
problem_name
block_name
field_name
lolowest coefficient
hihighest coefficient
get_low_dim_entsget lower dimension entities field name
Returns
MoFEMErrorCode

Definition at line 111 of file BcManager.cpp.

115 {
116 Interface &m_field = cOre;
117 auto prb_mng = m_field.getInterface<ProblemsManager>();
119
120 // if(problem_name.size())
121 // MOFEM_LOG("BcMngWorld", Sev::warning)
122 // << "Argument problem_name has no effect";
123
124 auto fix_disp = [&]() {
126
127 auto mark_fix_dofs = [&](std::vector<unsigned char> &marked_field_dofs,
128 const auto lo, const auto hi) {
129 return prb_mng->modifyMarkDofs(problem_name, ROW, field_name, lo, hi,
131 marked_field_dofs);
132 };
133
134 auto iterate_meshsets = [&](auto &&meshset_vec_ptr) {
136 for (auto m : meshset_vec_ptr) {
137 auto bc = boost::make_shared<BCs>();
138 CHKERR m_field.get_moab().get_entities_by_handle(m->getMeshset(),
139 bc->bcEnts, true);
140 CHKERR m->getAttributes(bc->bcAttributes);
141
142 if (problem_name.size())
143 CHKERR mark_fix_dofs(bc->bcMarkers, lo, hi);
144 MOFEM_LOG("BcMngWorld", Sev::verbose)
145 << "Found block " << m->getName() << " number of attributes "
146 << bc->bcAttributes.size();
147
148 if (get_low_dim_ents) {
149 auto low_dim_ents =
150 BcManagerImplTools::get_adj_ents(m_field.get_moab(), bc->bcEnts);
151 bc->bcEnts.swap(low_dim_ents);
152 }
153
154 CHKERR m_field.getInterface<CommInterface>()->synchroniseEntities(
155 bc->bcEnts);
156 if (problem_name.size())
157 CHKERR prb_mng->markDofs(problem_name, ROW, ProblemsManager::AND,
158 bc->bcEnts, bc->bcMarkers);
159
160 const std::string bc_id =
161 problem_name + "_" + field_name + "_" + m->getName();
162 bcMapByBlockName[bc_id] = bc;
163 }
165 };
166
167 CHKERR iterate_meshsets(
168
169 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(std::regex(
170
171 (boost::format("%s(.*)") % block_name).str()
172
173 ))
174
175 );
176
178 };
179
180 CHKERR fix_disp();
181
183}
auto get_adj_ents(moab::Interface &moab, const Range &ents)
Definition: BcManager.cpp:17
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.

◆ pushMarkDOFsOnEntities() [4/25]

template<>
MoFEMErrorCode MoFEM::BcManager::pushMarkDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix 
)

◆ pushMarkDOFsOnEntities() [5/25]

template<>
MoFEMErrorCode MoFEM::BcManager::pushMarkDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix 
)

◆ pushMarkDOFsOnEntities() [6/25]

template<>
MoFEMErrorCode MoFEM::BcManager::pushMarkDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix 
)

◆ pushMarkDOFsOnEntities() [7/25]

template<>
MoFEMErrorCode MoFEM::BcManager::pushMarkDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix 
)

◆ pushMarkDOFsOnEntities() [8/25]

template<>
MoFEMErrorCode MoFEM::BcManager::pushMarkDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix 
)

◆ pushMarkDOFsOnEntities() [9/25]

template<>
MoFEMErrorCode MoFEM::BcManager::pushMarkDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix 
)

◆ pushMarkDOFsOnEntities() [10/25]

template<>
MoFEMErrorCode MoFEM::BcManager::pushMarkDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix 
)

◆ pushMarkDOFsOnEntities() [11/25]

template<>
MoFEMErrorCode MoFEM::BcManager::pushMarkDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix 
)

◆ pushMarkDOFsOnEntities() [12/25]

template<>
MoFEMErrorCode MoFEM::BcManager::pushMarkDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix 
)

◆ pushMarkDOFsOnEntities() [13/25]

template<>
MoFEMErrorCode MoFEM::BcManager::pushMarkDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix 
)

◆ pushMarkDOFsOnEntities() [14/25]

template<>
MoFEMErrorCode MoFEM::BcManager::pushMarkDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix 
)

Definition at line 587 of file BcManager.cpp.

590 {
591 Interface &m_field = cOre;
592 auto prb_mng = m_field.getInterface<ProblemsManager>();
594
595 // if(problem_name.size()==0)
596 // MOFEM_LOG("BcMngWorld", Sev::warning)
597 // << "Argument problem_name has no effect";
598
599 if (block_name_field_prefix)
600 MOFEM_LOG("BcMngWorld", Sev::warning)
601 << "Argument block_name_field_prefix=true has no effect";
602
603 auto fix_disp = [&]() {
605
606 auto iterate_meshsets = [&](auto &&meshset_vec_ptr) {
608 for (auto m : meshset_vec_ptr) {
609 auto bc = boost::make_shared<BCs>();
610 CHKERR m_field.get_moab().get_entities_by_handle(m->getMeshset(),
611 bc->bcEnts, true);
612 bc->dispBcPtr = boost::make_shared<DisplacementCubitBcData>();
613 CHKERR m->getBcDataStructure(*(bc->dispBcPtr));
614
615 MOFEM_LOG("BcMngWorld", Sev::verbose)
616 << "Found block DISPLACEMENTSET id = " << m->getMeshsetId();
617 MOFEM_LOG("BcMngWorld", Sev::verbose) << *bc->dispBcPtr;
618
619 MOFEM_LOG("BcMngSync", Sev::noisy)
620 << "Found block DISPLACEMENTSET id = " << m->getMeshsetId()
621 << " nb. of entities " << bc->bcEnts.size()
622 << " highest dim of entities "
623 << BcManagerImplTools::get_dim(bc->bcEnts);
624 MOFEM_LOG("BcMngSync", Sev::noisy) << *bc->dispBcPtr;
625 MOFEM_LOG_SEVERITY_SYNC(m_field.get_comm(), Sev::noisy);
626
627 if (problem_name.size()) {
628
629 if (bc->dispBcPtr->data.flag1)
630 CHKERR prb_mng->modifyMarkDofs(problem_name, ROW, field_name, 0, 0,
632 bc->bcMarkers);
633 if (bc->dispBcPtr->data.flag2)
634 CHKERR prb_mng->modifyMarkDofs(problem_name, ROW, field_name, 1, 1,
636 bc->bcMarkers);
637 if (bc->dispBcPtr->data.flag3)
638 CHKERR prb_mng->modifyMarkDofs(problem_name, ROW, field_name, 2, 2,
640 bc->bcMarkers);
641 if (bc->dispBcPtr->data.flag4) {
642
643 CHKERR prb_mng->modifyMarkDofs(problem_name, ROW, field_name, 1, 1,
645 bc->bcMarkers);
646 CHKERR prb_mng->modifyMarkDofs(problem_name, ROW, field_name, 2, 2,
648 bc->bcMarkers);
649 }
650 if (bc->dispBcPtr->data.flag5) {
651
652 CHKERR prb_mng->modifyMarkDofs(problem_name, ROW, field_name, 0, 0,
654 bc->bcMarkers);
655 CHKERR prb_mng->modifyMarkDofs(problem_name, ROW, field_name, 2, 2,
657 bc->bcMarkers);
658 }
659 if (bc->dispBcPtr->data.flag6) {
660
661 CHKERR prb_mng->modifyMarkDofs(problem_name, ROW, field_name, 0, 0,
663 bc->bcMarkers);
664 CHKERR prb_mng->modifyMarkDofs(problem_name, ROW, field_name, 1, 1,
666 bc->bcMarkers);
667 }
668 }
669
670 if (get_low_dim_ents) {
671 auto low_dim_ents =
672 BcManagerImplTools::get_adj_ents(m_field.get_moab(), bc->bcEnts);
673 bc->bcEnts.swap(low_dim_ents);
674 }
675
676 CHKERR m_field.getInterface<CommInterface>()->synchroniseEntities(
677 bc->bcEnts);
678 if (problem_name.size())
679 CHKERR prb_mng->markDofs(problem_name, ROW, ProblemsManager::AND,
680 bc->bcEnts, bc->bcMarkers);
681
682 const std::string bc_id =
683 problem_name + "_" + field_name + "_DISPLACEMENTSET" +
684 boost::lexical_cast<std::string>(m->getMeshsetId());
685 bcMapByBlockName[bc_id] = bc;
686 }
688 };
689
690 CHKERR iterate_meshsets(
691
692 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
694
695 );
696
698 };
699
700 CHKERR fix_disp();
701
703}
#define MOFEM_LOG_SEVERITY_SYNC(comm, severity)
Synchronise "SYNC" on curtain severity level.
Definition: LogManager.hpp:352
@ NODESET
Definition: definitions.h:146
@ DISPLACEMENTSET
Definition: definitions.h:150
auto get_dim(const Range &ents)
Definition: BcManager.cpp:10

◆ pushMarkDOFsOnEntities() [15/25]

template<>
MoFEMErrorCode MoFEM::BcManager::pushMarkDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix 
)

Definition at line 706 of file BcManager.cpp.

708 {
709 Interface &m_field = cOre;
710 auto prb_mng = m_field.getInterface<ProblemsManager>();
712
713 if (block_name_field_prefix)
714 MOFEM_LOG("BcMngWorld", Sev::warning)
715 << "Argument block_name_field_prefix=true has no effect";
716
717 auto fix_temp = [&]() {
719
720 auto iterate_meshsets = [&](auto &&meshset_vec_ptr) {
722 for (auto m : meshset_vec_ptr) {
723 auto bc = boost::make_shared<BCs>();
724 CHKERR m_field.get_moab().get_entities_by_handle(m->getMeshset(),
725 bc->bcEnts, true);
726 bc->tempBcPtr = boost::make_shared<TemperatureCubitBcData>();
727 CHKERR m->getBcDataStructure(*(bc->tempBcPtr));
728
729 MOFEM_LOG("BcMngWorld", Sev::verbose)
730 << "Found block TEMPERATURESET id = " << m->getMeshsetId();
731 MOFEM_LOG("BcMngWorld", Sev::verbose) << *bc->tempBcPtr;
732
733 CHKERR prb_mng->modifyMarkDofs(
734 problem_name, ROW, field_name, 0, MAX_DOFS_ON_ENTITY,
735 ProblemsManager::MarkOP::OR, 1, bc->bcMarkers);
736
737 if (get_low_dim_ents) {
738 auto low_dim_ents =
739 BcManagerImplTools::get_adj_ents(m_field.get_moab(), bc->bcEnts);
740 bc->bcEnts.swap(low_dim_ents);
741 }
742
743 CHKERR m_field.getInterface<CommInterface>()->synchroniseEntities(
744 bc->bcEnts);
745 CHKERR prb_mng->markDofs(problem_name, ROW, ProblemsManager::AND,
746 bc->bcEnts, bc->bcMarkers);
747
748 const std::string bc_id =
749 problem_name + "_" + field_name + "_TEMPERATURESET" +
750 boost::lexical_cast<std::string>(m->getMeshsetId());
751 bcMapByBlockName[bc_id] = bc;
752 }
754 };
755
756 CHKERR iterate_meshsets(
757
758 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
760
761 );
762
764 };
765
766 CHKERR fix_temp();
767
769}
@ TEMPERATURESET
Definition: definitions.h:155

◆ pushMarkDOFsOnEntities() [16/25]

template<>
MoFEMErrorCode MoFEM::BcManager::pushMarkDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix 
)

Definition at line 772 of file BcManager.cpp.

774 {
775 Interface &m_field = cOre;
776 auto prb_mng = m_field.getInterface<ProblemsManager>();
778
779 if (block_name_field_prefix)
780 MOFEM_LOG("BcMngWorld", Sev::warning)
781 << "Argument block_name_field_prefix=true has no effect";
782
783 auto fix_disp = [&]() {
785
786 auto iterate_meshsets = [&](auto &&meshset_vec_ptr) {
788 for (auto m : meshset_vec_ptr) {
789 auto bc = boost::make_shared<BCs>();
790 CHKERR m_field.get_moab().get_entities_by_handle(m->getMeshset(),
791 bc->bcEnts, true);
792 bc->heatFluxBcPtr = boost::make_shared<HeatFluxCubitBcData>();
793 CHKERR m->getBcDataStructure(*(bc->heatFluxBcPtr));
794
795 CHKERR prb_mng->modifyMarkDofs(
796 problem_name, ROW, field_name, 0, MAX_DOFS_ON_ENTITY,
797 ProblemsManager::MarkOP::OR, 1, bc->bcMarkers);
798
799 MOFEM_LOG("BcMngWorld", Sev::verbose)
800 << "Found block HEATFLUX id = " << m->getMeshsetId();
801 MOFEM_LOG("BcMngWorld", Sev::verbose) << *bc->heatFluxBcPtr;
802
803 if (get_low_dim_ents) {
804 auto low_dim_ents =
805 BcManagerImplTools::get_adj_ents(m_field.get_moab(), bc->bcEnts);
806 bc->bcEnts.swap(low_dim_ents);
807 }
808
809 CHKERR m_field.getInterface<CommInterface>()->synchroniseEntities(
810 bc->bcEnts);
811 CHKERR prb_mng->markDofs(problem_name, ROW, ProblemsManager::AND,
812 bc->bcEnts, bc->bcMarkers);
813
814 const std::string bc_id =
815 problem_name + "_" + field_name + "_HEATFLUXSET" +
816 boost::lexical_cast<std::string>(m->getMeshsetId());
817 bcMapByBlockName[bc_id] = bc;
818 }
820 };
821
822 CHKERR iterate_meshsets(
823
824 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(SIDESET |
826
827 );
828
830 };
831
832 CHKERR fix_disp();
833
835}
@ HEATFLUXSET
Definition: definitions.h:156
@ SIDESET
Definition: definitions.h:147

◆ pushMarkDOFsOnEntities() [17/25]

template<>
MoFEMErrorCode MoFEM::BcManager::pushMarkDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix 
)

Definition at line 838 of file BcManager.cpp.

841 {
843
844 auto mark_dofs = [&](const string block_name, const int &idx_0,
845 const int &idx_1) {
847 if (block_name_field_prefix) {
848 const string field_block = field_name + "_" + block_name;
849 CHKERR pushMarkDOFsOnEntities(problem_name, field_block, field_name,
850 idx_0, idx_1, get_low_dim_ents);
851 } else {
852
853 CHKERR pushMarkDOFsOnEntities(problem_name, block_name, field_name, idx_0,
854 idx_1, get_low_dim_ents);
855 }
857 };
858
859 // displacement
860 CHKERR mark_dofs("FIX_X", 0, 0);
861 CHKERR mark_dofs("FIX_Y", 1, 1);
862 CHKERR mark_dofs("FIX_Z", 2, 2);
863 CHKERR mark_dofs("FIX_ALL", 0, MAX_DOFS_ON_ENTITY);
864
865 // rotation
866 CHKERR mark_dofs("ROTATE_X", 1, 1);
867 CHKERR mark_dofs("ROTATE_X", 2, 2);
868 CHKERR mark_dofs("ROTATE_Y", 0, 0);
869 CHKERR mark_dofs("ROTATE_Y", 2, 2);
870 CHKERR mark_dofs("ROTATE_Z", 0, 0);
871 CHKERR mark_dofs("ROTATE_Z", 1, 1);
872 CHKERR mark_dofs("ROTATE_ALL", 0, MAX_DOFS_ON_ENTITY);
873
874 std::string regex_str;
875 if (block_name_field_prefix) {
876 regex_str = (boost::format("%s_%s_%s_(.*)") % problem_name % field_name %
878 .str();
879 } else {
880 regex_str = (boost::format("%s_%s_(.*)") % problem_name % field_name).str();
881 }
882
883 for (auto &m : bcMapByBlockName) {
884 auto &bc_id = m.first;
885 if (std::regex_match(bc_id, std::regex(regex_str))) {
886 auto &bc = m.second;
887 if (std::regex_match(bc_id, std::regex("(.*)_FIX_X(.*)"))) {
888 bc->dispBcPtr = boost::make_shared<DisplacementCubitBcData>();
889 bc->dispBcPtr->data.flag1 = 1;
890 if (bc->bcAttributes.empty()) {
891 bc->dispBcPtr->data.value1 = 0;
892 MOFEM_LOG("BcMngWorld", Sev::warning)
893 << "Expected one attribute on block but have "
894 << bc->bcAttributes.size();
895 } else if (bc->bcAttributes.size() >= 1) {
896 bc->dispBcPtr->data.value1 = bc->bcAttributes[0];
897 }
898 MOFEM_LOG("BcMngWorld", Sev::inform) << "Add X " << bc_id;
899 MOFEM_LOG("BcMngWorld", Sev::inform) << *bc->dispBcPtr;
900 } else if (std::regex_match(bc_id, std::regex("(.*)_FIX_Y(.*)"))) {
901 bc->dispBcPtr = boost::make_shared<DisplacementCubitBcData>();
902 bc->dispBcPtr->data.flag2 = 1;
903 if (bc->bcAttributes.empty()) {
904 bc->dispBcPtr->data.value2 = 0;
905 MOFEM_LOG("BcMngWorld", Sev::warning)
906 << "Expected one attribute on block but have "
907 << bc->bcAttributes.size();
908 } else if (bc->bcAttributes.size() == 1) {
909 bc->dispBcPtr->data.value2 = bc->bcAttributes[0];
910 } else if (bc->bcAttributes.size() >= 2) {
911 bc->dispBcPtr->data.value2 = bc->bcAttributes[1];
912 }
913 MOFEM_LOG("BcMngWorld", Sev::inform) << "Add Y " << bc_id;
914 MOFEM_LOG("BcMngWorld", Sev::inform) << *(bc->dispBcPtr);
915 } else if (std::regex_match(bc_id, std::regex("(.*)_FIX_Z(.*)"))) {
916 bc->dispBcPtr = boost::make_shared<DisplacementCubitBcData>();
917 bc->dispBcPtr->data.flag3 = 1;
918 if (bc->bcAttributes.empty()) {
919 bc->dispBcPtr->data.value3 = 0;
920 MOFEM_LOG("BcMngWorld", Sev::warning)
921 << "Expected one attribute on block but have "
922 << bc->bcAttributes.size();
923 } else if (bc->bcAttributes.size() == 1) {
924 bc->dispBcPtr->data.value3 = bc->bcAttributes[0];
925 } else if (bc->bcAttributes.size() == 3) {
926 bc->dispBcPtr->data.value3 = bc->bcAttributes[2];
927 }
928 MOFEM_LOG("BcMngWorld", Sev::inform) << "Add Z " << bc_id;
929 MOFEM_LOG("BcMngWorld", Sev::inform) << *(bc->dispBcPtr);
930 } else if (std::regex_match(bc_id, std::regex("(.*)_FIX_ALL(.*)"))) {
931 bc->dispBcPtr = boost::make_shared<DisplacementCubitBcData>();
932 bc->dispBcPtr->data.flag1 = 1;
933 bc->dispBcPtr->data.flag2 = 1;
934 bc->dispBcPtr->data.flag3 = 1;
935 if (bc->bcAttributes.size() >= 1) {
936 bc->dispBcPtr->data.value1 = bc->bcAttributes[0];
937 }
938 if (bc->bcAttributes.size() >= 2) {
939 bc->dispBcPtr->data.value2 = bc->bcAttributes[1];
940 }
941 if (bc->bcAttributes.size() >= 3) {
942 bc->dispBcPtr->data.value3 = bc->bcAttributes[2];
943 }
944 MOFEM_LOG("BcMngWorld", Sev::inform) << "Add ALL " << bc_id;
945 MOFEM_LOG("BcMngWorld", Sev::inform) << *(bc->dispBcPtr);
946 } else if (std::regex_match(bc_id, std::regex("(.*)_ROTATE_X(.*)"))) {
947 bc->dispBcPtr =
948 boost::make_shared<DisplacementCubitBcDataWithRotation>();
949 bc->dispBcPtr->data.flag4 = 1;
950 bc->dispBcPtr->data.flag5 = 0;
951 bc->dispBcPtr->data.flag6 = 0;
952 // for the ROTATE_X block the angles can be specified with either one or
953 // three attributes, e.g. 1, coords or 1,0,0,coords
954 if (bc->bcAttributes.empty()) {
955 bc->dispBcPtr->data.value4 = 0;
956 MOFEM_LOG("BcMngWorld", Sev::warning)
957 << "Expected one attribute on block on block (angle (1 or 3), "
958 "center coords(3) but have "
959 << bc->bcAttributes.size();
960 } else if (bc->bcAttributes.size() >= 1) {
961 bc->dispBcPtr->data.value4 = bc->bcAttributes[0];
962 }
963 MOFEM_LOG("BcMngWorld", Sev::inform) << "Add X " << bc_id;
964 MOFEM_LOG("BcMngWorld", Sev::inform) << *bc->dispBcPtr;
965 if (bc->bcAttributes.size() == 4 || bc->bcAttributes.size() == 6) {
966 if (auto ext_disp_bc =
967 dynamic_cast<DisplacementCubitBcDataWithRotation *>(
968 bc->dispBcPtr.get())) {
969 auto &o = ext_disp_bc->rotOffset;
970 for (int a = 0; a != 3; ++a)
971 o[a] = bc->bcAttributes[bc->bcAttributes.size() - 3 + a];
972 MOFEM_LOG("BcMngWorld", Sev::inform)
973 << "Add Rotate X Center: " << o[0] << " " << o[1] << " "
974 << o[2];
975 }
976 }
977 } else if (std::regex_match(bc_id, std::regex("(.*)_ROTATE_Y(.*)"))) {
978 bc->dispBcPtr =
979 boost::make_shared<DisplacementCubitBcDataWithRotation>();
980 bc->dispBcPtr->data.flag4 = 0;
981 bc->dispBcPtr->data.flag5 = 1;
982 bc->dispBcPtr->data.flag6 = 0;
983 // for the ROTATE_Y block the angles can be specified with either one or
984 // three attributes, e.g. 1, coords or 0,1,0,coords
985 if (bc->bcAttributes.empty()) {
986 bc->dispBcPtr->data.value5 = 0;
987 MOFEM_LOG("BcMngWorld", Sev::warning)
988 << "Expected one attribute on block on block (angle (1 or 3), "
989 "center coords(3) but have "
990 << bc->bcAttributes.size();
991 } else if (bc->bcAttributes.size() == 1 ||
992 bc->bcAttributes.size() == 4) {
993 bc->dispBcPtr->data.value5 = bc->bcAttributes[0];
994 } else if (bc->bcAttributes.size() == 6) {
995 bc->dispBcPtr->data.value5 = bc->bcAttributes[1];
996 }
997 MOFEM_LOG("BcMngWorld", Sev::inform) << "Add Y " << bc_id;
998 MOFEM_LOG("BcMngWorld", Sev::inform) << *(bc->dispBcPtr);
999 if (bc->bcAttributes.size() == 4 || bc->bcAttributes.size() == 6) {
1000 if (auto ext_disp_bc =
1001 dynamic_cast<DisplacementCubitBcDataWithRotation *>(
1002 bc->dispBcPtr.get())) {
1003 auto &o = ext_disp_bc->rotOffset;
1004 for (int a = 0; a != 3; ++a)
1005 o[a] = bc->bcAttributes[bc->bcAttributes.size() - 3 + a];
1006 MOFEM_LOG("BcMngWorld", Sev::inform)
1007 << "Add Rotate Y Center: " << o[0] << " " << o[1] << " "
1008 << o[2];
1009 }
1010 }
1011 } else if (std::regex_match(bc_id, std::regex("(.*)_ROTATE_Z(.*)"))) {
1012 bc->dispBcPtr =
1013 boost::make_shared<DisplacementCubitBcDataWithRotation>();
1014 bc->dispBcPtr->data.flag4 = 0;
1015 bc->dispBcPtr->data.flag5 = 0;
1016 bc->dispBcPtr->data.flag6 = 1;
1017 // for the ROTATE_Z block the angles can be specified with either one or
1018 // three attributes, e.g. 1, coords or 0,0,1,coords
1019 if (bc->bcAttributes.empty()) {
1020 bc->dispBcPtr->data.value6 = 0;
1021 MOFEM_LOG("BcMngWorld", Sev::warning)
1022 << "Expected one attribute on block (angle (1 or 3), center "
1023 "coords(3) but have "
1024 << bc->bcAttributes.size();
1025 } else if (bc->bcAttributes.size() == 1 ||
1026 bc->bcAttributes.size() == 4) {
1027 bc->dispBcPtr->data.value6 = bc->bcAttributes[0];
1028 } else if (bc->bcAttributes.size() == 3 ||
1029 bc->bcAttributes.size() == 6) {
1030 bc->dispBcPtr->data.value6 = bc->bcAttributes[2];
1031 }
1032 MOFEM_LOG("BcMngWorld", Sev::inform) << "Add Z " << bc_id;
1033 MOFEM_LOG("BcMngWorld", Sev::inform) << *(bc->dispBcPtr);
1034 if (bc->bcAttributes.size() == 4 || bc->bcAttributes.size() == 6) {
1035 if (auto ext_disp_bc =
1036 dynamic_cast<DisplacementCubitBcDataWithRotation *>(
1037 bc->dispBcPtr.get())) {
1038 auto &o = ext_disp_bc->rotOffset;
1039 for (int a = 0; a != 3; ++a)
1040 o[a] = bc->bcAttributes[bc->bcAttributes.size() - 3 + a];
1041 MOFEM_LOG("BcMngWorld", Sev::inform)
1042 << "Add Rotate Z Center: " << o[0] << " " << o[1] << " "
1043 << o[2];
1044 }
1045 }
1046 } else if (std::regex_match(bc_id, std::regex("(.*)_ROTATE_ALL(.*)"))) {
1047 bc->dispBcPtr =
1048 boost::make_shared<DisplacementCubitBcDataWithRotation>();
1049 bc->dispBcPtr->data.flag4 = 1;
1050 bc->dispBcPtr->data.flag5 = 1;
1051 bc->dispBcPtr->data.flag6 = 1;
1052 if (bc->bcAttributes.size() >= 1) {
1053 bc->dispBcPtr->data.value4 = bc->bcAttributes[0];
1054 }
1055 if (bc->bcAttributes.size() >= 2) {
1056 bc->dispBcPtr->data.value5 = bc->bcAttributes[1];
1057 }
1058 if (bc->bcAttributes.size() >= 3) {
1059 bc->dispBcPtr->data.value6 = bc->bcAttributes[2];
1060 }
1061 MOFEM_LOG("BcMngWorld", Sev::inform) << "Add ALL " << bc_id;
1062 MOFEM_LOG("BcMngWorld", Sev::inform) << *(bc->dispBcPtr);
1063 if (bc->bcAttributes.size() > 3) {
1064 if (auto ext_disp_bc =
1065 dynamic_cast<DisplacementCubitBcDataWithRotation *>(
1066 bc->dispBcPtr.get())) {
1067 auto &o = ext_disp_bc->rotOffset;
1068 for (int a = 0; a != 3; ++a)
1069 o[a] = bc->bcAttributes[3 + a];
1070 MOFEM_LOG("BcMngWorld", Sev::inform)
1071 << "Add Rotate ALL Center: " << o[0] << " " << o[1] << " "
1072 << o[2];
1073 }
1074 }
1075 }
1076 }
1077 }
1078
1080}
static Index< 'o', 3 > o
constexpr double a

◆ pushMarkDOFsOnEntities() [18/25]

template<>
MoFEMErrorCode MoFEM::BcManager::pushMarkDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix 
)

Definition at line 1119 of file BcManager.cpp.

1121 {
1123 // that marks DOFs and create data when are set by cubit nodesets.
1124 CHKERR pushMarkDOFsOnEntities<BcMeshsetType<DISPLACEMENTSET>>(
1125 problem_name, field_name, get_low_dim_ents, block_name_field_prefix);
1126 // that marks DOFs and create data when are set by blocsket.
1127 CHKERR pushMarkDOFsOnEntities<BcDisplacementMeshsetType<BLOCKSET>>(
1128 problem_name, field_name, get_low_dim_ents, block_name_field_prefix);
1130}

◆ pushMarkDOFsOnEntities() [19/25]

template<>
MoFEMErrorCode MoFEM::BcManager::pushMarkDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix 
)

Definition at line 1151 of file BcManager.cpp.

1153 {
1155 CHKERR pushMarkDOFsOnEntities<BcMeshsetType<TEMPERATURESET>>(
1156 problem_name, field_name, get_low_dim_ents, block_name_field_prefix);
1157
1158 auto get_block_name = [&]() {
1159 if (block_name_field_prefix)
1160 return (boost::format("%s_FIX_SCALAR") % field_name).str();
1161 else
1162 return field_name;
1163 };
1164
1165 CHKERR pushMarkDOFsOnEntities<BcScalarMeshsetType<BLOCKSET>>(
1166 problem_name, get_block_name(), field_name, get_low_dim_ents);
1168}

◆ pushMarkDOFsOnEntities() [20/25]

template<>
MoFEMErrorCode MoFEM::BcManager::pushMarkDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix 
)

Definition at line 1194 of file BcManager.cpp.

1196 {
1198 CHKERR pushMarkDOFsOnEntities<BcMeshsetType<HEATFLUXSET>>(
1199 problem_name, field_name, get_low_dim_ents, block_name_field_prefix);
1201}

◆ pushMarkDOFsOnEntities() [21/25]

template<>
MoFEMErrorCode MoFEM::BcManager::pushMarkDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix 
)

Definition at line 1240 of file BcManager.cpp.

1242 {
1243 Interface &m_field = cOre;
1244 auto prb_mng = m_field.getInterface<ProblemsManager>();
1246
1247 if (problem_name.empty())
1248 MOFEM_LOG("BcMngWorld", Sev::warning) << "Argument problem_name is empty";
1249
1250 if (block_name_field_prefix)
1251 MOFEM_LOG("BcMngWorld", Sev::warning)
1252 << "Argument block_name_field_prefix=true has no effect";
1253
1254 auto fix_force = [&]() {
1256
1257 auto iterate_meshsets = [&](auto &&meshset_vec_ptr) {
1259 for (auto m : meshset_vec_ptr) {
1260 auto bc = boost::make_shared<BCs>();
1261 CHKERR m_field.get_moab().get_entities_by_handle(m->getMeshset(),
1262 bc->bcEnts, true);
1263 bc->forceBcPtr = boost::make_shared<ForceCubitBcData>();
1264 CHKERR m->getBcDataStructure(*(bc->forceBcPtr));
1265
1266 MOFEM_LOG("BcMngWorld", Sev::verbose)
1267 << "Found block FORCESET id = " << m->getMeshsetId();
1268 MOFEM_LOG("BcMngWorld", Sev::verbose) << *bc->forceBcPtr;
1269
1270 MOFEM_LOG("BcMngSync", Sev::noisy)
1271 << "Found block FORCESET id = " << m->getMeshsetId()
1272 << " nb. of entities " << bc->bcEnts.size()
1273 << " highest dim of entities "
1274 << BcManagerImplTools::get_dim(bc->bcEnts);
1275 MOFEM_LOG("BcMngSync", Sev::noisy) << *bc->forceBcPtr;
1276 MOFEM_LOG_SEVERITY_SYNC(m_field.get_comm(), Sev::noisy);
1277
1278 if (problem_name.size()) {
1279
1280 if (bc->forceBcPtr->data.value2 > 0)
1281 CHKERR prb_mng->modifyMarkDofs(problem_name, ROW, field_name, 0, 0,
1283 bc->bcMarkers);
1284 if (bc->forceBcPtr->data.value3 > 0)
1285 CHKERR prb_mng->modifyMarkDofs(problem_name, ROW, field_name, 1, 1,
1287 bc->bcMarkers);
1288 if (bc->forceBcPtr->data.value4 > 0)
1289 CHKERR prb_mng->modifyMarkDofs(problem_name, ROW, field_name, 2, 2,
1291 bc->bcMarkers);
1292
1293 if (bc->forceBcPtr->data.value5 > 0) {
1294
1295 CHKERR prb_mng->modifyMarkDofs(problem_name, ROW, field_name, 1, 1,
1297 bc->bcMarkers);
1298 CHKERR prb_mng->modifyMarkDofs(problem_name, ROW, field_name, 2, 2,
1300 bc->bcMarkers);
1301 }
1302 if (bc->forceBcPtr->data.value5) {
1303
1304 CHKERR prb_mng->modifyMarkDofs(problem_name, ROW, field_name, 0, 0,
1306 bc->bcMarkers);
1307 CHKERR prb_mng->modifyMarkDofs(problem_name, ROW, field_name, 2, 2,
1309 bc->bcMarkers);
1310 }
1311 if (bc->forceBcPtr->data.value6) {
1312
1313 CHKERR prb_mng->modifyMarkDofs(problem_name, ROW, field_name, 0, 0,
1315 bc->bcMarkers);
1316 CHKERR prb_mng->modifyMarkDofs(problem_name, ROW, field_name, 1, 1,
1318 bc->bcMarkers);
1319 }
1320 }
1321
1322 if (get_low_dim_ents) {
1323 auto low_dim_ents =
1324 BcManagerImplTools::get_adj_ents(m_field.get_moab(), bc->bcEnts);
1325 bc->bcEnts.swap(low_dim_ents);
1326 }
1327
1328 CHKERR m_field.getInterface<CommInterface>()->synchroniseEntities(
1329 bc->bcEnts);
1330 if (problem_name.size())
1331 CHKERR prb_mng->markDofs(problem_name, ROW, ProblemsManager::AND,
1332 bc->bcEnts, bc->bcMarkers);
1333
1334 const std::string bc_id =
1335 problem_name + "_" + field_name + "_FORCESET" +
1336 boost::lexical_cast<std::string>(m->getMeshsetId());
1337 bcMapByBlockName[bc_id] = bc;
1338 }
1340 };
1341
1342 CHKERR iterate_meshsets(
1343
1344 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(NODESET |
1345 FORCESET)
1346
1347 );
1348
1350 };
1351
1352 CHKERR fix_force();
1353
1355}
@ FORCESET
Definition: definitions.h:151

◆ pushMarkDOFsOnEntities() [22/25]

template<>
MoFEMErrorCode MoFEM::BcManager::pushMarkDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix 
)

Definition at line 1358 of file BcManager.cpp.

1360 {
1361 Interface &m_field = cOre;
1362 auto prb_mng = m_field.getInterface<ProblemsManager>();
1364
1365 if (problem_name.size() == 0)
1366 MOFEM_LOG("BcMngWorld", Sev::warning) << "Argument problem_name is empty";
1367
1368 auto get_force_block = [&](auto block_name) {
1370
1371 for (auto m :
1372 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(std::regex(
1373
1374 (boost::format("%s(.*)") % block_name).str()
1375
1376 ))
1377
1378 ) {
1379
1380 const auto block_name = m->getName();
1381
1382 MOFEM_LOG("BcMngWorld", Sev::inform)
1383 << "Found force block " << block_name;
1384
1385 auto bc = boost::make_shared<BCs>();
1386 CHKERR m_field.get_moab().get_entities_by_handle(m->getMeshset(),
1387 bc->bcEnts, true);
1388
1389 CHKERR m->getAttributes(bc->bcAttributes);
1390 if (bc->bcAttributes.size() != 3) {
1391 SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
1392 "Expect three block attributes for force block");
1393 }
1394
1395 bc->forceBcPtr = boost::make_shared<ForceCubitBcData>();
1396 // For details look at ForceCubitBcData in mofem/src/multi_indices/BCData.hpp
1397 bc->forceBcPtr->data.value1 = 1;
1398 bc->forceBcPtr->data.value3 = bc->bcAttributes[0];
1399 bc->forceBcPtr->data.value4 = bc->bcAttributes[1];
1400 bc->forceBcPtr->data.value5 = bc->bcAttributes[2];
1401
1402 MOFEM_LOG("BcMngWorld", Sev::inform) << *bc->forceBcPtr;
1403 MOFEM_LOG("BcMngSync", Sev::noisy)
1404 << "Found block FORCESET id = " << m->getMeshsetId()
1405 << " nb. of entities " << bc->bcEnts.size()
1406 << " highest dim of entities "
1407 << BcManagerImplTools::get_dim(bc->bcEnts);
1408 MOFEM_LOG("BcMngSync", Sev::noisy) << *bc->forceBcPtr;
1409 MOFEM_LOG_SEVERITY_SYNC(m_field.get_comm(), Sev::noisy);
1410
1411 if (problem_name.size()) {
1412
1413 if (bc->forceBcPtr->data.value2 > 0)
1414 CHKERR prb_mng->modifyMarkDofs(problem_name, ROW, field_name, 0, 0,
1416 bc->bcMarkers);
1417 if (bc->forceBcPtr->data.value3 > 0)
1418 CHKERR prb_mng->modifyMarkDofs(problem_name, ROW, field_name, 1, 1,
1420 bc->bcMarkers);
1421 if (bc->forceBcPtr->data.value4 > 0)
1422 CHKERR prb_mng->modifyMarkDofs(problem_name, ROW, field_name, 2, 2,
1424 bc->bcMarkers);
1425 }
1426
1427 if (get_low_dim_ents) {
1428 auto low_dim_ents =
1429 BcManagerImplTools::get_adj_ents(m_field.get_moab(), bc->bcEnts);
1430 bc->bcEnts.swap(low_dim_ents);
1431 }
1432
1433 CHKERR m_field.getInterface<CommInterface>()->synchroniseEntities(
1434 bc->bcEnts);
1435 if (problem_name.size())
1436 CHKERR prb_mng->markDofs(problem_name, ROW, ProblemsManager::AND,
1437 bc->bcEnts, bc->bcMarkers);
1438
1439 const std::string bc_id =
1440 problem_name + "_" + field_name + "_" + block_name;
1441 bcMapByBlockName[bc_id] = bc;
1442 }
1444 };
1445
1446 CHKERR get_force_block("FORCE");
1447
1449}

◆ pushMarkDOFsOnEntities() [23/25]

template<>
MoFEMErrorCode MoFEM::BcManager::pushMarkDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix 
)

Definition at line 1452 of file BcManager.cpp.

1454 {
1456
1457 CHKERR pushMarkDOFsOnEntities<BcMeshsetType<FORCESET>>(
1458 problem_name, field_name, get_low_dim_ents, block_name_field_prefix);
1459
1460 CHKERR pushMarkDOFsOnEntities<BcForceMeshsetType<BLOCKSET>>(
1461 problem_name, field_name, get_low_dim_ents, block_name_field_prefix);
1462
1464}

◆ pushMarkDOFsOnEntities() [24/25]

template<typename T >
MoFEMErrorCode MoFEM::BcManager::pushMarkDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents = true,
bool  block_name_field_prefix = false 
)

Mark block DOFs.

Parameters
problem_name
field_name
get_low_dim_entsget lower dimension entities
block_name_field_prefix
Returns
MoFEMErrorCode

◆ pushMarkDOFsOnEntities() [25/25]

template<>
MoFEMErrorCode MoFEM::BcManager::pushMarkDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
const std::string  block_name,
bool  get_low_dim_ents 
)

◆ query_interface()

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

Implements MoFEM::UnknownInterface.

Definition at line 34 of file BcManager.cpp.

35 {
37 *iface = const_cast<BcManager *>(this);
39}
BcManager(const MoFEM::Core &core)
Definition: BcManager.cpp:41

◆ removeBlockDOFsOnEntities() [1/25]

template<>
MoFEMErrorCode MoFEM::BcManager::removeBlockDOFsOnEntities ( const std::string  problem_name,
const std::string  block_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  is_distributed_mesh 
)

◆ removeBlockDOFsOnEntities() [2/25]

template<>
MoFEMErrorCode MoFEM::BcManager::removeBlockDOFsOnEntities ( const std::string  problem_name,
const std::string  block_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  is_distributed_mesh 
)

Definition at line 532 of file BcManager.cpp.

536 {
537 Interface &m_field = cOre;
538 auto prb_mng = m_field.getInterface<ProblemsManager>();
540
541 CHKERR pushMarkDOFsOnEntities<BcScalarMeshsetType<BLOCKSET>>(
542 problem_name, block_name, field_name, get_low_dim_ents);
543
544 Range ents_to_remove;
545
546 for (auto m :
547
548 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(BLOCKSET)) {
549
550 std::string bc_id = problem_name + "_" + field_name + "_" + m->getName();
551
552 auto str = boost::format("%s_%s_%s(.*)")
553
554 % problem_name % field_name % block_name;
555
556 if (std::regex_match(bc_id, std::regex(str.str()))) {
557
558 auto bc = bcMapByBlockName.at(bc_id);
559
560 if (auto temp_bc = bc->tempBcPtr) {
561 if (temp_bc->data.flag1) {
562 ents_to_remove.merge(bc->bcEnts);
563 }
564 } else {
565 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
566 "BC type not implemented");
567 }
568 }
569 }
570
571 auto remove_dofs_on_ents = [&](const Range &ents, const int lo,
572 const int hi) {
573 if (is_distributed_mesh)
574 return prb_mng->removeDofsOnEntities(problem_name, field_name, ents, lo,
575 hi);
576 else
577 return prb_mng->removeDofsOnEntitiesNotDistributed(
578 problem_name, field_name, ents, lo, hi);
579 };
580
581 CHKERR remove_dofs_on_ents(ents_to_remove, 0, MAX_DOFS_ON_ENTITY);
582
584}
@ BLOCKSET
Definition: definitions.h:148

◆ removeBlockDOFsOnEntities() [3/25]

template<typename T >
MoFEMErrorCode MoFEM::BcManager::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 
)

Mark block DOFs.

Template Parameters
BCSET
Parameters
problem_name
field_name
block_name
get_low_dim_ents
is_distributed_mesh
Returns
MoFEMErrorCode

◆ removeBlockDOFsOnEntities() [4/25]

MoFEMErrorCode MoFEM::BcManager::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.

Parameters
problem_name
block_name
field_name
lolowest coefficient
hihighest coefficient
get_low_dim_entsget lower dimension entities
is_distributed_meshdistributed mesh
Returns
MoFEMErrorCode

Definition at line 73 of file BcManager.cpp.

76 {
77 Interface &m_field = cOre;
78 auto prb_mng = m_field.getInterface<ProblemsManager>();
80
81 CHKERR pushMarkDOFsOnEntities(problem_name, block_name, field_name, lo, hi,
82 get_low_dim_ents);
83
84 auto remove_dofs_on_ents = [&](const Range &ents, const int lo,
85 const int hi) {
86 if (is_distributed_mesh)
87 return prb_mng->removeDofsOnEntities(problem_name, field_name, ents, lo,
88 hi);
89 else
90 return prb_mng->removeDofsOnEntitiesNotDistributed(
91 problem_name, field_name, ents, lo, hi);
92 };
93
94 for (auto m :
95 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(std::regex(
96
97 (boost::format("%s(.*)") % block_name).str()
98
99 ))
100
101 ) {
102 const std::string bc_id =
103 problem_name + "_" + field_name + "_" + m->getName();
104 CHKERR remove_dofs_on_ents(bcMapByBlockName.at(bc_id)->bcEnts, lo, hi);
105 bcMapByBlockName.at(bc_id)->bcMarkers = std::vector<unsigned char>();
106 }
107
109}

◆ removeBlockDOFsOnEntities() [5/25]

template<>
MoFEMErrorCode MoFEM::BcManager::removeBlockDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix,
bool  is_distributed_mesh 
)

◆ removeBlockDOFsOnEntities() [6/25]

template<>
MoFEMErrorCode MoFEM::BcManager::removeBlockDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix,
bool  is_distributed_mesh 
)

◆ removeBlockDOFsOnEntities() [7/25]

template<>
MoFEMErrorCode MoFEM::BcManager::removeBlockDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix,
bool  is_distributed_mesh 
)

◆ removeBlockDOFsOnEntities() [8/25]

template<>
MoFEMErrorCode MoFEM::BcManager::removeBlockDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix,
bool  is_distributed_mesh 
)

◆ removeBlockDOFsOnEntities() [9/25]

template<>
MoFEMErrorCode MoFEM::BcManager::removeBlockDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix,
bool  is_distributed_mesh 
)

◆ removeBlockDOFsOnEntities() [10/25]

template<>
MoFEMErrorCode MoFEM::BcManager::removeBlockDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix,
bool  is_distributed_mesh 
)

◆ removeBlockDOFsOnEntities() [11/25]

template<>
MoFEMErrorCode MoFEM::BcManager::removeBlockDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix,
bool  is_distributed_mesh 
)

◆ removeBlockDOFsOnEntities() [12/25]

template<>
MoFEMErrorCode MoFEM::BcManager::removeBlockDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix,
bool  is_distributed_mesh 
)

◆ removeBlockDOFsOnEntities() [13/25]

template<>
MoFEMErrorCode MoFEM::BcManager::removeBlockDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix,
bool  is_distributed_mesh 
)

◆ removeBlockDOFsOnEntities() [14/25]

template<>
MoFEMErrorCode MoFEM::BcManager::removeBlockDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix,
bool  is_distributed_mesh 
)

◆ removeBlockDOFsOnEntities() [15/25]

template<>
MoFEMErrorCode MoFEM::BcManager::removeBlockDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix,
bool  is_distributed_mesh 
)

Definition at line 291 of file BcManager.cpp.

295 {
296 Interface &m_field = cOre;
297 auto prb_mng = m_field.getInterface<ProblemsManager>();
299
300 CHKERR pushMarkDOFsOnEntities<BcMeshsetType<DISPLACEMENTSET>>(
301 problem_name, field_name, get_low_dim_ents, block_name_field_prefix);
302
303 std::array<Range, 3> ents_to_remove;
304
305 for (auto m :
306
307 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
309
310 const std::string bc_id =
311 problem_name + "_" + field_name + "_DISPLACEMENTSET" +
312 boost::lexical_cast<std::string>(m->getMeshsetId());
313
314 auto bc = bcMapByBlockName.at(bc_id);
315
316 if (bc->dispBcPtr) {
317 if (bc->dispBcPtr->data.flag1) {
318 ents_to_remove[0].merge(bc->bcEnts);
319 }
320 if (bc->dispBcPtr->data.flag2) {
321 ents_to_remove[1].merge(bc->bcEnts);
322 }
323 if (bc->dispBcPtr->data.flag3) {
324 ents_to_remove[2].merge(bc->bcEnts);
325 }
326 if (bc->dispBcPtr->data.flag4) {
327 ents_to_remove[1].merge(bc->bcEnts);
328 ents_to_remove[2].merge(bc->bcEnts);
329 }
330 if (bc->dispBcPtr->data.flag5) {
331 ents_to_remove[0].merge(bc->bcEnts);
332 ents_to_remove[2].merge(bc->bcEnts);
333 }
334 if (bc->dispBcPtr->data.flag6) {
335 ents_to_remove[0].merge(bc->bcEnts);
336 ents_to_remove[1].merge(bc->bcEnts);
337 }
338 }
339 bc->bcMarkers = std::vector<unsigned char>();
340 }
341
342 auto remove_dofs_on_ents = [&](const Range &ents, const int lo,
343 const int hi) {
344 if (is_distributed_mesh)
345 return prb_mng->removeDofsOnEntities(problem_name, field_name, ents, lo,
346 hi);
347 else
348 return prb_mng->removeDofsOnEntitiesNotDistributed(
349 problem_name, field_name, ents, lo, hi);
350 };
351
352 CHKERR remove_dofs_on_ents(ents_to_remove[0], 0, 0);
353 CHKERR remove_dofs_on_ents(ents_to_remove[1], 1, 1);
354 CHKERR remove_dofs_on_ents(ents_to_remove[2], 2, 2);
355
357}

◆ removeBlockDOFsOnEntities() [16/25]

template<>
MoFEMErrorCode MoFEM::BcManager::removeBlockDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix,
bool  is_distributed_mesh 
)

Definition at line 360 of file BcManager.cpp.

364 {
365 Interface &m_field = cOre;
366 auto prb_mng = m_field.getInterface<ProblemsManager>();
368
369 CHKERR pushMarkDOFsOnEntities<BcMeshsetType<TEMPERATURESET>>(
370 problem_name, field_name, get_low_dim_ents, block_name_field_prefix);
371
372 Range ents_to_remove;
373
374 for (auto m :
375
376 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(
378
379 ) {
380 const std::string bc_id =
381 problem_name + "_" + field_name + "_TEMPERATURESET" +
382 boost::lexical_cast<std::string>(m->getMeshsetId());
383 auto bc = bcMapByBlockName.at(bc_id);
384 ents_to_remove.merge(bc->bcEnts);
385 bc->bcMarkers = std::vector<unsigned char>();
386 }
387
388 auto remove_dofs_on_ents = [&](const Range &ents, const int lo,
389 const int hi) {
390 if (is_distributed_mesh)
391 return prb_mng->removeDofsOnEntities(problem_name, field_name, ents, lo,
392 hi);
393 else
394 return prb_mng->removeDofsOnEntitiesNotDistributed(
395 problem_name, field_name, ents, lo, hi);
396 };
397
398 CHKERR remove_dofs_on_ents(ents_to_remove, 0, MAX_DOFS_ON_ENTITY);
399
401}

◆ removeBlockDOFsOnEntities() [17/25]

template<>
MoFEMErrorCode MoFEM::BcManager::removeBlockDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix,
bool  is_distributed_mesh 
)

Definition at line 404 of file BcManager.cpp.

407 {
408 Interface &m_field = cOre;
409 auto prb_mng = m_field.getInterface<ProblemsManager>();
411
412 CHKERR pushMarkDOFsOnEntities<BcMeshsetType<HEATFLUXSET>>(
413 problem_name, field_name, get_low_dim_ents, block_name_field_prefix);
414
415 Range ents_to_remove;
416
417 for (auto m :
418
419 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(NODESET |
421
422 ) {
423 const std::string bc_id =
424 problem_name + "_" + field_name + "_HEATFLUXSET" +
425 boost::lexical_cast<std::string>(m->getMeshsetId());
426 auto bc = bcMapByBlockName.at(bc_id);
427 ents_to_remove.merge(bc->bcEnts);
428 bc->bcMarkers = std::vector<unsigned char>();
429 }
430
431 auto remove_dofs_on_ents = [&](const Range &ents, const int lo,
432 const int hi) {
433 if (is_distributed_mesh)
434 return prb_mng->removeDofsOnEntities(problem_name, field_name, ents, lo,
435 hi);
436 else
437 return prb_mng->removeDofsOnEntitiesNotDistributed(
438 problem_name, field_name, ents, lo, hi);
439 };
440
441 CHKERR remove_dofs_on_ents(ents_to_remove, 0, MAX_DOFS_ON_ENTITY);
442
444}

◆ removeBlockDOFsOnEntities() [18/25]

template<>
MoFEMErrorCode MoFEM::BcManager::removeBlockDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix,
bool  is_distributed_mesh 
)

Definition at line 447 of file BcManager.cpp.

451 {
452 Interface &m_field = cOre;
453 auto prb_mng = m_field.getInterface<ProblemsManager>();
455
456 CHKERR pushMarkDOFsOnEntities<BcDisplacementMeshsetType<BLOCKSET>>(
457 problem_name, field_name, get_low_dim_ents, block_name_field_prefix);
458
459 std::array<Range, 3> ents_to_remove;
460
461 for (auto m :
462
463 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(BLOCKSET)) {
464
465 const auto block_name = m->getName();
466
467 std::string bc_id = problem_name + "_" + field_name + "_" + block_name;
468 std::string regex_str;
469 if (block_name_field_prefix) {
470 regex_str = (boost::format("%s_%s_%s_((FIX_(ALL|X|Y|Z))|("
471 "DISPLACEMENT|ROTATE))(.*)") %
472 problem_name % field_name % field_name)
473 .str();
474 } else {
475 regex_str = (boost::format("%s_%s_((FIX_(ALL|X|Y|Z))|("
476 "DISPLACEMENT|ROTATE))(.*)") %
477 problem_name % field_name)
478 .str();
479 }
480
481 if (std::regex_match(bc_id, std::regex(regex_str))) {
482
483 auto bc = bcMapByBlockName.at(bc_id);
484
485 if (auto disp_bc = bc->dispBcPtr) {
486 if (disp_bc->data.flag1) {
487 ents_to_remove[0].merge(bc->bcEnts);
488 }
489 if (disp_bc->data.flag2) {
490 ents_to_remove[1].merge(bc->bcEnts);
491 }
492 if (disp_bc->data.flag3) {
493 ents_to_remove[2].merge(bc->bcEnts);
494 }
495 if (disp_bc->data.flag4) {
496 ents_to_remove[1].merge(bc->bcEnts);
497 ents_to_remove[2].merge(bc->bcEnts);
498 }
499 if (disp_bc->data.flag5) {
500 ents_to_remove[0].merge(bc->bcEnts);
501 ents_to_remove[2].merge(bc->bcEnts);
502 }
503 if (disp_bc->data.flag6) {
504 ents_to_remove[0].merge(bc->bcEnts);
505 ents_to_remove[1].merge(bc->bcEnts);
506 }
507 } else {
508 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
509 "BC type not implemented");
510 }
511 }
512 }
513
514 auto remove_dofs_on_ents = [&](const Range &ents, const int lo,
515 const int hi) {
516 if (is_distributed_mesh)
517 return prb_mng->removeDofsOnEntities(problem_name, field_name, ents, lo,
518 hi);
519 else
520 return prb_mng->removeDofsOnEntitiesNotDistributed(
521 problem_name, field_name, ents, lo, hi);
522 };
523
524 CHKERR remove_dofs_on_ents(ents_to_remove[0], 0, 0);
525 CHKERR remove_dofs_on_ents(ents_to_remove[1], 1, 1);
526 CHKERR remove_dofs_on_ents(ents_to_remove[2], 2, 2);
527
529}

◆ removeBlockDOFsOnEntities() [19/25]

template<>
MoFEMErrorCode MoFEM::BcManager::removeBlockDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix,
bool  is_distributed_mesh 
)

Definition at line 1133 of file BcManager.cpp.

1136 {
1138 // that remove DOFs when are set by cubit nodesets.
1139 CHKERR removeBlockDOFsOnEntities<BcMeshsetType<DISPLACEMENTSET>>(
1140 problem_name, field_name, get_low_dim_ents, block_name_field_prefix,
1141 is_distributed_mesh);
1142 // that remove DOFs when are by blocksets
1143 CHKERR removeBlockDOFsOnEntities<BcDisplacementMeshsetType<BLOCKSET>>(
1144 problem_name, field_name, get_low_dim_ents, block_name_field_prefix,
1145 is_distributed_mesh);
1146 // add more ways to remove bcs when appropiate
1148}

◆ removeBlockDOFsOnEntities() [20/25]

template<>
MoFEMErrorCode MoFEM::BcManager::removeBlockDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix,
bool  is_distributed_mesh 
)

Definition at line 1171 of file BcManager.cpp.

1174 {
1176 CHKERR removeBlockDOFsOnEntities<BcMeshsetType<TEMPERATURESET>>(
1177 problem_name, field_name, get_low_dim_ents, block_name_field_prefix,
1178 is_distributed_mesh);
1179
1180 auto get_block_name = [&]() {
1181 if (block_name_field_prefix)
1182 return (boost::format("%s_FIX_SCALAR") % field_name).str();
1183 else
1184 return field_name;
1185 };
1186
1187 CHKERR removeBlockDOFsOnEntities<BcScalarMeshsetType<BLOCKSET>>(
1188 problem_name, get_block_name(), field_name, get_low_dim_ents,
1189 is_distributed_mesh);
1191}

◆ removeBlockDOFsOnEntities() [21/25]

template<>
MoFEMErrorCode MoFEM::BcManager::removeBlockDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix,
bool  is_distributed_mesh 
)

Definition at line 1204 of file BcManager.cpp.

1207 {
1209 CHKERR removeBlockDOFsOnEntities<BcMeshsetType<HEATFLUXSET>>(
1210 problem_name, field_name, get_low_dim_ents, block_name_field_prefix,
1211 is_distributed_mesh);
1213}

◆ removeBlockDOFsOnEntities() [22/25]

template<>
MoFEMErrorCode MoFEM::BcManager::removeBlockDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix,
bool  is_distributed_mesh 
)

Definition at line 1467 of file BcManager.cpp.

1470 {
1471 Interface &m_field = cOre;
1472 auto prb_mng = m_field.getInterface<ProblemsManager>();
1474
1475 CHKERR pushMarkDOFsOnEntities<BcMeshsetType<FORCESET>>(
1476 problem_name, field_name, get_low_dim_ents);
1477
1478 std::array<Range, 3> ents_to_remove;
1479
1480 for (auto m :
1481
1482 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(NODESET |
1483 FORCESET)) {
1484
1485 const auto block_name = m->getName();
1486 std::string bc_id = problem_name + "_" + field_name + "_" + block_name;
1487
1488 auto str = boost::format("%s_%s_%s(.*)")
1489
1490 % problem_name % field_name % block_name;
1491
1492 if (std::regex_match(bc_id, std::regex(str.str()))) {
1493
1494 auto bc = bcMapByBlockName.at(bc_id);
1495
1496 if (auto force_bc = bc->forceBcPtr) {
1497 if (force_bc->data.value3 > 0) {
1498 ents_to_remove[0].merge(bc->bcEnts);
1499 }
1500 if (force_bc->data.value4 > 0) {
1501 ents_to_remove[1].merge(bc->bcEnts);
1502 }
1503 if (force_bc->data.value5 > 0) {
1504 ents_to_remove[2].merge(bc->bcEnts);
1505 }
1506 } else {
1507 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1508 "BC type not implemented");
1509 }
1510 }
1511 }
1512
1513 auto remove_dofs_on_ents = [&](const Range &ents, const int lo,
1514 const int hi) {
1515 if (is_distributed_mesh)
1516 return prb_mng->removeDofsOnEntities(problem_name, field_name, ents, lo,
1517 hi);
1518 else
1519 return prb_mng->removeDofsOnEntitiesNotDistributed(
1520 problem_name, field_name, ents, lo, hi);
1521 };
1522
1523 CHKERR remove_dofs_on_ents(ents_to_remove[0], 0, 0);
1524 CHKERR remove_dofs_on_ents(ents_to_remove[1], 1, 1);
1525 CHKERR remove_dofs_on_ents(ents_to_remove[2], 2, 2);
1526
1528}

◆ removeBlockDOFsOnEntities() [23/25]

template<>
MoFEMErrorCode MoFEM::BcManager::removeBlockDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix,
bool  is_distributed_mesh 
)

Definition at line 1531 of file BcManager.cpp.

1535 {
1536 Interface &m_field = cOre;
1537 auto prb_mng = m_field.getInterface<ProblemsManager>();
1539
1540 CHKERR pushMarkDOFsOnEntities<BcForceMeshsetType<BLOCKSET>>(
1541 problem_name, field_name, get_low_dim_ents);
1542
1543 std::array<Range, 3> ents_to_remove;
1544
1545 for (auto m :
1546
1547 m_field.getInterface<MeshsetsManager>()->getCubitMeshsetPtr(BLOCKSET)) {
1548
1549 const auto block_name = m->getName();
1550 std::string bc_id = problem_name + "_" + field_name + "_" + block_name;
1551
1552 auto str = boost::format("%s_%s_%s(.*)")
1553
1554 % problem_name % field_name % block_name;
1555
1556 if (std::regex_match(bc_id, std::regex(str.str()))) {
1557
1558 auto bc = bcMapByBlockName.at(bc_id);
1559
1560 if (auto force_bc = bc->forceBcPtr) {
1561 if (force_bc->data.value3 > 0) {
1562 ents_to_remove[0].merge(bc->bcEnts);
1563 }
1564 if (force_bc->data.value4 > 0) {
1565 ents_to_remove[1].merge(bc->bcEnts);
1566 }
1567 if (force_bc->data.value5 > 0) {
1568 ents_to_remove[2].merge(bc->bcEnts);
1569 }
1570 } else {
1571 SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
1572 "BC type not implemented");
1573 }
1574 }
1575 }
1576
1577 auto remove_dofs_on_ents = [&](const Range &ents, const int lo,
1578 const int hi) {
1579 if (is_distributed_mesh)
1580 return prb_mng->removeDofsOnEntities(problem_name, field_name, ents, lo,
1581 hi);
1582 else
1583 return prb_mng->removeDofsOnEntitiesNotDistributed(
1584 problem_name, field_name, ents, lo, hi);
1585 };
1586
1587 CHKERR remove_dofs_on_ents(ents_to_remove[0], 0, 0);
1588 CHKERR remove_dofs_on_ents(ents_to_remove[1], 1, 1);
1589 CHKERR remove_dofs_on_ents(ents_to_remove[2], 2, 2);
1590
1592}

◆ removeBlockDOFsOnEntities() [24/25]

template<>
MoFEMErrorCode MoFEM::BcManager::removeBlockDOFsOnEntities ( const std::string  problem_name,
const std::string  field_name,
bool  get_low_dim_ents,
bool  block_name_field_prefix,
bool  is_distributed_mesh 
)

Definition at line 1595 of file BcManager.cpp.

1598 {
1600
1601 CHKERR removeBlockDOFsOnEntities<BcMeshsetType<FORCESET>>(
1602 problem_name, field_name, get_low_dim_ents, block_name_field_prefix,
1603 is_distributed_mesh);
1604
1605 CHKERR removeBlockDOFsOnEntities<BcForceMeshsetType<BLOCKSET>>(
1606 problem_name, field_name, get_low_dim_ents, block_name_field_prefix,
1607 is_distributed_mesh);
1608
1610};

◆ removeBlockDOFsOnEntities() [25/25]

template<typename T >
MoFEMErrorCode MoFEM::BcManager::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 
)

Mark block DOFs.

Template Parameters
BCSET
Parameters
problem_name
field_name
get_low_dim_ents
is_distributed_mesh
block_name_field_prefix
Returns
MoFEMErrorCode

Member Data Documentation

◆ bcMapByBlockName

BcMapByBlockName MoFEM::BcManager::bcMapByBlockName
private

Definition at line 327 of file BcManager.hpp.

◆ cOre

MoFEM::Core& MoFEM::BcManager::cOre
private

Definition at line 325 of file BcManager.hpp.


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