10namespace po = boost::program_options;
24 : cOre(const_cast<
Core &>(core)) {
27 auto core_log = logging::core::get();
45 MOFEM_LOG(
"MeshsetMngWorld", Sev::noisy) <<
"Mashset manager created";
62 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform) <<
m;
70 moab::Interface &moab = m_field.
get_moab();
74 CHKERR moab.get_entities_by_type(0, MBENTITYSET, meshsets,
false);
75 for (
auto m : meshsets) {
82 "meshset not inserted");
83 MOFEM_LOG(
"MeshsetMngSelf", Sev::noisy) <<
"read " << block;
92 moab::Interface &moab = m_field.
get_moab();
95 ParallelComm *pcomm = ParallelComm::get_pcomm(&moab,
MYPCOMM_INDEX);
98 "MOAB communicator not set");
100 const double coords[] = {0, 0, 0};
102 auto set_tags_dummy_node = [&](
const EntityHandle dummy_node,
105 std::vector<Tag> tag_handles;
106 CHKERR moab.tag_get_tags_on_entity(meshset, tag_handles);
107 for (
auto th : tag_handles) {
110 CHKERR moab.tag_get_by_ptr(
th, &meshset, 1, (
const void **)data,
112 CHKERR moab.tag_set_by_ptr(
th, &dummy_node, 1, data, &tag_size);
117 for (
int from_proc = 0; from_proc < pcomm->size(); ++from_proc) {
121 if (from_proc == pcomm->rank()) {
122 std::vector<EntityHandle> dummy_nodes(
cubitMeshsets.size(), 0);
125 CHKERR moab.create_vertex(coords, dummy_nodes[
i]);
126 CHKERR set_tags_dummy_node(dummy_nodes[
i],
m.getMeshset());
129 r_dummy_nodes.insert_list(dummy_nodes.begin(), dummy_nodes.end());
132 CHKERR pcomm->broadcast_entities(from_proc, r_dummy_nodes,
false,
true);
134 for (
auto dummy_node : r_dummy_nodes) {
136 CHKERR moab.create_meshset(MESHSET_SET,
m);
137 CHKERR set_tags_dummy_node(
m, dummy_node);
145 CHKERR moab.delete_entities(&
m, 1);
148 <<
"broadcast " << broadcast_block;
153 CHKERR moab.delete_entities(r_dummy_nodes);
162 moab::Interface &moab = m_field.
get_moab();
163 int default_val = -1;
164 CHKERR moab.tag_get_handle(DIRICHLET_SET_TAG_NAME, 1, MB_TYPE_INTEGER,
nsTag,
165 MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
167 CHKERR moab.tag_get_handle(NEUMANN_SET_TAG_NAME, 1, MB_TYPE_INTEGER,
ssTag,
168 MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
170 const int def_bc_data_len = 0;
171 std::string tag_name = std::string(DIRICHLET_SET_TAG_NAME) +
"__BC_DATA";
172 CHKERR moab.tag_get_handle(
173 tag_name.c_str(), def_bc_data_len, MB_TYPE_OPAQUE,
nsTag_data,
174 MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES | MB_TAG_VARLEN, NULL);
176 tag_name = std::string(NEUMANN_SET_TAG_NAME) +
"__BC_DATA";
177 CHKERR moab.tag_get_handle(
178 tag_name.c_str(), def_bc_data_len, MB_TYPE_OPAQUE,
ssTag_data,
179 MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES | MB_TAG_VARLEN, NULL);
181 CHKERR moab.tag_get_handle(MATERIAL_SET_TAG_NAME, 1, MB_TYPE_INTEGER,
bhTag,
182 MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
184 std::vector<unsigned int> def_uint_zero(3, 0);
185 CHKERR moab.tag_get_handle(
186 BLOCK_HEADER, 3 *
sizeof(
unsigned int), MB_TYPE_INTEGER,
bhTag_header,
187 MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES, &def_uint_zero[0]);
190 int def_Block_Attributes_length = 0;
191 CHKERR moab.tag_get_handle(
192 BLOCK_ATTRIBUTES, def_Block_Attributes_length, MB_TYPE_DOUBLE,
193 block_attribs, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN, NULL);
196 CHKERR moab.tag_get_handle(NAME_TAG_NAME, NAME_TAG_SIZE, MB_TYPE_OPAQUE,
197 entity_name_tag, MB_TAG_SPARSE | MB_TAG_CREAT);
240 const moab::Interface &moab = m_field.
get_moab();
244 CHKERR it->getAttributeDataStructure(data);
245 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform) << *it;
246 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform) << data;
248 CHKERR moab.get_entities_by_dimension(it->meshset, 3, tets,
true);
249 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform)
250 <<
"MAT_ELATIC msId " << it->getMeshsetId() <<
" nb. volumes "
257 CHKERR it->getAttributeDataStructure(data);
258 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform) << *it;
259 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform) << data;
265 CHKERR it->getAttributeDataStructure(data);
266 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform) << *it;
267 MOFEM_LOG(
"MeshsetMngWorld", Sev::inform) << data;
276 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
285 int *
const number_of_meshsets_ptr)
const {
288 if (std::distance(miit, hi_miit) == 0) {
291 if (number_of_meshsets_ptr) {
292 *number_of_meshsets_ptr = std::distance(miit, hi_miit);
299 const std::string name) {
301 moab::Interface &moab = m_field.
get_moab();
305 "such cubit meshset is already there", ms_id);
314 "meshset not inserted");
316 if (name.size() > 0) {
321 "name to cubit meshset can not be set");
331 const int ms_id,
const Range &ents) {
333 moab::Interface &moab = m_field.
get_moab();
337 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
341 "Cannot find Cubit meshset with id: %d", ms_id);
344 CHKERR moab.add_entities(meshset, ents);
354 moab::Interface &moab = m_field.
get_moab();
358 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
362 "Cannot find Cubit meshset with id: %d", ms_id);
365 CHKERR moab.add_entities(meshset, ents, nb_ents);
372 const std::vector<double> &attributes,
373 const std::string name) {
375 moab::Interface &moab = m_field.
get_moab();
379 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
383 "Cannot find Cubit meshset with id: %d", ms_id);
385 if (name.size() > 0) {
390 "name to cubit meshset can not be set");
398 "modification unsuccessful");
400 std::ostringstream ss;
401 ss <<
"Block " << cit->getName();
403 for (
unsigned int ii = 0; ii != attributes.size(); ii++) {
404 ss << attributes[ii] <<
" ";
406 MOFEM_LOG(
"MeshsetMngSelf", Sev::noisy) << ss.str();
415 moab::Interface &moab = m_field.
get_moab();
419 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
423 "Cannot find Cubit meshset with id: %d", ms_id);
425 if (name.size() > 0) {
430 "name to cubit meshset can not be set");
438 "modification unsuccessful");
446 moab::Interface &moab = m_field.
get_moab();
450 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
454 "Cubit meshset with id is already there", ms_id);
461 "modification unsuccessful");
469 moab::Interface &moab = m_field.
get_moab();
473 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
478 "meshset not found", ms_id);
485 CHKERR moab.delete_entities(&meshset, 1);
497 boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
500 *cubit_meshset_ptr = &*miit;
503 "msId = %d is not there", ms_id);
514 "Get not get meshset");
515 return cubit_meshset_ptr;
519 const string name,
const CubitMeshSets **cubit_meshset_ptr)
const {
524 if (std::distance(miit, hi_miit) == 0) {
526 "meshset name <%s> is not there", name.c_str());
528 if (std::distance(miit, hi_miit) > 1) {
530 "more that one meshser of that name <%s>", name.c_str());
532 *cubit_meshset_ptr = &*miit;
538 std::vector<const CubitMeshSets *> &vec_ptr)
const {
542 if ((
c.getBcType() & cubit_bc_type) == cubit_bc_type) {
543 vec_ptr.push_back(&
c);
549std::vector<const CubitMeshSets *>
551 std::vector<const CubitMeshSets *> vec_ptr;
553 "Error in getting meshsets by name");
558 const std::regex reg_exp_name,
559 std::vector<const CubitMeshSets *> &vec_ptr)
const {
564 for (; r.first != r.second; ++r.first) {
565 const auto name = r.first->getName();
566 if (std::regex_match(name, reg_exp_name)) {
567 vec_ptr.push_back(&*r.first);
573std::vector<const CubitMeshSets *>
575 std::vector<const CubitMeshSets *> vec_ptr;
577 "Error in getting meshsets by name");
582 const int msId,
const unsigned int cubit_bc_type,
const int dimension,
583 Range &entities,
const bool recursive)
const {
585 moab::Interface &moab = m_field.
get_moab();
589 boost::make_tuple(msId, cubit_bc_type));
592 CHKERR miit->getMeshsetIdEntitiesByDimension(moab, dimension, entities,
596 "msId = %d is not there", msId);
602 const int ms_id,
const unsigned int cubit_bc_type,
Range &entities,
603 const bool recursive)
const {
605 moab::Interface &moab = m_field.
get_moab();
609 boost::make_tuple(ms_id, cubit_bc_type));
612 CHKERR miit->getMeshsetIdEntitiesByDimension(moab, entities, recursive);
615 "ms_id = %d is not there", ms_id);
621 const unsigned int cubit_bc_type,
627 boost::make_tuple(ms_id, cubit_bc_type));
630 meshset = miit->meshset;
633 "ms_id = %d is not there", ms_id);
639 const int ms_id,
const unsigned int cubit_bc_type,
640 const EntityHandle *entities,
int num_entities,
const int operation_type) {
643 boost::make_tuple(ms_id, cubit_bc_type));
647 return m_field.
get_moab().contains_entities(miit->meshset, entities,
648 num_entities, operation_type);
655 Range &meshsets)
const {
661 for (; miit != hi_miit; miit++) {
662 meshsets.insert(miit->meshset);
694 std::memcpy(
dispBc.
data.name,
"Displacement", 12);
699 std::memcpy(
cfgBc.
data.name,
"cfd_bc", 6);
704 bool clean_file_options) {
707 std::ifstream ini_file(file_name.c_str(), std::ifstream::in);
708 po::variables_map vm;
709 if (clean_file_options) {
711 boost::shared_ptr<boost::program_options::options_description>(
712 new po::options_description());
715 auto add_block_attributes = [&](
auto prefix,
auto &block_lists,
auto &it) {
718 (prefix +
".number_of_attributes").c_str(),
719 po::value<int>(&block_lists[it->getMeshsetId()].numberOfAttributes)
721 "Number of blockset attribute");
722 for (
int ii = 1; ii <= 10; ii++) {
723 std::string surfix =
".user" + boost::lexical_cast<std::string>(ii);
725 (prefix + surfix).c_str(),
726 po::value<double>(&block_lists[it->getMeshsetId()].aTtr[ii - 1])
727 ->default_value(0.0),
728 "Add block attribute");
733 map<int, BlockData> block_lists;
735 block_lists[it->getMeshsetId()].cubitMeshset = it->getMeshset();
737 "block_" + boost::lexical_cast<std::string>(it->getMeshsetId());
739 (prefix +
".add").c_str(),
740 po::value<string>(&block_lists[it->getMeshsetId()].addType)
741 ->default_value(
"UNKNOWNSET"),
743 (prefix +
".id").c_str(),
744 po::value<int>(&block_lists[it->getMeshsetId()].iD)->default_value(-1),
746 (prefix +
".name").c_str(),
747 po::value<string>(&block_lists[it->getMeshsetId()].nAme)
749 "Name of the meshset");
752 add_block_attributes(prefix, block_lists, it);
760 (prefix +
".young").c_str(),
762 &block_lists[it->getMeshsetId()].matElastic.data.Young)
765 (prefix +
".poisson").c_str(),
767 &block_lists[it->getMeshsetId()].matElastic.data.Poisson)
770 (prefix +
".thermalexpansion").c_str(),
772 &block_lists[it->getMeshsetId()].matElastic.data.ThermalExpansion)
774 "Thermal expansion");
785 (prefix +
".Youngp").c_str(),
787 &block_lists[it->getMeshsetId()].matTransIso.data.Youngp)
790 (prefix +
".Youngz").c_str(),
792 &block_lists[it->getMeshsetId()].matTransIso.data.Youngz)
795 (prefix +
".Poissonp").c_str(),
797 &block_lists[it->getMeshsetId()].matTransIso.data.Poissonp)
800 (prefix +
".Poissonpz").c_str(),
802 &block_lists[it->getMeshsetId()].matTransIso.data.Poissonpz)
805 (prefix +
".Shearzp").c_str(),
807 &block_lists[it->getMeshsetId()].matTransIso.data.Shearzp)
817 (prefix +
".conductivity").c_str(),
819 &block_lists[it->getMeshsetId()].matThermal.data.Conductivity)
822 (prefix +
".capacity").c_str(),
824 &block_lists[it->getMeshsetId()].matThermal.data.HeatCapacity)
836 (prefix +
".interface_alpha").c_str(),
838 &block_lists[it->getMeshsetId()].matInterf.data.alpha)
840 "alpha")((prefix +
".interface_beta").c_str(),
842 &block_lists[it->getMeshsetId()].matInterf.data.beta)
845 (prefix +
".interface_ft").c_str(),
846 po::value<double>(&block_lists[it->getMeshsetId()].matInterf.data.ft)
849 (prefix +
".interface_Gf").c_str(),
850 po::value<double>(&block_lists[it->getMeshsetId()].matInterf.data.Gf)
871 (prefix +
".disp_flag1").c_str(),
872 po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag1)
875 (prefix +
".disp_flag2").c_str(),
876 po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag2)
879 (prefix +
".disp_flag3").c_str(),
880 po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag3)
883 (prefix +
".disp_flag4").c_str(),
884 po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag4)
887 (prefix +
".disp_flag5").c_str(),
888 po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag5)
891 (prefix +
".disp_flag6").c_str(),
892 po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag6)
895 (prefix +
".disp_ux").c_str(),
896 po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value1)
899 (prefix +
".disp_uy").c_str(),
900 po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value2)
903 (prefix +
".disp_uz").c_str(),
904 po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value3)
907 (prefix +
".disp_rx").c_str(),
908 po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value4)
911 (prefix +
".disp_ry").c_str(),
912 po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value5)
915 (prefix +
".disp_rz").c_str(),
916 po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value6)
933 (prefix +
".force_magnitude").c_str(),
935 &block_lists[it->getMeshsetId()].forceBc.data.value1)
937 "value1")((prefix +
".moment_magnitude").c_str(),
939 &block_lists[it->getMeshsetId()].forceBc.data.value2)
942 (prefix +
".force_fx").c_str(),
944 &block_lists[it->getMeshsetId()].forceBc.data.value3)
946 "value3")((prefix +
".force_fy").c_str(),
948 &block_lists[it->getMeshsetId()].forceBc.data.value4)
951 (prefix +
".force_fz").c_str(),
953 &block_lists[it->getMeshsetId()].forceBc.data.value5)
955 "value5")((prefix +
".moment_mx").c_str(),
957 &block_lists[it->getMeshsetId()].forceBc.data.value6)
960 (prefix +
".moment_my").c_str(),
962 &block_lists[it->getMeshsetId()].forceBc.data.value7)
964 "value7")((prefix +
".moment_mz").c_str(),
966 &block_lists[it->getMeshsetId()].forceBc.data.value8)
987 (prefix +
".temperature_flag1").c_str(),
989 &block_lists[it->getMeshsetId()].temperatureBc.data.flag1)
992 (prefix +
".temperature_t").c_str(),
994 &block_lists[it->getMeshsetId()].temperatureBc.data.value1)
1007 (prefix +
".pressure_flag2").c_str(),
1009 &block_lists[it->getMeshsetId()].pressureBc.data.flag2)
1011 "flag2")((prefix +
".pressure_magnitude").c_str(),
1013 &block_lists[it->getMeshsetId()].pressureBc.data.value1)
1029 (prefix +
".heatflux_flag1").c_str(),
1031 &block_lists[it->getMeshsetId()].heatFluxBc.data.flag1)
1033 "flag1")((prefix +
".heatflux_magnitude").c_str(),
1035 &block_lists[it->getMeshsetId()].heatFluxBc.data.value1)
1042 (prefix +
".interface_type").c_str(),
1043 po::value<char>(&block_lists[it->getMeshsetId()].cfgBc.data.type)
1049 map<int, BlockData> block_set_attributes;
1051 block_set_attributes[it->getMeshsetId()].cubitMeshset = it->getMeshset();
1052 block_set_attributes[it->getMeshsetId()].iD = it->getMeshsetId();
1053 block_set_attributes[it->getMeshsetId()].bcType =
BLOCKSET;
1054 std::string block_name = it->getName();
1056 std::remove_if(block_name.begin(), block_name.end(), ::isspace),
1058 block_set_attributes[it->getMeshsetId()].nAme = block_name;
1060 if (block_name.compare(
"NoNameSet") != 0) {
1061 std::string prefix =
"SET_ATTR_" + block_name;
1063 add_block_attributes(prefix, block_set_attributes, it);
1067 po::parsed_options parsed =
1079 block_lists[it->getMeshsetId()].addType) {
1084 if (bc_type.none()) {
1085 block_lists[it->getMeshsetId()].bcType =
UNKNOWNSET;
1090 if (bc_type.to_ulong() ==
BLOCKSET)
1091 block_lists[it->getMeshsetId()].bcType =
BLOCKSET;
1092 else if (bc_type.to_ulong() ==
NODESET)
1093 block_lists[it->getMeshsetId()].bcType =
NODESET;
1094 else if (bc_type.to_ulong() ==
SIDESET)
1095 block_lists[it->getMeshsetId()].bcType =
SIDESET;
1098 "Not yet implemented type %s\n",
1099 block_lists[it->getMeshsetId()].addType.c_str());
1101 if (block_lists[it->getMeshsetId()].iD == -1) {
1103 "Unset iD number %d\n", block_lists[it->getMeshsetId()].iD);
1107 std::vector<std::string> additional_parameters;
1108 additional_parameters =
1109 collect_unrecognized(parsed.options, po::include_positional);
1110 for (std::vector<std::string>::iterator vit = additional_parameters.begin();
1111 vit != additional_parameters.end(); vit++) {
1112 MOFEM_LOG_C(
"MeshsetMngSelf", Sev::warning,
"Unrecognized option %s",
1115 for (map<int, BlockData>::iterator mit = block_lists.begin();
1116 mit != block_lists.end(); mit++) {
1117 CubitMeshSet_multiIndex::iterator cubit_meshset_it =
1121 "Data inconsistency\n");
1123 switch (mit->second.bcType) {
1127 if ((
CubitBCType(mit->second.bcType) & cubit_meshset_it->getBcType())
1129 mit->second.iD == cubit_meshset_it->getMeshsetId()) {
1141 if (mit->second.matElastic.data.Young != -1) {
1143 mit->second.matElastic);
1145 if (mit->second.matTransIso.data.Youngp != -1) {
1147 mit->second.matTransIso);
1149 if (mit->second.matThermal.data.Conductivity != -1) {
1151 mit->second.matThermal);
1153 if (mit->second.matInterf.data.ft != -1) {
1155 mit->second.matInterf);
1159 if ((
CubitBCType(mit->second.bcType) & cubit_meshset_it->getBcType())
1161 mit->second.iD == cubit_meshset_it->getMeshsetId()) {
1170 if (mit->second.dispBc.data.flag1 || mit->second.dispBc.data.flag2 ||
1171 mit->second.dispBc.data.flag3 || mit->second.dispBc.data.flag4 ||
1172 mit->second.dispBc.data.flag5 || mit->second.dispBc.data.flag6) {
1173 if (mit->second.dispBc.data.flag1 ==
'0')
1174 mit->second.dispBc.data.flag1 = 0;
1175 if (mit->second.dispBc.data.flag1 ==
'N')
1176 mit->second.dispBc.data.flag1 = 0;
1177 if (mit->second.dispBc.data.flag1)
1178 mit->second.dispBc.data.flag1 = 1;
1179 if (mit->second.dispBc.data.flag2 ==
'0')
1180 mit->second.dispBc.data.flag2 = 0;
1181 if (mit->second.dispBc.data.flag2 ==
'N')
1182 mit->second.dispBc.data.flag2 = 0;
1183 if (mit->second.dispBc.data.flag2)
1184 mit->second.dispBc.data.flag2 = 1;
1185 if (mit->second.dispBc.data.flag3 ==
'0')
1186 mit->second.dispBc.data.flag3 = 0;
1187 if (mit->second.dispBc.data.flag3 ==
'N')
1188 mit->second.dispBc.data.flag3 = 0;
1189 if (mit->second.dispBc.data.flag3)
1190 mit->second.dispBc.data.flag3 = 1;
1191 if (mit->second.dispBc.data.flag4 ==
'0')
1192 mit->second.dispBc.data.flag4 = 0;
1193 if (mit->second.dispBc.data.flag4 ==
'N')
1194 mit->second.dispBc.data.flag4 = 0;
1195 if (mit->second.dispBc.data.flag4)
1196 mit->second.dispBc.data.flag4 = 1;
1197 if (mit->second.dispBc.data.flag5 ==
'0')
1198 mit->second.dispBc.data.flag5 = 0;
1199 if (mit->second.dispBc.data.flag5 ==
'N')
1200 mit->second.dispBc.data.flag5 = 0;
1201 if (mit->second.dispBc.data.flag5)
1202 mit->second.dispBc.data.flag5 = 1;
1203 if (mit->second.dispBc.data.flag6 ==
'0')
1204 mit->second.dispBc.data.flag6 = 0;
1205 if (mit->second.dispBc.data.flag6 ==
'N')
1206 mit->second.dispBc.data.flag6 = 0;
1207 if (mit->second.dispBc.data.flag6)
1208 mit->second.dispBc.data.flag6 = 1;
1210 mit->second.dispBc);
1212 if (mit->second.forceBc.data.value1 != 0 ||
1213 mit->second.forceBc.data.value2 != 0) {
1215 mit->second.forceBc);
1218 if (mit->second.temperatureBc.data.flag1) {
1219 if (mit->second.temperatureBc.data.flag1 ==
'0')
1220 mit->second.temperatureBc.data.flag1 = 0;
1221 if (mit->second.temperatureBc.data.flag1 ==
'N')
1222 mit->second.temperatureBc.data.flag1 = 0;
1223 if (mit->second.temperatureBc.data.flag1)
1224 mit->second.temperatureBc.data.flag1 = 1;
1226 mit->second.temperatureBc);
1230 if ((
CubitBCType(mit->second.bcType) & cubit_meshset_it->getBcType())
1232 mit->second.iD == cubit_meshset_it->getMeshsetId()) {
1241 if (mit->second.pressureBc.data.value1 != 0) {
1242 if (mit->second.pressureBc.data.flag2 ==
'0')
1243 mit->second.pressureBc.data.flag2 = 0;
1244 if (mit->second.pressureBc.data.flag2 ==
'N')
1245 mit->second.pressureBc.data.flag2 = 0;
1246 if (mit->second.pressureBc.data.flag2)
1247 mit->second.pressureBc.data.flag2 = 1;
1249 mit->second.pressureBc);
1252 if (mit->second.heatFluxBc.data.value1 != 0) {
1253 if (mit->second.heatFluxBc.data.flag1 ==
'0')
1254 mit->second.heatFluxBc.data.flag1 = 0;
1255 if (mit->second.heatFluxBc.data.flag1 ==
'N')
1256 mit->second.heatFluxBc.data.flag1 = 0;
1257 if (mit->second.heatFluxBc.data.flag1)
1258 mit->second.heatFluxBc.data.flag1 = 1;
1260 mit->second.heatFluxBc);
1263 if (mit->second.cfgBc.data.type != 0) {
1264 CHKERR setBcData(mit->second.bcType, mit->second.iD, mit->second.cfgBc);
1269 "Not yet implemented type\n");
1273 for (
auto set_attr : block_set_attributes) {
1275 if (set_attr.second.numberOfAttributes > 0) {
1276 MOFEM_LOG(
"MeshsetMngSelf", Sev::verbose)
1277 <<
"Set attributes to blockset " << set_attr.second.nAme;
1278 set_attr.second.aTtr.resize(set_attr.second.numberOfAttributes);
1280 set_attr.second.aTtr);
1290 char meshset_file_name[255] =
"config_file.cfg";
1292 CHKERR PetscOptionsBegin(m_field.
get_comm(),
"",
"Set meshsets form file",
1294 CHKERR PetscOptionsString(
"-meshsets_config",
"meshsets config file name",
1295 "",
"add_cubit_meshsets.in", meshset_file_name, 255,
1297 if (flg_file == PETSC_TRUE) {
1298 ifstream f(meshset_file_name);
1301 "File configuring meshsets ( %s ) can not be open\n",
1306 ierr = PetscOptionsEnd();
1312 const int ms_id,
const unsigned int cubit_bc_type,
1313 const std::string file_name,
const std::string file_type,
1314 const std::string options)
const {
1321 CHKERR m_field.
get_moab().write_file(file_name.c_str(), file_type.c_str(),
1322 options.c_str(), &meshset, 1);
1327 const int ms_id,
const unsigned int cubit_bc_type,
const int dim,
1328 const std::string file_name,
const bool recursive,
1329 const std::string file_type,
const std::string options)
const {
1333 moab::Interface &moab = m_field.
get_moab();
1337 CHKERR moab.create_meshset(MESHSET_SET, meshset);
1338 CHKERR moab.add_entities(meshset, entities);
1339 CHKERR moab.write_file(file_name.c_str(), file_type.c_str(), options.c_str(),
1341 CHKERR moab.delete_entities(&meshset, 1);
#define MOFEM_LOG_C(channel, severity, format,...)
MoFEMTypes
Those types control how functions respond on arguments, f.e. error handling.
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define MYPCOMM_INDEX
default communicator number PCOMM
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
CubitBC
Types of sets and boundary conditions.
@ MAT_ELASTICSET
block name is "MAT_ELASTIC"
@ MAT_THERMALSET
block name is "MAT_THERMAL"
@ MAT_MOISTURESET
block name is "MAT_MOISTURE"
@ MOFEM_OPERATION_UNSUCCESSFUL
@ MOFEM_DATA_INCONSISTENCY
static const char *const CubitBCNames[]
Names of types of sets and boundary conditions.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
#define CHKERR
Inline error check.
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
FTensor::Index< 'm', SPACE_DIM > m
MoFEMErrorCode updateMeshsetByEntitiesChildren(const EntityHandle parent, const BitRefLevel &parent_bit, const BitRefLevel &parent_mask, const BitRefLevel &child_bit, const BitRefLevel &child_mask, const EntityHandle child, EntityType child_type, const bool recursive=false, int verb=0)
Get child entities form meshset containing parent entities.
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
#define MOFEM_LOG(channel, severity)
Log.
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
MoFEMErrorCode getMeshset(const int ms_id, const unsigned int cubit_bc_type, EntityHandle &meshset) const
get meshset from CUBIT Id and CUBIT type
bool checkMeshset(const int ms_id, const CubitBCType cubit_bc_type) const
check for CUBIT Id and CUBIT type
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet in a moFEM field.
MoFEMErrorCode addMeshset(const CubitBCType cubit_bc_type, const int ms_id, const std::string name="")
add cubit meshset
MoFEMErrorCode getMeshsetsByType(const unsigned int cubit_bc_type, Range &meshsets) const
get all CUBIT meshsets by CUBIT type
MoFEMErrorCode getCubitMeshsetPtr(const int ms_id, const CubitBCType cubit_bc_type, const CubitMeshSets **cubit_meshset_ptr) const
get cubit meshset
#define _IT_CUBITMESHSETS_FOR_LOOP_(MESHSET_MANAGER, IT)
Iterator that loops over all the Cubit MeshSets in a moFEM field.
MoFEMErrorCode getEntitiesByDimension(const int ms_id, const unsigned int cubit_bc_type, const int dimension, Range &entities, const bool recursive=true) const
get entities from CUBIT/meshset of a particular entity dimension
#define _IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet having a particular BC meshset in a moFEM field.
FTensor::Index< 'i', SPACE_DIM > i
const double c
speed of light (cm/ns)
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
std::bitset< 32 > CubitBCType
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
implementation of Data Operators for Forces and Sources
constexpr double t
plate stiffness
PressureCubitBcData pressureBc
Mat_Elastic_TransIso matTransIso
HeatFluxCubitBcData heatFluxBc
DisplacementCubitBcData dispBc
std::vector< double > aTtr
TemperatureCubitBcData temperatureBc
EntityHandle cubitMeshset
Definition of the cfd_bc data structure.
virtual moab::Interface & get_moab()=0
virtual MPI_Comm & get_comm() const =0
this struct keeps basic methods for moab meshset about material and boundary conditions
EntityHandle getMeshset() const
get bc meshset
MultiIndex Tag for field id.
Deprecated interface functions.
Definition of the displacement bc data structure.
Definition of the force bc data structure.
Generic attribute data structure.
Generic bc data structure.
const CubitBCType tYpe
Type of boundary condition.
Definition of the heat flux bc data structure.
static boost::shared_ptr< SinkType > createSink(boost::shared_ptr< std::ostream > stream_ptr, std::string comm_filter)
Create a sink object.
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.
static boost::shared_ptr< std::ostream > getStrmSync()
Get the strm sync object.
static bool checkIfChannelExist(const std::string channel)
Check if channel exist.
static boost::shared_ptr< std::ostream > getStrmSelf()
Get the strm self object.
Transverse Isotropic material data structure.
Elastic material data structure.
Linear interface data structure.
moisture transport material data structure
Thermal material data structure.
Interface for managing meshsets containing materials and boundary conditions.
static bool brodcastMeshsets
MeshsetsManager(const MoFEM::Core &core)
MoFEMErrorCode printForceSet() const
print meshsets with force boundary conditions data structure
MoFEMErrorCode saveMeshsetToFile(const int ms_id, const unsigned int cubit_bc_type, const std::string file_name="out_meshset.vtk", const std::string file_type="VTK", const std::string options="") const
save cubit meshset entities on the moab mesh
MoFEMErrorCode setBcData(const CubitBCType cubit_bc_type, const int ms_id, const GenericCubitBcData &data)
set boundary data structure to meshset
MoFEMErrorCode broadcastMeshsets(int verb=DEFAULT_VERBOSITY)
Boradcats meshsets.
MoFEMErrorCode initialiseDatabaseFromMesh(int verb=DEFAULT_VERBOSITY)
MoFEMErrorCode setAtributes(const CubitBCType cubit_bc_type, const int ms_id, const std::vector< double > &attributes, const std::string name="")
set attributes to cubit meshset
MoFEMErrorCode deleteMeshset(const CubitBCType cubit_bc_type, const int ms_id, const MoFEMTypes bh=MF_EXIST)
delete cubit meshset
MoFEMErrorCode clearMap()
clear multi-index container
MoFEMErrorCode addEntitiesToMeshset(const CubitBCType cubit_bc_type, const int ms_id, const Range &ents)
add entities to cubit meshset
bool checkIfMeshsetContainsEntities(const int ms_id, const unsigned int cubit_bc_type, const EntityHandle *entities, int num_entities, const int operation_type=moab::Interface::INTERSECT)
Check if meshset constains entities.
MoFEMErrorCode query_interface(boost::typeindex::type_index type_index, UnknownInterface **iface) const
MoFEMErrorCode updateAllMeshsetsByEntitiesChildren(const BitRefLevel &bit)
Update all blolsets, sidesets and node sets.
MoFEMErrorCode printPressureSet() const
print meshsets with pressure boundary conditions data structure
MoFEMErrorCode printBcSet(CUBIT_BC_DATA_TYPE &data, unsigned long int type) const
MoFEMErrorCode printMaterialsSet() const
print meshsets with material data structure set on it
MoFEMErrorCode setMeshsetFromFile()
get name of config file from line command '-meshsets_config'
MoFEMErrorCode setAtributesByDataStructure(const CubitBCType cubit_bc_type, const int ms_id, const GenericAttributeData &data, const std::string name="")
set (material) data structure to cubit meshset
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets
MoFEMErrorCode readMeshsets(int verb=DEFAULT_VERBOSITY)
Boradcats meshsets.
MoFEMErrorCode printHeatFluxSet() const
print meshsets with heat flux boundary conditions data structure
MoFEMErrorCode printTemperatureSet() const
print meshsets with temperature boundary conditions data structure
MoFEMErrorCode getTags(int verb=-1)
get tags handlers used on meshsets
boost::shared_ptr< boost::program_options::options_description > configFileOptionsPtr
config file options
MoFEMErrorCode printDisplacementSet() const
print meshsets with displacement boundary conditions data structure
Definition of the pressure bc data structure.
Definition of the temperature bc data structure.
base class for all interface classes
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface refernce to pointer of interface.