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  default:
186  MOFEM_LOG("MeshsetMngSync", Sev::verbose)
187  << "broadcast Unknown " << vec_meshsets.size();
188  }
189 
190  for (int from_proc = 0; from_proc < pcomm->size(); ++from_proc) {
191 
192  Range r_dummy_nodes;
193 
194  if (from_proc == pcomm->rank()) {
195  std::vector<EntityHandle> dummy_nodes(vec_meshsets.size(), 0);
196  int i = 0;
197  for (auto m : vec_meshsets) {
198  CHKERR moab.create_vertex(coords, dummy_nodes[i]);
199  CHKERR set_tags_dummy_node(dummy_nodes[i], m);
200  ++i;
201  }
202  r_dummy_nodes.insert_list(dummy_nodes.begin(), dummy_nodes.end());
203  }
204 
205  CHKERR pcomm->broadcast_entities(from_proc, r_dummy_nodes, false, true);
206 
207  if (from_proc != pcomm->rank()) {
208 
209  for (auto dummy_node : r_dummy_nodes) {
210  CubitMeshSets broadcast_block(moab, dummy_node);
211  auto id = broadcast_block.getMeshsetId();
212  if (id != -1) {
213  auto mit =
215  .find(boost::make_tuple(
216  id, broadcast_block.getMaskedBcTypeULong()));
217  if (mit ==
219  .end()) {
220  EntityHandle m;
221  CHKERR moab.create_meshset(MESHSET_SET, m);
222  CHKERR set_tags_dummy_node(m, dummy_node);
223  auto hint = cubitMeshsets.end();
224  auto p = cubitMeshsets.emplace_hint(hint, moab, m);
225  }
226  } else {
227  MOFEM_LOG("MeshsetMngSync", Sev::warning)
228  << "broadcasted vertex " << dummy_node << " has negative id";
229  }
230 
231  }
232 
233  } else {
234  MOFEM_LOG("MeshsetMngSync", Sev::verbose)
235  << "broadcast send from " << from_proc;
236  }
237 
238  CHKERR moab.delete_entities(r_dummy_nodes);
239  }
240 
241  MOFEM_LOG_SEVERITY_SYNC(m_field.get_comm(), Sev::verbose);
242  }
243 
245 }
246 
249  Interface &m_field = cOre;
250  moab::Interface &moab = m_field.get_moab();
251  int default_val = -1;
252  CHKERR moab.tag_get_handle(DIRICHLET_SET_TAG_NAME, 1, MB_TYPE_INTEGER, nsTag,
253  MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
254 
255  CHKERR moab.tag_get_handle(NEUMANN_SET_TAG_NAME, 1, MB_TYPE_INTEGER, ssTag,
256  MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
257 
258  const int def_bc_data_len = 0;
259  std::string tag_name = std::string(DIRICHLET_SET_TAG_NAME) + "__BC_DATA";
260  CHKERR moab.tag_get_handle(
261  tag_name.c_str(), def_bc_data_len, MB_TYPE_OPAQUE, nsTag_data,
262  MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES | MB_TAG_VARLEN, NULL);
263 
264  tag_name = std::string(NEUMANN_SET_TAG_NAME) + "__BC_DATA";
265  CHKERR moab.tag_get_handle(
266  tag_name.c_str(), def_bc_data_len, MB_TYPE_OPAQUE, ssTag_data,
267  MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES | MB_TAG_VARLEN, NULL);
268 
269  CHKERR moab.tag_get_handle(MATERIAL_SET_TAG_NAME, 1, MB_TYPE_INTEGER, bhTag,
270  MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
271 
272  std::vector<unsigned int> def_uint_zero(3, 0);
273  CHKERR moab.tag_get_handle(
274  BLOCK_HEADER, 3 * sizeof(unsigned int), MB_TYPE_INTEGER, bhTag_header,
275  MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES, &def_uint_zero[0]);
276 
277  Tag block_attribs;
278  int def_Block_Attributes_length = 0;
279  CHKERR moab.tag_get_handle(
280  BLOCK_ATTRIBUTES, def_Block_Attributes_length, MB_TYPE_DOUBLE,
281  block_attribs, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN, NULL);
282 
283  Tag entity_name_tag;
284  CHKERR moab.tag_get_handle(NAME_TAG_NAME, NAME_TAG_SIZE, MB_TYPE_OPAQUE,
285  entity_name_tag, MB_TAG_SPARSE | MB_TAG_CREAT);
286 
288 }
289 
293  CHKERR printBcSet(mydata, NODESET | mydata.tYpe.to_ulong());
295 }
296 
298  PressureCubitBcData mydata;
300  CHKERR printBcSet(mydata, SIDESET | mydata.tYpe.to_ulong());
302 }
303 
305  ForceCubitBcData mydata;
307  CHKERR printBcSet(mydata, NODESET | mydata.tYpe.to_ulong());
309 }
310 
312  TemperatureCubitBcData mydata;
314  CHKERR printBcSet(mydata, NODESET | mydata.tYpe.to_ulong());
316 }
317 
319  HeatFluxCubitBcData mydata;
321  CHKERR printBcSet(mydata, SIDESET | mydata.tYpe.to_ulong());
323 }
324 
327  const Interface &m_field = cOre;
328  const moab::Interface &moab = m_field.get_moab();
330  (*this), BLOCKSET | MAT_ELASTICSET, it)) {
331  Mat_Elastic data;
332  CHKERR it->getAttributeDataStructure(data);
333  MOFEM_LOG("MeshsetMngWorld", Sev::inform) << *it;
334  MOFEM_LOG("MeshsetMngWorld", Sev::inform) << data;
335  Range tets;
336  CHKERR moab.get_entities_by_dimension(it->meshset, 3, tets, true);
337  MOFEM_LOG("MeshsetMngWorld", Sev::inform)
338  << "MAT_ELATIC msId " << it->getMeshsetId() << " nb. volumes "
339  << tets.size();
340  }
341 
343  m_field, BLOCKSET | MAT_THERMALSET, it)) {
344  Mat_Thermal data;
345  CHKERR it->getAttributeDataStructure(data);
346  MOFEM_LOG("MeshsetMngWorld", Sev::inform) << *it;
347  MOFEM_LOG("MeshsetMngWorld", Sev::inform) << data;
348  }
349 
351  m_field, BLOCKSET | MAT_MOISTURESET, it)) {
352  Mat_Moisture data;
353  CHKERR it->getAttributeDataStructure(data);
354  MOFEM_LOG("MeshsetMngWorld", Sev::inform) << *it;
355  MOFEM_LOG("MeshsetMngWorld", Sev::inform) << data;
356  }
358 }
359 
360 bool MeshsetsManager::checkMeshset(const int ms_id,
361  const CubitBCType cubit_bc_type) const {
362  auto miit =
364  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
365  if (miit !=
367  return true;
368  }
369  return false;
370 }
371 
372 bool MeshsetsManager::checkMeshset(const string name,
373  int *const number_of_meshsets_ptr) const {
374  auto miit = cubitMeshsets.get<CubitMeshsets_name>().lower_bound(name);
375  auto hi_miit = cubitMeshsets.get<CubitMeshsets_name>().upper_bound(name);
376  if (std::distance(miit, hi_miit) == 0) {
377  return false;
378  }
379  if (number_of_meshsets_ptr) {
380  *number_of_meshsets_ptr = std::distance(miit, hi_miit);
381  }
382  return true;
383 }
384 
386  const int ms_id,
387  const std::string name) {
388  Interface &m_field = cOre;
389  moab::Interface &moab = m_field.get_moab();
391  if (checkMeshset(ms_id, cubit_bc_type)) {
392  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
393  "such cubit meshset is already there", ms_id);
394  }
395 
396  CubitMeshSets cmeshset(moab, cubit_bc_type, ms_id);
397  if ((cmeshset.cubitBcType & CubitBCType(NODESET | SIDESET | BLOCKSET))
398  .any()) {
399  auto p = cubitMeshsets.insert(cmeshset);
400  if (!p.second) {
401  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
402  "meshset not inserted");
403  }
404  if (name.size() > 0) {
405  bool success =
406  cubitMeshsets.modify(p.first, CubitMeshSets_change_name(moab, name));
407  if (!success) {
408  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
409  "name to cubit meshset can not be set");
410  }
411  }
412  }
413 
415 }
416 
419  const int ms_id, const Range &ents) {
420  Interface &m_field = cOre;
421  moab::Interface &moab = m_field.get_moab();
423  auto cit =
425  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
426  if (cit ==
428  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
429  "Cannot find Cubit meshset with id: %d", ms_id);
430  }
431  EntityHandle meshset = cit->getMeshset();
432  CHKERR moab.add_entities(meshset, ents);
433 
435 }
436 
439  const int ms_id, const EntityHandle *ents,
440  const int nb_ents) {
441  Interface &m_field = cOre;
442  moab::Interface &moab = m_field.get_moab();
444  auto cit =
446  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
447  if (cit ==
449  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
450  "Cannot find Cubit meshset with id: %d", ms_id);
451  }
452  EntityHandle meshset = cit->getMeshset();
453  CHKERR moab.add_entities(meshset, ents, nb_ents);
454 
456 }
457 
459 MeshsetsManager::setAtributes(const CubitBCType cubit_bc_type, const int ms_id,
460  const std::vector<double> &attributes,
461  const std::string name) {
462  Interface &m_field = cOre;
463  moab::Interface &moab = m_field.get_moab();
465  auto cit =
467  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
468  if (cit ==
470  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
471  "Cannot find Cubit meshset with id: %d", ms_id);
472  }
473  if (name.size() > 0) {
474  bool success = cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
475  CubitMeshSets_change_name(moab, name));
476  if (!success) {
477  SETERRQ(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
478  "name to cubit meshset can not be set");
479  }
480  }
481  bool success =
482  cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
483  CubitMeshSets_change_attributes(moab, attributes));
484  if (!success)
485  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
486  "modification unsuccessful");
487 
488  std::ostringstream ss;
489  ss << "Block " << cit->getName();
490  ss << " Add attr: ";
491  for (unsigned int ii = 0; ii != attributes.size(); ii++) {
492  ss << attributes[ii] << " ";
493  }
494  MOFEM_LOG("MeshsetMngSelf", Sev::noisy) << ss.str();
495 
497 }
498 
500  const CubitBCType cubit_bc_type, const int ms_id,
501  const GenericAttributeData &data, const std::string name) {
502  Interface &m_field = cOre;
503  moab::Interface &moab = m_field.get_moab();
505  auto cit =
507  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
508  if (cit ==
510  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
511  "Cannot find Cubit meshset with id: %d", ms_id);
512  }
513  if (name.size() > 0) {
514  bool success = cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
515  CubitMeshSets_change_name(moab, name));
516  if (!success) {
517  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
518  "name to cubit meshset can not be set");
519  }
520  }
521  bool success = cubitMeshsets.modify(
522  cubitMeshsets.project<0>(cit),
524  if (!success)
525  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
526  "modification unsuccessful");
528 }
529 
531  const int ms_id,
532  const GenericCubitBcData &data) {
533  Interface &m_field = cOre;
534  moab::Interface &moab = m_field.get_moab();
536  auto cit =
538  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
539  if (cit ==
541  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
542  "Cubit meshset with id is already there", ms_id);
543  }
544  bool success =
545  cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
547  if (!success)
548  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
549  "modification unsuccessful");
551 }
552 
554  const int ms_id,
555  const MoFEMTypes bh) {
556  Interface &m_field = cOre;
557  moab::Interface &moab = m_field.get_moab();
559  auto miit =
561  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
562  if (miit ==
564  if (bh & MF_EXIST) {
565  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
566  "meshset not found", ms_id);
567  } else {
569  }
570  }
571  EntityHandle meshset = miit->getMeshset();
573  CHKERR moab.delete_entities(&meshset, 1);
574 
576 }
577 
579  const int ms_id, const CubitBCType cubit_bc_type,
580  const CubitMeshSets **cubit_meshset_ptr) const {
581  Interface &m_field = cOre;
583  auto miit =
585  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
586  if (miit !=
588  *cubit_meshset_ptr = &*miit;
589  } else {
590  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
591  "msId = %d is not there", ms_id);
592  }
594 }
595 
596 const CubitMeshSets *
598  const CubitBCType cubit_bc_type) const {
599  const CubitMeshSets *cubit_meshset_ptr;
601  getCubitMeshsetPtr(ms_id, cubit_bc_type, &cubit_meshset_ptr),
602  "Get not get meshset");
603  return cubit_meshset_ptr;
604 }
605 
607  const string name, const CubitMeshSets **cubit_meshset_ptr) const {
608  Interface &m_field = cOre;
610  auto miit = cubitMeshsets.get<CubitMeshsets_name>().lower_bound(name);
611  auto hi_miit = cubitMeshsets.get<CubitMeshsets_name>().upper_bound(name);
612  if (std::distance(miit, hi_miit) == 0) {
613  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
614  "meshset name <%s> is not there", name.c_str());
615  }
616  if (std::distance(miit, hi_miit) > 1) {
617  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
618  "more that one meshser of that name <%s>", name.c_str());
619  }
620  *cubit_meshset_ptr = &*miit;
622 }
623 
625  const CubitBCType cubit_bc_type,
626  std::vector<const CubitMeshSets *> &vec_ptr) const {
628  auto r = cubitMeshsets.get<CubitMeshsetType_mi_tag>().equal_range(
629  cubit_bc_type.to_ulong());
630  for (auto it = r.first; it != r.second; ++it) {
631  vec_ptr.push_back(&*it);
632  }
633  sortMeshsets(vec_ptr);
635 }
636 
637 std::vector<const CubitMeshSets *>
639  std::vector<const CubitMeshSets *> vec_ptr;
640  CHK_MOAB_THROW(getCubitMeshsetPtr(cubit_bc_type, vec_ptr),
641  "Error in getting meshsets by name");
642  return vec_ptr;
643 }
644 
646  const std::regex reg_exp_name,
647  std::vector<const CubitMeshSets *> &vec_ptr) const {
649  auto r =
651  for (; r.first != r.second; ++r.first) {
652  const auto name = r.first->getName();
653  if (std::regex_match(name, reg_exp_name)) {
654  vec_ptr.push_back(&*r.first);
655  }
656  }
657  sortMeshsets(vec_ptr);
659 }
660 
661 std::vector<const CubitMeshSets *>
662 MeshsetsManager::getCubitMeshsetPtr(const std::regex reg_exp_name) const {
663  std::vector<const CubitMeshSets *> vec_ptr;
664  CHK_MOAB_THROW(getCubitMeshsetPtr(reg_exp_name, vec_ptr),
665  "Error in getting meshsets by name");
666  return vec_ptr;
667 }
668 
670  const int msId, const unsigned int cubit_bc_type, const int dimension,
671  Range &entities, const bool recursive) const {
672  Interface &m_field = cOre;
673  moab::Interface &moab = m_field.get_moab();
675  auto miit =
677  boost::make_tuple(msId, cubit_bc_type));
678  if (miit !=
680  CHKERR miit->getMeshsetIdEntitiesByDimension(moab, dimension, entities,
681  recursive);
682  } else {
683  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
684  "msId = %d is not there", msId);
685  }
687 }
688 
690  const int ms_id, const unsigned int cubit_bc_type, Range &entities,
691  const bool recursive) const {
692  Interface &m_field = cOre;
693  moab::Interface &moab = m_field.get_moab();
695  auto miit =
697  boost::make_tuple(ms_id, cubit_bc_type));
698  if (miit !=
700  CHKERR miit->getMeshsetIdEntitiesByDimension(moab, entities, recursive);
701  } else {
702  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
703  "ms_id = %d is not there", ms_id);
704  }
706 }
707 
709  const unsigned int cubit_bc_type,
710  EntityHandle &meshset) const {
711  Interface &m_field = cOre;
713  auto miit =
715  boost::make_tuple(ms_id, cubit_bc_type));
716  if (miit !=
718  meshset = miit->meshset;
719  } else {
720  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
721  "ms_id = %d is not there", ms_id);
722  }
724 }
725 
727  const int ms_id, const unsigned int cubit_bc_type,
728  const EntityHandle *entities, int num_entities, const int operation_type) {
729  auto miit =
731  boost::make_tuple(ms_id, cubit_bc_type));
732  if (miit !=
734  Interface &m_field = cOre;
735  return m_field.get_moab().contains_entities(miit->meshset, entities,
736  num_entities, operation_type);
737  } else
738  return false;
739 }
740 
742 MeshsetsManager::getMeshsetsByType(const unsigned int cubit_bc_type,
743  Range &meshsets) const {
745  auto miit =
746  cubitMeshsets.get<CubitMeshsetType_mi_tag>().lower_bound(cubit_bc_type);
747  auto hi_miit =
748  cubitMeshsets.get<CubitMeshsetType_mi_tag>().upper_bound(cubit_bc_type);
749  for (; miit != hi_miit; miit++) {
750  meshsets.insert(miit->meshset);
751  }
753 }
754 
755 struct BlockData {
756 
758 
759  int iD;
760  string addType;
761  string nAme;
763 
764  // Materials
769 
770  // BCs
777 
779  std::vector<double> aTtr;
780 
782  std::memcpy(dispBc.data.name, "Displacement", 12);
783  std::memcpy(forceBc.data.name, "Force", 5);
784  std::memcpy(pressureBc.data.name, "Pressure", 8);
785  std::memcpy(temperatureBc.data.name, "Temperature", 11);
786  std::memcpy(heatFluxBc.data.name, "HeatFlux", 8);
787  std::memcpy(cfgBc.data.name, "cfd_bc", 6);
788  }
789 };
790 
792  bool clean_file_options) {
793  Interface &m_field = cOre;
795  std::ifstream ini_file(file_name.c_str(), std::ifstream::in);
796  po::variables_map vm;
797  if (clean_file_options) {
799  boost::shared_ptr<boost::program_options::options_description>(
800  new po::options_description());
801  }
802 
803  auto add_block_attributes = [&](auto prefix, auto &block_lists, auto &it) {
804  // remove spacec from blockset name
805  configFileOptionsPtr->add_options()(
806  (prefix + ".number_of_attributes").c_str(),
807  po::value<int>(&block_lists[it->getMeshsetId()].numberOfAttributes)
808  ->default_value(-1),
809  "Number of blockset attribute");
810  for (int ii = 1; ii <= 10; ii++) {
811  std::string surfix = ".user" + boost::lexical_cast<std::string>(ii);
812  configFileOptionsPtr->add_options()(
813  (prefix + surfix).c_str(),
814  po::value<double>(&block_lists[it->getMeshsetId()].aTtr[ii - 1])
815  ->default_value(0.0),
816  "Add block attribute");
817  }
818  };
819 
820  // Add blocks
821  map<int, BlockData> block_lists;
823  block_lists[it->getMeshsetId()].cubitMeshset = it->getMeshset();
824  std::string prefix =
825  "block_" + boost::lexical_cast<std::string>(it->getMeshsetId());
826  configFileOptionsPtr->add_options()(
827  (prefix + ".add").c_str(),
828  po::value<string>(&block_lists[it->getMeshsetId()].addType)
829  ->default_value("UNKNOWNSET"),
830  "Add block set")(
831  (prefix + ".id").c_str(),
832  po::value<int>(&block_lists[it->getMeshsetId()].iD)->default_value(-1),
833  "Id of meshset")(
834  (prefix + ".name").c_str(),
835  po::value<string>(&block_lists[it->getMeshsetId()].nAme)
836  ->default_value(""),
837  "Name of the meshset");
838 
839  // Block attributes
840  add_block_attributes(prefix, block_lists, it);
841 
842  // Mat elastic
843  {
844  // double Young; ///< Young's modulus
845  // double Poisson; ///< Poisson's ratio
846  // double ThermalExpansion; ///< Thermal expansion
847  configFileOptionsPtr->add_options()(
848  (prefix + ".young").c_str(),
849  po::value<double>(
850  &block_lists[it->getMeshsetId()].matElastic.data.Young)
851  ->default_value(-1),
852  "Young modulus")(
853  (prefix + ".poisson").c_str(),
854  po::value<double>(
855  &block_lists[it->getMeshsetId()].matElastic.data.Poisson)
856  ->default_value(-2),
857  "Poisson ratio")(
858  (prefix + ".thermalexpansion").c_str(),
859  po::value<double>(
860  &block_lists[it->getMeshsetId()].matElastic.data.ThermalExpansion)
861  ->default_value(-1),
862  "Thermal expansion");
863  // TODO Add users parameters
864  }
865  // Mat Trans Iso
866  {
867  // Young's modulus in xy plane (Ep)
868  // Young's modulus in z-direction (Ez)
869  // Poisson's ratio in xy plane (vp)
870  // Poisson's ratio in z-direction (vpz)
871  // Shear modulus in z-direction (Gzp)
872  configFileOptionsPtr->add_options()(
873  (prefix + ".Youngp").c_str(),
874  po::value<double>(
875  &block_lists[it->getMeshsetId()].matTransIso.data.Youngp)
876  ->default_value(-1),
877  "Youngp")(
878  (prefix + ".Youngz").c_str(),
879  po::value<double>(
880  &block_lists[it->getMeshsetId()].matTransIso.data.Youngz)
881  ->default_value(-1),
882  "Youngz")(
883  (prefix + ".Poissonp").c_str(),
884  po::value<double>(
885  &block_lists[it->getMeshsetId()].matTransIso.data.Poissonp)
886  ->default_value(0),
887  "Poissonp")(
888  (prefix + ".Poissonpz").c_str(),
889  po::value<double>(
890  &block_lists[it->getMeshsetId()].matTransIso.data.Poissonpz)
891  ->default_value(0),
892  "Poissonpz")(
893  (prefix + ".Shearzp").c_str(),
894  po::value<double>(
895  &block_lists[it->getMeshsetId()].matTransIso.data.Shearzp)
896  ->default_value(-1),
897  "Shearzp");
898  // TODO Add users parameters
899  }
900  // Mat thermal
901  {
902  // double Conductivity; ///< Thermal conductivity
903  // double HeatCapacity; ///< Heat Capacity
904  configFileOptionsPtr->add_options()(
905  (prefix + ".conductivity").c_str(),
906  po::value<double>(
907  &block_lists[it->getMeshsetId()].matThermal.data.Conductivity)
908  ->default_value(-1),
909  "Conductivity")(
910  (prefix + ".capacity").c_str(),
911  po::value<double>(
912  &block_lists[it->getMeshsetId()].matThermal.data.HeatCapacity)
913  ->default_value(-1),
914  "Capacity");
915  // TODO Add users parameters
916  }
917  // Mat interface
918  {
919  // double alpha; ///< Elastic modulus multiplier
920  // double beta; ///< Damage Coupling multiplier between normal and
921  // shear (g=sqrt(gn^2 + beta(gt1^2 + gt2^2))) double ft; ///< Maximum
922  // stress of crack double Gf; ///< Fracture Energy
923  configFileOptionsPtr->add_options()(
924  (prefix + ".interface_alpha").c_str(),
925  po::value<double>(
926  &block_lists[it->getMeshsetId()].matInterf.data.alpha)
927  ->default_value(-1),
928  "alpha")((prefix + ".interface_beta").c_str(),
929  po::value<double>(
930  &block_lists[it->getMeshsetId()].matInterf.data.beta)
931  ->default_value(-1),
932  "beta")(
933  (prefix + ".interface_ft").c_str(),
934  po::value<double>(&block_lists[it->getMeshsetId()].matInterf.data.ft)
935  ->default_value(-1),
936  "ft")(
937  (prefix + ".interface_Gf").c_str(),
938  po::value<double>(&block_lists[it->getMeshsetId()].matInterf.data.Gf)
939  ->default_value(-1),
940  "Gf");
941  // TODO Add users parameters
942  }
943 
944  // Displacement bc
945  {
946  // char flag1; //< Flag for X-Translation (0: N/A, 1: specified)
947  // char flag2; //< Flag for Y-Translation (0: N/A, 1: specified)
948  // char flag3; //< Flag for Z-Translation (0: N/A, 1: specified)
949  // char flag4; //< Flag for X-Rotation (0: N/A, 1: specified)
950  // char flag5; //< Flag for Y-Rotation (0: N/A, 1: specified)
951  // char flag6; //< Flag for Z-Rotation (0: N/A, 1: specified)
952  // double value1; //< Value for X-Translation
953  // double value2; //< Value for Y-Translation
954  // double value3; //< Value for Z-Translation
955  // double value4; //< Value for X-Rotation
956  // double value5; //< Value for Y-Rotation
957  // double value6; //< Value for Z-Rotation
958  configFileOptionsPtr->add_options()(
959  (prefix + ".disp_flag1").c_str(),
960  po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag1)
961  ->default_value(0),
962  "flag1")(
963  (prefix + ".disp_flag2").c_str(),
964  po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag2)
965  ->default_value(0),
966  "flag2")(
967  (prefix + ".disp_flag3").c_str(),
968  po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag3)
969  ->default_value(0),
970  "flag3")(
971  (prefix + ".disp_flag4").c_str(),
972  po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag4)
973  ->default_value(0),
974  "flag4")(
975  (prefix + ".disp_flag5").c_str(),
976  po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag5)
977  ->default_value(0),
978  "flag5")(
979  (prefix + ".disp_flag6").c_str(),
980  po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag6)
981  ->default_value(0),
982  "flag6")(
983  (prefix + ".disp_ux").c_str(),
984  po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value1)
985  ->default_value(0),
986  "value1")(
987  (prefix + ".disp_uy").c_str(),
988  po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value2)
989  ->default_value(0),
990  "value2")(
991  (prefix + ".disp_uz").c_str(),
992  po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value3)
993  ->default_value(0),
994  "value3")(
995  (prefix + ".disp_rx").c_str(),
996  po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value4)
997  ->default_value(0),
998  "value4")(
999  (prefix + ".disp_ry").c_str(),
1000  po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value5)
1001  ->default_value(0),
1002  "value5")(
1003  (prefix + ".disp_rz").c_str(),
1004  po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value6)
1005  ->default_value(0),
1006  "value6");
1007  }
1008  // Force BC data
1009  {
1010  // char zero[3]; //< 3 zeros
1011  // double value1; //< Force magnitude
1012  // double value2; //< Moment magnitude
1013  // double value3; //< X-component of force direction vector
1014  // double value4; //< Y-component of force direction vector
1015  // double value5; //< Z-component of force direction vector
1016  // double value6; //< X-component of moment direction vector
1017  // double value7; //< Y-component of moment direction vector
1018  // double value8; //< Z-component of moment direction vector
1019  // char zero2; // 0
1020  configFileOptionsPtr->add_options()(
1021  (prefix + ".force_magnitude").c_str(),
1022  po::value<double>(
1023  &block_lists[it->getMeshsetId()].forceBc.data.value1)
1024  ->default_value(0),
1025  "value1")((prefix + ".moment_magnitude").c_str(),
1026  po::value<double>(
1027  &block_lists[it->getMeshsetId()].forceBc.data.value2)
1028  ->default_value(0),
1029  "value2")(
1030  (prefix + ".force_fx").c_str(),
1031  po::value<double>(
1032  &block_lists[it->getMeshsetId()].forceBc.data.value3)
1033  ->default_value(0),
1034  "value3")((prefix + ".force_fy").c_str(),
1035  po::value<double>(
1036  &block_lists[it->getMeshsetId()].forceBc.data.value4)
1037  ->default_value(0),
1038  "value4")(
1039  (prefix + ".force_fz").c_str(),
1040  po::value<double>(
1041  &block_lists[it->getMeshsetId()].forceBc.data.value5)
1042  ->default_value(0),
1043  "value5")((prefix + ".moment_mx").c_str(),
1044  po::value<double>(
1045  &block_lists[it->getMeshsetId()].forceBc.data.value6)
1046  ->default_value(0),
1047  "value6")(
1048  (prefix + ".moment_my").c_str(),
1049  po::value<double>(
1050  &block_lists[it->getMeshsetId()].forceBc.data.value7)
1051  ->default_value(0),
1052  "value7")((prefix + ".moment_mz").c_str(),
1053  po::value<double>(
1054  &block_lists[it->getMeshsetId()].forceBc.data.value8)
1055  ->default_value(0),
1056  "value8");
1057  }
1058  {
1059  // char name[11]; //< 11 characters for "Temperature"
1060  // char pre1; //< This is always zero
1061  // char pre2; //< 0: temperature is not applied on thin shells
1062  // (default); 1: temperature is applied on thin shells char flag1; //<
1063  // 0: N/A, 1: temperature value applied (not on thin shells) char flag2;
1064  // //< 0: N/A, 1: temperature applied on thin shell middle char flag3;
1065  // //< 0: N/A, 1: thin shell temperature gradient specified char flag4;
1066  // //< 0: N/A, 1: top thin shell temperature char flag5; //< 0: N/A, 1:
1067  // bottom thin shell temperature char flag6; //< This is always zero
1068  // double value1; //< Temperature (default case - no thin shells)
1069  // double value2; //< Temperature for middle of thin shells
1070  // double value3; //< Temperature gradient for thin shells
1071  // double value4; //< Temperature for top of thin shells
1072  // double value5; //< Temperature for bottom of thin shells
1073  // double value6; //< This is always zero, i.e. ignore
1074  configFileOptionsPtr->add_options()(
1075  (prefix + ".temperature_flag1").c_str(),
1076  po::value<char>(
1077  &block_lists[it->getMeshsetId()].temperatureBc.data.flag1)
1078  ->default_value(0),
1079  "flag1")(
1080  (prefix + ".temperature_t").c_str(),
1081  po::value<double>(
1082  &block_lists[it->getMeshsetId()].temperatureBc.data.value1)
1083  ->default_value(0),
1084  "value1");
1085  // TODO: Add more cases, see above
1086  }
1087  // Sideset
1088  {
1089  // char name[8]; //< 8 characters for "Pressure"
1090  // char zero; //< This is always zero
1091  // char flag2; //< 0: Pressure is interpreted as pure pressure 1:
1092  // pressure is interpreted as total force double value1; //< Pressure
1093  // value
1094  configFileOptionsPtr->add_options()(
1095  (prefix + ".pressure_flag2").c_str(),
1096  po::value<char>(
1097  &block_lists[it->getMeshsetId()].pressureBc.data.flag2)
1098  ->default_value(0),
1099  "flag2")((prefix + ".pressure_magnitude").c_str(),
1100  po::value<double>(
1101  &block_lists[it->getMeshsetId()].pressureBc.data.value1)
1102  ->default_value(0),
1103  "value1");
1104  }
1105  {
1106  // char name[8]; //< 8 characters for "HeatFlux" (no space)
1107  // char pre1; //< This is always zero
1108  // char pre2; //< 0: heat flux is not applied on thin shells (default);
1109  // 1: heat flux is applied on thin shells char flag1; //< 0: N/A, 1:
1110  // normal heat flux case (i.e. single value, case without thin shells)
1111  // char flag2; //< 0: N/A, 1: Thin shell top heat flux specified
1112  // char flag3; //< 0: N/A, 1: Thin shell bottom heat flux specidied
1113  // double value1; //< Heat flux value for default case (no thin shells)
1114  // double value2; //< Heat flux (thin shell top)
1115  // double value3; //< Heat flux (thin shell bottom)
1116  configFileOptionsPtr->add_options()(
1117  (prefix + ".heatflux_flag1").c_str(),
1118  po::value<char>(
1119  &block_lists[it->getMeshsetId()].heatFluxBc.data.flag1)
1120  ->default_value(0),
1121  "flag1")((prefix + ".heatflux_magnitude").c_str(),
1122  po::value<double>(
1123  &block_lists[it->getMeshsetId()].heatFluxBc.data.value1)
1124  ->default_value(0),
1125  "value1");
1126  }
1127  // Interface set
1128  {
1129  configFileOptionsPtr->add_options()(
1130  (prefix + ".interface_type").c_str(),
1131  po::value<char>(&block_lists[it->getMeshsetId()].cfgBc.data.type)
1132  ->default_value(0),
1133  "type");
1134  }
1135  }
1136 
1137  map<int, BlockData> block_set_attributes;
1139  block_set_attributes[it->getMeshsetId()].cubitMeshset = it->getMeshset();
1140  block_set_attributes[it->getMeshsetId()].iD = it->getMeshsetId();
1141  block_set_attributes[it->getMeshsetId()].bcType = BLOCKSET;
1142  std::string block_name = it->getName();
1143  block_name.erase(
1144  std::remove_if(block_name.begin(), block_name.end(), ::isspace),
1145  block_name.end());
1146  block_set_attributes[it->getMeshsetId()].nAme = block_name;
1147  // Only blocks which have name
1148  if (block_name.compare("NoNameSet") != 0) {
1149  std::string prefix = "SET_ATTR_" + block_name;
1150  // Block attributes
1151  add_block_attributes(prefix, block_set_attributes, it);
1152  }
1153  }
1154 
1155  po::parsed_options parsed =
1156  parse_config_file(ini_file, *configFileOptionsPtr, true);
1157  store(parsed, vm);
1158  po::notify(vm);
1159 
1160  // Set type from name
1162 
1163  CubitBCType bc_type;
1164  unsigned jj = 0;
1165  while (1 << jj != LASTSET_BC) {
1166  if (string(CubitBCNames[jj + 1]) ==
1167  block_lists[it->getMeshsetId()].addType) {
1168  bc_type = 1 << jj;
1169  }
1170  ++jj;
1171  }
1172  if (bc_type.none()) {
1173  block_lists[it->getMeshsetId()].bcType = UNKNOWNSET;
1174  // Skip the bockset nothing is defined for it
1175  continue;
1176  }
1177 
1178  if (bc_type.to_ulong() == BLOCKSET)
1179  block_lists[it->getMeshsetId()].bcType = BLOCKSET;
1180  else if (bc_type.to_ulong() == NODESET)
1181  block_lists[it->getMeshsetId()].bcType = NODESET;
1182  else if (bc_type.to_ulong() == SIDESET)
1183  block_lists[it->getMeshsetId()].bcType = SIDESET;
1184  else {
1185  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
1186  "Not yet implemented type %s\n",
1187  block_lists[it->getMeshsetId()].addType.c_str());
1188  }
1189  if (block_lists[it->getMeshsetId()].iD == -1) {
1190  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
1191  "Unset iD number %d\n", block_lists[it->getMeshsetId()].iD);
1192  }
1193  }
1194 
1195  std::vector<std::string> additional_parameters;
1196  additional_parameters =
1197  collect_unrecognized(parsed.options, po::include_positional);
1198  for (std::vector<std::string>::iterator vit = additional_parameters.begin();
1199  vit != additional_parameters.end(); vit++) {
1200  MOFEM_LOG_C("MeshsetMngSelf", Sev::warning, "Unrecognized option %s",
1201  vit->c_str());
1202  }
1203  for (map<int, BlockData>::iterator mit = block_lists.begin();
1204  mit != block_lists.end(); mit++) {
1205  CubitMeshSet_multiIndex::iterator cubit_meshset_it =
1206  cubitMeshsets.find(mit->second.cubitMeshset);
1207  if (cubit_meshset_it == cubitMeshsets.end()) {
1208  SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
1209  "Data inconsistency\n");
1210  }
1211  switch (mit->second.bcType) {
1212  case UNKNOWNSET:
1213  break;
1214  case BLOCKSET: {
1215  if ((CubitBCType(mit->second.bcType) & cubit_meshset_it->getBcType())
1216  .any() &&
1217  mit->second.iD == cubit_meshset_it->getMeshsetId()) {
1218  // Meshset is the same, only modification
1219  } else {
1220  CHKERR addMeshset(mit->second.bcType, mit->second.iD, mit->second.nAme);
1221  EntityHandle meshset = cubit_meshset_it->getMeshset();
1222  CHKERR addEntitiesToMeshset(mit->second.bcType, mit->second.iD,
1223  &meshset, 1);
1224  }
1225  // Add attributes
1226  CHKERR setAtributes(mit->second.bcType, mit->second.iD, mit->second.aTtr);
1227  // Add material elastic data if value are physical (i.e. Young > 0,
1228  // Poisson in (-1.0.5) and ThermalExpansion>0)
1229  if (mit->second.matElastic.data.Young != -1) {
1230  CHKERR setAtributesByDataStructure(mit->second.bcType, mit->second.iD,
1231  mit->second.matElastic);
1232  }
1233  if (mit->second.matTransIso.data.Youngp != -1) {
1234  CHKERR setAtributesByDataStructure(mit->second.bcType, mit->second.iD,
1235  mit->second.matTransIso);
1236  }
1237  if (mit->second.matThermal.data.Conductivity != -1) {
1238  CHKERR setAtributesByDataStructure(mit->second.bcType, mit->second.iD,
1239  mit->second.matThermal);
1240  }
1241  if (mit->second.matInterf.data.ft != -1) {
1242  CHKERR setAtributesByDataStructure(mit->second.bcType, mit->second.iD,
1243  mit->second.matInterf);
1244  }
1245  } break;
1246  case NODESET: {
1247  if ((CubitBCType(mit->second.bcType) & cubit_meshset_it->getBcType())
1248  .any() &&
1249  mit->second.iD == cubit_meshset_it->getMeshsetId()) {
1250  // Meshset is the same, only modification
1251  } else {
1252  CHKERR addMeshset(mit->second.bcType, mit->second.iD);
1253  EntityHandle meshset = cubit_meshset_it->getMeshset();
1254  CHKERR addEntitiesToMeshset(mit->second.bcType, mit->second.iD,
1255  &meshset, 1);
1256  }
1257  // Add displacement bc
1258  if (mit->second.dispBc.data.flag1 || mit->second.dispBc.data.flag2 ||
1259  mit->second.dispBc.data.flag3 || mit->second.dispBc.data.flag4 ||
1260  mit->second.dispBc.data.flag5 || mit->second.dispBc.data.flag6) {
1261  if (mit->second.dispBc.data.flag1 == '0')
1262  mit->second.dispBc.data.flag1 = 0;
1263  if (mit->second.dispBc.data.flag1 == 'N')
1264  mit->second.dispBc.data.flag1 = 0;
1265  if (mit->second.dispBc.data.flag1)
1266  mit->second.dispBc.data.flag1 = 1;
1267  if (mit->second.dispBc.data.flag2 == '0')
1268  mit->second.dispBc.data.flag2 = 0;
1269  if (mit->second.dispBc.data.flag2 == 'N')
1270  mit->second.dispBc.data.flag2 = 0;
1271  if (mit->second.dispBc.data.flag2)
1272  mit->second.dispBc.data.flag2 = 1;
1273  if (mit->second.dispBc.data.flag3 == '0')
1274  mit->second.dispBc.data.flag3 = 0;
1275  if (mit->second.dispBc.data.flag3 == 'N')
1276  mit->second.dispBc.data.flag3 = 0;
1277  if (mit->second.dispBc.data.flag3)
1278  mit->second.dispBc.data.flag3 = 1;
1279  if (mit->second.dispBc.data.flag4 == '0')
1280  mit->second.dispBc.data.flag4 = 0;
1281  if (mit->second.dispBc.data.flag4 == 'N')
1282  mit->second.dispBc.data.flag4 = 0;
1283  if (mit->second.dispBc.data.flag4)
1284  mit->second.dispBc.data.flag4 = 1;
1285  if (mit->second.dispBc.data.flag5 == '0')
1286  mit->second.dispBc.data.flag5 = 0;
1287  if (mit->second.dispBc.data.flag5 == 'N')
1288  mit->second.dispBc.data.flag5 = 0;
1289  if (mit->second.dispBc.data.flag5)
1290  mit->second.dispBc.data.flag5 = 1;
1291  if (mit->second.dispBc.data.flag6 == '0')
1292  mit->second.dispBc.data.flag6 = 0;
1293  if (mit->second.dispBc.data.flag6 == 'N')
1294  mit->second.dispBc.data.flag6 = 0;
1295  if (mit->second.dispBc.data.flag6)
1296  mit->second.dispBc.data.flag6 = 1;
1297  CHKERR setBcData(mit->second.bcType, mit->second.iD,
1298  mit->second.dispBc);
1299  }
1300  if (mit->second.forceBc.data.value1 != 0 ||
1301  mit->second.forceBc.data.value2 != 0) {
1302  CHKERR setBcData(mit->second.bcType, mit->second.iD,
1303  mit->second.forceBc);
1304  }
1305  // Add temperature boundary condition
1306  if (mit->second.temperatureBc.data.flag1) {
1307  if (mit->second.temperatureBc.data.flag1 == '0')
1308  mit->second.temperatureBc.data.flag1 = 0;
1309  if (mit->second.temperatureBc.data.flag1 == 'N')
1310  mit->second.temperatureBc.data.flag1 = 0;
1311  if (mit->second.temperatureBc.data.flag1)
1312  mit->second.temperatureBc.data.flag1 = 1;
1313  CHKERR setBcData(mit->second.bcType, mit->second.iD,
1314  mit->second.temperatureBc);
1315  }
1316  } break;
1317  case SIDESET: {
1318  if ((CubitBCType(mit->second.bcType) & cubit_meshset_it->getBcType())
1319  .any() &&
1320  mit->second.iD == cubit_meshset_it->getMeshsetId()) {
1321  // Meshset is the same, only modification
1322  } else {
1323  CHKERR addMeshset(mit->second.bcType, mit->second.iD);
1324  EntityHandle meshset = cubit_meshset_it->getMeshset();
1325  CHKERR addEntitiesToMeshset(mit->second.bcType, mit->second.iD,
1326  &meshset, 1);
1327  }
1328  // Add pressure
1329  if (mit->second.pressureBc.data.value1 != 0) {
1330  if (mit->second.pressureBc.data.flag2 == '0')
1331  mit->second.pressureBc.data.flag2 = 0;
1332  if (mit->second.pressureBc.data.flag2 == 'N')
1333  mit->second.pressureBc.data.flag2 = 0;
1334  if (mit->second.pressureBc.data.flag2)
1335  mit->second.pressureBc.data.flag2 = 1;
1336  CHKERR setBcData(mit->second.bcType, mit->second.iD,
1337  mit->second.pressureBc);
1338  }
1339  // Add heat flux
1340  if (mit->second.heatFluxBc.data.value1 != 0) {
1341  if (mit->second.heatFluxBc.data.flag1 == '0')
1342  mit->second.heatFluxBc.data.flag1 = 0;
1343  if (mit->second.heatFluxBc.data.flag1 == 'N')
1344  mit->second.heatFluxBc.data.flag1 = 0;
1345  if (mit->second.heatFluxBc.data.flag1)
1346  mit->second.heatFluxBc.data.flag1 = 1;
1347  CHKERR setBcData(mit->second.bcType, mit->second.iD,
1348  mit->second.heatFluxBc);
1349  }
1350  // Add Interface
1351  if (mit->second.cfgBc.data.type != 0) {
1352  CHKERR setBcData(mit->second.bcType, mit->second.iD, mit->second.cfgBc);
1353  }
1354  } break;
1355  default:
1356  SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
1357  "Not yet implemented type\n");
1358  }
1359  }
1360 
1361  for (auto set_attr : block_set_attributes) {
1362  // Add attributes
1363  if (set_attr.second.numberOfAttributes > 0) {
1364  MOFEM_LOG("MeshsetMngSelf", Sev::verbose)
1365  << "Set attributes to blockset " << set_attr.second.nAme;
1366  set_attr.second.aTtr.resize(set_attr.second.numberOfAttributes);
1367  CHKERR setAtributes(set_attr.second.bcType, set_attr.second.iD,
1368  set_attr.second.aTtr);
1369  }
1370  }
1371 
1373 }
1374 
1376  Interface &m_field = cOre;
1377  PetscBool flg_file;
1378  char meshset_file_name[255] = "config_file.cfg";
1380  CHKERR PetscOptionsBegin(m_field.get_comm(), "", "Set meshsets form file",
1381  "none");
1382  CHKERR PetscOptionsString("-meshsets_config", "meshsets config file name",
1383  "", "add_cubit_meshsets.in", meshset_file_name, 255,
1384  &flg_file);
1385  if (flg_file == PETSC_TRUE) {
1386  ifstream f(meshset_file_name);
1387  if (!f.good()) {
1388  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
1389  "File configuring meshsets ( %s ) can not be open\n",
1390  meshset_file_name);
1391  }
1392  CHKERR setMeshsetFromFile(string(meshset_file_name));
1393  }
1394  ierr = PetscOptionsEnd();
1395  CHKERRG(ierr);
1397 }
1398 
1400  const int ms_id, const unsigned int cubit_bc_type,
1401  const std::string file_name, const std::string file_type,
1402  const std::string options) const {
1403 
1405  MoFEM::Interface &m_field = cOre;
1406  const CubitMeshSets *cubit_meshset_ptr;
1407  CHKERR getCubitMeshsetPtr(ms_id, cubit_bc_type, &cubit_meshset_ptr);
1408  EntityHandle meshset = cubit_meshset_ptr->getMeshset();
1409  CHKERR m_field.get_moab().write_file(file_name.c_str(), file_type.c_str(),
1410  options.c_str(), &meshset, 1);
1412 }
1413 
1415  const int ms_id, const unsigned int cubit_bc_type, const int dim,
1416  const std::string file_name, const bool recursive,
1417  const std::string file_type, const std::string options) const {
1418 
1420  MoFEM::Interface &m_field = cOre;
1421  moab::Interface &moab = m_field.get_moab();
1422  Range entities;
1423  CHKERR getEntitiesByDimension(ms_id, cubit_bc_type, dim, entities, recursive);
1424  EntityHandle meshset;
1425  CHKERR moab.create_meshset(MESHSET_SET, meshset);
1426  CHKERR moab.add_entities(meshset, entities);
1427  CHKERR moab.write_file(file_name.c_str(), file_type.c_str(), options.c_str(),
1428  &meshset, 1);
1429  CHKERR moab.delete_entities(&meshset, 1);
1431 }
1432 
1437  for (_IT_CUBITMESHSETS_FOR_LOOP_((*this), iit)) {
1438  EntityHandle meshset = iit->getMeshset();
1439  for (EntityType t = MBVERTEX; t != MBENTITYSET; ++t)
1440  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset, t,
1441  true);
1442  }
1444 }
1445 
1446 } // namespace MoFEM
CubitBCNames
const static char *const CubitBCNames[]
Names of types of sets and boundary conditions.
Definition: definitions.h:188
MoFEMFunctionReturnHot
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:460
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:589
MoFEM::CubitMeshSets::cubitBcType
CubitBCType cubitBcType
Definition: BCMultiIndices.hpp:22
MoFEM::CubitMeshSets_change_bc_data_structure
Definition: BCMultiIndices.hpp:437
SIDESET
@ SIDESET
Definition: definitions.h:160
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:742
MYPCOMM_INDEX
#define MYPCOMM_INDEX
default communicator number PCOMM
Definition: definitions.h:228
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:311
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:418
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:771
CHK_THROW_MESSAGE
#define CHK_THROW_MESSAGE(err, msg)
Check and throw MoFEM exception.
Definition: definitions.h:609
MoFEM::Mat_Elastic
Elastic material data structure.
Definition: MaterialBlocks.hpp:139
MoFEM::BlockData::addType
string addType
Definition: MeshsetsManager.cpp:760
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:781
MoFEM::th
Tag th
Definition: Projection10NodeCoordsOnField.cpp:122
MoFEM::BlockData::temperatureBc
TemperatureCubitBcData temperatureBc
Definition: MeshsetsManager.cpp:774
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:779
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:708
MoFEM::Interface
DeprecatedCoreInterface Interface
Definition: Interface.hpp:2010
MoFEM::MeshsetsManager::bhTag_header
Tag bhTag_header
Definition: MeshsetsManager.hpp:890
MoFEM::BlockData::cfgBc
CfgCubitBcData cfgBc
Definition: MeshsetsManager.cpp:776
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:767
MoFEM::MeshsetsManager::initialiseDatabaseFromMesh
MoFEMErrorCode initialiseDatabaseFromMesh(int verb=DEFAULT_VERBOSITY)
Definition: MeshsetsManager.cpp:65
NODESET
@ NODESET
Definition: definitions.h:159
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:548
MoFEM::MeshsetsManager::printForceSet
MoFEMErrorCode printForceSet() const
print meshsets with force boundary conditions data structure
Definition: MeshsetsManager.cpp:304
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:1399
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:1434
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:318
a
constexpr double a
Definition: approx_sphere.cpp:30
MAT_THERMALSET
@ MAT_THERMALSET
block name is "MAT_THERMAL"
Definition: definitions.h:174
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:669
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:385
MAT_ELASTICSET
@ MAT_ELASTICSET
block name is "MAT_ELASTIC"
Definition: definitions.h:172
MoFEM::BlockData::nAme
string nAme
Definition: MeshsetsManager.cpp:761
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:757
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:499
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:765
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:58
MoFEM::GenericAttributeData
Generic attribute data structure.
Definition: MaterialBlocks.hpp:17
UNKNOWNSET
@ UNKNOWNSET
Definition: definitions.h:158
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:325
MoFEM::BlockData::pressureBc
PressureCubitBcData pressureBc
Definition: MeshsetsManager.cpp:773
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:459
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:247
LASTSET_BC
@ LASTSET_BC
Definition: definitions.h:179
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:553
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:290
_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:297
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:161
MoFEM::BlockData::matTransIso
Mat_Elastic_TransIso matTransIso
Definition: MeshsetsManager.cpp:766
MoFEM::Exceptions::ierr
static MoFEMErrorCodeGeneric< PetscErrorCode > ierr
Definition: Exceptions.hpp:76
MoFEM::BlockData::matInterf
Mat_Interf matInterf
Definition: MeshsetsManager.cpp:768
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:755
MoFEMTypes
MoFEMTypes
Those types control how functions respond on arguments, f.e. error handling.
Definition: definitions.h:110
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:530
MoFEM::BlockData::iD
int iD
Definition: MeshsetsManager.cpp:759
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:778
MoFEMFunctionBeginHot
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:453
MoFEM::MeshsetsManager::readMeshsets
MoFEMErrorCode readMeshsets(int verb=DEFAULT_VERBOSITY)
Boradcats meshsets.
Definition: MeshsetsManager.cpp:92
MoFEM::BlockData::forceBc
ForceCubitBcData forceBc
Definition: MeshsetsManager.cpp:772
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:578
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:360
MoFEM::BlockData::bcType
CubitBC bcType
Definition: MeshsetsManager.cpp:762
MoFEM::CfgCubitBcData
Definition of the cfd_bc data structure.
Definition: BCData.hpp:480
MF_EXIST
@ MF_EXIST
Definition: definitions.h:113
MoFEMFunctionReturn
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:429
MAT_MOISTURESET
@ MAT_MOISTURESET
block name is "MAT_MOISTURE"
Definition: definitions.h:176
CHKERRG
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:496
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:726
MoFEMFunctionBegin
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:359
CubitBC
CubitBC
Types of sets and boundary conditions.
Definition: definitions.h:157
MoFEM::BlockData::heatFluxBc
HeatFluxCubitBcData heatFluxBc
Definition: MeshsetsManager.cpp:775
MoFEM::MeshsetsManager::setMeshsetFromFile
MoFEMErrorCode setMeshsetFromFile()
get name of config file from line command '-meshsets_config'
Definition: MeshsetsManager.cpp:1375