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();
186 MOFEM_LOG(
"MeshsetMngSync", Sev::verbose)
187 <<
"broadcast Unknown " << vec_meshsets.size();
190 for (
int from_proc = 0; from_proc < pcomm->size(); ++from_proc) {
194 if (from_proc == pcomm->rank()) {
195 std::vector<EntityHandle> dummy_nodes(vec_meshsets.size(), 0);
197 for (
auto m : vec_meshsets) {
198 CHKERR moab.create_vertex(coords, dummy_nodes[
i]);
199 CHKERR set_tags_dummy_node(dummy_nodes[
i],
m);
202 r_dummy_nodes.insert_list(dummy_nodes.begin(), dummy_nodes.end());
205 CHKERR pcomm->broadcast_entities(from_proc, r_dummy_nodes,
false,
true);
207 if (from_proc != pcomm->rank()) {
209 for (
auto dummy_node : r_dummy_nodes) {
215 .find(boost::make_tuple(
221 CHKERR moab.create_meshset(MESHSET_SET,
m);
222 CHKERR set_tags_dummy_node(
m, dummy_node);
227 MOFEM_LOG(
"MeshsetMngSync", Sev::warning)
228 <<
"broadcasted vertex " << dummy_node <<
" has negative id";
234 MOFEM_LOG(
"MeshsetMngSync", Sev::verbose)
235 <<
"broadcast send from " << from_proc;
238 CHKERR moab.delete_entities(r_dummy_nodes);
251 int default_val = -1;
252 CHKERR moab.tag_get_handle(DIRICHLET_SET_TAG_NAME, 1, MB_TYPE_INTEGER,
nsTag,
253 MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
255 CHKERR moab.tag_get_handle(NEUMANN_SET_TAG_NAME, 1, MB_TYPE_INTEGER,
ssTag,
256 MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
258 const int def_bc_data_len = 0;
259 std::string tag_name = std::string(DIRICHLET_SET_TAG_NAME) +
"__BC_DATA";
260 CHKERR moab.tag_get_handle(
261 tag_name.c_str(), def_bc_data_len, MB_TYPE_OPAQUE,
nsTag_data,
262 MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES | MB_TAG_VARLEN, NULL);
264 tag_name = std::string(NEUMANN_SET_TAG_NAME) +
"__BC_DATA";
265 CHKERR moab.tag_get_handle(
266 tag_name.c_str(), def_bc_data_len, MB_TYPE_OPAQUE,
ssTag_data,
267 MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES | MB_TAG_VARLEN, NULL);
269 CHKERR moab.tag_get_handle(MATERIAL_SET_TAG_NAME, 1, MB_TYPE_INTEGER,
bhTag,
270 MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
272 std::vector<unsigned int> def_uint_zero(3, 0);
273 CHKERR moab.tag_get_handle(
274 BLOCK_HEADER, 3 *
sizeof(
unsigned int), MB_TYPE_INTEGER,
bhTag_header,
275 MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES, &def_uint_zero[0]);
278 int def_Block_Attributes_length = 0;
279 CHKERR moab.tag_get_handle(
280 BLOCK_ATTRIBUTES, def_Block_Attributes_length, MB_TYPE_DOUBLE,
281 block_attribs, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN, NULL);
284 CHKERR moab.tag_get_handle(NAME_TAG_NAME, NAME_TAG_SIZE, MB_TYPE_OPAQUE,
285 entity_name_tag, MB_TAG_SPARSE | MB_TAG_CREAT);
332 CHKERR it->getAttributeDataStructure(data);
333 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform) << *it;
334 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform) << data;
336 CHKERR moab.get_entities_by_dimension(it->meshset, 3, tets,
true);
337 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform)
338 <<
"MAT_ELATIC msId " << it->getMeshsetId() <<
" nb. volumes "
345 CHKERR it->getAttributeDataStructure(data);
346 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform) << *it;
347 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform) << data;
353 CHKERR it->getAttributeDataStructure(data);
354 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform) << *it;
355 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform) << data;
364 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
373 int *
const number_of_meshsets_ptr)
const {
376 if (std::distance(miit, hi_miit) == 0) {
379 if (number_of_meshsets_ptr) {
380 *number_of_meshsets_ptr = std::distance(miit, hi_miit);
387 const std::string name) {
393 "such cubit meshset is already there", ms_id);
402 "meshset not inserted");
404 if (name.size() > 0) {
409 "name to cubit meshset can not be set");
419 const int ms_id,
const Range &ents) {
425 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
429 "Cannot find Cubit meshset with id: %d", ms_id);
432 CHKERR moab.add_entities(meshset, ents);
446 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
450 "Cannot find Cubit meshset with id: %d", ms_id);
453 CHKERR moab.add_entities(meshset, ents, nb_ents);
460 const std::vector<double> &attributes,
461 const std::string name) {
467 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
471 "Cannot find Cubit meshset with id: %d", ms_id);
473 if (name.size() > 0) {
478 "name to cubit meshset can not be set");
486 "modification unsuccessful");
488 std::ostringstream ss;
489 ss <<
"Block " << cit->getName();
491 for (
unsigned int ii = 0; ii != attributes.size(); ii++) {
492 ss << attributes[ii] <<
" ";
494 MOFEM_LOG(
"MeshsetMngSelf", Sev::noisy) << ss.str();
507 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
511 "Cannot find Cubit meshset with id: %d", ms_id);
513 if (name.size() > 0) {
518 "name to cubit meshset can not be set");
526 "modification unsuccessful");
538 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
542 "Cubit meshset with id is already there", ms_id);
549 "modification unsuccessful");
561 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
566 "meshset not found", ms_id);
573 CHKERR moab.delete_entities(&meshset, 1);
585 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
588 *cubit_meshset_ptr = &*miit;
591 "msId = %d is not there", ms_id);
602 "Get not get meshset");
603 return cubit_meshset_ptr;
607 const string name,
const CubitMeshSets **cubit_meshset_ptr)
const {
612 if (std::distance(miit, hi_miit) == 0) {
614 "meshset name <%s> is not there", name.c_str());
616 if (std::distance(miit, hi_miit) > 1) {
618 "more that one meshser of that name <%s>", name.c_str());
620 *cubit_meshset_ptr = &*miit;
626 std::vector<const CubitMeshSets *> &vec_ptr)
const {
629 cubit_bc_type.to_ulong());
630 for (
auto it =
r.first; it !=
r.second; ++it) {
631 vec_ptr.push_back(&*it);
637 std::vector<const CubitMeshSets *>
639 std::vector<const CubitMeshSets *> vec_ptr;
641 "Error in getting meshsets by name");
646 const std::regex reg_exp_name,
647 std::vector<const CubitMeshSets *> &vec_ptr)
const {
651 for (;
r.first !=
r.second; ++
r.first) {
652 const auto name =
r.first->getName();
653 if (std::regex_match(name, reg_exp_name)) {
654 vec_ptr.push_back(&*
r.first);
661 std::vector<const CubitMeshSets *>
663 std::vector<const CubitMeshSets *> vec_ptr;
665 "Error in getting meshsets by name");
670 const int msId,
const unsigned int cubit_bc_type,
const int dimension,
671 Range &entities,
const bool recursive)
const {
677 boost::make_tuple(msId, cubit_bc_type));
680 CHKERR miit->getMeshsetIdEntitiesByDimension(moab, dimension, entities,
684 "msId = %d is not there", msId);
690 const int ms_id,
const unsigned int cubit_bc_type,
Range &entities,
691 const bool recursive)
const {
697 boost::make_tuple(ms_id, cubit_bc_type));
700 CHKERR miit->getMeshsetIdEntitiesByDimension(moab, entities, recursive);
703 "ms_id = %d is not there", ms_id);
709 const unsigned int cubit_bc_type,
715 boost::make_tuple(ms_id, cubit_bc_type));
718 meshset = miit->meshset;
721 "ms_id = %d is not there", ms_id);
727 const int ms_id,
const unsigned int cubit_bc_type,
728 const EntityHandle *entities,
int num_entities,
const int operation_type) {
731 boost::make_tuple(ms_id, cubit_bc_type));
735 return m_field.
get_moab().contains_entities(miit->meshset, entities,
736 num_entities, operation_type);
743 Range &meshsets)
const {
749 for (; miit != hi_miit; miit++) {
750 meshsets.insert(miit->meshset);
782 std::memcpy(
dispBc.
data.name,
"Displacement", 12);
787 std::memcpy(
cfgBc.
data.name,
"cfd_bc", 6);
792 bool clean_file_options) {
795 std::ifstream ini_file(file_name.c_str(), std::ifstream::in);
796 po::variables_map vm;
797 if (clean_file_options) {
799 boost::shared_ptr<boost::program_options::options_description>(
800 new po::options_description());
803 auto add_block_attributes = [&](
auto prefix,
auto &block_lists,
auto &it) {
806 (prefix +
".number_of_attributes").c_str(),
807 po::value<int>(&block_lists[it->getMeshsetId()].numberOfAttributes)
809 "Number of blockset attribute");
810 for (
int ii = 1; ii <= 10; ii++) {
811 std::string surfix =
".user" + boost::lexical_cast<std::string>(ii);
813 (prefix + surfix).c_str(),
814 po::value<double>(&block_lists[it->getMeshsetId()].aTtr[ii - 1])
815 ->default_value(0.0),
816 "Add block attribute");
821 map<int, BlockData> block_lists;
823 block_lists[it->getMeshsetId()].cubitMeshset = it->getMeshset();
825 "block_" + boost::lexical_cast<std::string>(it->getMeshsetId());
827 (prefix +
".add").c_str(),
828 po::value<string>(&block_lists[it->getMeshsetId()].addType)
829 ->default_value(
"UNKNOWNSET"),
831 (prefix +
".id").c_str(),
832 po::value<int>(&block_lists[it->getMeshsetId()].iD)->default_value(-1),
834 (prefix +
".name").c_str(),
835 po::value<string>(&block_lists[it->getMeshsetId()].nAme)
837 "Name of the meshset");
840 add_block_attributes(prefix, block_lists, it);
848 (prefix +
".young").c_str(),
850 &block_lists[it->getMeshsetId()].matElastic.data.Young)
853 (prefix +
".poisson").c_str(),
855 &block_lists[it->getMeshsetId()].matElastic.data.Poisson)
858 (prefix +
".thermalexpansion").c_str(),
860 &block_lists[it->getMeshsetId()].matElastic.data.ThermalExpansion)
862 "Thermal expansion");
873 (prefix +
".Youngp").c_str(),
875 &block_lists[it->getMeshsetId()].matTransIso.data.Youngp)
878 (prefix +
".Youngz").c_str(),
880 &block_lists[it->getMeshsetId()].matTransIso.data.Youngz)
883 (prefix +
".Poissonp").c_str(),
885 &block_lists[it->getMeshsetId()].matTransIso.data.Poissonp)
888 (prefix +
".Poissonpz").c_str(),
890 &block_lists[it->getMeshsetId()].matTransIso.data.Poissonpz)
893 (prefix +
".Shearzp").c_str(),
895 &block_lists[it->getMeshsetId()].matTransIso.data.Shearzp)
905 (prefix +
".conductivity").c_str(),
907 &block_lists[it->getMeshsetId()].matThermal.data.Conductivity)
910 (prefix +
".capacity").c_str(),
912 &block_lists[it->getMeshsetId()].matThermal.data.HeatCapacity)
924 (prefix +
".interface_alpha").c_str(),
926 &block_lists[it->getMeshsetId()].matInterf.data.alpha)
928 "alpha")((prefix +
".interface_beta").c_str(),
930 &block_lists[it->getMeshsetId()].matInterf.data.beta)
933 (prefix +
".interface_ft").c_str(),
934 po::value<double>(&block_lists[it->getMeshsetId()].matInterf.data.ft)
937 (prefix +
".interface_Gf").c_str(),
938 po::value<double>(&block_lists[it->getMeshsetId()].matInterf.data.Gf)
959 (prefix +
".disp_flag1").c_str(),
960 po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag1)
963 (prefix +
".disp_flag2").c_str(),
964 po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag2)
967 (prefix +
".disp_flag3").c_str(),
968 po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag3)
971 (prefix +
".disp_flag4").c_str(),
972 po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag4)
975 (prefix +
".disp_flag5").c_str(),
976 po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag5)
979 (prefix +
".disp_flag6").c_str(),
980 po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag6)
983 (prefix +
".disp_ux").c_str(),
984 po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value1)
987 (prefix +
".disp_uy").c_str(),
988 po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value2)
991 (prefix +
".disp_uz").c_str(),
992 po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value3)
995 (prefix +
".disp_rx").c_str(),
996 po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value4)
999 (prefix +
".disp_ry").c_str(),
1000 po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value5)
1003 (prefix +
".disp_rz").c_str(),
1004 po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value6)
1021 (prefix +
".force_magnitude").c_str(),
1023 &block_lists[it->getMeshsetId()].forceBc.data.value1)
1025 "value1")((prefix +
".moment_magnitude").c_str(),
1027 &block_lists[it->getMeshsetId()].forceBc.data.value2)
1030 (prefix +
".force_fx").c_str(),
1032 &block_lists[it->getMeshsetId()].forceBc.data.value3)
1034 "value3")((prefix +
".force_fy").c_str(),
1036 &block_lists[it->getMeshsetId()].forceBc.data.value4)
1039 (prefix +
".force_fz").c_str(),
1041 &block_lists[it->getMeshsetId()].forceBc.data.value5)
1043 "value5")((prefix +
".moment_mx").c_str(),
1045 &block_lists[it->getMeshsetId()].forceBc.data.value6)
1048 (prefix +
".moment_my").c_str(),
1050 &block_lists[it->getMeshsetId()].forceBc.data.value7)
1052 "value7")((prefix +
".moment_mz").c_str(),
1054 &block_lists[it->getMeshsetId()].forceBc.data.value8)
1075 (prefix +
".temperature_flag1").c_str(),
1077 &block_lists[it->getMeshsetId()].temperatureBc.data.flag1)
1080 (prefix +
".temperature_t").c_str(),
1082 &block_lists[it->getMeshsetId()].temperatureBc.data.value1)
1095 (prefix +
".pressure_flag2").c_str(),
1097 &block_lists[it->getMeshsetId()].pressureBc.data.flag2)
1099 "flag2")((prefix +
".pressure_magnitude").c_str(),
1101 &block_lists[it->getMeshsetId()].pressureBc.data.value1)
1117 (prefix +
".heatflux_flag1").c_str(),
1119 &block_lists[it->getMeshsetId()].heatFluxBc.data.flag1)
1121 "flag1")((prefix +
".heatflux_magnitude").c_str(),
1123 &block_lists[it->getMeshsetId()].heatFluxBc.data.value1)
1130 (prefix +
".interface_type").c_str(),
1131 po::value<char>(&block_lists[it->getMeshsetId()].cfgBc.data.type)
1137 map<int, BlockData> block_set_attributes;
1139 block_set_attributes[it->getMeshsetId()].cubitMeshset = it->getMeshset();
1140 block_set_attributes[it->getMeshsetId()].iD = it->getMeshsetId();
1141 block_set_attributes[it->getMeshsetId()].bcType =
BLOCKSET;
1142 std::string block_name = it->getName();
1144 std::remove_if(block_name.begin(), block_name.end(), ::isspace),
1146 block_set_attributes[it->getMeshsetId()].nAme = block_name;
1148 if (block_name.compare(
"NoNameSet") != 0) {
1149 std::string prefix =
"SET_ATTR_" + block_name;
1151 add_block_attributes(prefix, block_set_attributes, it);
1155 po::parsed_options parsed =
1167 block_lists[it->getMeshsetId()].addType) {
1172 if (bc_type.none()) {
1173 block_lists[it->getMeshsetId()].bcType =
UNKNOWNSET;
1178 if (bc_type.to_ulong() ==
BLOCKSET)
1179 block_lists[it->getMeshsetId()].bcType =
BLOCKSET;
1180 else if (bc_type.to_ulong() ==
NODESET)
1181 block_lists[it->getMeshsetId()].bcType =
NODESET;
1182 else if (bc_type.to_ulong() ==
SIDESET)
1183 block_lists[it->getMeshsetId()].bcType =
SIDESET;
1186 "Not yet implemented type %s\n",
1187 block_lists[it->getMeshsetId()].addType.c_str());
1189 if (block_lists[it->getMeshsetId()].iD == -1) {
1191 "Unset iD number %d\n", block_lists[it->getMeshsetId()].iD);
1195 std::vector<std::string> additional_parameters;
1196 additional_parameters =
1197 collect_unrecognized(parsed.options, po::include_positional);
1198 for (std::vector<std::string>::iterator vit = additional_parameters.begin();
1199 vit != additional_parameters.end(); vit++) {
1200 MOFEM_LOG_C(
"MeshsetMngSelf", Sev::warning,
"Unrecognized option %s",
1203 for (map<int, BlockData>::iterator mit = block_lists.begin();
1204 mit != block_lists.end(); mit++) {
1205 CubitMeshSet_multiIndex::iterator cubit_meshset_it =
1209 "Data inconsistency\n");
1211 switch (mit->second.bcType) {
1215 if ((
CubitBCType(mit->second.bcType) & cubit_meshset_it->getBcType())
1217 mit->second.iD == cubit_meshset_it->getMeshsetId()) {
1229 if (mit->second.matElastic.data.Young != -1) {
1231 mit->second.matElastic);
1233 if (mit->second.matTransIso.data.Youngp != -1) {
1235 mit->second.matTransIso);
1237 if (mit->second.matThermal.data.Conductivity != -1) {
1239 mit->second.matThermal);
1241 if (mit->second.matInterf.data.ft != -1) {
1243 mit->second.matInterf);
1247 if ((
CubitBCType(mit->second.bcType) & cubit_meshset_it->getBcType())
1249 mit->second.iD == cubit_meshset_it->getMeshsetId()) {
1258 if (mit->second.dispBc.data.flag1 || mit->second.dispBc.data.flag2 ||
1259 mit->second.dispBc.data.flag3 || mit->second.dispBc.data.flag4 ||
1260 mit->second.dispBc.data.flag5 || mit->second.dispBc.data.flag6) {
1261 if (mit->second.dispBc.data.flag1 ==
'0')
1262 mit->second.dispBc.data.flag1 = 0;
1263 if (mit->second.dispBc.data.flag1 ==
'N')
1264 mit->second.dispBc.data.flag1 = 0;
1265 if (mit->second.dispBc.data.flag1)
1266 mit->second.dispBc.data.flag1 = 1;
1267 if (mit->second.dispBc.data.flag2 ==
'0')
1268 mit->second.dispBc.data.flag2 = 0;
1269 if (mit->second.dispBc.data.flag2 ==
'N')
1270 mit->second.dispBc.data.flag2 = 0;
1271 if (mit->second.dispBc.data.flag2)
1272 mit->second.dispBc.data.flag2 = 1;
1273 if (mit->second.dispBc.data.flag3 ==
'0')
1274 mit->second.dispBc.data.flag3 = 0;
1275 if (mit->second.dispBc.data.flag3 ==
'N')
1276 mit->second.dispBc.data.flag3 = 0;
1277 if (mit->second.dispBc.data.flag3)
1278 mit->second.dispBc.data.flag3 = 1;
1279 if (mit->second.dispBc.data.flag4 ==
'0')
1280 mit->second.dispBc.data.flag4 = 0;
1281 if (mit->second.dispBc.data.flag4 ==
'N')
1282 mit->second.dispBc.data.flag4 = 0;
1283 if (mit->second.dispBc.data.flag4)
1284 mit->second.dispBc.data.flag4 = 1;
1285 if (mit->second.dispBc.data.flag5 ==
'0')
1286 mit->second.dispBc.data.flag5 = 0;
1287 if (mit->second.dispBc.data.flag5 ==
'N')
1288 mit->second.dispBc.data.flag5 = 0;
1289 if (mit->second.dispBc.data.flag5)
1290 mit->second.dispBc.data.flag5 = 1;
1291 if (mit->second.dispBc.data.flag6 ==
'0')
1292 mit->second.dispBc.data.flag6 = 0;
1293 if (mit->second.dispBc.data.flag6 ==
'N')
1294 mit->second.dispBc.data.flag6 = 0;
1295 if (mit->second.dispBc.data.flag6)
1296 mit->second.dispBc.data.flag6 = 1;
1298 mit->second.dispBc);
1300 if (mit->second.forceBc.data.value1 != 0 ||
1301 mit->second.forceBc.data.value2 != 0) {
1303 mit->second.forceBc);
1306 if (mit->second.temperatureBc.data.flag1) {
1307 if (mit->second.temperatureBc.data.flag1 ==
'0')
1308 mit->second.temperatureBc.data.flag1 = 0;
1309 if (mit->second.temperatureBc.data.flag1 ==
'N')
1310 mit->second.temperatureBc.data.flag1 = 0;
1311 if (mit->second.temperatureBc.data.flag1)
1312 mit->second.temperatureBc.data.flag1 = 1;
1314 mit->second.temperatureBc);
1318 if ((
CubitBCType(mit->second.bcType) & cubit_meshset_it->getBcType())
1320 mit->second.iD == cubit_meshset_it->getMeshsetId()) {
1329 if (mit->second.pressureBc.data.value1 != 0) {
1330 if (mit->second.pressureBc.data.flag2 ==
'0')
1331 mit->second.pressureBc.data.flag2 = 0;
1332 if (mit->second.pressureBc.data.flag2 ==
'N')
1333 mit->second.pressureBc.data.flag2 = 0;
1334 if (mit->second.pressureBc.data.flag2)
1335 mit->second.pressureBc.data.flag2 = 1;
1337 mit->second.pressureBc);
1340 if (mit->second.heatFluxBc.data.value1 != 0) {
1341 if (mit->second.heatFluxBc.data.flag1 ==
'0')
1342 mit->second.heatFluxBc.data.flag1 = 0;
1343 if (mit->second.heatFluxBc.data.flag1 ==
'N')
1344 mit->second.heatFluxBc.data.flag1 = 0;
1345 if (mit->second.heatFluxBc.data.flag1)
1346 mit->second.heatFluxBc.data.flag1 = 1;
1348 mit->second.heatFluxBc);
1351 if (mit->second.cfgBc.data.type != 0) {
1352 CHKERR setBcData(mit->second.bcType, mit->second.iD, mit->second.cfgBc);
1357 "Not yet implemented type\n");
1361 for (
auto set_attr : block_set_attributes) {
1363 if (set_attr.second.numberOfAttributes > 0) {
1364 MOFEM_LOG(
"MeshsetMngSelf", Sev::verbose)
1365 <<
"Set attributes to blockset " << set_attr.second.nAme;
1366 set_attr.second.aTtr.resize(set_attr.second.numberOfAttributes);
1368 set_attr.second.aTtr);
1378 char meshset_file_name[255] =
"config_file.cfg";
1380 CHKERR PetscOptionsBegin(m_field.
get_comm(),
"",
"Set meshsets form file",
1382 CHKERR PetscOptionsString(
"-meshsets_config",
"meshsets config file name",
1383 "",
"add_cubit_meshsets.in", meshset_file_name, 255,
1385 if (flg_file == PETSC_TRUE) {
1386 ifstream
f(meshset_file_name);
1389 "File configuring meshsets ( %s ) can not be open\n",
1394 ierr = PetscOptionsEnd();
1400 const int ms_id,
const unsigned int cubit_bc_type,
1401 const std::string file_name,
const std::string file_type,
1402 const std::string options)
const {
1409 CHKERR m_field.
get_moab().write_file(file_name.c_str(), file_type.c_str(),
1410 options.c_str(), &meshset, 1);
1415 const int ms_id,
const unsigned int cubit_bc_type,
const int dim,
1416 const std::string file_name,
const bool recursive,
1417 const std::string file_type,
const std::string options)
const {
1425 CHKERR moab.create_meshset(MESHSET_SET, meshset);
1426 CHKERR moab.add_entities(meshset, entities);
1427 CHKERR moab.write_file(file_name.c_str(), file_type.c_str(), options.c_str(),
1429 CHKERR moab.delete_entities(&meshset, 1);
1439 for (EntityType
t = MBVERTEX;
t != MBENTITYSET; ++
t)