v0.14.0
MeshsetsManager.cpp
Go to the documentation of this file.
1 /** \file MeshsetsManager.cpp
2  * \brief Interface to manage meshsets which carrying information about boundary
3  * conditions and material blocks
4  *
5  */
6 
7 using namespace std;
8 namespace po = boost::program_options;
9 
10 namespace MoFEM {
11 
12 void MeshsetsManager::sortMeshsets(
13  std::vector<const CubitMeshSets *> &vec_ptr) {
14  std::sort(vec_ptr.begin(), vec_ptr.end(),
15  [](const CubitMeshSets *a, const CubitMeshSets *b) {
16  if (a->getBcType().to_ullong() < b->getBcType().to_ullong())
17  return true;
18  if (a->getBcType().to_ullong() > b->getBcType().to_ullong())
19  return false;
20  else
21  return a->getMeshsetId() < b->getMeshsetId();
22  });
23 }
24 
25 bool MeshsetsManager::brodcastMeshsets = true;
26 
28 MeshsetsManager::query_interface(boost::typeindex::type_index type_index,
29  UnknownInterface **iface) const {
30  *iface = const_cast<MeshsetsManager *>(this);
31  return 0;
32 }
33 
34 MeshsetsManager::MeshsetsManager(const Core &core)
35  : cOre(const_cast<Core &>(core)) {
36 
37  if (!LogManager::checkIfChannelExist("MeshsetMngWorld")) {
38  auto core_log = logging::core::get();
39 
40  core_log->add_sink(
41  LogManager::createSink(LogManager::getStrmWorld(), "MeshsetMngWorld"));
42  core_log->add_sink(
43  LogManager::createSink(LogManager::getStrmSync(), "MeshsetMngSync"));
44  core_log->add_sink(
45  LogManager::createSink(LogManager::getStrmSelf(), "MeshsetMngSelf"));
46 
47  LogManager::setLog("MeshsetMngWorld");
48  LogManager::setLog("MeshsetMngSync");
49  LogManager::setLog("MeshsetMngSelf");
50 
51  MOFEM_LOG_TAG("MeshsetMngWorld", "MeshsetMng");
52  MOFEM_LOG_TAG("MeshsetMngSync", "MeshsetMng");
53  MOFEM_LOG_TAG("MeshsetMngSelf", "MeshsetMng");
54  }
55 
56  MOFEM_LOG("MeshsetMngWorld", Sev::noisy) << "Mashset manager created";
57 }
58 
61  cubitMeshsets.clear();
63 }
64 
66  Interface &m_field = cOre;
68  CHKERR readMeshsets(verb);
69  if (brodcastMeshsets)
71 
72  std::vector<const CubitMeshSets *> vec_ptr;
73  for (auto &m : cubitMeshsets) {
74  vec_ptr.push_back(&m);
75  }
76  sortMeshsets(vec_ptr);
77 
78  for (auto m_ptr : vec_ptr) {
79  MOFEM_LOG("MeshsetMngWorld", Sev::inform)
80  << "meshset in database " << *m_ptr;
81  }
82  // Verbose synchronised print
83  for (auto m_ptr : vec_ptr) {
84  MOFEM_LOG("MeshsetMngSync", Sev::verbose)
85  << "meshset in database " << *m_ptr;
86  }
87  MOFEM_LOG_SEVERITY_SYNC(m_field.get_comm(), Sev::verbose);
88 
90 }
91 
93  Interface &m_field = cOre;
94  moab::Interface &moab = m_field.get_moab();
96 
97  Range meshsets;
98  CHKERR moab.get_entities_by_type(0, MBENTITYSET, meshsets, false);
99  for (auto m : meshsets) {
100  // check if meshset is cubit meshset
101  CubitMeshSets block(moab, m);
102  if ((block.cubitBcType & CubitBCType(NODESET | SIDESET | BLOCKSET)).any()) {
103  auto p = cubitMeshsets.insert(block);
104  if (!p.second) {
105  // blockset/nodeset/sideset set exist, could be created on other
106  // processor.
107  Range ents;
108  CHKERR m_field.get_moab().get_entities_by_handle(m, ents, true);
109  CHKERR m_field.get_moab().add_entities(p.first->getMeshset(), ents);
110  CHKERR m_field.get_moab().delete_entities(&m, 1);
111  }
112  }
113  }
114 
115  std::vector<const CubitMeshSets *> vec_ptr;
116  for (auto &m : cubitMeshsets) {
117  vec_ptr.push_back(&m);
118  }
119  sortMeshsets(vec_ptr);
120 
121  for (auto m_ptr : vec_ptr) {
122  MOFEM_LOG("MeshsetMngSync", Sev::verbose) << "read " << *m_ptr;
123  }
124  MOFEM_LOG_SEVERITY_SYNC(m_field.get_comm(), Sev::verbose);
125 
127 }
128 
130  Interface &m_field = cOre;
131  moab::Interface &moab = m_field.get_moab();
133 
134  ParallelComm *pcomm = ParallelComm::get_pcomm(&moab, MYPCOMM_INDEX);
135  if (pcomm == NULL)
136  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
137  "MOAB communicator not set");
138 
139  const double coords[] = {0, 0, 0};
140 
141  auto set_tags_dummy_node = [&](const EntityHandle dummy_node,
142  const EntityHandle meshset) {
144  std::vector<Tag> tag_handles;
145  CHKERR moab.tag_get_tags_on_entity(meshset, tag_handles);
146  for (auto th : tag_handles) {
147  void *data[1];
148  int tag_size;
149  CHKERR moab.tag_get_by_ptr(th, &meshset, 1, (const void **)data,
150  &tag_size);
151  if (tag_size > 0)
152  CHKERR moab.tag_set_by_ptr(th, &dummy_node, 1, data, &tag_size);
153  }
155  };
156 
157  for (auto t : {NODESET, SIDESET, BLOCKSET}) {
158  std::vector<const CubitMeshSets *> vec_ptr;
159  for (auto &m : cubitMeshsets) {
160  if ((m.getBcType() & CubitBCType(t)).any()) {
161  vec_ptr.push_back(&m);
162  }
163  }
164  sortMeshsets(vec_ptr);
165 
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());
170  }
171 
172  switch (t) {
173  case NODESET:
174  MOFEM_LOG("MeshsetMngSync", Sev::verbose)
175  << "broadcast NODESET " << vec_meshsets.size();
176  break;
177  case SIDESET:
178  MOFEM_LOG("MeshsetMngSync", Sev::verbose)
179  << "broadcast SIDESET " << vec_meshsets.size();
180  break;
181  case BLOCKSET:
182  MOFEM_LOG("MeshsetMngSync", Sev::verbose)
183  << "broadcast BLOCKSET " << vec_meshsets.size();
184  break;
185  }
186 
187  for (int from_proc = 0; from_proc < pcomm->size(); ++from_proc) {
188 
189  Range r_dummy_nodes;
190 
191  if (from_proc == pcomm->rank()) {
192  std::vector<EntityHandle> dummy_nodes(vec_meshsets.size(), 0);
193  int i = 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);
197  ++i;
198  }
199  r_dummy_nodes.insert_list(dummy_nodes.begin(), dummy_nodes.end());
200  }
201 
202  CHKERR pcomm->broadcast_entities(from_proc, r_dummy_nodes, false, true);
203 
204  if (from_proc != pcomm->rank()) {
205 
206  for (auto dummy_node : r_dummy_nodes) {
207  CubitMeshSets broadcast_block(moab, dummy_node);
208  auto id = broadcast_block.getMeshsetId();
209  if (id != -1) {
210  auto mit =
212  .find(boost::make_tuple(
213  id, broadcast_block.getMaskedBcTypeULong()));
214  if (mit ==
216  .end()) {
217  EntityHandle m;
218  CHKERR moab.create_meshset(MESHSET_SET, m);
219  CHKERR set_tags_dummy_node(m, dummy_node);
220  auto hint = cubitMeshsets.end();
221  auto p = cubitMeshsets.emplace_hint(hint, moab, m);
222  }
223  } else {
224  MOFEM_LOG("MeshsetMngSync", Sev::warning)
225  << "broadcasted vertex " << dummy_node << " has negative id";
226  }
227 
228  }
229 
230  } else {
231  MOFEM_LOG("MeshsetMngSync", Sev::verbose)
232  << "broadcast send from " << from_proc;
233  }
234 
235  CHKERR moab.delete_entities(r_dummy_nodes);
236  }
237 
238  MOFEM_LOG_SEVERITY_SYNC(m_field.get_comm(), Sev::verbose);
239  }
240 
242 }
243 
246  Interface &m_field = cOre;
247  moab::Interface &moab = m_field.get_moab();
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);
251 
252  CHKERR moab.tag_get_handle(NEUMANN_SET_TAG_NAME, 1, MB_TYPE_INTEGER, ssTag,
253  MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
254 
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);
260 
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);
265 
266  CHKERR moab.tag_get_handle(MATERIAL_SET_TAG_NAME, 1, MB_TYPE_INTEGER, bhTag,
267  MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
268 
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]);
273 
274  Tag block_attribs;
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);
279 
280  Tag entity_name_tag;
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);
283 
285 }
286 
290  CHKERR printBcSet(mydata, NODESET | mydata.tYpe.to_ulong());
292 }
293 
295  PressureCubitBcData mydata;
297  CHKERR printBcSet(mydata, SIDESET | mydata.tYpe.to_ulong());
299 }
300 
302  ForceCubitBcData mydata;
304  CHKERR printBcSet(mydata, NODESET | mydata.tYpe.to_ulong());
306 }
307 
309  TemperatureCubitBcData mydata;
311  CHKERR printBcSet(mydata, NODESET | mydata.tYpe.to_ulong());
313 }
314 
316  HeatFluxCubitBcData mydata;
318  CHKERR printBcSet(mydata, SIDESET | mydata.tYpe.to_ulong());
320 }
321 
324  const Interface &m_field = cOre;
325  const moab::Interface &moab = m_field.get_moab();
327  (*this), BLOCKSET | MAT_ELASTICSET, it)) {
328  Mat_Elastic data;
329  CHKERR it->getAttributeDataStructure(data);
330  MOFEM_LOG("MeshsetMngWorld", Sev::inform) << *it;
331  MOFEM_LOG("MeshsetMngWorld", Sev::inform) << data;
332  Range tets;
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 "
336  << tets.size();
337  }
338 
340  m_field, BLOCKSET | MAT_THERMALSET, it)) {
341  Mat_Thermal data;
342  CHKERR it->getAttributeDataStructure(data);
343  MOFEM_LOG("MeshsetMngWorld", Sev::inform) << *it;
344  MOFEM_LOG("MeshsetMngWorld", Sev::inform) << data;
345  }
346 
348  m_field, BLOCKSET | MAT_MOISTURESET, it)) {
349  Mat_Moisture data;
350  CHKERR it->getAttributeDataStructure(data);
351  MOFEM_LOG("MeshsetMngWorld", Sev::inform) << *it;
352  MOFEM_LOG("MeshsetMngWorld", Sev::inform) << data;
353  }
355 }
356 
357 bool MeshsetsManager::checkMeshset(const int ms_id,
358  const CubitBCType cubit_bc_type) const {
359  auto miit =
361  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
362  if (miit !=
364  return true;
365  }
366  return false;
367 }
368 
369 bool MeshsetsManager::checkMeshset(const string name,
370  int *const number_of_meshsets_ptr) const {
371  auto miit = cubitMeshsets.get<CubitMeshsets_name>().lower_bound(name);
372  auto hi_miit = cubitMeshsets.get<CubitMeshsets_name>().upper_bound(name);
373  if (std::distance(miit, hi_miit) == 0) {
374  return false;
375  }
376  if (number_of_meshsets_ptr) {
377  *number_of_meshsets_ptr = std::distance(miit, hi_miit);
378  }
379  return true;
380 }
381 
383  const int ms_id,
384  const std::string name) {
385  Interface &m_field = cOre;
386  moab::Interface &moab = m_field.get_moab();
388  if (checkMeshset(ms_id, cubit_bc_type)) {
389  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
390  "such cubit meshset is already there", ms_id);
391  }
392 
393  CubitMeshSets cmeshset(moab, cubit_bc_type, ms_id);
394  if ((cmeshset.cubitBcType & CubitBCType(NODESET | SIDESET | BLOCKSET))
395  .any()) {
396  auto p = cubitMeshsets.insert(cmeshset);
397  if (!p.second) {
398  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
399  "meshset not inserted");
400  }
401  if (name.size() > 0) {
402  bool success =
403  cubitMeshsets.modify(p.first, CubitMeshSets_change_name(moab, name));
404  if (!success) {
405  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
406  "name to cubit meshset can not be set");
407  }
408  }
409  }
410 
412 }
413 
416  const int ms_id, const Range &ents) {
417  Interface &m_field = cOre;
418  moab::Interface &moab = m_field.get_moab();
420  auto cit =
422  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
423  if (cit ==
425  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
426  "Cannot find Cubit meshset with id: %d", ms_id);
427  }
428  EntityHandle meshset = cit->getMeshset();
429  CHKERR moab.add_entities(meshset, ents);
430 
432 }
433 
436  const int ms_id, const EntityHandle *ents,
437  const int nb_ents) {
438  Interface &m_field = cOre;
439  moab::Interface &moab = m_field.get_moab();
441  auto cit =
443  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
444  if (cit ==
446  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
447  "Cannot find Cubit meshset with id: %d", ms_id);
448  }
449  EntityHandle meshset = cit->getMeshset();
450  CHKERR moab.add_entities(meshset, ents, nb_ents);
451 
453 }
454 
456 MeshsetsManager::setAtributes(const CubitBCType cubit_bc_type, const int ms_id,
457  const std::vector<double> &attributes,
458  const std::string name) {
459  Interface &m_field = cOre;
460  moab::Interface &moab = m_field.get_moab();
462  auto cit =
464  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
465  if (cit ==
467  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
468  "Cannot find Cubit meshset with id: %d", ms_id);
469  }
470  if (name.size() > 0) {
471  bool success = cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
472  CubitMeshSets_change_name(moab, name));
473  if (!success) {
474  SETERRQ(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
475  "name to cubit meshset can not be set");
476  }
477  }
478  bool success =
479  cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
480  CubitMeshSets_change_attributes(moab, attributes));
481  if (!success)
482  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
483  "modification unsuccessful");
484 
485  std::ostringstream ss;
486  ss << "Block " << cit->getName();
487  ss << " Add attr: ";
488  for (unsigned int ii = 0; ii != attributes.size(); ii++) {
489  ss << attributes[ii] << " ";
490  }
491  MOFEM_LOG("MeshsetMngSelf", Sev::noisy) << ss.str();
492 
494 }
495 
497  const CubitBCType cubit_bc_type, const int ms_id,
498  const GenericAttributeData &data, const std::string name) {
499  Interface &m_field = cOre;
500  moab::Interface &moab = m_field.get_moab();
502  auto cit =
504  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
505  if (cit ==
507  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
508  "Cannot find Cubit meshset with id: %d", ms_id);
509  }
510  if (name.size() > 0) {
511  bool success = cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
512  CubitMeshSets_change_name(moab, name));
513  if (!success) {
514  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
515  "name to cubit meshset can not be set");
516  }
517  }
518  bool success = cubitMeshsets.modify(
519  cubitMeshsets.project<0>(cit),
521  if (!success)
522  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
523  "modification unsuccessful");
525 }
526 
528  const int ms_id,
529  const GenericCubitBcData &data) {
530  Interface &m_field = cOre;
531  moab::Interface &moab = m_field.get_moab();
533  auto cit =
535  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
536  if (cit ==
538  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
539  "Cubit meshset with id is already there", ms_id);
540  }
541  bool success =
542  cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
544  if (!success)
545  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
546  "modification unsuccessful");
548 }
549 
551  const int ms_id,
552  const MoFEMTypes bh) {
553  Interface &m_field = cOre;
554  moab::Interface &moab = m_field.get_moab();
556  auto miit =
558  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
559  if (miit ==
561  if (bh & MF_EXIST) {
562  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
563  "meshset not found", ms_id);
564  } else {
566  }
567  }
568  EntityHandle meshset = miit->getMeshset();
570  CHKERR moab.delete_entities(&meshset, 1);
571 
573 }
574 
576  const int ms_id, const CubitBCType cubit_bc_type,
577  const CubitMeshSets **cubit_meshset_ptr) const {
578  Interface &m_field = cOre;
580  auto miit =
582  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
583  if (miit !=
585  *cubit_meshset_ptr = &*miit;
586  } else {
587  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
588  "msId = %d is not there", ms_id);
589  }
591 }
592 
593 const CubitMeshSets *
595  const CubitBCType cubit_bc_type) const {
596  const CubitMeshSets *cubit_meshset_ptr;
598  getCubitMeshsetPtr(ms_id, cubit_bc_type, &cubit_meshset_ptr),
599  "Get not get meshset");
600  return cubit_meshset_ptr;
601 }
602 
604  const string name, const CubitMeshSets **cubit_meshset_ptr) const {
605  Interface &m_field = cOre;
607  auto miit = cubitMeshsets.get<CubitMeshsets_name>().lower_bound(name);
608  auto hi_miit = cubitMeshsets.get<CubitMeshsets_name>().upper_bound(name);
609  if (std::distance(miit, hi_miit) == 0) {
610  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
611  "meshset name <%s> is not there", name.c_str());
612  }
613  if (std::distance(miit, hi_miit) > 1) {
614  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
615  "more that one meshser of that name <%s>", name.c_str());
616  }
617  *cubit_meshset_ptr = &*miit;
619 }
620 
622  const CubitBCType cubit_bc_type,
623  std::vector<const CubitMeshSets *> &vec_ptr) const {
625  auto r = cubitMeshsets.get<CubitMeshsetType_mi_tag>().equal_range(
626  cubit_bc_type.to_ulong());
627  for (auto it = r.first; it != r.second; ++it) {
628  vec_ptr.push_back(&*it);
629  }
630  sortMeshsets(vec_ptr);
632 }
633 
634 std::vector<const CubitMeshSets *>
636  std::vector<const CubitMeshSets *> vec_ptr;
637  CHK_MOAB_THROW(getCubitMeshsetPtr(cubit_bc_type, vec_ptr),
638  "Error in getting meshsets by name");
639  return vec_ptr;
640 }
641 
643  const std::regex reg_exp_name,
644  std::vector<const CubitMeshSets *> &vec_ptr) const {
646  auto r =
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);
652  }
653  }
654  sortMeshsets(vec_ptr);
656 }
657 
658 std::vector<const CubitMeshSets *>
659 MeshsetsManager::getCubitMeshsetPtr(const std::regex reg_exp_name) const {
660  std::vector<const CubitMeshSets *> vec_ptr;
661  CHK_MOAB_THROW(getCubitMeshsetPtr(reg_exp_name, vec_ptr),
662  "Error in getting meshsets by name");
663  return vec_ptr;
664 }
665 
667  const int msId, const unsigned int cubit_bc_type, const int dimension,
668  Range &entities, const bool recursive) const {
669  Interface &m_field = cOre;
670  moab::Interface &moab = m_field.get_moab();
672  auto miit =
674  boost::make_tuple(msId, cubit_bc_type));
675  if (miit !=
677  CHKERR miit->getMeshsetIdEntitiesByDimension(moab, dimension, entities,
678  recursive);
679  } else {
680  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
681  "msId = %d is not there", msId);
682  }
684 }
685 
687  const int ms_id, const unsigned int cubit_bc_type, Range &entities,
688  const bool recursive) const {
689  Interface &m_field = cOre;
690  moab::Interface &moab = m_field.get_moab();
692  auto miit =
694  boost::make_tuple(ms_id, cubit_bc_type));
695  if (miit !=
697  CHKERR miit->getMeshsetIdEntitiesByDimension(moab, entities, recursive);
698  } else {
699  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
700  "ms_id = %d is not there", ms_id);
701  }
703 }
704 
706  const unsigned int cubit_bc_type,
707  EntityHandle &meshset) const {
708  Interface &m_field = cOre;
710  auto miit =
712  boost::make_tuple(ms_id, cubit_bc_type));
713  if (miit !=
715  meshset = miit->meshset;
716  } else {
717  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
718  "ms_id = %d is not there", ms_id);
719  }
721 }
722 
724  const int ms_id, const unsigned int cubit_bc_type,
725  const EntityHandle *entities, int num_entities, const int operation_type) {
726  auto miit =
728  boost::make_tuple(ms_id, cubit_bc_type));
729  if (miit !=
731  Interface &m_field = cOre;
732  return m_field.get_moab().contains_entities(miit->meshset, entities,
733  num_entities, operation_type);
734  } else
735  return false;
736 }
737 
739 MeshsetsManager::getMeshsetsByType(const unsigned int cubit_bc_type,
740  Range &meshsets) const {
742  auto miit =
743  cubitMeshsets.get<CubitMeshsetType_mi_tag>().lower_bound(cubit_bc_type);
744  auto hi_miit =
745  cubitMeshsets.get<CubitMeshsetType_mi_tag>().upper_bound(cubit_bc_type);
746  for (; miit != hi_miit; miit++) {
747  meshsets.insert(miit->meshset);
748  }
750 }
751 
752 struct BlockData {
753 
755 
756  int iD;
757  string addType;
758  string nAme;
760 
761  // Materials
766 
767  // BCs
774 
776  std::vector<double> aTtr;
777 
779  std::memcpy(dispBc.data.name, "Displacement", 12);
780  std::memcpy(forceBc.data.name, "Force", 5);
781  std::memcpy(pressureBc.data.name, "Pressure", 8);
782  std::memcpy(temperatureBc.data.name, "Temperature", 11);
783  std::memcpy(heatFluxBc.data.name, "HeatFlux", 8);
784  std::memcpy(cfgBc.data.name, "cfd_bc", 6);
785  }
786 };
787 
789  bool clean_file_options) {
790  Interface &m_field = cOre;
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());
798  }
799 
800  auto add_block_attributes = [&](auto prefix, auto &block_lists, auto &it) {
801  // remove spacec from blockset name
802  configFileOptionsPtr->add_options()(
803  (prefix + ".number_of_attributes").c_str(),
804  po::value<int>(&block_lists[it->getMeshsetId()].numberOfAttributes)
805  ->default_value(-1),
806  "Number of blockset attribute");
807  for (int ii = 1; ii <= 10; ii++) {
808  std::string surfix = ".user" + boost::lexical_cast<std::string>(ii);
809  configFileOptionsPtr->add_options()(
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");
814  }
815  };
816 
817  // Add blocks
818  map<int, BlockData> block_lists;
820  block_lists[it->getMeshsetId()].cubitMeshset = it->getMeshset();
821  std::string prefix =
822  "block_" + boost::lexical_cast<std::string>(it->getMeshsetId());
823  configFileOptionsPtr->add_options()(
824  (prefix + ".add").c_str(),
825  po::value<string>(&block_lists[it->getMeshsetId()].addType)
826  ->default_value("UNKNOWNSET"),
827  "Add block set")(
828  (prefix + ".id").c_str(),
829  po::value<int>(&block_lists[it->getMeshsetId()].iD)->default_value(-1),
830  "Id of meshset")(
831  (prefix + ".name").c_str(),
832  po::value<string>(&block_lists[it->getMeshsetId()].nAme)
833  ->default_value(""),
834  "Name of the meshset");
835 
836  // Block attributes
837  add_block_attributes(prefix, block_lists, it);
838 
839  // Mat elastic
840  {
841  // double Young; ///< Young's modulus
842  // double Poisson; ///< Poisson's ratio
843  // double ThermalExpansion; ///< Thermal expansion
844  configFileOptionsPtr->add_options()(
845  (prefix + ".young").c_str(),
846  po::value<double>(
847  &block_lists[it->getMeshsetId()].matElastic.data.Young)
848  ->default_value(-1),
849  "Young modulus")(
850  (prefix + ".poisson").c_str(),
851  po::value<double>(
852  &block_lists[it->getMeshsetId()].matElastic.data.Poisson)
853  ->default_value(-2),
854  "Poisson ratio")(
855  (prefix + ".thermalexpansion").c_str(),
856  po::value<double>(
857  &block_lists[it->getMeshsetId()].matElastic.data.ThermalExpansion)
858  ->default_value(-1),
859  "Thermal expansion");
860  // TODO Add users parameters
861  }
862  // Mat Trans Iso
863  {
864  // Young's modulus in xy plane (Ep)
865  // Young's modulus in z-direction (Ez)
866  // Poisson's ratio in xy plane (vp)
867  // Poisson's ratio in z-direction (vpz)
868  // Shear modulus in z-direction (Gzp)
869  configFileOptionsPtr->add_options()(
870  (prefix + ".Youngp").c_str(),
871  po::value<double>(
872  &block_lists[it->getMeshsetId()].matTransIso.data.Youngp)
873  ->default_value(-1),
874  "Youngp")(
875  (prefix + ".Youngz").c_str(),
876  po::value<double>(
877  &block_lists[it->getMeshsetId()].matTransIso.data.Youngz)
878  ->default_value(-1),
879  "Youngz")(
880  (prefix + ".Poissonp").c_str(),
881  po::value<double>(
882  &block_lists[it->getMeshsetId()].matTransIso.data.Poissonp)
883  ->default_value(0),
884  "Poissonp")(
885  (prefix + ".Poissonpz").c_str(),
886  po::value<double>(
887  &block_lists[it->getMeshsetId()].matTransIso.data.Poissonpz)
888  ->default_value(0),
889  "Poissonpz")(
890  (prefix + ".Shearzp").c_str(),
891  po::value<double>(
892  &block_lists[it->getMeshsetId()].matTransIso.data.Shearzp)
893  ->default_value(-1),
894  "Shearzp");
895  // TODO Add users parameters
896  }
897  // Mat thermal
898  {
899  // double Conductivity; ///< Thermal conductivity
900  // double HeatCapacity; ///< Heat Capacity
901  configFileOptionsPtr->add_options()(
902  (prefix + ".conductivity").c_str(),
903  po::value<double>(
904  &block_lists[it->getMeshsetId()].matThermal.data.Conductivity)
905  ->default_value(-1),
906  "Conductivity")(
907  (prefix + ".capacity").c_str(),
908  po::value<double>(
909  &block_lists[it->getMeshsetId()].matThermal.data.HeatCapacity)
910  ->default_value(-1),
911  "Capacity");
912  // TODO Add users parameters
913  }
914  // Mat interface
915  {
916  // double alpha; ///< Elastic modulus multiplier
917  // double beta; ///< Damage Coupling multiplier between normal and
918  // shear (g=sqrt(gn^2 + beta(gt1^2 + gt2^2))) double ft; ///< Maximum
919  // stress of crack double Gf; ///< Fracture Energy
920  configFileOptionsPtr->add_options()(
921  (prefix + ".interface_alpha").c_str(),
922  po::value<double>(
923  &block_lists[it->getMeshsetId()].matInterf.data.alpha)
924  ->default_value(-1),
925  "alpha")((prefix + ".interface_beta").c_str(),
926  po::value<double>(
927  &block_lists[it->getMeshsetId()].matInterf.data.beta)
928  ->default_value(-1),
929  "beta")(
930  (prefix + ".interface_ft").c_str(),
931  po::value<double>(&block_lists[it->getMeshsetId()].matInterf.data.ft)
932  ->default_value(-1),
933  "ft")(
934  (prefix + ".interface_Gf").c_str(),
935  po::value<double>(&block_lists[it->getMeshsetId()].matInterf.data.Gf)
936  ->default_value(-1),
937  "Gf");
938  // TODO Add users parameters
939  }
940 
941  // Displacement bc
942  {
943  // char flag1; //< Flag for X-Translation (0: N/A, 1: specified)
944  // char flag2; //< Flag for Y-Translation (0: N/A, 1: specified)
945  // char flag3; //< Flag for Z-Translation (0: N/A, 1: specified)
946  // char flag4; //< Flag for X-Rotation (0: N/A, 1: specified)
947  // char flag5; //< Flag for Y-Rotation (0: N/A, 1: specified)
948  // char flag6; //< Flag for Z-Rotation (0: N/A, 1: specified)
949  // double value1; //< Value for X-Translation
950  // double value2; //< Value for Y-Translation
951  // double value3; //< Value for Z-Translation
952  // double value4; //< Value for X-Rotation
953  // double value5; //< Value for Y-Rotation
954  // double value6; //< Value for Z-Rotation
955  configFileOptionsPtr->add_options()(
956  (prefix + ".disp_flag1").c_str(),
957  po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag1)
958  ->default_value(0),
959  "flag1")(
960  (prefix + ".disp_flag2").c_str(),
961  po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag2)
962  ->default_value(0),
963  "flag2")(
964  (prefix + ".disp_flag3").c_str(),
965  po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag3)
966  ->default_value(0),
967  "flag3")(
968  (prefix + ".disp_flag4").c_str(),
969  po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag4)
970  ->default_value(0),
971  "flag4")(
972  (prefix + ".disp_flag5").c_str(),
973  po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag5)
974  ->default_value(0),
975  "flag5")(
976  (prefix + ".disp_flag6").c_str(),
977  po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag6)
978  ->default_value(0),
979  "flag6")(
980  (prefix + ".disp_ux").c_str(),
981  po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value1)
982  ->default_value(0),
983  "value1")(
984  (prefix + ".disp_uy").c_str(),
985  po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value2)
986  ->default_value(0),
987  "value2")(
988  (prefix + ".disp_uz").c_str(),
989  po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value3)
990  ->default_value(0),
991  "value3")(
992  (prefix + ".disp_rx").c_str(),
993  po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value4)
994  ->default_value(0),
995  "value4")(
996  (prefix + ".disp_ry").c_str(),
997  po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value5)
998  ->default_value(0),
999  "value5")(
1000  (prefix + ".disp_rz").c_str(),
1001  po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value6)
1002  ->default_value(0),
1003  "value6");
1004  }
1005  // Force BC data
1006  {
1007  // char zero[3]; //< 3 zeros
1008  // double value1; //< Force magnitude
1009  // double value2; //< Moment magnitude
1010  // double value3; //< X-component of force direction vector
1011  // double value4; //< Y-component of force direction vector
1012  // double value5; //< Z-component of force direction vector
1013  // double value6; //< X-component of moment direction vector
1014  // double value7; //< Y-component of moment direction vector
1015  // double value8; //< Z-component of moment direction vector
1016  // char zero2; // 0
1017  configFileOptionsPtr->add_options()(
1018  (prefix + ".force_magnitude").c_str(),
1019  po::value<double>(
1020  &block_lists[it->getMeshsetId()].forceBc.data.value1)
1021  ->default_value(0),
1022  "value1")((prefix + ".moment_magnitude").c_str(),
1023  po::value<double>(
1024  &block_lists[it->getMeshsetId()].forceBc.data.value2)
1025  ->default_value(0),
1026  "value2")(
1027  (prefix + ".force_fx").c_str(),
1028  po::value<double>(
1029  &block_lists[it->getMeshsetId()].forceBc.data.value3)
1030  ->default_value(0),
1031  "value3")((prefix + ".force_fy").c_str(),
1032  po::value<double>(
1033  &block_lists[it->getMeshsetId()].forceBc.data.value4)
1034  ->default_value(0),
1035  "value4")(
1036  (prefix + ".force_fz").c_str(),
1037  po::value<double>(
1038  &block_lists[it->getMeshsetId()].forceBc.data.value5)
1039  ->default_value(0),
1040  "value5")((prefix + ".moment_mx").c_str(),
1041  po::value<double>(
1042  &block_lists[it->getMeshsetId()].forceBc.data.value6)
1043  ->default_value(0),
1044  "value6")(
1045  (prefix + ".moment_my").c_str(),
1046  po::value<double>(
1047  &block_lists[it->getMeshsetId()].forceBc.data.value7)
1048  ->default_value(0),
1049  "value7")((prefix + ".moment_mz").c_str(),
1050  po::value<double>(
1051  &block_lists[it->getMeshsetId()].forceBc.data.value8)
1052  ->default_value(0),
1053  "value8");
1054  }
1055  {
1056  // char name[11]; //< 11 characters for "Temperature"
1057  // char pre1; //< This is always zero
1058  // char pre2; //< 0: temperature is not applied on thin shells
1059  // (default); 1: temperature is applied on thin shells char flag1; //<
1060  // 0: N/A, 1: temperature value applied (not on thin shells) char flag2;
1061  // //< 0: N/A, 1: temperature applied on thin shell middle char flag3;
1062  // //< 0: N/A, 1: thin shell temperature gradient specified char flag4;
1063  // //< 0: N/A, 1: top thin shell temperature char flag5; //< 0: N/A, 1:
1064  // bottom thin shell temperature char flag6; //< This is always zero
1065  // double value1; //< Temperature (default case - no thin shells)
1066  // double value2; //< Temperature for middle of thin shells
1067  // double value3; //< Temperature gradient for thin shells
1068  // double value4; //< Temperature for top of thin shells
1069  // double value5; //< Temperature for bottom of thin shells
1070  // double value6; //< This is always zero, i.e. ignore
1071  configFileOptionsPtr->add_options()(
1072  (prefix + ".temperature_flag1").c_str(),
1073  po::value<char>(
1074  &block_lists[it->getMeshsetId()].temperatureBc.data.flag1)
1075  ->default_value(0),
1076  "flag1")(
1077  (prefix + ".temperature_t").c_str(),
1078  po::value<double>(
1079  &block_lists[it->getMeshsetId()].temperatureBc.data.value1)
1080  ->default_value(0),
1081  "value1");
1082  // TODO: Add more cases, see above
1083  }
1084  // Sideset
1085  {
1086  // char name[8]; //< 8 characters for "Pressure"
1087  // char zero; //< This is always zero
1088  // char flag2; //< 0: Pressure is interpreted as pure pressure 1:
1089  // pressure is interpreted as total force double value1; //< Pressure
1090  // value
1091  configFileOptionsPtr->add_options()(
1092  (prefix + ".pressure_flag2").c_str(),
1093  po::value<char>(
1094  &block_lists[it->getMeshsetId()].pressureBc.data.flag2)
1095  ->default_value(0),
1096  "flag2")((prefix + ".pressure_magnitude").c_str(),
1097  po::value<double>(
1098  &block_lists[it->getMeshsetId()].pressureBc.data.value1)
1099  ->default_value(0),
1100  "value1");
1101  }
1102  {
1103  // char name[8]; //< 8 characters for "HeatFlux" (no space)
1104  // char pre1; //< This is always zero
1105  // char pre2; //< 0: heat flux is not applied on thin shells (default);
1106  // 1: heat flux is applied on thin shells char flag1; //< 0: N/A, 1:
1107  // normal heat flux case (i.e. single value, case without thin shells)
1108  // char flag2; //< 0: N/A, 1: Thin shell top heat flux specified
1109  // char flag3; //< 0: N/A, 1: Thin shell bottom heat flux specidied
1110  // double value1; //< Heat flux value for default case (no thin shells)
1111  // double value2; //< Heat flux (thin shell top)
1112  // double value3; //< Heat flux (thin shell bottom)
1113  configFileOptionsPtr->add_options()(
1114  (prefix + ".heatflux_flag1").c_str(),
1115  po::value<char>(
1116  &block_lists[it->getMeshsetId()].heatFluxBc.data.flag1)
1117  ->default_value(0),
1118  "flag1")((prefix + ".heatflux_magnitude").c_str(),
1119  po::value<double>(
1120  &block_lists[it->getMeshsetId()].heatFluxBc.data.value1)
1121  ->default_value(0),
1122  "value1");
1123  }
1124  // Interface set
1125  {
1126  configFileOptionsPtr->add_options()(
1127  (prefix + ".interface_type").c_str(),
1128  po::value<char>(&block_lists[it->getMeshsetId()].cfgBc.data.type)
1129  ->default_value(0),
1130  "type");
1131  }
1132  }
1133 
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();
1140  block_name.erase(
1141  std::remove_if(block_name.begin(), block_name.end(), ::isspace),
1142  block_name.end());
1143  block_set_attributes[it->getMeshsetId()].nAme = block_name;
1144  // Only blocks which have name
1145  if (block_name.compare("NoNameSet") != 0) {
1146  std::string prefix = "SET_ATTR_" + block_name;
1147  // Block attributes
1148  add_block_attributes(prefix, block_set_attributes, it);
1149  }
1150  }
1151 
1152  po::parsed_options parsed =
1153  parse_config_file(ini_file, *configFileOptionsPtr, true);
1154  store(parsed, vm);
1155  po::notify(vm);
1156 
1157  // Set type from name
1159 
1160  CubitBCType bc_type;
1161  unsigned jj = 0;
1162  while (1 << jj != LASTSET_BC) {
1163  if (string(CubitBCNames[jj + 1]) ==
1164  block_lists[it->getMeshsetId()].addType) {
1165  bc_type = 1 << jj;
1166  }
1167  ++jj;
1168  }
1169  if (bc_type.none()) {
1170  block_lists[it->getMeshsetId()].bcType = UNKNOWNSET;
1171  // Skip the bockset nothing is defined for it
1172  continue;
1173  }
1174 
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;
1181  else {
1182  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
1183  "Not yet implemented type %s\n",
1184  block_lists[it->getMeshsetId()].addType.c_str());
1185  }
1186  if (block_lists[it->getMeshsetId()].iD == -1) {
1187  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
1188  "Unset iD number %d\n", block_lists[it->getMeshsetId()].iD);
1189  }
1190  }
1191 
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",
1198  vit->c_str());
1199  }
1200  for (map<int, BlockData>::iterator mit = block_lists.begin();
1201  mit != block_lists.end(); mit++) {
1202  CubitMeshSet_multiIndex::iterator cubit_meshset_it =
1203  cubitMeshsets.find(mit->second.cubitMeshset);
1204  if (cubit_meshset_it == cubitMeshsets.end()) {
1205  SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
1206  "Data inconsistency\n");
1207  }
1208  switch (mit->second.bcType) {
1209  case UNKNOWNSET:
1210  break;
1211  case BLOCKSET: {
1212  if ((CubitBCType(mit->second.bcType) & cubit_meshset_it->getBcType())
1213  .any() &&
1214  mit->second.iD == cubit_meshset_it->getMeshsetId()) {
1215  // Meshset is the same, only modification
1216  } else {
1217  CHKERR addMeshset(mit->second.bcType, mit->second.iD, mit->second.nAme);
1218  EntityHandle meshset = cubit_meshset_it->getMeshset();
1219  CHKERR addEntitiesToMeshset(mit->second.bcType, mit->second.iD,
1220  &meshset, 1);
1221  }
1222  // Add attributes
1223  CHKERR setAtributes(mit->second.bcType, mit->second.iD, mit->second.aTtr);
1224  // Add material elastic data if value are physical (i.e. Young > 0,
1225  // Poisson in (-1.0.5) and ThermalExpansion>0)
1226  if (mit->second.matElastic.data.Young != -1) {
1227  CHKERR setAtributesByDataStructure(mit->second.bcType, mit->second.iD,
1228  mit->second.matElastic);
1229  }
1230  if (mit->second.matTransIso.data.Youngp != -1) {
1231  CHKERR setAtributesByDataStructure(mit->second.bcType, mit->second.iD,
1232  mit->second.matTransIso);
1233  }
1234  if (mit->second.matThermal.data.Conductivity != -1) {
1235  CHKERR setAtributesByDataStructure(mit->second.bcType, mit->second.iD,
1236  mit->second.matThermal);
1237  }
1238  if (mit->second.matInterf.data.ft != -1) {
1239  CHKERR setAtributesByDataStructure(mit->second.bcType, mit->second.iD,
1240  mit->second.matInterf);
1241  }
1242  } break;
1243  case NODESET: {
1244  if ((CubitBCType(mit->second.bcType) & cubit_meshset_it->getBcType())
1245  .any() &&
1246  mit->second.iD == cubit_meshset_it->getMeshsetId()) {
1247  // Meshset is the same, only modification
1248  } else {
1249  CHKERR addMeshset(mit->second.bcType, mit->second.iD);
1250  EntityHandle meshset = cubit_meshset_it->getMeshset();
1251  CHKERR addEntitiesToMeshset(mit->second.bcType, mit->second.iD,
1252  &meshset, 1);
1253  }
1254  // Add displacement bc
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;
1294  CHKERR setBcData(mit->second.bcType, mit->second.iD,
1295  mit->second.dispBc);
1296  }
1297  if (mit->second.forceBc.data.value1 != 0 ||
1298  mit->second.forceBc.data.value2 != 0) {
1299  CHKERR setBcData(mit->second.bcType, mit->second.iD,
1300  mit->second.forceBc);
1301  }
1302  // Add temperature boundary condition
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;
1310  CHKERR setBcData(mit->second.bcType, mit->second.iD,
1311  mit->second.temperatureBc);
1312  }
1313  } break;
1314  case SIDESET: {
1315  if ((CubitBCType(mit->second.bcType) & cubit_meshset_it->getBcType())
1316  .any() &&
1317  mit->second.iD == cubit_meshset_it->getMeshsetId()) {
1318  // Meshset is the same, only modification
1319  } else {
1320  CHKERR addMeshset(mit->second.bcType, mit->second.iD);
1321  EntityHandle meshset = cubit_meshset_it->getMeshset();
1322  CHKERR addEntitiesToMeshset(mit->second.bcType, mit->second.iD,
1323  &meshset, 1);
1324  }
1325  // Add pressure
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;
1333  CHKERR setBcData(mit->second.bcType, mit->second.iD,
1334  mit->second.pressureBc);
1335  }
1336  // Add heat flux
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;
1344  CHKERR setBcData(mit->second.bcType, mit->second.iD,
1345  mit->second.heatFluxBc);
1346  }
1347  // Add Interface
1348  if (mit->second.cfgBc.data.type != 0) {
1349  CHKERR setBcData(mit->second.bcType, mit->second.iD, mit->second.cfgBc);
1350  }
1351  } break;
1352  default:
1353  SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
1354  "Not yet implemented type\n");
1355  }
1356  }
1357 
1358  for (auto set_attr : block_set_attributes) {
1359  // Add 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);
1364  CHKERR setAtributes(set_attr.second.bcType, set_attr.second.iD,
1365  set_attr.second.aTtr);
1366  }
1367  }
1368 
1370 }
1371 
1373  Interface &m_field = cOre;
1374  PetscBool flg_file;
1375  char meshset_file_name[255] = "config_file.cfg";
1377  CHKERR PetscOptionsBegin(m_field.get_comm(), "", "Set meshsets form file",
1378  "none");
1379  CHKERR PetscOptionsString("-meshsets_config", "meshsets config file name",
1380  "", "add_cubit_meshsets.in", meshset_file_name, 255,
1381  &flg_file);
1382  if (flg_file == PETSC_TRUE) {
1383  ifstream f(meshset_file_name);
1384  if (!f.good()) {
1385  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
1386  "File configuring meshsets ( %s ) can not be open\n",
1387  meshset_file_name);
1388  }
1389  CHKERR setMeshsetFromFile(string(meshset_file_name));
1390  }
1391  ierr = PetscOptionsEnd();
1392  CHKERRG(ierr);
1394 }
1395 
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 {
1400 
1402  MoFEM::Interface &m_field = cOre;
1403  const CubitMeshSets *cubit_meshset_ptr;
1404  CHKERR getCubitMeshsetPtr(ms_id, cubit_bc_type, &cubit_meshset_ptr);
1405  EntityHandle meshset = cubit_meshset_ptr->getMeshset();
1406  CHKERR m_field.get_moab().write_file(file_name.c_str(), file_type.c_str(),
1407  options.c_str(), &meshset, 1);
1409 }
1410 
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 {
1415 
1417  MoFEM::Interface &m_field = cOre;
1418  moab::Interface &moab = m_field.get_moab();
1419  Range entities;
1420  CHKERR getEntitiesByDimension(ms_id, cubit_bc_type, dim, entities, recursive);
1421  EntityHandle meshset;
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(),
1425  &meshset, 1);
1426  CHKERR moab.delete_entities(&meshset, 1);
1428 }
1429 
1434  for (_IT_CUBITMESHSETS_FOR_LOOP_((*this), iit)) {
1435  EntityHandle meshset = iit->getMeshset();
1436  for (EntityType t = MBVERTEX; t != MBENTITYSET; ++t)
1437  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset, t,
1438  true);
1439  }
1441 }
1442 
1443 } // namespace MoFEM
CubitBCNames
const static char *const CubitBCNames[]
Names of types of sets and boundary conditions.
Definition: definitions.h:175
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:447
MoFEM::UnknownInterface::getInterface
MoFEMErrorCode getInterface(IFACE *&iface) const
Get interface reference to pointer of interface.
Definition: UnknownInterface.hpp:93
CHK_MOAB_THROW
#define CHK_MOAB_THROW(err, msg)
Check error code of MoAB function and throw MoFEM exception.
Definition: definitions.h:576
MoFEM::CubitMeshSets::cubitBcType
CubitBCType cubitBcType
Definition: BCMultiIndices.hpp:22
MoFEM::CubitMeshSets_change_bc_data_structure
Definition: BCMultiIndices.hpp:437
SIDESET
@ SIDESET
Definition: definitions.h:147
MoFEM::LogManager::checkIfChannelExist
static bool checkIfChannelExist(const std::string channel)
Check if channel exist.
Definition: LogManager.cpp:404
MoFEM::MeshsetsManager::cOre
MoFEM::Core & cOre
Definition: MeshsetsManager.hpp:109
MoFEM::MeshsetsManager::getMeshsetsByType
MoFEMErrorCode getMeshsetsByType(const unsigned int cubit_bc_type, Range &meshsets) const
get all CUBIT meshsets by CUBIT type
Definition: MeshsetsManager.cpp:739
MYPCOMM_INDEX
#define MYPCOMM_INDEX
default communicator number PCOMM
Definition: definitions.h:215
MoFEM::MeshsetsManager::sortMeshsets
static void sortMeshsets(std::vector< const CubitMeshSets * > &vec_ptr)
Definition: MeshsetsManager.cpp:12
MoFEM::GenericCubitBcData
Generic bc data structure.
Definition: BCData.hpp:20
MoFEM::CoreTmp< 0 >
Core (interface) class.
Definition: Core.hpp:82
MoFEM::TemperatureCubitBcData
Definition of the temperature bc data structure.
Definition: BCData.hpp:306
MoFEM::MeshsetsManager::printTemperatureSet
MoFEMErrorCode printTemperatureSet() const
print meshsets with temperature boundary conditions data structure
Definition: MeshsetsManager.cpp:308
MoFEM::MeshsetsManager::addEntitiesToMeshset
MoFEMErrorCode addEntitiesToMeshset(const CubitBCType cubit_bc_type, const int ms_id, const Range &ents)
add entities to cubit meshset
Definition: MeshsetsManager.cpp:415
MOFEM_LOG_SEVERITY_SYNC
#define MOFEM_LOG_SEVERITY_SYNC(comm, severity)
Synchronise "SYNC" on curtain severity level.
Definition: LogManager.hpp:352
EntityHandle
MoFEM::CoreInterface::get_comm
virtual MPI_Comm & get_comm() const =0
MoFEM::BlockData::dispBc
DisplacementCubitBcData dispBc
Definition: MeshsetsManager.cpp:768
CHK_THROW_MESSAGE
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
Definition: definitions.h:596
MoFEM::Mat_Elastic
Elastic material data structure.
Definition: MaterialBlocks.hpp:139
MoFEM::BlockData::addType
string addType
Definition: MeshsetsManager.cpp:757
MoFEM::MeshsetsManager::broadcastMeshsets
MoFEMErrorCode broadcastMeshsets(int verb=DEFAULT_VERBOSITY)
Boradcats meshsets.
Definition: MeshsetsManager.cpp:129
MoFEM::Exceptions::MoFEMErrorCode
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:56
MoFEM::CubitMeshSets
this struct keeps basic methods for moab meshset about material and boundary conditions
Definition: BCMultiIndices.hpp:19
_IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet in a moFEM field.
Definition: MeshsetsManager.hpp:49
MoFEM::BlockData::BlockData
BlockData()
Definition: MeshsetsManager.cpp:778
MoFEM::BlockData::iD
int iD
Definition: MeshsetsManager.cpp:756
MoFEM::th
Tag th
Definition: Projection10NodeCoordsOnField.cpp:122
MoFEM::BlockData::temperatureBc
TemperatureCubitBcData temperatureBc
Definition: MeshsetsManager.cpp:771
MoFEM::MeshsetsManager::brodcastMeshsets
static bool brodcastMeshsets
Definition: MeshsetsManager.hpp:881
MoFEM::CubitMeshSets_change_attributes_data_structure
Definition: BCMultiIndices.hpp:425
MoFEM::ForceCubitBcData
Definition of the force bc data structure.
Definition: BCData.hpp:139
MoFEM::DisplacementCubitBcData
Definition of the displacement bc data structure.
Definition: BCData.hpp:76
MoFEM::GenericCubitBcData::tYpe
const CubitBCType tYpe
Type of boundary condition.
Definition: BCData.hpp:59
MoFEM::CubitMeshSets::getMaskedBcTypeULong
unsigned long int getMaskedBcTypeULong() const
get meshset type and mask
Definition: BCMultiIndices.hpp:76
MoFEM::LogManager::createSink
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
MoFEM::BlockData::aTtr
std::vector< double > aTtr
Definition: MeshsetsManager.cpp:776
sdf.r
int r
Definition: sdf.py:8
MoFEM::PressureCubitBcData
Definition of the pressure bc data structure.
Definition: BCData.hpp:379
MoFEM::DeprecatedCoreInterface
Deprecated interface functions.
Definition: DeprecatedCoreInterface.hpp:16
MoFEM::MeshsetsManager::getMeshset
MoFEMErrorCode getMeshset(const int ms_id, const unsigned int cubit_bc_type, EntityHandle &meshset) const
get meshset from CUBIT Id and CUBIT type
Definition: MeshsetsManager.cpp:705
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1975
MoFEM::MeshsetsManager::bhTag_header
Tag bhTag_header
Definition: MeshsetsManager.hpp:890
MoFEM::BlockData::cfgBc
CfgCubitBcData cfgBc
Definition: MeshsetsManager.cpp:773
MoFEM::MeshsetsManager::ssTag_data
Tag ssTag_data
Definition: MeshsetsManager.hpp:888
MoFEM::Mat_Interf
Linear interface data structure.
Definition: MaterialBlocks.hpp:430
MoFEM::BlockData::matThermal
Mat_Thermal matThermal
Definition: MeshsetsManager.cpp:764
MoFEM::MeshsetsManager::initialiseDatabaseFromMesh
MoFEMErrorCode initialiseDatabaseFromMesh(int verb=DEFAULT_VERBOSITY)
Definition: MeshsetsManager.cpp:65
NODESET
@ NODESET
Definition: definitions.h:146
MoFEM::MeshsetsManager::nsTag
Tag nsTag
Definition: MeshsetsManager.hpp:885
MoFEM::MeshsetsManager::clearMap
MoFEMErrorCode clearMap()
clear multi-index container
Definition: MeshsetsManager.cpp:59
MoFEM::CubitMeshSets_change_name
change meshset name
Definition: BCMultiIndices.hpp:402
CHKERR
#define CHKERR
Inline error check.
Definition: definitions.h:535
MoFEM::MeshsetsManager::printForceSet
MoFEMErrorCode printForceSet() const
print meshsets with force boundary conditions data structure
Definition: MeshsetsManager.cpp:301
MoFEM::MeshsetsManager::saveMeshsetToFile
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
Definition: MeshsetsManager.cpp:1396
MoFEM::CoreInterface::get_moab
virtual moab::Interface & get_moab()=0
MoFEM::MeshsetsManager::updateAllMeshsetsByEntitiesChildren
MoFEMErrorCode updateAllMeshsetsByEntitiesChildren(const BitRefLevel &bit)
Update all blolsets, sidesets and node sets.
Definition: MeshsetsManager.cpp:1431
MoFEM
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:10
MoFEM::MeshsetsManager::printHeatFluxSet
MoFEMErrorCode printHeatFluxSet() const
print meshsets with heat flux boundary conditions data structure
Definition: MeshsetsManager.cpp:315
a
constexpr double a
Definition: approx_sphere.cpp:30
MAT_THERMALSET
@ MAT_THERMALSET
block name is "MAT_THERMAL"
Definition: definitions.h:161
MoFEM::MeshsetsManager::getEntitiesByDimension
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
Definition: MeshsetsManager.cpp:666
MOFEM_LOG_C
#define MOFEM_LOG_C(channel, severity, format,...)
Definition: LogManager.hpp:311
MoFEM::Mat_Elastic_TransIso
Transverse Isotropic material data structure.
Definition: MaterialBlocks.hpp:371
MoFEM::Mat_Moisture
moisture transport material data structure
Definition: MaterialBlocks.hpp:263
bit
auto bit
set bit
Definition: hanging_node_approx.cpp:75
MoFEM::MeshsetsManager::addMeshset
MoFEMErrorCode addMeshset(const CubitBCType cubit_bc_type, const int ms_id, const std::string name="")
add cubit meshset
Definition: MeshsetsManager.cpp:382
MAT_ELASTICSET
@ MAT_ELASTICSET
block name is "MAT_ELASTIC"
Definition: definitions.h:159
MoFEM::BlockData::nAme
string nAme
Definition: MeshsetsManager.cpp:758
MoFEM::LogManager::getStrmSync
static boost::shared_ptr< std::ostream > getStrmSync()
Get the strm sync object.
Definition: LogManager.cpp:348
MoFEM::MeshsetsManager::ssTag
Tag ssTag
Definition: MeshsetsManager.hpp:886
MoFEM::BlockData::cubitMeshset
EntityHandle cubitMeshset
Definition: MeshsetsManager.cpp:754
MoFEM::MeshsetsManager::setAtributesByDataStructure
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
Definition: MeshsetsManager.cpp:496
MoFEM::CubitMeshSets_change_attributes
Definition: BCMultiIndices.hpp:413
MoFEM::CfgCubitBcData::data
_data_ data
Definition: BCData.hpp:485
MoFEM::LogManager::getStrmWorld
static boost::shared_ptr< std::ostream > getStrmWorld()
Get the strm world object.
Definition: LogManager.cpp:344
MoFEM::BitRefManager::updateMeshsetByEntitiesChildren
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.
Definition: BitRefManager.cpp:1029
MoFEM::ForceCubitBcData::data
_data_ data
Definition: BCData.hpp:152
MoFEM::MeshsetsManager::nsTag_data
Tag nsTag_data
Definition: MeshsetsManager.hpp:887
MoFEM::MeshsetsManager::cubitMeshsets
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets
Definition: MeshsetsManager.hpp:893
MoFEM::LogManager::getStrmSelf
static boost::shared_ptr< std::ostream > getStrmSelf()
Get the strm self object.
Definition: LogManager.cpp:340
MoFEM::Composite_Cubit_msId_And_MeshsetType_mi_tag
Definition: TagMultiIndices.hpp:15
MoFEM::BlockData::matElastic
Mat_Elastic matElastic
Definition: MeshsetsManager.cpp:762
MOFEM_OPERATION_UNSUCCESSFUL
@ MOFEM_OPERATION_UNSUCCESSFUL
Definition: definitions.h:34
MOFEM_LOG_TAG
#define MOFEM_LOG_TAG(channel, tag)
Tag channel.
Definition: LogManager.hpp:339
MoFEM::DisplacementCubitBcData::data
_data_ data
Definition: BCData.hpp:99
t
constexpr double t
plate stiffness
Definition: plate.cpp:59
MoFEM::GenericAttributeData
Generic attribute data structure.
Definition: MaterialBlocks.hpp:17
UNKNOWNSET
@ UNKNOWNSET
Definition: definitions.h:145
i
FTensor::Index< 'i', SPACE_DIM > i
Definition: hcurl_divergence_operator_2d.cpp:27
MoFEM::MeshsetsManager::printMaterialsSet
MoFEMErrorCode printMaterialsSet() const
print meshsets with material data structure set on it
Definition: MeshsetsManager.cpp:322
MoFEM::BlockData::pressureBc
PressureCubitBcData pressureBc
Definition: MeshsetsManager.cpp:770
MoFEM::MeshsetsManager::setAtributes
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
Definition: MeshsetsManager.cpp:456
MoFEM::PressureCubitBcData::data
_data_ data
Definition: BCData.hpp:387
MoFEM::MeshsetsManager::getTags
MoFEMErrorCode getTags(int verb=-1)
get tags handlers used on meshsets
Definition: MeshsetsManager.cpp:244
LASTSET_BC
@ LASTSET_BC
Definition: definitions.h:166
MoFEM::MeshsetsManager::deleteMeshset
MoFEMErrorCode deleteMeshset(const CubitBCType cubit_bc_type, const int ms_id, const MoFEMTypes bh=MF_EXIST)
delete cubit meshset
Definition: MeshsetsManager.cpp:550
MoFEM::UnknownInterface
base class for all interface classes
Definition: UnknownInterface.hpp:34
MoFEM::CubitMeshsetMaskedType_mi_tag
Definition: TagMultiIndices.hpp:13
MoFEM::TemperatureCubitBcData::data
_data_ data
Definition: BCData.hpp:325
MoFEM::MeshsetsManager::configFileOptionsPtr
boost::shared_ptr< boost::program_options::options_description > configFileOptionsPtr
config file options
Definition: MeshsetsManager.hpp:895
Range
MoFEM::Types::CubitBCType
std::bitset< 32 > CubitBCType
Definition: Types.hpp:52
MOFEM_LOG
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:308
MoFEM::MeshsetsManager::printDisplacementSet
MoFEMErrorCode printDisplacementSet() const
print meshsets with displacement boundary conditions data structure
Definition: MeshsetsManager.cpp:287
_IT_CUBITMESHSETS_BY_SET_TYPE_FOR_LOOP_
#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.
Definition: MeshsetsManager.hpp:71
MoFEM::MeshsetsManager::printBcSet
MoFEMErrorCode printBcSet(CUBIT_BC_DATA_TYPE &data, unsigned long int type) const
Definition: MeshsetsManager.hpp:901
MoFEM::MeshsetsManager::printPressureSet
MoFEMErrorCode printPressureSet() const
print meshsets with pressure boundary conditions data structure
Definition: MeshsetsManager.cpp:294
MoFEM::CubitMeshSets::getMeshset
EntityHandle getMeshset() const
get bc meshset
Definition: BCMultiIndices.hpp:62
MoFEM::MeshsetsManager::bhTag
Tag bhTag
Definition: MeshsetsManager.hpp:889
std
Definition: enable_if.hpp:5
MoFEM::Mat_Thermal
Thermal material data structure.
Definition: MaterialBlocks.hpp:201
HenckyOps::f
auto f
Definition: HenckyOps.hpp:15
MoFEM::CubitMeshSets::getMeshsetId
int getMeshsetId() const
get meshset id as it set in preprocessing software
Definition: BCMultiIndices.hpp:43
BLOCKSET
@ BLOCKSET
Definition: definitions.h:148
MoFEM::BlockData::matTransIso
Mat_Elastic_TransIso matTransIso
Definition: MeshsetsManager.cpp:763
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
MoFEM::BlockData::matInterf
Mat_Interf matInterf
Definition: MeshsetsManager.cpp:765
MOFEM_DATA_INCONSISTENCY
@ MOFEM_DATA_INCONSISTENCY
Definition: definitions.h:31
MoFEM::MeshsetsManager
Interface for managing meshsets containing materials and boundary conditions.
Definition: MeshsetsManager.hpp:104
MoFEM::BlockData
Definition: MeshsetsManager.cpp:752
MoFEMTypes
MoFEMTypes
Those types control how functions respond on arguments, f.e. error handling.
Definition: definitions.h:97
MoFEM::MeshsetsManager::setBcData
MoFEMErrorCode setBcData(const CubitBCType cubit_bc_type, const int ms_id, const GenericCubitBcData &data)
set boundary data structure to meshset
Definition: MeshsetsManager.cpp:527
MoFEM::CubitMeshsets_name
Definition: TagMultiIndices.hpp:14
MoFEM::HeatFluxCubitBcData
Definition of the heat flux bc data structure.
Definition: BCData.hpp:427
_IT_CUBITMESHSETS_FOR_LOOP_
#define _IT_CUBITMESHSETS_FOR_LOOP_(MESHSET_MANAGER, IT)
Iterator that loops over all the Cubit MeshSets in a moFEM field.
Definition: MeshsetsManager.hpp:34
m
FTensor::Index< 'm', 3 > m
Definition: shallow_wave.cpp:80
MoFEM::BitRefManager
Managing BitRefLevels.
Definition: BitRefManager.hpp:21
MoFEM::Types::BitRefLevel
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:40
MoFEM::HeatFluxCubitBcData::data
_data_ data
Definition: BCData.hpp:441
MoFEM::BlockData::numberOfAttributes
int numberOfAttributes
Definition: MeshsetsManager.cpp:775
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:440
MoFEM::MeshsetsManager::readMeshsets
MoFEMErrorCode readMeshsets(int verb=DEFAULT_VERBOSITY)
Boradcats meshsets.
Definition: MeshsetsManager.cpp:92
MoFEM::BlockData::forceBc
ForceCubitBcData forceBc
Definition: MeshsetsManager.cpp:769
MoFEM::CubitMeshsetType_mi_tag
MultiIndex Tag for field id.
Definition: TagMultiIndices.hpp:12
MoFEM::MeshsetsManager::getCubitMeshsetPtr
MoFEMErrorCode getCubitMeshsetPtr(const int ms_id, const CubitBCType cubit_bc_type, const CubitMeshSets **cubit_meshset_ptr) const
get cubit meshset
Definition: MeshsetsManager.cpp:575
MoFEM::LogManager::setLog
static LoggerType & setLog(const std::string channel)
Set ans resset chanel logger.
Definition: LogManager.cpp:389
MoFEM::MeshsetsManager::checkMeshset
bool checkMeshset(const int ms_id, const CubitBCType cubit_bc_type) const
check for CUBIT Id and CUBIT type
Definition: MeshsetsManager.cpp:357
MoFEM::BlockData::bcType
CubitBC bcType
Definition: MeshsetsManager.cpp:759
MoFEM::CfgCubitBcData
Definition of the cfd_bc data structure.
Definition: BCData.hpp:480
MF_EXIST
@ MF_EXIST
Definition: definitions.h:100
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:416
MAT_MOISTURESET
@ MAT_MOISTURESET
block name is "MAT_MOISTURE"
Definition: definitions.h:163
CHKERRG
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:483
MoFEM::MeshsetsManager::checkIfMeshsetContainsEntities
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.
Definition: MeshsetsManager.cpp:723
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:346
CubitBC
CubitBC
Types of sets and boundary conditions.
Definition: definitions.h:144
MoFEM::BlockData::heatFluxBc
HeatFluxCubitBcData heatFluxBc
Definition: MeshsetsManager.cpp:772
MoFEM::MeshsetsManager::setMeshsetFromFile
MoFEMErrorCode setMeshsetFromFile()
get name of config file from line command '-meshsets_config'
Definition: MeshsetsManager.cpp:1372