v0.9.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 /**
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  std::ostringstream ss;
72  ss << "read cubit " << base_meshset << std::endl;
73  // PetscSynchronizedPrintf(comm,ss.str().c_str());
74  PetscPrintf(m_field.get_comm(), ss.str().c_str());
75  }
76  }
77  }
79 }
80 
83  Interface &m_field = cOre;
84  moab::Interface &moab = m_field.get_moab();
85  int default_val = -1;
86  CHKERR moab.tag_get_handle(DIRICHLET_SET_TAG_NAME, 1, MB_TYPE_INTEGER, nsTag,
87  MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
88 
89  CHKERR moab.tag_get_handle(NEUMANN_SET_TAG_NAME, 1, MB_TYPE_INTEGER, ssTag,
90  MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
91 
92  const int def_bc_data_len = 0;
93  std::string tag_name = std::string(DIRICHLET_SET_TAG_NAME) + "__BC_DATA";
94  CHKERR moab.tag_get_handle(
95  tag_name.c_str(), def_bc_data_len, MB_TYPE_OPAQUE, nsTag_data,
96  MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES | MB_TAG_VARLEN, NULL);
97 
98  tag_name = std::string(NEUMANN_SET_TAG_NAME) + "__BC_DATA";
99  CHKERR moab.tag_get_handle(
100  tag_name.c_str(), def_bc_data_len, MB_TYPE_OPAQUE, ssTag_data,
101  MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES | MB_TAG_VARLEN, NULL);
102 
103  CHKERR moab.tag_get_handle(MATERIAL_SET_TAG_NAME, 1, MB_TYPE_INTEGER, bhTag,
104  MB_TAG_SPARSE | MB_TAG_CREAT, &default_val);
105 
106  std::vector<unsigned int> def_uint_zero(3, 0);
107  CHKERR moab.tag_get_handle(
108  BLOCK_HEADER, 3 * sizeof(unsigned int), MB_TYPE_INTEGER, bhTag_header,
109  MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_BYTES, &def_uint_zero[0]);
110 
111  Tag block_attribs;
112  int def_Block_Attributes_length = 0;
113  CHKERR moab.tag_get_handle(
114  BLOCK_ATTRIBUTES, def_Block_Attributes_length, MB_TYPE_DOUBLE,
115  block_attribs, MB_TAG_CREAT | MB_TAG_SPARSE | MB_TAG_VARLEN, NULL);
116 
117  Tag entity_name_tag;
118  CHKERR moab.tag_get_handle(NAME_TAG_NAME, NAME_TAG_SIZE, MB_TYPE_OPAQUE,
119  entity_name_tag, MB_TAG_SPARSE | MB_TAG_CREAT);
120 
122 }
123 
127  CHKERR printBcSet(mydata, NODESET | mydata.tYpe.to_ulong());
129 }
130 
132  PressureCubitBcData mydata;
134  CHKERR printBcSet(mydata, SIDESET | mydata.tYpe.to_ulong());
136 }
137 
139  ForceCubitBcData mydata;
141  CHKERR printBcSet(mydata, NODESET | mydata.tYpe.to_ulong());
143 }
144 
146  TemperatureCubitBcData mydata;
148  CHKERR printBcSet(mydata, NODESET | mydata.tYpe.to_ulong());
150 }
151 
153  HeatFluxCubitBcData mydata;
155  CHKERR printBcSet(mydata, SIDESET | mydata.tYpe.to_ulong());
157 }
158 
161  const Interface &m_field = cOre;
162  const moab::Interface &moab = m_field.get_moab();
164  (*this), BLOCKSET | MAT_ELASTICSET, it)) {
165  Mat_Elastic data;
166  CHKERR it->getAttributeDataStructure(data);
167  std::ostringstream ss;
168  ss << *it << std::endl;
169  ss << data;
170  Range tets;
171  CHKERR moab.get_entities_by_type(it->meshset, MBTET, tets, true);
172 
173  ss << "MAT_ELATIC msId " << it->getMeshsetId() << " nb. tets "
174  << tets.size() << std::endl;
175  ss << std::endl;
176  PetscPrintf(m_field.get_comm(), ss.str().c_str());
177  }
178 
180  m_field, BLOCKSET | MAT_THERMALSET, it)) {
181  Mat_Thermal data;
182  CHKERR it->getAttributeDataStructure(data);
183  std::ostringstream ss;
184  ss << *it << std::endl;
185  ss << data;
186  PetscPrintf(m_field.get_comm(), ss.str().c_str());
187  }
188 
190  m_field, BLOCKSET | MAT_MOISTURESET, it)) {
191  Mat_Moisture data;
192  CHKERR it->getAttributeDataStructure(data);
193  std::ostringstream ss;
194  ss << *it << std::endl;
195  ss << data;
196  PetscPrintf(m_field.get_comm(), ss.str().c_str());
197  }
199 }
200 
201 bool MeshsetsManager::checkMeshset(const int ms_id,
202  const CubitBCType cubit_bc_type) const {
203  auto miit =
205  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
206  if (miit !=
208  return true;
209  }
210  return false;
211 }
212 
213 bool MeshsetsManager::checkMeshset(const string name,
214  int *const number_of_meshsets_ptr) const {
215  auto miit = cubitMeshsets.get<CubitMeshSets_name>().lower_bound(name);
216  auto hi_miit = cubitMeshsets.get<CubitMeshSets_name>().upper_bound(name);
217  if (std::distance(miit, hi_miit) == 0) {
218  return false;
219  }
220  if (number_of_meshsets_ptr) {
221  *number_of_meshsets_ptr = std::distance(miit, hi_miit);
222  }
223  return true;
224 }
225 
227  const int ms_id,
228  const std::string name) {
229  Interface &m_field = cOre;
230  moab::Interface &moab = m_field.get_moab();
232  if (checkMeshset(ms_id, cubit_bc_type)) {
233  SETERRQ1(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY,
234  "such cubit meshset is already there", ms_id);
235  }
236 
237  CubitMeshSets cmeshset(moab, cubit_bc_type, ms_id);
238  if ((cmeshset.cubitBcType & CubitBCType(NODESET | SIDESET | BLOCKSET))
239  .any()) {
240  auto p = cubitMeshsets.insert(cmeshset);
241  if (!p.second) {
242  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
243  "meshset not inserted");
244  }
245  if (name.size() > 0) {
246  bool success =
247  cubitMeshsets.modify(p.first, CubitMeshSets_change_name(moab, name));
248  if (!success) {
249  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
250  "name to cubit meshset can not be set");
251  }
252  }
253  }
254 
256 }
257 
260  const int ms_id, const Range &ents) {
261  Interface &m_field = cOre;
262  moab::Interface &moab = m_field.get_moab();
264  auto cit =
266  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
267  if (cit ==
269  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
270  "such cubit meshset is already there", ms_id);
271  }
272  EntityHandle meshset = cit->getMeshset();
273  CHKERR moab.add_entities(meshset, ents);
274 
276 }
277 
280  const int ms_id, const EntityHandle *ents,
281  const int nb_ents) {
282  Interface &m_field = cOre;
283  moab::Interface &moab = m_field.get_moab();
285  auto cit =
287  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
288  if (cit ==
290  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
291  "such cubit meshset is already there", ms_id);
292  }
293  EntityHandle meshset = cit->getMeshset();
294  CHKERR moab.add_entities(meshset, ents, nb_ents);
295 
297 }
298 
300 MeshsetsManager::setAtributes(const CubitBCType cubit_bc_type, const int ms_id,
301  const std::vector<double> &attributes,
302  const std::string name) {
303  Interface &m_field = cOre;
304  moab::Interface &moab = m_field.get_moab();
306  auto cit =
308  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
309  if (cit ==
311  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
312  "such cubit meshset is already there", ms_id);
313  }
314  if (name.size() > 0) {
315  bool success = cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
316  CubitMeshSets_change_name(moab, name));
317  if (!success) {
318  SETERRQ(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
319  "name to cubit meshset can not be set");
320  }
321  }
322  bool success =
323  cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
324  CubitMeshSets_change_attributes(moab, attributes));
325  if (!success)
326  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
327  "modification unsuccessful");
329 }
330 
332  const CubitBCType cubit_bc_type, const int ms_id,
333  const GenericAttributeData &data, const std::string name) {
334  Interface &m_field = cOre;
335  moab::Interface &moab = m_field.get_moab();
337  auto cit =
339  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
340  if (cit ==
342  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
343  "such cubit meshset is already there", ms_id);
344  }
345  if (name.size() > 0) {
346  bool success = cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
347  CubitMeshSets_change_name(moab, name));
348  if (!success) {
349  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
350  "name to cubit meshset can not be set");
351  }
352  }
353  bool success = cubitMeshsets.modify(
354  cubitMeshsets.project<0>(cit),
356  if (!success)
357  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
358  "modification unsuccessful");
360 }
361 
363  const int ms_id,
364  const GenericCubitBcData &data) {
365  Interface &m_field = cOre;
366  moab::Interface &moab = m_field.get_moab();
368  auto cit =
370  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
371  if (cit ==
373  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
374  "such cubit meshset is already there", ms_id);
375  }
376  bool success =
377  cubitMeshsets.modify(cubitMeshsets.project<0>(cit),
379  if (!success)
380  SETERRQ(PETSC_COMM_SELF, MOFEM_OPERATION_UNSUCCESSFUL,
381  "modification unsuccessful");
383 }
384 
386  const int ms_id,
387  const MoFEMTypes bh) {
388  Interface &m_field = cOre;
389  moab::Interface &moab = m_field.get_moab();
391  auto miit =
393  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
394  if (miit ==
396  if (bh & MF_EXIST) {
397  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
398  "meshset not found", ms_id);
399  } else {
401  }
402  }
403  EntityHandle meshset = miit->getMeshset();
405  CHKERR moab.delete_entities(&meshset, 1);
406 
408 }
409 
411  const int ms_id, const CubitBCType cubit_bc_type,
412  const CubitMeshSets **cubit_meshset_ptr) const {
413  Interface &m_field = cOre;
415  auto miit =
417  boost::make_tuple(ms_id, cubit_bc_type.to_ulong()));
418  if (miit !=
420  *cubit_meshset_ptr = &*miit;
421  } else {
422  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
423  "msId = %d is not there", ms_id);
424  }
426 }
427 
429  const string name, const CubitMeshSets **cubit_meshset_ptr) const {
430  Interface &m_field = cOre;
432  auto miit = cubitMeshsets.get<CubitMeshSets_name>().lower_bound(name);
433  auto hi_miit = cubitMeshsets.get<CubitMeshSets_name>().upper_bound(name);
434  if (std::distance(miit, hi_miit) == 0) {
435  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
436  "meshset name = %s is not there", name.c_str());
437  }
438  if (std::distance(miit, hi_miit) > 1) {
439  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
440  "meshset name = %s is not there", name.c_str());
441  }
442  *cubit_meshset_ptr = &*miit;
444 }
445 
447  const int msId, const unsigned int cubit_bc_type, const int dimension,
448  Range &entities, const bool recursive) const {
449  Interface &m_field = cOre;
450  moab::Interface &moab = m_field.get_moab();
452  auto miit =
454  boost::make_tuple(msId, cubit_bc_type));
455  if (miit !=
457  CHKERR miit->getMeshsetIdEntitiesByDimension(moab, dimension, entities,
458  recursive);
459  } else {
460  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
461  "msId = %d is not there", msId);
462  }
464 }
465 
467  const int ms_id, const unsigned int cubit_bc_type, Range &entities,
468  const bool recursive) const {
469  Interface &m_field = cOre;
470  moab::Interface &moab = m_field.get_moab();
472  auto miit =
474  boost::make_tuple(ms_id, cubit_bc_type));
475  if (miit !=
477  CHKERR miit->getMeshsetIdEntitiesByDimension(moab, entities, recursive);
478  } else {
479  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
480  "ms_id = %d is not there", ms_id);
481  }
483 }
484 
486  const unsigned int cubit_bc_type,
487  EntityHandle &meshset) const {
488  Interface &m_field = cOre;
490  auto miit =
492  boost::make_tuple(ms_id, cubit_bc_type));
493  if (miit !=
495  meshset = miit->meshset;
496  } else {
497  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
498  "ms_id = %d is not there", ms_id);
499  }
501 }
502 
504  const int ms_id, const unsigned int cubit_bc_type,
505  const EntityHandle *entities, int num_entities, const int operation_type) {
506  auto miit =
508  boost::make_tuple(ms_id, cubit_bc_type));
509  if (miit !=
511  Interface &m_field = cOre;
512  return m_field.get_moab().contains_entities(miit->meshset, entities,
513  num_entities, operation_type);
514  } else
515  return false;
516 }
517 
519 MeshsetsManager::getMeshsetsByType(const unsigned int cubit_bc_type,
520  Range &meshsets) const {
522  auto miit =
523  cubitMeshsets.get<CubitMeshSets_mi_tag>().lower_bound(cubit_bc_type);
524  auto hi_miit =
525  cubitMeshsets.get<CubitMeshSets_mi_tag>().upper_bound(cubit_bc_type);
526  for (; miit != hi_miit; miit++) {
527  meshsets.insert(miit->meshset);
528  }
530 }
531 
532 struct BlockData {
533 
535 
536  int iD;
537  string addType;
538  string nAme;
540 
541  // Materials
545 
546  // BCs
553 
554  std::vector<double> aTtr;
555  BlockData() : aTtr(10, 0) {
556  std::memcpy(dispBc.data.name, "Displacement", 12);
557  std::memcpy(forceBc.data.name, "Force", 5);
558  std::memcpy(pressureBc.data.name, "Pressure", 8);
559  std::memcpy(temperatureBc.data.name, "Temperature", 11);
560  std::memcpy(heatFluxBc.data.name, "HeatFlux", 8);
561  std::memcpy(cfgBc.data.name, "cfd_bc", 6);
562  }
563 };
564 
566  bool clean_file_options) {
567  Interface &m_field = cOre;
568  // moab::Interface &moab = m_field.get_moab();
570  std::ifstream ini_file(file_name.c_str(), std::ifstream::in);
571  po::variables_map vm;
572  if (clean_file_options) {
574  boost::shared_ptr<boost::program_options::options_description>(
575  new po::options_description());
576  }
577  map<int, BlockData> block_lists;
579  block_lists[it->getMeshsetId()].cubitMeshset = it->getMeshset();
580  std::string prefix =
581  "block_" + boost::lexical_cast<std::string>(it->getMeshsetId());
582  configFileOptionsPtr->add_options()(
583  (prefix + ".add").c_str(),
584  po::value<string>(&block_lists[it->getMeshsetId()].addType)
585  ->default_value("UNKNOWNSET"),
586  "Add block set")(
587  (prefix + ".id").c_str(),
588  po::value<int>(&block_lists[it->getMeshsetId()].iD)->default_value(-1),
589  "Id of meshset")(
590  (prefix + ".name").c_str(),
591  po::value<string>(&block_lists[it->getMeshsetId()].nAme)
592  ->default_value(""),
593  "Name of the meshset");
594  // Block attributes
595  for (int ii = 1; ii <= 10; ii++) {
596  std::string surfix = ".user" + boost::lexical_cast<std::string>(ii);
597  configFileOptionsPtr->add_options()(
598  (prefix + surfix).c_str(),
599  po::value<double>(&block_lists[it->getMeshsetId()].aTtr[ii - 1])
600  ->default_value(0.0),
601  "Add block attribute");
602  }
603  // Mat elastic
604  {
605  // double Young; ///< Young's modulus
606  // double Poisson; ///< Poisson's ratio
607  // double ThermalExpansion; ///< Thermal expansion
608  configFileOptionsPtr->add_options()(
609  (prefix + ".young").c_str(),
610  po::value<double>(
611  &block_lists[it->getMeshsetId()].matElastic.data.Young)
612  ->default_value(-1),
613  "Young modulus")(
614  (prefix + ".poisson").c_str(),
615  po::value<double>(
616  &block_lists[it->getMeshsetId()].matElastic.data.Poisson)
617  ->default_value(-2),
618  "Poisson ratio")(
619  (prefix + ".thermalexpansion").c_str(),
620  po::value<double>(
621  &block_lists[it->getMeshsetId()].matElastic.data.ThermalExpansion)
622  ->default_value(-1),
623  "Thermal expansion");
624  // TODO Add users parameters
625  }
626  // Mat thermal
627  {
628  // double Conductivity; ///< Thermal conductivity
629  // double HeatCapacity; ///< Heat Capacity
630  configFileOptionsPtr->add_options()(
631  (prefix + ".conductivity").c_str(),
632  po::value<double>(
633  &block_lists[it->getMeshsetId()].matThermal.data.Conductivity)
634  ->default_value(-1),
635  "Conductivity")(
636  (prefix + ".capacity").c_str(),
637  po::value<double>(
638  &block_lists[it->getMeshsetId()].matThermal.data.HeatCapacity)
639  ->default_value(-1),
640  "Capacity");
641  // TODO Add users parameters
642  }
643  // Mat interface
644  {
645  // double alpha; ///< Elastic modulus multiplier
646  // double beta; ///< Damage Coupling multiplier between normal and
647  // shear (g=sqrt(gn^2 + beta(gt1^2 + gt2^2))) double ft; ///< Maximum
648  // stress of crack double Gf; ///< Fracture Energy
649  configFileOptionsPtr->add_options()(
650  (prefix + ".interface_alpha").c_str(),
651  po::value<double>(
652  &block_lists[it->getMeshsetId()].matInterf.data.alpha)
653  ->default_value(-1),
654  "alpha")((prefix + ".interface_beta").c_str(),
655  po::value<double>(
656  &block_lists[it->getMeshsetId()].matInterf.data.beta)
657  ->default_value(-1),
658  "beta")(
659  (prefix + ".interface_ft").c_str(),
660  po::value<double>(&block_lists[it->getMeshsetId()].matInterf.data.ft)
661  ->default_value(-1),
662  "ft")(
663  (prefix + ".interface_Gf").c_str(),
664  po::value<double>(&block_lists[it->getMeshsetId()].matInterf.data.Gf)
665  ->default_value(-1),
666  "Gf");
667  // TODO Add users parameters
668  }
669 
670  // Displacement bc
671  {
672  // char flag1; //< Flag for X-Translation (0: N/A, 1: specified)
673  // char flag2; //< Flag for Y-Translation (0: N/A, 1: specified)
674  // char flag3; //< Flag for Z-Translation (0: N/A, 1: specified)
675  // char flag4; //< Flag for X-Rotation (0: N/A, 1: specified)
676  // char flag5; //< Flag for Y-Rotation (0: N/A, 1: specified)
677  // char flag6; //< Flag for Z-Rotation (0: N/A, 1: specified)
678  // double value1; //< Value for X-Translation
679  // double value2; //< Value for Y-Translation
680  // double value3; //< Value for Z-Translation
681  // double value4; //< Value for X-Rotation
682  // double value5; //< Value for Y-Rotation
683  // double value6; //< Value for Z-Rotation
684  configFileOptionsPtr->add_options()(
685  (prefix + ".disp_flag1").c_str(),
686  po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag1)
687  ->default_value(0),
688  "flag1")(
689  (prefix + ".disp_flag2").c_str(),
690  po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag2)
691  ->default_value(0),
692  "flag2")(
693  (prefix + ".disp_flag3").c_str(),
694  po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag3)
695  ->default_value(0),
696  "flag3")(
697  (prefix + ".disp_flag4").c_str(),
698  po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag4)
699  ->default_value(0),
700  "flag4")(
701  (prefix + ".disp_flag5").c_str(),
702  po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag5)
703  ->default_value(0),
704  "flag5")(
705  (prefix + ".disp_flag6").c_str(),
706  po::value<char>(&block_lists[it->getMeshsetId()].dispBc.data.flag6)
707  ->default_value(0),
708  "flag6")(
709  (prefix + ".disp_ux").c_str(),
710  po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value1)
711  ->default_value(0),
712  "value1")(
713  (prefix + ".disp_uy").c_str(),
714  po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value2)
715  ->default_value(0),
716  "value2")(
717  (prefix + ".disp_uz").c_str(),
718  po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value3)
719  ->default_value(0),
720  "value3")(
721  (prefix + ".disp_rx").c_str(),
722  po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value4)
723  ->default_value(0),
724  "value4")(
725  (prefix + ".disp_ry").c_str(),
726  po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value5)
727  ->default_value(0),
728  "value5")(
729  (prefix + ".disp_rz").c_str(),
730  po::value<double>(&block_lists[it->getMeshsetId()].dispBc.data.value6)
731  ->default_value(0),
732  "value6");
733  }
734  // Force BC data
735  {
736  // char zero[3]; //< 3 zeros
737  // double value1; //< Force magnitude
738  // double value2; //< Moment magnitude
739  // double value3; //< X-component of force direction vector
740  // double value4; //< Y-component of force direction vector
741  // double value5; //< Z-component of force direction vector
742  // double value6; //< X-component of moment direction vector
743  // double value7; //< Y-component of moment direction vector
744  // double value8; //< Z-component of moment direction vector
745  // char zero2; // 0
746  configFileOptionsPtr->add_options()(
747  (prefix + ".force_magnitude").c_str(),
748  po::value<double>(
749  &block_lists[it->getMeshsetId()].forceBc.data.value1)
750  ->default_value(0),
751  "value1")((prefix + ".moment_magnitude").c_str(),
752  po::value<double>(
753  &block_lists[it->getMeshsetId()].forceBc.data.value2)
754  ->default_value(0),
755  "value2")(
756  (prefix + ".force_fx").c_str(),
757  po::value<double>(
758  &block_lists[it->getMeshsetId()].forceBc.data.value3)
759  ->default_value(0),
760  "value3")((prefix + ".force_fy").c_str(),
761  po::value<double>(
762  &block_lists[it->getMeshsetId()].forceBc.data.value4)
763  ->default_value(0),
764  "value4")(
765  (prefix + ".force_fz").c_str(),
766  po::value<double>(
767  &block_lists[it->getMeshsetId()].forceBc.data.value5)
768  ->default_value(0),
769  "value5")((prefix + ".moment_mx").c_str(),
770  po::value<double>(
771  &block_lists[it->getMeshsetId()].forceBc.data.value6)
772  ->default_value(0),
773  "value6")(
774  (prefix + ".moment_my").c_str(),
775  po::value<double>(
776  &block_lists[it->getMeshsetId()].forceBc.data.value7)
777  ->default_value(0),
778  "value7")((prefix + ".moment_mz").c_str(),
779  po::value<double>(
780  &block_lists[it->getMeshsetId()].forceBc.data.value8)
781  ->default_value(0),
782  "value8");
783  }
784  {
785  // char name[11]; //< 11 characters for "Temperature"
786  // char pre1; //< This is always zero
787  // char pre2; //< 0: temperature is not applied on thin shells
788  // (default); 1: temperature is applied on thin shells char flag1; //<
789  // 0: N/A, 1: temperature value applied (not on thin shells) char flag2;
790  // //< 0: N/A, 1: temperature applied on thin shell middle char flag3;
791  // //< 0: N/A, 1: thin shell temperature gradient specified char flag4;
792  // //< 0: N/A, 1: top thin shell temperature char flag5; //< 0: N/A, 1:
793  // bottom thin shell temperature char flag6; //< This is always zero
794  // double value1; //< Temperature (default case - no thin shells)
795  // double value2; //< Temperature for middle of thin shells
796  // double value3; //< Temperature gradient for thin shells
797  // double value4; //< Temperature for top of thin shells
798  // double value5; //< Temperature for bottom of thin shells
799  // double value6; //< This is always zero, i.e. ignore
800  configFileOptionsPtr->add_options()(
801  (prefix + ".temperature_flag1").c_str(),
802  po::value<char>(
803  &block_lists[it->getMeshsetId()].temperatureBc.data.flag1)
804  ->default_value(0),
805  "flag1")(
806  (prefix + ".temperature_t").c_str(),
807  po::value<double>(
808  &block_lists[it->getMeshsetId()].temperatureBc.data.value1)
809  ->default_value(0),
810  "value1");
811  // TODO: Add more cases, see above
812  }
813  // Sideset
814  {
815  // char name[8]; //< 8 characters for "Pressure"
816  // char zero; //< This is always zero
817  // char flag2; //< 0: Pressure is interpreted as pure pressure 1:
818  // pressure is interpreted as total force double value1; //< Pressure
819  // value
820  configFileOptionsPtr->add_options()(
821  (prefix + ".pressure_flag2").c_str(),
822  po::value<char>(
823  &block_lists[it->getMeshsetId()].pressureBc.data.flag2)
824  ->default_value(0),
825  "flag2")((prefix + ".pressure_magnitude").c_str(),
826  po::value<double>(
827  &block_lists[it->getMeshsetId()].pressureBc.data.value1)
828  ->default_value(0),
829  "value1");
830  }
831  {
832  // char name[8]; //< 8 characters for "HeatFlux" (no space)
833  // char pre1; //< This is always zero
834  // char pre2; //< 0: heat flux is not applied on thin shells (default);
835  // 1: heat flux is applied on thin shells char flag1; //< 0: N/A, 1:
836  // normal heat flux case (i.e. single value, case without thin shells)
837  // char flag2; //< 0: N/A, 1: Thin shell top heat flux specified
838  // char flag3; //< 0: N/A, 1: Thin shell bottom heat flux specidied
839  // double value1; //< Heat flux value for default case (no thin shells)
840  // double value2; //< Heat flux (thin shell top)
841  // double value3; //< Heat flux (thin shell bottom)
842  configFileOptionsPtr->add_options()(
843  (prefix + ".heatflux_flag1").c_str(),
844  po::value<char>(
845  &block_lists[it->getMeshsetId()].heatFluxBc.data.flag1)
846  ->default_value(0),
847  "flag1")((prefix + ".heatflux_magnitude").c_str(),
848  po::value<double>(
849  &block_lists[it->getMeshsetId()].heatFluxBc.data.value1)
850  ->default_value(0),
851  "value1");
852  }
853  // Interface set
854  {
855  configFileOptionsPtr->add_options()(
856  (prefix + ".interface_type").c_str(),
857  po::value<char>(&block_lists[it->getMeshsetId()].cfgBc.data.type)
858  ->default_value(0),
859  "type");
860  }
861  }
862  po::parsed_options parsed =
863  parse_config_file(ini_file, *configFileOptionsPtr, true);
864  store(parsed, vm);
865  po::notify(vm);
867 
868  CubitBCType bc_type;
869  unsigned jj = 0;
870  while (1 << jj != LASTSET_BC) {
871  if (string(CubitBCNames[jj + 1]) ==
872  block_lists[it->getMeshsetId()].addType) {
873  // cerr << CubitBCNames[jj+1] << " ";
874  bc_type = 1 << jj;
875  }
876  ++jj;
877  }
878  if (bc_type.none()) {
879  block_lists[it->getMeshsetId()].bcType = UNKNOWNSET;
880  // Skip the bockset nothing is defined for it
881  continue;
882  }
883 
884  if (bc_type.to_ulong() == BLOCKSET)
885  block_lists[it->getMeshsetId()].bcType = BLOCKSET;
886  else if (bc_type.to_ulong() == NODESET)
887  block_lists[it->getMeshsetId()].bcType = NODESET;
888  else if (bc_type.to_ulong() == SIDESET)
889  block_lists[it->getMeshsetId()].bcType = SIDESET;
890  else {
891  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
892  "Not yet implemented type %s\n",
893  block_lists[it->getMeshsetId()].addType.c_str());
894  }
895  if (block_lists[it->getMeshsetId()].iD == -1) {
896  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
897  "Unset iD number %d\n", block_lists[it->getMeshsetId()].iD);
898  }
899  }
900  std::vector<std::string> additional_parameters;
901  additional_parameters =
902  collect_unrecognized(parsed.options, po::include_positional);
903  for (std::vector<std::string>::iterator vit = additional_parameters.begin();
904  vit != additional_parameters.end(); vit++) {
905  CHKERR PetscPrintf(m_field.get_comm(),
906  "** WARNING Unrecognized option %s\n", vit->c_str());
907  }
908  for (map<int, BlockData>::iterator mit = block_lists.begin();
909  mit != block_lists.end(); mit++) {
910  CubitMeshSet_multiIndex::iterator cubit_meshset_it =
911  cubitMeshsets.find(mit->second.cubitMeshset);
912  if (cubit_meshset_it == cubitMeshsets.end()) {
913  SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
914  "Data inconsistency\n");
915  }
916  switch (mit->second.bcType) {
917  case UNKNOWNSET:
918  break;
919  case BLOCKSET: {
920  if ((CubitBCType(mit->second.bcType) & cubit_meshset_it->getBcType())
921  .any() &&
922  mit->second.iD == cubit_meshset_it->getMeshsetId()) {
923  // Meshset is the same, only modification
924  } else {
925  CHKERR addMeshset(mit->second.bcType, mit->second.iD, mit->second.nAme);
926  EntityHandle meshset = cubit_meshset_it->getMeshset();
927  CHKERR addEntitiesToMeshset(mit->second.bcType, mit->second.iD,
928  &meshset, 1);
929  }
930  // Add attributes
931  CHKERR setAtributes(mit->second.bcType, mit->second.iD, mit->second.aTtr);
932  // Add material elastic data if value are physical (i.e. Young > 0,
933  // Poisson in (-1.0.5) and ThermalExpansion>0)
934  if (mit->second.matElastic.data.Young != -1) {
935  CHKERR setAtributesByDataStructure(mit->second.bcType, mit->second.iD,
936  mit->second.matElastic);
937  }
938  if (mit->second.matThermal.data.Conductivity != -1) {
939  CHKERR setAtributesByDataStructure(mit->second.bcType, mit->second.iD,
940  mit->second.matThermal);
941  }
942  if (mit->second.matInterf.data.ft != -1) {
943  CHKERR setAtributesByDataStructure(mit->second.bcType, mit->second.iD,
944  mit->second.matInterf);
945  }
946  } break;
947  case NODESET: {
948  if ((CubitBCType(mit->second.bcType) & cubit_meshset_it->getBcType())
949  .any() &&
950  mit->second.iD == cubit_meshset_it->getMeshsetId()) {
951  // Meshset is the same, only modification
952  } else {
953  CHKERR addMeshset(mit->second.bcType, mit->second.iD);
954  EntityHandle meshset = cubit_meshset_it->getMeshset();
955  CHKERR addEntitiesToMeshset(mit->second.bcType, mit->second.iD,
956  &meshset, 1);
957  }
958  // Add displacement bc
959  if (mit->second.dispBc.data.flag1 || mit->second.dispBc.data.flag2 ||
960  mit->second.dispBc.data.flag3 || mit->second.dispBc.data.flag4 ||
961  mit->second.dispBc.data.flag5 || mit->second.dispBc.data.flag6) {
962  if (mit->second.dispBc.data.flag1 == '0')
963  mit->second.dispBc.data.flag1 = 0;
964  if (mit->second.dispBc.data.flag1 == 'N')
965  mit->second.dispBc.data.flag1 = 0;
966  if (mit->second.dispBc.data.flag1)
967  mit->second.dispBc.data.flag1 = 1;
968  if (mit->second.dispBc.data.flag2 == '0')
969  mit->second.dispBc.data.flag2 = 0;
970  if (mit->second.dispBc.data.flag2 == 'N')
971  mit->second.dispBc.data.flag2 = 0;
972  if (mit->second.dispBc.data.flag2)
973  mit->second.dispBc.data.flag2 = 1;
974  if (mit->second.dispBc.data.flag3 == '0')
975  mit->second.dispBc.data.flag3 = 0;
976  if (mit->second.dispBc.data.flag3 == 'N')
977  mit->second.dispBc.data.flag3 = 0;
978  if (mit->second.dispBc.data.flag3)
979  mit->second.dispBc.data.flag3 = 1;
980  if (mit->second.dispBc.data.flag4 == '0')
981  mit->second.dispBc.data.flag4 = 0;
982  if (mit->second.dispBc.data.flag4 == 'N')
983  mit->second.dispBc.data.flag4 = 0;
984  if (mit->second.dispBc.data.flag4)
985  mit->second.dispBc.data.flag4 = 1;
986  if (mit->second.dispBc.data.flag5 == '0')
987  mit->second.dispBc.data.flag5 = 0;
988  if (mit->second.dispBc.data.flag5 == 'N')
989  mit->second.dispBc.data.flag5 = 0;
990  if (mit->second.dispBc.data.flag5)
991  mit->second.dispBc.data.flag5 = 1;
992  if (mit->second.dispBc.data.flag6 == '0')
993  mit->second.dispBc.data.flag6 = 0;
994  if (mit->second.dispBc.data.flag6 == 'N')
995  mit->second.dispBc.data.flag6 = 0;
996  if (mit->second.dispBc.data.flag6)
997  mit->second.dispBc.data.flag6 = 1;
998  ierr =
999  setBcData(mit->second.bcType, mit->second.iD, mit->second.dispBc);
1000  CHKERRG(ierr);
1001  }
1002  if (mit->second.forceBc.data.value1 != 0 ||
1003  mit->second.forceBc.data.value2 != 0) {
1004  CHKERR setBcData(mit->second.bcType, mit->second.iD,
1005  mit->second.forceBc);
1006  }
1007  // Add temperature boundary condition
1008  if (mit->second.temperatureBc.data.flag1) {
1009  if (mit->second.temperatureBc.data.flag1 == '0')
1010  mit->second.temperatureBc.data.flag1 = 0;
1011  if (mit->second.temperatureBc.data.flag1 == 'N')
1012  mit->second.temperatureBc.data.flag1 = 0;
1013  if (mit->second.temperatureBc.data.flag1)
1014  mit->second.temperatureBc.data.flag1 = 1;
1015  CHKERR setBcData(mit->second.bcType, mit->second.iD,
1016  mit->second.temperatureBc);
1017  }
1018  } break;
1019  case SIDESET: {
1020  if ((CubitBCType(mit->second.bcType) & cubit_meshset_it->getBcType())
1021  .any() &&
1022  mit->second.iD == cubit_meshset_it->getMeshsetId()) {
1023  // Meshset is the same, only modification
1024  } else {
1025  CHKERR addMeshset(mit->second.bcType, mit->second.iD);
1026  EntityHandle meshset = cubit_meshset_it->getMeshset();
1027  CHKERR addEntitiesToMeshset(mit->second.bcType, mit->second.iD,
1028  &meshset, 1);
1029  }
1030  // Add pressure
1031  if (mit->second.pressureBc.data.value1 != 0) {
1032  if (mit->second.pressureBc.data.flag2 == '0')
1033  mit->second.pressureBc.data.flag2 = 0;
1034  if (mit->second.pressureBc.data.flag2 == 'N')
1035  mit->second.pressureBc.data.flag2 = 0;
1036  if (mit->second.pressureBc.data.flag2)
1037  mit->second.pressureBc.data.flag2 = 1;
1038  CHKERR setBcData(mit->second.bcType, mit->second.iD,
1039  mit->second.pressureBc);
1040  }
1041  // Add heat flux
1042  if (mit->second.heatFluxBc.data.value1 != 0) {
1043  if (mit->second.heatFluxBc.data.flag1 == '0')
1044  mit->second.heatFluxBc.data.flag1 = 0;
1045  if (mit->second.heatFluxBc.data.flag1 == 'N')
1046  mit->second.heatFluxBc.data.flag1 = 0;
1047  if (mit->second.heatFluxBc.data.flag1)
1048  mit->second.heatFluxBc.data.flag1 = 1;
1049  CHKERR setBcData(mit->second.bcType, mit->second.iD,
1050  mit->second.heatFluxBc);
1051  }
1052  // Add Interface
1053  if (mit->second.cfgBc.data.type != 0) {
1054  CHKERR setBcData(mit->second.bcType, mit->second.iD, mit->second.cfgBc);
1055  }
1056  } break;
1057  default:
1058  SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
1059  "Not yet implemented type\n");
1060  }
1061  }
1062 
1064 }
1065 
1067  Interface &m_field = cOre;
1068  // moab::Interface &moab = m_field.get_moab();
1069  PetscBool flg_file;
1070  char meshset_file_name[255];
1072  CHKERR PetscOptionsBegin(m_field.get_comm(), "", "Set meshsets form file",
1073  "none");
1074  CHKERR PetscOptionsString("-meshsets_config", "meshsets config file name",
1075  "", "add_cubit_meshsets.in", meshset_file_name, 255,
1076  &flg_file);
1077  if (flg_file == PETSC_TRUE) {
1078  ifstream f(meshset_file_name);
1079  if (!f.good()) {
1080  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
1081  "File configuring meshsets ( %s ) can not be open\n",
1082  meshset_file_name);
1083  }
1084  CHKERR setMeshsetFromFile(string(meshset_file_name));
1085  }
1086  ierr = PetscOptionsEnd();
1087  CHKERRG(ierr);
1089 }
1090 
1092  const int ms_id, const unsigned int cubit_bc_type,
1093  const std::string file_name, const std::string file_type,
1094  const std::string options) const {
1095 
1097  MoFEM::Interface &m_field = cOre;
1098  const CubitMeshSets *cubit_meshset_ptr;
1099  CHKERR getCubitMeshsetPtr(ms_id, cubit_bc_type, &cubit_meshset_ptr);
1100  EntityHandle meshset = cubit_meshset_ptr->getMeshset();
1101  CHKERR m_field.get_moab().write_file(file_name.c_str(), file_type.c_str(),
1102  options.c_str(), &meshset, 1, nullptr,
1103  0);
1105 }
1106 
1108  const int ms_id, const unsigned int cubit_bc_type, const int dim,
1109  const std::string file_name, const bool recursive,
1110  const std::string file_type, const std::string options) const {
1111 
1113  MoFEM::Interface &m_field = cOre;
1114  moab::Interface &moab = m_field.get_moab();
1115  Range entities;
1116  CHKERR getEntitiesByDimension(ms_id, cubit_bc_type, dim, entities, recursive);
1117  EntityHandle meshset;
1118  CHKERR moab.create_meshset(MESHSET_SET, meshset);
1119  CHKERR moab.add_entities(meshset, entities);
1120  CHKERR moab.write_file(file_name.c_str(), file_type.c_str(), options.c_str(),
1121  &meshset, 1, nullptr, 0);
1122  CHKERR moab.delete_entities(&meshset, 1);
1124 }
1125 
1130  for (_IT_CUBITMESHSETS_FOR_LOOP_((*this), iit)) {
1131  EntityHandle meshset = iit->getMeshset();
1132  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1133  MBVERTEX, true);
1134  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1135  MBEDGE, true);
1136  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1137  MBTRI, true);
1138  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1139  MBTET, true);
1140  CHKERR bit_mng->updateMeshsetByEntitiesChildren(meshset, bit, meshset,
1141  MBPRISM, true);
1142  }
1144 }
1145 
1146 } // namespace MoFEM
Generic bc data structure.
Definition: BCData.hpp:30
EntityHandle cubitMeshset
Definition of the temperature bc data structure.
Definition: BCData.hpp:311
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
MoFEM interface unique ID.
CubitMeshSet_multiIndex cubitMeshsets
cubit meshsets
static const MOFEMuuid IDD_MOFEMMeshsetsManager
block name is "MAT_MOISTURE"
Definition: definitions.h:226
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:501
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,...
base class for all interface classes
Elastic material data structure.
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:477
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:544
DisplacementCubitBcData dispBc
const CubitBCType tYpe
Type of boundary condition.
Definition: BCData.hpp:68
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:508
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'
Definition of the force bc data structure.
Definition: BCData.hpp:147
MoFEMErrorCode printBcSet(CUBIT_BC_DATA_TYPE &data, unsigned long int type) const
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:66
#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:224
Definition of the cfd_bc data structure.
Definition: BCData.hpp:466
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:207
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:596
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:222
Mat_Elastic matElastic
std::bitset< BITREFLEVEL_SIZE > BitRefLevel
Bit structure attached to each entity identifying to what mesh entity is attached.
Definition: Types.hpp:51
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:63
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:407
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:238
Definition of the heat flux bc data structure.
Definition: BCData.hpp:415
MoFEMErrorCode clearMap()
clear multi-index container
Definition of the pressure bc data structure.
Definition: BCData.hpp:367
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:183