8 namespace po = boost::program_options;
12 void MeshsetsManager::sortMeshsets(
13 std::vector<const CubitMeshSets *> &vec_ptr) {
14 std::sort(vec_ptr.begin(), vec_ptr.end(),
16 if (a->getBcType().to_ullong() < b->getBcType().to_ullong())
18 if (a->getBcType().to_ullong() > b->getBcType().to_ullong())
21 return a->getMeshsetId() < b->getMeshsetId();
25 bool MeshsetsManager::brodcastMeshsets =
true;
28 MeshsetsManager::query_interface(boost::typeindex::type_index type_index,
34 MeshsetsManager::MeshsetsManager(
const Core &core)
35 : cOre(const_cast<
Core &>(core)) {
38 auto core_log = logging::core::get();
56 MOFEM_LOG(
"MeshsetMngWorld", Sev::noisy) <<
"Mashset manager created";
72 std::vector<const CubitMeshSets *> vec_ptr;
74 vec_ptr.push_back(&
m);
78 for (
auto m_ptr : vec_ptr) {
80 <<
"meshset in database " << *m_ptr;
83 for (
auto m_ptr : vec_ptr) {
85 <<
"meshset in database " << *m_ptr;
98 CHKERR moab.get_entities_by_type(0, MBENTITYSET, meshsets,
false);
99 for (
auto m : meshsets) {
109 CHKERR m_field.
get_moab().add_entities(p.first->getMeshset(), ents);
115 std::vector<const CubitMeshSets *> vec_ptr;
117 vec_ptr.push_back(&
m);
121 for (
auto m_ptr : vec_ptr) {
122 MOFEM_LOG(
"MeshsetMngSync", Sev::verbose) <<
"read " << *m_ptr;
134 ParallelComm *pcomm = ParallelComm::get_pcomm(&moab,
MYPCOMM_INDEX);
137 "MOAB communicator not set");
139 const double coords[] = {0, 0, 0};
141 auto set_tags_dummy_node = [&](
const EntityHandle dummy_node,
144 std::vector<Tag> tag_handles;
145 CHKERR moab.tag_get_tags_on_entity(meshset, tag_handles);
146 for (
auto th : tag_handles) {
149 CHKERR moab.tag_get_by_ptr(
th, &meshset, 1, (
const void **)data,
152 CHKERR moab.tag_set_by_ptr(
th, &dummy_node, 1, data, &tag_size);
158 std::vector<const CubitMeshSets *> vec_ptr;
161 vec_ptr.push_back(&
m);
166 std::vector<EntityHandle> vec_meshsets;
167 vec_meshsets.reserve(vec_ptr.size());
168 for (
auto m_ptr : vec_ptr) {
169 vec_meshsets.push_back(m_ptr->getMeshset());
174 MOFEM_LOG(
"MeshsetMngSync", Sev::verbose)
175 <<
"broadcast NODESET " << vec_meshsets.size();
178 MOFEM_LOG(
"MeshsetMngSync", Sev::verbose)
179 <<
"broadcast SIDESET " << vec_meshsets.size();
182 MOFEM_LOG(
"MeshsetMngSync", Sev::verbose)
183 <<
"broadcast BLOCKSET " << vec_meshsets.size();
187 for (
int from_proc = 0; from_proc < pcomm->size(); ++from_proc) {
191 if (from_proc == pcomm->rank()) {
192 std::vector<EntityHandle> dummy_nodes(vec_meshsets.size(), 0);
194 for (
auto m : vec_meshsets) {
195 CHKERR moab.create_vertex(coords, dummy_nodes[
i]);
196 CHKERR set_tags_dummy_node(dummy_nodes[
i],
m);
199 r_dummy_nodes.insert_list(dummy_nodes.begin(), dummy_nodes.end());
202 CHKERR pcomm->broadcast_entities(from_proc, r_dummy_nodes,
false,
true);
204 if (from_proc != pcomm->rank()) {
206 for (
auto dummy_node : r_dummy_nodes) {
212 .find(boost::make_tuple(
218 CHKERR moab.create_meshset(MESHSET_SET,
m);
219 CHKERR set_tags_dummy_node(
m, dummy_node);
224 MOFEM_LOG(
"MeshsetMngSync", Sev::warning)
225 <<
"broadcasted vertex " << dummy_node <<
" has negative id";
231 MOFEM_LOG(
"MeshsetMngSync", Sev::verbose)
232 <<
"broadcast send from " << from_proc;
235 CHKERR moab.delete_entities(r_dummy_nodes);
248 int default_val = -1;
249 CHKERR moab.tag_get_handle(DIRICHLET_SET_TAG_NAME, 1, MB_TYPE_INTEGER,
nsTag,
250 MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
252 CHKERR moab.tag_get_handle(NEUMANN_SET_TAG_NAME, 1, MB_TYPE_INTEGER,
ssTag,
253 MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
255 const int def_bc_data_len = 0;
256 std::string tag_name = std::string(DIRICHLET_SET_TAG_NAME) +
"__BC_DATA";
257 CHKERR moab.tag_get_handle(
258 tag_name.c_str(), def_bc_data_len, MB_TYPE_OPAQUE,
nsTag_data,
259 MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES | MB_TAG_VARLEN, NULL);
261 tag_name = std::string(NEUMANN_SET_TAG_NAME) +
"__BC_DATA";
262 CHKERR moab.tag_get_handle(
263 tag_name.c_str(), def_bc_data_len, MB_TYPE_OPAQUE,
ssTag_data,
264 MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES | MB_TAG_VARLEN, NULL);
266 CHKERR moab.tag_get_handle(MATERIAL_SET_TAG_NAME, 1, MB_TYPE_INTEGER,
bhTag,
267 MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
269 std::vector<unsigned int> def_uint_zero(3, 0);
270 CHKERR moab.tag_get_handle(
271 BLOCK_HEADER, 3 *
sizeof(
unsigned int), MB_TYPE_INTEGER,
bhTag_header,
272 MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES, &def_uint_zero[0]);
275 int def_Block_Attributes_length = 0;
276 CHKERR moab.tag_get_handle(
277 BLOCK_ATTRIBUTES, def_Block_Attributes_length, MB_TYPE_DOUBLE,
278 block_attribs, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN, NULL);
281 CHKERR moab.tag_get_handle(NAME_TAG_NAME, NAME_TAG_SIZE, MB_TYPE_OPAQUE,
282 entity_name_tag, MB_TAG_SPARSE | MB_TAG_CREAT);
329 CHKERR it->getAttributeDataStructure(data);
330 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform) << *it;
331 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform) << data;
333 CHKERR moab.get_entities_by_dimension(it->meshset, 3, tets,
true);
334 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform)
335 <<
"MAT_ELATIC msId " << it->getMeshsetId() <<
" nb. volumes "
342 CHKERR it->getAttributeDataStructure(data);
343 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform) << *it;
344 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform) << data;
350 CHKERR it->getAttributeDataStructure(data);
351 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform) << *it;
352 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform) << data;
361 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
370 int *
const number_of_meshsets_ptr)
const {
373 if (std::distance(miit, hi_miit) == 0) {
376 if (number_of_meshsets_ptr) {
377 *number_of_meshsets_ptr = std::distance(miit, hi_miit);
384 const std::string name) {
390 "such cubit meshset is already there", ms_id);
399 "meshset not inserted");
401 if (name.size() > 0) {
406 "name to cubit meshset can not be set");
416 const int ms_id,
const Range &ents) {
422 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
426 "Cannot find Cubit meshset with id: %d", ms_id);
429 CHKERR moab.add_entities(meshset, ents);
443 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
447 "Cannot find Cubit meshset with id: %d", ms_id);
450 CHKERR moab.add_entities(meshset, ents, nb_ents);
457 const std::vector<double> &attributes,
458 const std::string name) {
464 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
468 "Cannot find Cubit meshset with id: %d", ms_id);
470 if (name.size() > 0) {
475 "name to cubit meshset can not be set");
483 "modification unsuccessful");
485 std::ostringstream ss;
486 ss <<
"Block " << cit->getName();
488 for (
unsigned int ii = 0; ii != attributes.size(); ii++) {
489 ss << attributes[ii] <<
" ";
491 MOFEM_LOG(
"MeshsetMngSelf", Sev::noisy) << ss.str();
504 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
508 "Cannot find Cubit meshset with id: %d", ms_id);
510 if (name.size() > 0) {
515 "name to cubit meshset can not be set");
523 "modification unsuccessful");
535 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
539 "Cubit meshset with id is already there", ms_id);
546 "modification unsuccessful");
558 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
563 "meshset not found", ms_id);
570 CHKERR moab.delete_entities(&meshset, 1);
582 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
585 *cubit_meshset_ptr = &*miit;
588 "msId = %d is not there", ms_id);
599 "Get not get meshset");
600 return cubit_meshset_ptr;
604 const string name,
const CubitMeshSets **cubit_meshset_ptr)
const {
609 if (std::distance(miit, hi_miit) == 0) {
611 "meshset name <%s> is not there", name.c_str());
613 if (std::distance(miit, hi_miit) > 1) {
615 "more that one meshser of that name <%s>", name.c_str());
617 *cubit_meshset_ptr = &*miit;
623 std::vector<const CubitMeshSets *> &vec_ptr)
const {
626 cubit_bc_type.to_ulong());
627 for (
auto it =
r.first; it !=
r.second; ++it) {
628 vec_ptr.push_back(&*it);
634 std::vector<const CubitMeshSets *>
636 std::vector<const CubitMeshSets *> vec_ptr;
638 "Error in getting meshsets by name");
643 const std::regex reg_exp_name,
644 std::vector<const CubitMeshSets *> &vec_ptr)
const {
648 for (;
r.first !=
r.second; ++
r.first) {
649 const auto name =
r.first->getName();
650 if (std::regex_match(name, reg_exp_name)) {
651 vec_ptr.push_back(&*
r.first);
658 std::vector<const CubitMeshSets *>
660 std::vector<const CubitMeshSets *> vec_ptr;
662 "Error in getting meshsets by name");
667 const int msId,
const unsigned int cubit_bc_type,
const int dimension,
668 Range &entities,
const bool recursive)
const {
674 boost::make_tuple(msId, cubit_bc_type));
677 CHKERR miit->getMeshsetIdEntitiesByDimension(moab, dimension, entities,
681 "msId = %d is not there", msId);
687 const int ms_id,
const unsigned int cubit_bc_type,
Range &entities,
688 const bool recursive)
const {
694 boost::make_tuple(ms_id, cubit_bc_type));
697 CHKERR miit->getMeshsetIdEntitiesByDimension(moab, entities, recursive);
700 "ms_id = %d is not there", ms_id);
706 const unsigned int cubit_bc_type,
712 boost::make_tuple(ms_id, cubit_bc_type));
715 meshset = miit->meshset;
718 "ms_id = %d is not there", ms_id);
724 const int ms_id,
const unsigned int cubit_bc_type,
725 const EntityHandle *entities,
int num_entities,
const int operation_type) {
728 boost::make_tuple(ms_id, cubit_bc_type));
732 return m_field.
get_moab().contains_entities(miit->meshset, entities,
733 num_entities, operation_type);
740 Range &meshsets)
const {
746 for (; miit != hi_miit; miit++) {
747 meshsets.insert(miit->meshset);
779 std::memcpy(
dispBc.
data.name,
"Displacement", 12);
784 std::memcpy(
cfgBc.
data.name,
"cfd_bc", 6);
789 bool clean_file_options) {
792 std::ifstream ini_file(file_name.c_str(), std::ifstream::in);
793 po::variables_map vm;
794 if (clean_file_options) {
796 boost::shared_ptr<boost::program_options::options_description>(
797 new po::options_description());
800 auto add_block_attributes = [&](
auto prefix,
auto &block_lists,
auto &it) {
803 (prefix +
".number_of_attributes").c_str(),
804 po::value<int>(&block_lists[it->getMeshsetId()].numberOfAttributes)
806 "Number of blockset attribute");
807 for (
int ii = 1; ii <= 10; ii++) {
808 std::string surfix =
".user" + boost::lexical_cast<std::string>(ii);
810 (prefix + surfix).c_str(),
811 po::value<double>(&block_lists[it->getMeshsetId()].aTtr[ii - 1])
812 ->default_value(0.0),
813 "Add block attribute");
818 map<int, BlockData> block_lists;
820 block_lists[it->getMeshsetId()].cubitMeshset = it->getMeshset();
822 "block_" + boost::lexical_cast<std::string>(it->getMeshsetId());
824 (prefix +
".add").c_str(),
825 po::value<string>(&block_lists[it->getMeshsetId()].addType)
826 ->default_value(
"UNKNOWNSET"),
828 (prefix +
".id").c_str(),
829 po::value<int>(&block_lists[it->getMeshsetId()].iD)->default_value(-1),
831 (prefix +
".name").c_str(),
832 po::value<string>(&block_lists[it->getMeshsetId()].nAme)
834 "Name of the meshset");
837 add_block_attributes(prefix, block_lists, it);
845 (prefix +
".young").c_str(),
847 &block_lists[it->getMeshsetId()].matElastic.data.Young)
850 (prefix +
".poisson").c_str(),
852 &block_lists[it->getMeshsetId()].matElastic.data.Poisson)
855 (prefix +
".thermalexpansion").c_str(),
857 &block_lists[it->getMeshsetId()].matElastic.data.ThermalExpansion)
859 "Thermal expansion");
870 (prefix +
".Youngp").c_str(),
872 &block_lists[it->getMeshsetId()].matTransIso.data.Youngp)
875 (prefix +
".Youngz").c_str(),
877 &block_lists[it->getMeshsetId()].matTransIso.data.Youngz)
880 (prefix +
".Poissonp").c_str(),
882 &block_lists[it->getMeshsetId()].matTransIso.data.Poissonp)
885 (prefix +
".Poissonpz").c_str(),
887 &block_lists[it->getMeshsetId()].matTransIso.data.Poissonpz)
890 (prefix +
".Shearzp").c_str(),
892 &block_lists[it->getMeshsetId()].matTransIso.data.Shearzp)
902 (prefix +
".conductivity").c_str(),
904 &block_lists[it->getMeshsetId()].matThermal.data.Conductivity)
907 (prefix +
".capacity").c_str(),
909 &block_lists[it->getMeshsetId()].matThermal.data.HeatCapacity)
921 (prefix +
".interface_alpha").c_str(),
923 &block_lists[it->getMeshsetId()].matInterf.data.alpha)
925 "alpha")((prefix +
".interface_beta").c_str(),
927 &block_lists[it->getMeshsetId()].matInterf.data.beta)
930 (prefix +
".interface_ft").c_str(),
931 po::value<double>(&block_lists[it->getMeshsetId()].matInterf.data.ft)
934 (prefix +
".interface_Gf").c_str(),
935 po::value<double>(&block_lists[it->getMeshsetId()].matInterf.data.Gf)
956 (prefix +
".disp_flag1").c_str(),
957 po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag1)
960 (prefix +
".disp_flag2").c_str(),
961 po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag2)
964 (prefix +
".disp_flag3").c_str(),
965 po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag3)
968 (prefix +
".disp_flag4").c_str(),
969 po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag4)
972 (prefix +
".disp_flag5").c_str(),
973 po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag5)
976 (prefix +
".disp_flag6").c_str(),
977 po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag6)
980 (prefix +
".disp_ux").c_str(),
981 po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value1)
984 (prefix +
".disp_uy").c_str(),
985 po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value2)
988 (prefix +
".disp_uz").c_str(),
989 po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value3)
992 (prefix +
".disp_rx").c_str(),
993 po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value4)
996 (prefix +
".disp_ry").c_str(),
997 po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value5)
1000 (prefix +
".disp_rz").c_str(),
1001 po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value6)
1018 (prefix +
".force_magnitude").c_str(),
1020 &block_lists[it->getMeshsetId()].forceBc.data.value1)
1022 "value1")((prefix +
".moment_magnitude").c_str(),
1024 &block_lists[it->getMeshsetId()].forceBc.data.value2)
1027 (prefix +
".force_fx").c_str(),
1029 &block_lists[it->getMeshsetId()].forceBc.data.value3)
1031 "value3")((prefix +
".force_fy").c_str(),
1033 &block_lists[it->getMeshsetId()].forceBc.data.value4)
1036 (prefix +
".force_fz").c_str(),
1038 &block_lists[it->getMeshsetId()].forceBc.data.value5)
1040 "value5")((prefix +
".moment_mx").c_str(),
1042 &block_lists[it->getMeshsetId()].forceBc.data.value6)
1045 (prefix +
".moment_my").c_str(),
1047 &block_lists[it->getMeshsetId()].forceBc.data.value7)
1049 "value7")((prefix +
".moment_mz").c_str(),
1051 &block_lists[it->getMeshsetId()].forceBc.data.value8)
1072 (prefix +
".temperature_flag1").c_str(),
1074 &block_lists[it->getMeshsetId()].temperatureBc.data.flag1)
1077 (prefix +
".temperature_t").c_str(),
1079 &block_lists[it->getMeshsetId()].temperatureBc.data.value1)
1092 (prefix +
".pressure_flag2").c_str(),
1094 &block_lists[it->getMeshsetId()].pressureBc.data.flag2)
1096 "flag2")((prefix +
".pressure_magnitude").c_str(),
1098 &block_lists[it->getMeshsetId()].pressureBc.data.value1)
1114 (prefix +
".heatflux_flag1").c_str(),
1116 &block_lists[it->getMeshsetId()].heatFluxBc.data.flag1)
1118 "flag1")((prefix +
".heatflux_magnitude").c_str(),
1120 &block_lists[it->getMeshsetId()].heatFluxBc.data.value1)
1127 (prefix +
".interface_type").c_str(),
1128 po::value<char>(&block_lists[it->getMeshsetId()].cfgBc.data.type)
1134 map<int, BlockData> block_set_attributes;
1136 block_set_attributes[it->getMeshsetId()].cubitMeshset = it->getMeshset();
1137 block_set_attributes[it->getMeshsetId()].iD = it->getMeshsetId();
1138 block_set_attributes[it->getMeshsetId()].bcType =
BLOCKSET;
1139 std::string block_name = it->getName();
1141 std::remove_if(block_name.begin(), block_name.end(), ::isspace),
1143 block_set_attributes[it->getMeshsetId()].nAme = block_name;
1145 if (block_name.compare(
"NoNameSet") != 0) {
1146 std::string prefix =
"SET_ATTR_" + block_name;
1148 add_block_attributes(prefix, block_set_attributes, it);
1152 po::parsed_options parsed =
1164 block_lists[it->getMeshsetId()].addType) {
1169 if (bc_type.none()) {
1170 block_lists[it->getMeshsetId()].bcType =
UNKNOWNSET;
1175 if (bc_type.to_ulong() ==
BLOCKSET)
1176 block_lists[it->getMeshsetId()].bcType =
BLOCKSET;
1177 else if (bc_type.to_ulong() ==
NODESET)
1178 block_lists[it->getMeshsetId()].bcType =
NODESET;
1179 else if (bc_type.to_ulong() ==
SIDESET)
1180 block_lists[it->getMeshsetId()].bcType =
SIDESET;
1183 "Not yet implemented type %s\n",
1184 block_lists[it->getMeshsetId()].addType.c_str());
1186 if (block_lists[it->getMeshsetId()].iD == -1) {
1188 "Unset iD number %d\n", block_lists[it->getMeshsetId()].iD);
1192 std::vector<std::string> additional_parameters;
1193 additional_parameters =
1194 collect_unrecognized(parsed.options, po::include_positional);
1195 for (std::vector<std::string>::iterator vit = additional_parameters.begin();
1196 vit != additional_parameters.end(); vit++) {
1197 MOFEM_LOG_C(
"MeshsetMngSelf", Sev::warning,
"Unrecognized option %s",
1200 for (map<int, BlockData>::iterator mit = block_lists.begin();
1201 mit != block_lists.end(); mit++) {
1202 CubitMeshSet_multiIndex::iterator cubit_meshset_it =
1206 "Data inconsistency\n");
1208 switch (mit->second.bcType) {
1212 if ((
CubitBCType(mit->second.bcType) & cubit_meshset_it->getBcType())
1214 mit->second.iD == cubit_meshset_it->getMeshsetId()) {
1226 if (mit->second.matElastic.data.Young != -1) {
1228 mit->second.matElastic);
1230 if (mit->second.matTransIso.data.Youngp != -1) {
1232 mit->second.matTransIso);
1234 if (mit->second.matThermal.data.Conductivity != -1) {
1236 mit->second.matThermal);
1238 if (mit->second.matInterf.data.ft != -1) {
1240 mit->second.matInterf);
1244 if ((
CubitBCType(mit->second.bcType) & cubit_meshset_it->getBcType())
1246 mit->second.iD == cubit_meshset_it->getMeshsetId()) {
1255 if (mit->second.dispBc.data.flag1 || mit->second.dispBc.data.flag2 ||
1256 mit->second.dispBc.data.flag3 || mit->second.dispBc.data.flag4 ||
1257 mit->second.dispBc.data.flag5 || mit->second.dispBc.data.flag6) {
1258 if (mit->second.dispBc.data.flag1 ==
'0')
1259 mit->second.dispBc.data.flag1 = 0;
1260 if (mit->second.dispBc.data.flag1 ==
'N')
1261 mit->second.dispBc.data.flag1 = 0;
1262 if (mit->second.dispBc.data.flag1)
1263 mit->second.dispBc.data.flag1 = 1;
1264 if (mit->second.dispBc.data.flag2 ==
'0')
1265 mit->second.dispBc.data.flag2 = 0;
1266 if (mit->second.dispBc.data.flag2 ==
'N')
1267 mit->second.dispBc.data.flag2 = 0;
1268 if (mit->second.dispBc.data.flag2)
1269 mit->second.dispBc.data.flag2 = 1;
1270 if (mit->second.dispBc.data.flag3 ==
'0')
1271 mit->second.dispBc.data.flag3 = 0;
1272 if (mit->second.dispBc.data.flag3 ==
'N')
1273 mit->second.dispBc.data.flag3 = 0;
1274 if (mit->second.dispBc.data.flag3)
1275 mit->second.dispBc.data.flag3 = 1;
1276 if (mit->second.dispBc.data.flag4 ==
'0')
1277 mit->second.dispBc.data.flag4 = 0;
1278 if (mit->second.dispBc.data.flag4 ==
'N')
1279 mit->second.dispBc.data.flag4 = 0;
1280 if (mit->second.dispBc.data.flag4)
1281 mit->second.dispBc.data.flag4 = 1;
1282 if (mit->second.dispBc.data.flag5 ==
'0')
1283 mit->second.dispBc.data.flag5 = 0;
1284 if (mit->second.dispBc.data.flag5 ==
'N')
1285 mit->second.dispBc.data.flag5 = 0;
1286 if (mit->second.dispBc.data.flag5)
1287 mit->second.dispBc.data.flag5 = 1;
1288 if (mit->second.dispBc.data.flag6 ==
'0')
1289 mit->second.dispBc.data.flag6 = 0;
1290 if (mit->second.dispBc.data.flag6 ==
'N')
1291 mit->second.dispBc.data.flag6 = 0;
1292 if (mit->second.dispBc.data.flag6)
1293 mit->second.dispBc.data.flag6 = 1;
1295 mit->second.dispBc);
1297 if (mit->second.forceBc.data.value1 != 0 ||
1298 mit->second.forceBc.data.value2 != 0) {
1300 mit->second.forceBc);
1303 if (mit->second.temperatureBc.data.flag1) {
1304 if (mit->second.temperatureBc.data.flag1 ==
'0')
1305 mit->second.temperatureBc.data.flag1 = 0;
1306 if (mit->second.temperatureBc.data.flag1 ==
'N')
1307 mit->second.temperatureBc.data.flag1 = 0;
1308 if (mit->second.temperatureBc.data.flag1)
1309 mit->second.temperatureBc.data.flag1 = 1;
1311 mit->second.temperatureBc);
1315 if ((
CubitBCType(mit->second.bcType) & cubit_meshset_it->getBcType())
1317 mit->second.iD == cubit_meshset_it->getMeshsetId()) {
1326 if (mit->second.pressureBc.data.value1 != 0) {
1327 if (mit->second.pressureBc.data.flag2 ==
'0')
1328 mit->second.pressureBc.data.flag2 = 0;
1329 if (mit->second.pressureBc.data.flag2 ==
'N')
1330 mit->second.pressureBc.data.flag2 = 0;
1331 if (mit->second.pressureBc.data.flag2)
1332 mit->second.pressureBc.data.flag2 = 1;
1334 mit->second.pressureBc);
1337 if (mit->second.heatFluxBc.data.value1 != 0) {
1338 if (mit->second.heatFluxBc.data.flag1 ==
'0')
1339 mit->second.heatFluxBc.data.flag1 = 0;
1340 if (mit->second.heatFluxBc.data.flag1 ==
'N')
1341 mit->second.heatFluxBc.data.flag1 = 0;
1342 if (mit->second.heatFluxBc.data.flag1)
1343 mit->second.heatFluxBc.data.flag1 = 1;
1345 mit->second.heatFluxBc);
1348 if (mit->second.cfgBc.data.type != 0) {
1349 CHKERR setBcData(mit->second.bcType, mit->second.iD, mit->second.cfgBc);
1354 "Not yet implemented type\n");
1358 for (
auto set_attr : block_set_attributes) {
1360 if (set_attr.second.numberOfAttributes > 0) {
1361 MOFEM_LOG(
"MeshsetMngSelf", Sev::verbose)
1362 <<
"Set attributes to blockset " << set_attr.second.nAme;
1363 set_attr.second.aTtr.resize(set_attr.second.numberOfAttributes);
1365 set_attr.second.aTtr);
1375 char meshset_file_name[255] =
"config_file.cfg";
1377 CHKERR PetscOptionsBegin(m_field.
get_comm(),
"",
"Set meshsets form file",
1379 CHKERR PetscOptionsString(
"-meshsets_config",
"meshsets config file name",
1380 "",
"add_cubit_meshsets.in", meshset_file_name, 255,
1382 if (flg_file == PETSC_TRUE) {
1383 ifstream
f(meshset_file_name);
1386 "File configuring meshsets ( %s ) can not be open\n",
1391 ierr = PetscOptionsEnd();
1397 const int ms_id,
const unsigned int cubit_bc_type,
1398 const std::string file_name,
const std::string file_type,
1399 const std::string options)
const {
1406 CHKERR m_field.
get_moab().write_file(file_name.c_str(), file_type.c_str(),
1407 options.c_str(), &meshset, 1);
1412 const int ms_id,
const unsigned int cubit_bc_type,
const int dim,
1413 const std::string file_name,
const bool recursive,
1414 const std::string file_type,
const std::string options)
const {
1422 CHKERR moab.create_meshset(MESHSET_SET, meshset);
1423 CHKERR moab.add_entities(meshset, entities);
1424 CHKERR moab.write_file(file_name.c_str(), file_type.c_str(), options.c_str(),
1426 CHKERR moab.delete_entities(&meshset, 1);
1436 for (EntityType
t = MBVERTEX;
t != MBENTITYSET; ++
t)