v0.9.2
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 /**
8  * The MoFEM package is copyrighted by Lukasz Kaczmarczyk.
9  * It can be freely used for educational and research purposes
10  * by other institutions. If you use this softwre pleas cite my work.
11  *
12  * MoFEM is free software: you can redistribute it and/or modify it under
13  * the terms of the GNU Lesser General Public License as published by the
14  * Free Software Foundation, either version 3 of the License, or (at your
15  * option) any later version.
16  *
17  * MoFEM is distributed in the hope that it will be useful, but WITHOUT
18  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19  * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
20  * License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public
23  * License along with MoFEM. If not, see <http://www.gnu.org/licenses/>
24  */
25 
26 using namespace std;
27 namespace po = boost::program_options;
28 
29 namespace MoFEM {
30 
32 MeshsetsManager::query_interface(const MOFEMuuid &uuid,
33  UnknownInterface **iface) const {
35  *iface = NULL;
36  if (uuid == IDD_MOFEMMeshsetsManager) {
37  *iface = const_cast<MeshsetsManager *>(this);
39  }
40  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "unknown interface");
42 }
43 
44 MeshsetsManager::MeshsetsManager(const Core &core)
45  : cOre(const_cast<Core &>(core)) {}
46 
49  cubitMeshsets.clear();
51 }
52 
54  Interface &m_field = cOre;
55  moab::Interface &moab = m_field.get_moab();
57  Range meshsets;
58  CHKERR moab.get_entities_by_type(0, MBENTITYSET, meshsets, false);
59  for (Range::iterator mit = meshsets.begin(); mit != meshsets.end(); mit++) {
60  // check if meshset is cubit meshset
61  CubitMeshSets base_meshset(moab, *mit);
62  if ((base_meshset.cubitBcType & CubitBCType(NODESET | SIDESET | BLOCKSET))
63  .any()) {
64  std::pair<CubitMeshSet_multiIndex::iterator, bool> p =
65  cubitMeshsets.insert(base_meshset);
66  if (!p.second)
67  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
68  "meshset not inserted");
69 
70  if (verb > QUIET)
71  MOFEM_LOG("WORLD", Sev::inform) << "read cubit " << base_meshset;
72  }
73  }
75 }
76 
79  Interface &m_field = cOre;
80  moab::Interface &moab = m_field.get_moab();
81  int default_val = -1;
82  CHKERR moab.tag_get_handle(DIRICHLET_SET_TAG_NAME, 1, MB_TYPE_INTEGER, nsTag,
83  MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
84 
85  CHKERR moab.tag_get_handle(NEUMANN_SET_TAG_NAME, 1, MB_TYPE_INTEGER, ssTag,
86  MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
87 
88  const int def_bc_data_len = 0;
89  std::string tag_name = std::string(DIRICHLET_SET_TAG_NAME) + "__BC_DATA";
90  CHKERR moab.tag_get_handle(
91  tag_name.c_str(), def_bc_data_len, MB_TYPE_OPAQUE, nsTag_data,
92  MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES | MB_TAG_VARLEN, NULL);
93 
94  tag_name = std::string(NEUMANN_SET_TAG_NAME) + "__BC_DATA";
95  CHKERR moab.tag_get_handle(
96  tag_name.c_str(), def_bc_data_len, MB_TYPE_OPAQUE, ssTag_data,
97  MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES | MB_TAG_VARLEN, NULL);
98 
99  CHKERR moab.tag_get_handle(MATERIAL_SET_TAG_NAME, 1, MB_TYPE_INTEGER, bhTag,
100  MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
101 
102  std::vector<unsigned int> def_uint_zero(3, 0);
103  CHKERR moab.tag_get_handle(
104  BLOCK_HEADER, 3 * sizeof(unsigned int), MB_TYPE_INTEGER, bhTag_header,
105  MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES, &def_uint_zero[0]);
106 
107  Tag block_attribs;
108  int def_Block_Attributes_length = 0;
109  CHKERR moab.tag_get_handle(
110  BLOCK_ATTRIBUTES, def_Block_Attributes_length, MB_TYPE_DOUBLE,
111  block_attribs, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN, NULL);
112 
113  Tag entity_name_tag;
114  CHKERR moab.tag_get_handle(NAME_TAG_NAME, NAME_TAG_SIZE, MB_TYPE_OPAQUE,
115  entity_name_tag, MB_TAG_SPARSE | MB_TAG_CREAT);
116 
118 }
119 
123  CHKERR printBcSet(mydata, NODESET | mydata.tYpe.to_ulong());
125 }
126 
128  PressureCubitBcData mydata;
130  CHKERR printBcSet(mydata, SIDESET | mydata.tYpe.to_ulong());
132 }
133 
135  ForceCubitBcData mydata;
137  CHKERR printBcSet(mydata, NODESET | mydata.tYpe.to_ulong());
139 }
140 
142  TemperatureCubitBcData mydata;
144  CHKERR printBcSet(mydata, NODESET | mydata.tYpe.to_ulong());
146 }
147 
149  HeatFluxCubitBcData mydata;
151  CHKERR printBcSet(mydata, SIDESET | mydata.tYpe.to_ulong());
153 }
154 
157  const Interface &m_field = cOre;
158  const moab::Interface &moab = m_field.get_moab();
160  (*this), BLOCKSET | MAT_ELASTICSET, it)) {
161  Mat_Elastic data;
162  CHKERR it->getAttributeDataStructure(data);
163  MOFEM_LOG("WORLD", Sev::inform) << *it;
164  MOFEM_LOG("WORLD", Sev::inform) << data;
165  Range tets;
166  CHKERR moab.get_entities_by_type(it->meshset, MBTET, tets, true);
167  MOFEM_LOG("WORLD", Sev::inform) << "MAT_ELATIC msId " << it->getMeshsetId()
168  << " nb. tets " << tets.size();
169  }
170 
172  m_field, BLOCKSET | MAT_THERMALSET, it)) {
173  Mat_Thermal data;
174  CHKERR it->getAttributeDataStructure(data);
175  MOFEM_LOG("WORLD", Sev::inform) << *it;
176  MOFEM_LOG("WORLD", Sev::inform) << data;
177  }
178 
180  m_field, BLOCKSET | MAT_MOISTURESET, it)) {
181  Mat_Moisture data;
182  CHKERR it->getAttributeDataStructure(data);
183  MOFEM_LOG("WORLD", Sev::inform) << *it;
184  MOFEM_LOG("WORLD", Sev::inform) << data;
185  }
187 }
188 
189 bool MeshsetsManager::checkMeshset(const int ms_id,
190  const CubitBCType cubit_bc_type) const {
191  auto miit =
193  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
194  if (miit !=
196  return true;
197  }
198  return false;
199 }
200 
201 bool MeshsetsManager::checkMeshset(const string name,
202  int *const number_of_meshsets_ptr) const {
203  auto miit = cubitMeshsets.get<CubitMeshSets_name>().lower_bound(name);
204  auto hi_miit = cubitMeshsets.get<CubitMeshSets_name>().upper_bound(name);
205  if (std::distance(miit, hi_miit) == 0) {
206  return false;
207  }
208  if (number_of_meshsets_ptr) {
209  *number_of_meshsets_ptr = std::distance(miit, hi_miit);
210  }
211  return true;
212 }
213 
215  const int ms_id,
216  const std::string name) {
217  Interface &m_field = cOre;
218  moab::Interface &moab = m_field.get_moab();
220  if (checkMeshset(ms_id, cubit_bc_type)) {
221  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
222  "such cubit meshset is already there", ms_id);
223  }
224 
225  CubitMeshSets cmeshset(moab, cubit_bc_type, ms_id);
226  if ((cmeshset.cubitBcType & CubitBCType(NODESET | SIDESET | BLOCKSET))
227  .any()) {
228  auto p = cubitMeshsets.insert(cmeshset);
229  if (!p.second) {
230  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
231  "meshset not inserted");
232  }
233  if (name.size() > 0) {
234  bool success =
235  cubitMeshsets.modify(p.first, CubitMeshSets_change_name(moab, name));
236  if (!success) {
237  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
238  "name to cubit meshset can not be set");
239  }
240  }
241  }
242 
244 }
245 
248  const int ms_id, const Range &ents) {
249  Interface &m_field = cOre;
250  moab::Interface &moab = m_field.get_moab();
252  auto cit =
254  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
255  if (cit ==
257  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
258  "Cannot find Cubit meshset with id: %d", ms_id);
259  }
260  EntityHandle meshset = cit->getMeshset();
261  CHKERR moab.add_entities(meshset, ents);
262 
264 }
265 
268  const int ms_id, const EntityHandle *ents,
269  const int nb_ents) {
270  Interface &m_field = cOre;
271  moab::Interface &moab = m_field.get_moab();
273  auto cit =
275  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
276  if (cit ==
278  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
279  "Cannot find Cubit meshset with id: %d", ms_id);
280  }
281  EntityHandle meshset = cit->getMeshset();
282  CHKERR moab.add_entities(meshset, ents, nb_ents);
283 
285 }
286 
288 MeshsetsManager::setAtributes(const CubitBCType cubit_bc_type, const int ms_id,
289  const std::vector<double> &attributes,
290  const std::string name) {
291  Interface &m_field = cOre;
292  moab::Interface &moab = m_field.get_moab();
294  auto cit =
296  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
297  if (cit ==
299  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
300  "Cannot find Cubit meshset with id: %d", ms_id);
301  }
302  if (name.size() > 0) {
303  bool success = cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
304  CubitMeshSets_change_name(moab, name));
305  if (!success) {
306  SETERRQ(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
307  "name to cubit meshset can not be set");
308  }
309  }
310  bool success =
311  cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
312  CubitMeshSets_change_attributes(moab, attributes));
313  if (!success)
314  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
315  "modification unsuccessful");
317 }
318 
320  const CubitBCType cubit_bc_type, const int ms_id,
321  const GenericAttributeData &data, const std::string name) {
322  Interface &m_field = cOre;
323  moab::Interface &moab = m_field.get_moab();
325  auto cit =
327  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
328  if (cit ==
330  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
331  "Cannot find Cubit meshset with id: %d", ms_id);
332  }
333  if (name.size() > 0) {
334  bool success = cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
335  CubitMeshSets_change_name(moab, name));
336  if (!success) {
337  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
338  "name to cubit meshset can not be set");
339  }
340  }
341  bool success = cubitMeshsets.modify(
342  cubitMeshsets.project<0>(cit),
344  if (!success)
345  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
346  "modification unsuccessful");
348 }
349 
351  const int ms_id,
352  const GenericCubitBcData &data) {
353  Interface &m_field = cOre;
354  moab::Interface &moab = m_field.get_moab();
356  auto cit =
358  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
359  if (cit ==
361  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
362  "Cubit meshset with id is already there", ms_id);
363  }
364  bool success =
365  cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
367  if (!success)
368  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
369  "modification unsuccessful");
371 }
372 
374  const int ms_id,
375  const MoFEMTypes bh) {
376  Interface &m_field = cOre;
377  moab::Interface &moab = m_field.get_moab();
379  auto miit =
381  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
382  if (miit ==
384  if (bh & MF_EXIST) {
385  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
386  "meshset not found", ms_id);
387  } else {
389  }
390  }
391  EntityHandle meshset = miit->getMeshset();
393  CHKERR moab.delete_entities(&meshset, 1);
394 
396 }
397 
399  const int ms_id, const CubitBCType cubit_bc_type,
400  const CubitMeshSets **cubit_meshset_ptr) const {
401  Interface &m_field = cOre;
403  auto miit =
405  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
406  if (miit !=
408  *cubit_meshset_ptr = &*miit;
409  } else {
410  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
411  "msId = %d is not there", ms_id);
412  }
414 }
415 
417  const string name, const CubitMeshSets **cubit_meshset_ptr) const {
418  Interface &m_field = cOre;
420  auto miit = cubitMeshsets.get<CubitMeshSets_name>().lower_bound(name);
421  auto hi_miit = cubitMeshsets.get<CubitMeshSets_name>().upper_bound(name);
422  if (std::distance(miit, hi_miit) == 0) {
423  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
424  "meshset name = %s is not there", name.c_str());
425  }
426  if (std::distance(miit, hi_miit) > 1) {
427  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
428  "meshset name = %s is not there", name.c_str());
429  }
430  *cubit_meshset_ptr = &*miit;
432 }
433 
435  const int msId, const unsigned int cubit_bc_type, const int dimension,
436  Range &entities, const bool recursive) const {
437  Interface &m_field = cOre;
438  moab::Interface &moab = m_field.get_moab();
440  auto miit =
442  boost::make_tuple(msId, cubit_bc_type));
443  if (miit !=
445  CHKERR miit->getMeshsetIdEntitiesByDimension(moab, dimension, entities,
446  recursive);
447  } else {
448  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
449  "msId = %d is not there", msId);
450  }
452 }
453 
455  const int ms_id, const unsigned int cubit_bc_type, Range &entities,
456  const bool recursive) const {
457  Interface &m_field = cOre;
458  moab::Interface &moab = m_field.get_moab();
460  auto miit =
462  boost::make_tuple(ms_id, cubit_bc_type));
463  if (miit !=
465  CHKERR miit->getMeshsetIdEntitiesByDimension(moab, entities, recursive);
466  } else {
467  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
468  "ms_id = %d is not there", ms_id);
469  }
471 }
472 
474  const unsigned int cubit_bc_type,
475  EntityHandle &meshset) const {
476  Interface &m_field = cOre;
478  auto miit =
480  boost::make_tuple(ms_id, cubit_bc_type));
481  if (miit !=
483  meshset = miit->meshset;
484  } else {
485  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
486  "ms_id = %d is not there", ms_id);
487  }
489 }
490 
492  const int ms_id, const unsigned int cubit_bc_type,
493  const EntityHandle *entities, int num_entities, const int operation_type) {
494  auto miit =
496  boost::make_tuple(ms_id, cubit_bc_type));
497  if (miit !=
499  Interface &m_field = cOre;
500  return m_field.get_moab().contains_entities(miit->meshset, entities,
501  num_entities, operation_type);
502  } else
503  return false;
504 }
505 
507 MeshsetsManager::getMeshsetsByType(const unsigned int cubit_bc_type,
508  Range &meshsets) const {
510  auto miit =
511  cubitMeshsets.get<CubitMeshSets_mi_tag>().lower_bound(cubit_bc_type);
512  auto hi_miit =
513  cubitMeshsets.get<CubitMeshSets_mi_tag>().upper_bound(cubit_bc_type);
514  for (; miit != hi_miit; miit++) {
515  meshsets.insert(miit->meshset);
516  }
518 }
519 
520 struct BlockData {
521 
523 
524  int iD;
525  string addType;
526  string nAme;
528 
529  // Materials
533 
534  // BCs
541 
542  std::vector<double> aTtr;
543  BlockData() : aTtr(10, 0) {
544  std::memcpy(dispBc.data.name, "Displacement", 12);
545  std::memcpy(forceBc.data.name, "Force", 5);
546  std::memcpy(pressureBc.data.name, "Pressure", 8);
547  std::memcpy(temperatureBc.data.name, "Temperature", 11);
548  std::memcpy(heatFluxBc.data.name, "HeatFlux", 8);
549  std::memcpy(cfgBc.data.name, "cfd_bc", 6);
550  }
551 };
552 
554  bool clean_file_options) {
555  Interface &m_field = cOre;
557  std::ifstream ini_file(file_name.c_str(), std::ifstream::in);
558  po::variables_map vm;
559  if (clean_file_options) {
561  boost::shared_ptr<boost::program_options::options_description>(
562  new po::options_description());
563  }
564  map<int, BlockData> block_lists;
566  block_lists[it->getMeshsetId()].cubitMeshset = it->getMeshset();
567  std::string prefix =
568  "block_" + boost::lexical_cast<std::string>(it->getMeshsetId());
569  configFileOptionsPtr->add_options()(
570  (prefix + ".add").c_str(),
571  po::value<string>(&block_lists[it->getMeshsetId()].addType)
572  ->default_value("UNKNOWNSET"),
573  "Add block set")(
574  (prefix + ".id").c_str(),
575  po::value<int>(&block_lists[it->getMeshsetId()].iD)->default_value(-1),
576  "Id of meshset")(
577  (prefix + ".name").c_str(),
578  po::value<string>(&block_lists[it->getMeshsetId()].nAme)
579  ->default_value(""),
580  "Name of the meshset");
581  // Block attributes
582  for (int ii = 1; ii <= 10; ii++) {
583  std::string surfix = ".user" + boost::lexical_cast<std::string>(ii);
584  configFileOptionsPtr->add_options()(
585  (prefix + surfix).c_str(),
586  po::value<double>(&block_lists[it->getMeshsetId()].aTtr[ii - 1])
587  ->default_value(0.0),
588  "Add block attribute");
589  }
590  // Mat elastic
591  {
592  // double Young; ///< Young's modulus
593  // double Poisson; ///< Poisson's ratio
594  // double ThermalExpansion; ///< Thermal expansion
595  configFileOptionsPtr->add_options()(
596  (prefix + ".young").c_str(),
597  po::value<double>(
598  &block_lists[it->getMeshsetId()].matElastic.data.Young)
599  ->default_value(-1),
600  "Young modulus")(
601  (prefix + ".poisson").c_str(),
602  po::value<double>(
603  &block_lists[it->getMeshsetId()].matElastic.data.Poisson)
604  ->default_value(-2),
605  "Poisson ratio")(
606  (prefix + ".thermalexpansion").c_str(),
607  po::value<double>(
608  &block_lists[it->getMeshsetId()].matElastic.data.ThermalExpansion)
609  ->default_value(-1),
610  "Thermal expansion");
611  // TODO Add users parameters
612  }
613  // Mat thermal
614  {
615  // double Conductivity; ///< Thermal conductivity
616  // double HeatCapacity; ///< Heat Capacity
617  configFileOptionsPtr->add_options()(
618  (prefix + ".conductivity").c_str(),
619  po::value<double>(
620  &block_lists[it->getMeshsetId()].matThermal.data.Conductivity)
621  ->default_value(-1),
622  "Conductivity")(
623  (prefix + ".capacity").c_str(),
624  po::value<double>(
625  &block_lists[it->getMeshsetId()].matThermal.data.HeatCapacity)
626  ->default_value(-1),
627  "Capacity");
628  // TODO Add users parameters
629  }
630  // Mat interface
631  {
632  // double alpha; ///< Elastic modulus multiplier
633  // double beta; ///< Damage Coupling multiplier between normal and
634  // shear (g=sqrt(gn^2 + beta(gt1^2 + gt2^2))) double ft; ///< Maximum
635  // stress of crack double Gf; ///< Fracture Energy
636  configFileOptionsPtr->add_options()(
637  (prefix + ".interface_alpha").c_str(),
638  po::value<double>(
639  &block_lists[it->getMeshsetId()].matInterf.data.alpha)
640  ->default_value(-1),
641  "alpha")((prefix + ".interface_beta").c_str(),
642  po::value<double>(
643  &block_lists[it->getMeshsetId()].matInterf.data.beta)
644  ->default_value(-1),
645  "beta")(
646  (prefix + ".interface_ft").c_str(),
647  po::value<double>(&block_lists[it->getMeshsetId()].matInterf.data.ft)
648  ->default_value(-1),
649  "ft")(
650  (prefix + ".interface_Gf").c_str(),
651  po::value<double>(&block_lists[it->getMeshsetId()].matInterf.data.Gf)
652  ->default_value(-1),
653  "Gf");
654  // TODO Add users parameters
655  }
656 
657  // Displacement bc
658  {
659  // char flag1; //< Flag for X-Translation (0: N/A, 1: specified)
660  // char flag2; //< Flag for Y-Translation (0: N/A, 1: specified)
661  // char flag3; //< Flag for Z-Translation (0: N/A, 1: specified)
662  // char flag4; //< Flag for X-Rotation (0: N/A, 1: specified)
663  // char flag5; //< Flag for Y-Rotation (0: N/A, 1: specified)
664  // char flag6; //< Flag for Z-Rotation (0: N/A, 1: specified)
665  // double value1; //< Value for X-Translation
666  // double value2; //< Value for Y-Translation
667  // double value3; //< Value for Z-Translation
668  // double value4; //< Value for X-Rotation
669  // double value5; //< Value for Y-Rotation
670  // double value6; //< Value for Z-Rotation
671  configFileOptionsPtr->add_options()(
672  (prefix + ".disp_flag1").c_str(),
673  po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag1)
674  ->default_value(0),
675  "flag1")(
676  (prefix + ".disp_flag2").c_str(),
677  po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag2)
678  ->default_value(0),
679  "flag2")(
680  (prefix + ".disp_flag3").c_str(),
681  po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag3)
682  ->default_value(0),
683  "flag3")(
684  (prefix + ".disp_flag4").c_str(),
685  po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag4)
686  ->default_value(0),
687  "flag4")(
688  (prefix + ".disp_flag5").c_str(),
689  po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag5)
690  ->default_value(0),
691  "flag5")(
692  (prefix + ".disp_flag6").c_str(),
693  po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag6)
694  ->default_value(0),
695  "flag6")(
696  (prefix + ".disp_ux").c_str(),
697  po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value1)
698  ->default_value(0),
699  "value1")(
700  (prefix + ".disp_uy").c_str(),
701  po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value2)
702  ->default_value(0),
703  "value2")(
704  (prefix + ".disp_uz").c_str(),
705  po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value3)
706  ->default_value(0),
707  "value3")(
708  (prefix + ".disp_rx").c_str(),
709  po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value4)
710  ->default_value(0),
711  "value4")(
712  (prefix + ".disp_ry").c_str(),
713  po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value5)
714  ->default_value(0),
715  "value5")(
716  (prefix + ".disp_rz").c_str(),
717  po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value6)
718  ->default_value(0),
719  "value6");
720  }
721  // Force BC data
722  {
723  // char zero[3]; //< 3 zeros
724  // double value1; //< Force magnitude
725  // double value2; //< Moment magnitude
726  // double value3; //< X-component of force direction vector
727  // double value4; //< Y-component of force direction vector
728  // double value5; //< Z-component of force direction vector
729  // double value6; //< X-component of moment direction vector
730  // double value7; //< Y-component of moment direction vector
731  // double value8; //< Z-component of moment direction vector
732  // char zero2; // 0
733  configFileOptionsPtr->add_options()(
734  (prefix + ".force_magnitude").c_str(),
735  po::value<double>(
736  &block_lists[it->getMeshsetId()].forceBc.data.value1)
737  ->default_value(0),
738  "value1")((prefix + ".moment_magnitude").c_str(),
739  po::value<double>(
740  &block_lists[it->getMeshsetId()].forceBc.data.value2)
741  ->default_value(0),
742  "value2")(
743  (prefix + ".force_fx").c_str(),
744  po::value<double>(
745  &block_lists[it->getMeshsetId()].forceBc.data.value3)
746  ->default_value(0),
747  "value3")((prefix + ".force_fy").c_str(),
748  po::value<double>(
749  &block_lists[it->getMeshsetId()].forceBc.data.value4)
750  ->default_value(0),
751  "value4")(
752  (prefix + ".force_fz").c_str(),
753  po::value<double>(
754  &block_lists[it->getMeshsetId()].forceBc.data.value5)
755  ->default_value(0),
756  "value5")((prefix + ".moment_mx").c_str(),
757  po::value<double>(
758  &block_lists[it->getMeshsetId()].forceBc.data.value6)
759  ->default_value(0),
760  "value6")(
761  (prefix + ".moment_my").c_str(),
762  po::value<double>(
763  &block_lists[it->getMeshsetId()].forceBc.data.value7)
764  ->default_value(0),
765  "value7")((prefix + ".moment_mz").c_str(),
766  po::value<double>(
767  &block_lists[it->getMeshsetId()].forceBc.data.value8)
768  ->default_value(0),
769  "value8");
770  }
771  {
772  // char name[11]; //< 11 characters for "Temperature"
773  // char pre1; //< This is always zero
774  // char pre2; //< 0: temperature is not applied on thin shells
775  // (default); 1: temperature is applied on thin shells char flag1; //<
776  // 0: N/A, 1: temperature value applied (not on thin shells) char flag2;
777  // //< 0: N/A, 1: temperature applied on thin shell middle char flag3;
778  // //< 0: N/A, 1: thin shell temperature gradient specified char flag4;
779  // //< 0: N/A, 1: top thin shell temperature char flag5; //< 0: N/A, 1:
780  // bottom thin shell temperature char flag6; //< This is always zero
781  // double value1; //< Temperature (default case - no thin shells)
782  // double value2; //< Temperature for middle of thin shells
783  // double value3; //< Temperature gradient for thin shells
784  // double value4; //< Temperature for top of thin shells
785  // double value5; //< Temperature for bottom of thin shells
786  // double value6; //< This is always zero, i.e. ignore
787  configFileOptionsPtr->add_options()(
788  (prefix + ".temperature_flag1").c_str(),
789  po::value<char>(
790  &block_lists[it->getMeshsetId()].temperatureBc.data.flag1)
791  ->default_value(0),
792  "flag1")(
793  (prefix + ".temperature_t").c_str(),
794  po::value<double>(
795  &block_lists[it->getMeshsetId()].temperatureBc.data.value1)
796  ->default_value(0),
797  "value1");
798  // TODO: Add more cases, see above
799  }
800  // Sideset
801  {
802  // char name[8]; //< 8 characters for "Pressure"
803  // char zero; //< This is always zero
804  // char flag2; //< 0: Pressure is interpreted as pure pressure 1:
805  // pressure is interpreted as total force double value1; //< Pressure
806  // value
807  configFileOptionsPtr->add_options()(
808  (prefix + ".pressure_flag2").c_str(),
809  po::value<char>(
810  &block_lists[it->getMeshsetId()].pressureBc.data.flag2)
811  ->default_value(0),
812  "flag2")((prefix + ".pressure_magnitude").c_str(),
813  po::value<double>(
814  &block_lists[it->getMeshsetId()].pressureBc.data.value1)
815  ->default_value(0),
816  "value1");
817  }
818  {
819  // char name[8]; //< 8 characters for "HeatFlux" (no space)
820  // char pre1; //< This is always zero
821  // char pre2; //< 0: heat flux is not applied on thin shells (default);
822  // 1: heat flux is applied on thin shells char flag1; //< 0: N/A, 1:
823  // normal heat flux case (i.e. single value, case without thin shells)
824  // char flag2; //< 0: N/A, 1: Thin shell top heat flux specified
825  // char flag3; //< 0: N/A, 1: Thin shell bottom heat flux specidied
826  // double value1; //< Heat flux value for default case (no thin shells)
827  // double value2; //< Heat flux (thin shell top)
828  // double value3; //< Heat flux (thin shell bottom)
829  configFileOptionsPtr->add_options()(
830  (prefix + ".heatflux_flag1").c_str(),
831  po::value<char>(
832  &block_lists[it->getMeshsetId()].heatFluxBc.data.flag1)
833  ->default_value(0),
834  "flag1")((prefix + ".heatflux_magnitude").c_str(),
835  po::value<double>(
836  &block_lists[it->getMeshsetId()].heatFluxBc.data.value1)
837  ->default_value(0),
838  "value1");
839  }
840  // Interface set
841  {
842  configFileOptionsPtr->add_options()(
843  (prefix + ".interface_type").c_str(),
844  po::value<char>(&block_lists[it->getMeshsetId()].cfgBc.data.type)
845  ->default_value(0),
846  "type");
847  }
848  }
849  po::parsed_options parsed =
850  parse_config_file(ini_file, *configFileOptionsPtr, true);
851  store(parsed, vm);
852  po::notify(vm);
854 
855  CubitBCType bc_type;
856  unsigned jj = 0;
857  while (1 << jj != LASTSET_BC) {
858  if (string(CubitBCNames[jj + 1]) ==
859  block_lists[it->getMeshsetId()].addType) {
860  // cerr << CubitBCNames[jj+1] << " ";
861  bc_type = 1 << jj;
862  }
863  ++jj;
864  }
865  if (bc_type.none()) {
866  block_lists[it->getMeshsetId()].bcType = UNKNOWNSET;
867  // Skip the bockset nothing is defined for it
868  continue;
869  }
870 
871  if (bc_type.to_ulong() == BLOCKSET)
872  block_lists[it->getMeshsetId()].bcType = BLOCKSET;
873  else if (bc_type.to_ulong() == NODESET)
874  block_lists[it->getMeshsetId()].bcType = NODESET;
875  else if (bc_type.to_ulong() == SIDESET)
876  block_lists[it->getMeshsetId()].bcType = SIDESET;
877  else {
878  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
879  "Not yet implemented type %s\n",
880  block_lists[it->getMeshsetId()].addType.c_str());
881  }
882  if (block_lists[it->getMeshsetId()].iD == -1) {
883  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
884  "Unset iD number %d\n", block_lists[it->getMeshsetId()].iD);
885  }
886  }
887  std::vector<std::string> additional_parameters;
888  additional_parameters =
889  collect_unrecognized(parsed.options, po::include_positional);
890  for (std::vector<std::string>::iterator vit = additional_parameters.begin();
891  vit != additional_parameters.end(); vit++) {
892  MOFEM_LOG_C("WORLD", Sev::warning, "Unrecognized option %s", vit->c_str());
893  }
894  for (map<int, BlockData>::iterator mit = block_lists.begin();
895  mit != block_lists.end(); mit++) {
896  CubitMeshSet_multiIndex::iterator cubit_meshset_it =
897  cubitMeshsets.find(mit->second.cubitMeshset);
898  if (cubit_meshset_it == cubitMeshsets.end()) {
899  SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
900  "Data inconsistency\n");
901  }
902  switch (mit->second.bcType) {
903  case UNKNOWNSET:
904  break;
905  case BLOCKSET: {
906  if ((CubitBCType(mit->second.bcType) & cubit_meshset_it->getBcType())
907  .any() &&
908  mit->second.iD == cubit_meshset_it->getMeshsetId()) {
909  // Meshset is the same, only modification
910  } else {
911  CHKERR addMeshset(mit->second.bcType, mit->second.iD, mit->second.nAme);
912  EntityHandle meshset = cubit_meshset_it->getMeshset();
913  CHKERR addEntitiesToMeshset(mit->second.bcType, mit->second.iD,
914  &meshset, 1);
915  }
916  // Add attributes
917  CHKERR setAtributes(mit->second.bcType, mit->second.iD, mit->second.aTtr);
918  // Add material elastic data if value are physical (i.e. Young > 0,
919  // Poisson in (-1.0.5) and ThermalExpansion>0)
920  if (mit->second.matElastic.data.Young != -1) {
921  CHKERR setAtributesByDataStructure(mit->second.bcType, mit->second.iD,
922  mit->second.matElastic);
923  }
924  if (mit->second.matThermal.data.Conductivity != -1) {
925  CHKERR setAtributesByDataStructure(mit->second.bcType, mit->second.iD,
926  mit->second.matThermal);
927  }
928  if (mit->second.matInterf.data.ft != -1) {
929  CHKERR setAtributesByDataStructure(mit->second.bcType, mit->second.iD,
930  mit->second.matInterf);
931  }
932  } break;
933  case NODESET: {
934  if ((CubitBCType(mit->second.bcType) & cubit_meshset_it->getBcType())
935  .any() &&
936  mit->second.iD == cubit_meshset_it->getMeshsetId()) {
937  // Meshset is the same, only modification
938  } else {
939  CHKERR addMeshset(mit->second.bcType, mit->second.iD);
940  EntityHandle meshset = cubit_meshset_it->getMeshset();
941  CHKERR addEntitiesToMeshset(mit->second.bcType, mit->second.iD,
942  &meshset, 1);
943  }
944  // Add displacement bc
945  if (mit->second.dispBc.data.flag1 || mit->second.dispBc.data.flag2 ||
946  mit->second.dispBc.data.flag3 || mit->second.dispBc.data.flag4 ||
947  mit->second.dispBc.data.flag5 || mit->second.dispBc.data.flag6) {
948  if (mit->second.dispBc.data.flag1 == '0')
949  mit->second.dispBc.data.flag1 = 0;
950  if (mit->second.dispBc.data.flag1 == 'N')
951  mit->second.dispBc.data.flag1 = 0;
952  if (mit->second.dispBc.data.flag1)
953  mit->second.dispBc.data.flag1 = 1;
954  if (mit->second.dispBc.data.flag2 == '0')
955  mit->second.dispBc.data.flag2 = 0;
956  if (mit->second.dispBc.data.flag2 == 'N')
957  mit->second.dispBc.data.flag2 = 0;
958  if (mit->second.dispBc.data.flag2)
959  mit->second.dispBc.data.flag2 = 1;
960  if (mit->second.dispBc.data.flag3 == '0')
961  mit->second.dispBc.data.flag3 = 0;
962  if (mit->second.dispBc.data.flag3 == 'N')
963  mit->second.dispBc.data.flag3 = 0;
964  if (mit->second.dispBc.data.flag3)
965  mit->second.dispBc.data.flag3 = 1;
966  if (mit->second.dispBc.data.flag4 == '0')
967  mit->second.dispBc.data.flag4 = 0;
968  if (mit->second.dispBc.data.flag4 == 'N')
969  mit->second.dispBc.data.flag4 = 0;
970  if (mit->second.dispBc.data.flag4)
971  mit->second.dispBc.data.flag4 = 1;
972  if (mit->second.dispBc.data.flag5 == '0')
973  mit->second.dispBc.data.flag5 = 0;
974  if (mit->second.dispBc.data.flag5 == 'N')
975  mit->second.dispBc.data.flag5 = 0;
976  if (mit->second.dispBc.data.flag5)
977  mit->second.dispBc.data.flag5 = 1;
978  if (mit->second.dispBc.data.flag6 == '0')
979  mit->second.dispBc.data.flag6 = 0;
980  if (mit->second.dispBc.data.flag6 == 'N')
981  mit->second.dispBc.data.flag6 = 0;
982  if (mit->second.dispBc.data.flag6)
983  mit->second.dispBc.data.flag6 = 1;
984  CHKERR setBcData(mit->second.bcType, mit->second.iD,
985  mit->second.dispBc);
986  }
987  if (mit->second.forceBc.data.value1 != 0 ||
988  mit->second.forceBc.data.value2 != 0) {
989  CHKERR setBcData(mit->second.bcType, mit->second.iD,
990  mit->second.forceBc);
991  }
992  // Add temperature boundary condition
993  if (mit->second.temperatureBc.data.flag1) {
994  if (mit->second.temperatureBc.data.flag1 == '0')
995  mit->second.temperatureBc.data.flag1 = 0;
996  if (mit->second.temperatureBc.data.flag1 == 'N')
997  mit->second.temperatureBc.data.flag1 = 0;
998  if (mit->second.temperatureBc.data.flag1)
999  mit->second.temperatureBc.data.flag1 = 1;
1000  CHKERR setBcData(mit->second.bcType, mit->second.iD,
1001  mit->second.temperatureBc);
1002  }
1003  } break;
1004  case SIDESET: {
1005  if ((CubitBCType(mit->second.bcType) & cubit_meshset_it->getBcType())
1006  .any() &&
1007  mit->second.iD == cubit_meshset_it->getMeshsetId()) {
1008  // Meshset is the same, only modification
1009  } else {
1010  CHKERR addMeshset(mit->second.bcType, mit->second.iD);
1011  EntityHandle meshset = cubit_meshset_it->getMeshset();
1012  CHKERR addEntitiesToMeshset(mit->second.bcType, mit->second.iD,
1013  &meshset, 1);
1014  }
1015  // Add pressure
1016  if (mit->second.pressureBc.data.value1 != 0) {
1017  if (mit->second.pressureBc.data.flag2 == '0')
1018  mit->second.pressureBc.data.flag2 = 0;
1019  if (mit->second.pressureBc.data.flag2 == 'N')
1020  mit->second.pressureBc.data.flag2 = 0;
1021  if (mit->second.pressureBc.data.flag2)
1022  mit->second.pressureBc.data.flag2 = 1;
1023  CHKERR setBcData(mit->second.bcType, mit->second.iD,
1024  mit->second.pressureBc);
1025  }
1026  // Add heat flux
1027  if (mit->second.heatFluxBc.data.value1 != 0) {
1028  if (mit->second.heatFluxBc.data.flag1 == '0')
1029  mit->second.heatFluxBc.data.flag1 = 0;
1030  if (mit->second.heatFluxBc.data.flag1 == 'N')
1031  mit->second.heatFluxBc.data.flag1 = 0;
1032  if (mit->second.heatFluxBc.data.flag1)
1033  mit->second.heatFluxBc.data.flag1 = 1;
1034  CHKERR setBcData(mit->second.bcType, mit->second.iD,
1035  mit->second.heatFluxBc);
1036  }
1037  // Add Interface
1038  if (mit->second.cfgBc.data.type != 0) {
1039  CHKERR setBcData(mit->second.bcType, mit->second.iD, mit->second.cfgBc);
1040  }
1041  } break;
1042  default:
1043  SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
1044  "Not yet implemented type\n");
1045  }
1046  }
1047 
1049 }
1050 
1052  Interface &m_field = cOre;
1053  // moab::Interface &moab = m_field.get_moab();
1054  PetscBool flg_file;
1055  char meshset_file_name[255];
1057  CHKERR PetscOptionsBegin(m_field.get_comm(), "", "Set meshsets form file",
1058  "none");
1059  CHKERR PetscOptionsString("-meshsets_config", "meshsets config file name",
1060  "", "add_cubit_meshsets.in", meshset_file_name, 255,
1061  &flg_file);
1062  if (flg_file == PETSC_TRUE) {
1063  ifstream f(meshset_file_name);
1064  if (!f.good()) {
1065  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
1066  "File configuring meshsets ( %s ) can not be open\n",
1067  meshset_file_name);
1068  }
1069  CHKERR setMeshsetFromFile(string(meshset_file_name));
1070  }
1071  ierr = PetscOptionsEnd();
1072  CHKERRG(ierr);
1074 }
1075 
1077  const int ms_id, const unsigned int cubit_bc_type,
1078  const std::string file_name, const std::string file_type,
1079  const std::string options) const {
1080 
1082  MoFEM::Interface &m_field = cOre;
1083  const CubitMeshSets *cubit_meshset_ptr;
1084  CHKERR getCubitMeshsetPtr(ms_id, cubit_bc_type, &cubit_meshset_ptr);
1085  EntityHandle meshset = cubit_meshset_ptr->getMeshset();
1086  CHKERR m_field.get_moab().write_file(file_name.c_str(), file_type.c_str(),
1087  options.c_str(), &meshset, 1);
1089 }
1090 
1092  const int ms_id, const unsigned int cubit_bc_type, const int dim,
1093  const std::string file_name, const bool recursive,
1094  const std::string file_type, const std::string options) const {
1095 
1097  MoFEM::Interface &m_field = cOre;
1098  moab::Interface &moab = m_field.get_moab();
1099  Range entities;
1100  CHKERR getEntitiesByDimension(ms_id, cubit_bc_type, dim, entities, recursive);
1101  EntityHandle meshset;
1102  CHKERR moab.create_meshset(MESHSET_SET, meshset);
1103  CHKERR moab.add_entities(meshset, entities);
1104  CHKERR moab.write_file(file_name.c_str(), file_type.c_str(), options.c_str(),
1105  &meshset, 1);
1106  CHKERR moab.delete_entities(&meshset, 1);
1108 }
1109 
1114  for (_IT_CUBITMESHSETS_FOR_LOOP_((*this), iit)) {
1115  EntityHandle meshset = iit->getMeshset();
1116  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1117  MBVERTEX, true);
1118  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1119  MBEDGE, true);
1120  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1121  MBTRI, true);
1122  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1123  MBTET, true);
1124  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1125  MBPRISM, true);
1126  }
1128 }
1129 
1130 } // namespace MoFEM
Generic bc data structure.
Definition: BCData.hpp:31
EntityHandle cubitMeshset
Definition of the temperature bc data structure.
Definition: BCData.hpp:316
TemperatureCubitBcData temperatureBc
MoFEMErrorCode getMeshset(const int ms_id, const unsigned int cubit_bc_type, EntityHandle &meshset) const
get meshset from CUBIT Id and CUBIT type
Deprecated interface functions.
MoFEM interface unique ID.
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets
static const MOFEMuuid IDD_MOFEMMeshsetsManager
block name is "MAT_MOISTURE"
Definition: definitions.h:232
virtual moab::Interface & get_moab()=0
boost::shared_ptr< boost::program_options::options_description > configFileOptionsPtr
config file options
bool checkIfMeshsetContainsEntities(const int ms_id, const unsigned int cubit_bc_type, const EntityHandle *entities, int num_entities, const int operation_type=moab::Interface::INTERSECT)
Check if meshset constains entities.
MoFEMErrorCode updateAllMeshsetsByEntitiesChildren(const BitRefLevel &bit)
std::vector< double > aTtr
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:507
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 dimensionNodeset can contain nodes,...
#define MOFEM_LOG(channel, severity)
Log.
Definition: LogManager.hpp:303
base class for all interface classes
Elastic material data structure.
#define MOFEM_LOG_C(channel, severity, format,...)
Definition: LogManager.hpp:306
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:483
this struct keeps basic methods for moab meshset about material and boundary conditions
MoFEMErrorCode printHeatFluxSet() const
print meshsets with heat flux boundary conditions data structure
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:550
DisplacementCubitBcData dispBc
const CubitBCType tYpe
Type of boundary condition.
Definition: BCData.hpp:70
PressureCubitBcData pressureBc
CfgCubitBcData cfgBc
Core (interface) class.
Definition: Core.hpp:50
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:514
implementation of Data Operators for Forces and Sources
Definition: Common.hpp:21
MoFEMErrorCode deleteMeshset(const CubitBCType cubit_bc_type, const int ms_id, const MoFEMTypes bh=MF_EXIST)
delete cubit meshset
MoFEMErrorCode getTags(int verb=-1)
get tags handlers used on meshsets
MoFEMErrorCode setMeshsetFromFile()
get name of config file from line command '-meshsets_config'
const int dim
Definition of the force bc data structure.
Definition: BCData.hpp:149
MoFEMErrorCode printBcSet(CUBIT_BC_DATA_TYPE &data, unsigned long int type) const
#define MeshsetsManagerFunctionBegin
Definition of the displacement bc data structure.
Definition: BCData.hpp:87
MoFEMErrorCode getInterface(const MOFEMuuid &uuid, IFACE *&iface) const
Get interface by uuid and return reference to pointer of interface.
MoFEMErrorCode initialiseDatabaseFromMesh(int verb=0)
MoFEMErrorCode printTemperatureSet() const
print meshsets with temperature boundary conditions data structure
MoFEMErrorCode setBcData(const CubitBCType cubit_bc_type, const int ms_id, const GenericCubitBcData &data)
set boundary data structure to meshset
Thermal material data structure.
MoFEMErrorCode addMeshset(const CubitBCType cubit_bc_type, const int ms_id, const std::string name="")
add cubit meshset
MoFEMErrorCode printForceSet() const
print meshsets with force boundary conditions data structure
ForceCubitBcData forceBc
PetscErrorCode MoFEMErrorCode
MoFEM/PETSc error code.
Definition: Exceptions.hpp:67
#define _IT_CUBITMESHSETS_BY_BCDATA_TYPE_FOR_LOOP_(MESHSET_MANAGER, CUBITBCTYPE, IT)
Iterator that loops over a specific Cubit MeshSet in a moFEM field.
MoFEMErrorCode 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 entitiesSearch for refined entities of given type w...
bool checkMeshset(const int ms_id, const CubitBCType cubit_bc_type) const
check for CUBIT Id and CUBIT type
MoFEMErrorCode saveMeshsetToFile(const int ms_id, const unsigned int cubit_bc_type, const std::string file_name="out_meshset.vtk", const std::string file_type="VTK", const std::string options="") const
save cubit meshset entities on the moab mesh
MoFEMErrorCode printPressureSet() const
print meshsets with pressure boundary conditions data structure
Managing BitRefLevels.
MoFEMErrorCode printDisplacementSet() const
print meshsets with displacement boundary conditions data structure
Linear interface data structure.
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
block name is "MAT_THERMAL"
Definition: definitions.h:230
Definition of the cfd_bc data structure.
Definition: BCData.hpp:490
HeatFluxCubitBcData heatFluxBc
EntityHandle getMeshset() const
get bc meshset
MoFEMErrorCode addEntitiesToMeshset(const CubitBCType cubit_bc_type, const int ms_id, const Range &ents)
add entities to cubit meshset
MoFEMErrorCode printMaterialsSet() const
print meshsets with material data structure set on it
CubitBC
Types of sets and boundary conditions.
Definition: definitions.h:213
MultiIndex Tag for field id.
Generic attribute data structure.
#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.
#define CHKERR
Inline error check.
Definition: definitions.h:602
MoFEMErrorCode getCubitMeshsetPtr(const int ms_id, const CubitBCType cubit_bc_type, const CubitMeshSets **cubit_meshset_ptr) const
get cubit meshset
block name is "MAT_ELASTIC"
Definition: definitions.h:228
Mat_Elastic matElastic
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:50
Mat_Thermal matThermal
MoFEMErrorCode getMeshsetsByType(const unsigned int cubit_bc_type, Range &meshsets) const
get all CUBIT meshsets by CUBIT type
#define _IT_CUBITMESHSETS_FOR_LOOP_(MESHSET_MANAGER, IT)
Iterator that loops over all the Cubit MeshSets in a moFEM field.
std::bitset< 32 > CubitBCType
Definition: Types.hpp:62
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1879
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:413
virtual MPI_Comm & get_comm() const =0
moisture transport material data structure
static const char *const CubitBCNames[]
Names of types of sets and boundary conditions.
Definition: definitions.h:244
Definition of the heat flux bc data structure.
Definition: BCData.hpp:437
MoFEMErrorCode clearMap()
clear multi-index container
Definition of the pressure bc data structure.
Definition: BCData.hpp:389
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
MoFEMTypes
Those types control how functions respond on arguments, f.e. error handling.
Definition: definitions.h:189