v0.9.1
Classes | Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
MoFEM::MedInterface Struct Reference

Interface for load MED files. More...

#include <src/interfaces/MedInterface.hpp>

Inheritance diagram for MoFEM::MedInterface:
[legend]
Collaboration diagram for MoFEM::MedInterface:
[legend]

Classes

struct  FieldData
 

Public Member Functions

MoFEMErrorCode query_interface (const MOFEMuuid &uuid, UnknownInterface **iface) const
 
 MedInterface (const MoFEM::Core &core)
 
MoFEMErrorCode getFileNameFromCommandLine (int verb=1)
 Get MED file name from command line. More...
 
PetscBool getFlgFile () const
 Check if file name is given in command line. More...
 
MoFEMErrorCode medGetFieldNames (const string &file, int verb=1)
 Get field names in MED file. More...
 
MoFEMErrorCode medGetFieldNames (int verb=1)
 get field names in MED file More...
 
MoFEMErrorCode readMed (const string &file, int verb=1)
 read MED file More...
 
MoFEMErrorCode readMed (int verb=1)
 read MED file More...
 
MoFEMErrorCode writeMed (const string &file, int verb=1)
 write MED file More...
 
MoFEMErrorCode readFields (const std::string &file_name, const std::string &field_name, const bool load_series=false, const int only_step=-1, int verb=1)
 
- Public Member Functions inherited from MoFEM::UnknownInterface
template<class IFACE >
MoFEMErrorCode registerInterface (const MOFEMuuid &uuid, bool error_if_registration_failed=true)
 Register interface. More...
 
template<class IFACE , bool VERIFY = false>
MoFEMErrorCode getInterface (const MOFEMuuid &uuid, IFACE *&iface) const
 Get interface by uuid and return reference to pointer of interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE *&iface) const
 Get interface refernce to pointer of interface. More...
 
template<class IFACE >
MoFEMErrorCode getInterface (IFACE **const iface) const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_pointer< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get interface pointer to pointer of interface. More...
 
template<class IFACE , typename boost::enable_if< boost::is_reference< IFACE >, int >::type = 0>
IFACE getInterface () const
 Get reference to interface. More...
 
template<class IFACE >
IFACE * getInterface () const
 Function returning pointer to interface. More...
 
virtual ~UnknownInterface ()=default
 
virtual MoFEMErrorCode getLibVersion (Version &version) const
 Get library version. More...
 
virtual const MoFEMErrorCode getFileVersion (moab::Interface &moab, Version &version) const
 Get database major version. More...
 
virtual MoFEMErrorCode getInterfaceVersion (Version &version) const
 Get database major version. More...
 
template<>
MoFEMErrorCode getInterface (const MOFEMuuid &uuid, UnknownInterface *&iface) const
 

Public Attributes

std::vector< std::string > meshNames
 list of meshes in MED file More...
 
std::vector< EntityHandlemeshMeshsets
 meshset for each mesh More...
 
std::map< std::string, FieldDatafieldNames
 
std::string medFileName
 MED file name. More...
 

Private Member Functions

MoFEMErrorCode readMesh (const string &file, const int index, std::map< int, Range > &family_elem_map, int verb=1)
 read mesh from MED file More...
 
MoFEMErrorCode readFamily (const string &file, const int index, const std::map< int, Range > &family_elem_mapint, std::map< string, Range > &group_elem_map, int verb=1)
 read family and groups More...
 
MoFEMErrorCode makeBlockSets (const std::map< string, Range > &group_elem_map, int verb=1)
 make from groups meshsets More...
 

Private Attributes

MoFEM::CorecOre
 core database More...
 
PetscBool flgFile
 true if file name given in command line More...
 

Additional Inherited Members

- Protected Member Functions inherited from MoFEM::UnknownInterface
boost::typeindex::type_index getClassIdx (const MOFEMuuid &uid) const
 Get type name for interface Id. More...
 
MOFEMuuid getUId (const boost::typeindex::type_index &class_idx) const
 Get interface Id for class name. More...
 

Detailed Description

Interface for load MED files.

Definition at line 36 of file MedInterface.hpp.

Constructor & Destructor Documentation

◆ MedInterface()

MoFEM::MedInterface::MedInterface ( const MoFEM::Core core)

Definition at line 62 of file MedInterface.cpp.

63  : cOre(const_cast<Core &>(core)), flgFile(PETSC_FALSE) {}
MoFEM::Core & cOre
core database
PetscBool flgFile
true if file name given in command line

Member Function Documentation

◆ getFileNameFromCommandLine()

MoFEMErrorCode MoFEM::MedInterface::getFileNameFromCommandLine ( int  verb = 1)

Get MED file name from command line.

Parameters
verbverbosity level
Returns
error code

Definition at line 65 of file MedInterface.cpp.

65  {
66  Interface &m_field = cOre;
67  char mesh_file_name[255];
69  ierr = PetscOptionsBegin(m_field.get_comm(), "", "MED Interface", "none");
70  CHKERRG(ierr);
71  ierr = PetscOptionsString("-med_file", "med file name", "", "mesh.med",
72  mesh_file_name, 255, &flgFile);
73  CHKERRG(ierr);
74  ierr = PetscOptionsEnd();
75  CHKERRG(ierr);
76  if (flgFile == PETSC_TRUE) {
77  medFileName = std::string(mesh_file_name);
78  } else {
79  medFileName = std::string("mesh.med");
80  }
82 }
MoFEM::Core & cOre
core database
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:506
#define CHKERRG(n)
Check error code of MoFEM/MOAB/PETSc function.
Definition: definitions.h:549
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:513
char mesh_file_name[255]
PetscBool flgFile
true if file name given in command line
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1791
std::string medFileName
MED file name.

◆ getFlgFile()

PetscBool MoFEM::MedInterface::getFlgFile ( ) const

Check if file name is given in command line.

Definition at line 52 of file MedInterface.hpp.

52 { return flgFile; }
PetscBool flgFile
true if file name given in command line

◆ makeBlockSets()

MoFEMErrorCode MoFEM::MedInterface::makeBlockSets ( const std::map< string, Range > &  group_elem_map,
int  verb = 1 
)
private

make from groups meshsets

Parameters
group_elem_mapmap of groups and elements
verbverbosity level
Returns
error code

Definition at line 594 of file MedInterface.cpp.

595  {
596 
597  Interface &m_field = cOre;
599  MeshsetsManager *meshsets_manager_ptr;
600  CHKERR m_field.getInterface(meshsets_manager_ptr);
601 
602  int max_id = 0;
604  max_id = (max_id < cit->getMeshsetId()) ? cit->getMeshsetId() : max_id;
605  }
606  max_id++;
607 
608  // cerr << group_elem_map.size() << endl;
609  for (std::map<string, Range>::const_iterator git = group_elem_map.begin();
610  git != group_elem_map.end(); git++) {
611  // cerr << "AAA\n";
612  CHKERR meshsets_manager_ptr->addMeshset(BLOCKSET, max_id, git->first);
613  CubitMeshSet_multiIndex::index<
614  Composite_Cubit_msId_And_MeshSetType_mi_tag>::type::iterator cit;
615  cit =
616  meshsets_manager_ptr->getMeshsetsMultindex()
617  .get<Composite_Cubit_msId_And_MeshSetType_mi_tag>()
618  .find(boost::make_tuple(max_id, CubitBCType(BLOCKSET).to_ulong()));
619  EntityHandle meshsets = cit->getMeshset();
620  if (!git->second.empty()) {
621  CHKERR m_field.get_moab().add_entities(meshsets, git->second);
622  }
623  max_id++;
624  // cerr << git->second << endl;
625  }
626 
627  // if(verb>0) {
629  PetscPrintf(
630  m_field.get_comm(), "%s\n",
631  static_cast<std::ostringstream &>(std::ostringstream().seekp(0) << *cit)
632  .str()
633  .c_str());
634  }
635  // }
636 
638 }
MoFEM::Core & cOre
core database
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:482
#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:601
std::bitset< 32 > CubitBCType
Definition: Types.hpp:62
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1791
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:412

◆ medGetFieldNames() [1/2]

MoFEMErrorCode MoFEM::MedInterface::medGetFieldNames ( const string &  file,
int  verb = 1 
)

Get field names in MED file.

Parameters
filefile name
verbverbosity level
Returns
error code

Definition at line 84 of file MedInterface.cpp.

84  {
85  Interface &m_field = cOre;
87  med_idt fid = MEDfileOpen(file.c_str(), MED_ACC_RDONLY);
88  if (fid < 0) {
89  SETERRQ1(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
90  "Unable to open file '%s'", file.c_str());
91  }
92  med_int num_fields = MEDnField(fid);
93  for (int index = 0; index < num_fields; index++) {
94 
95  med_int num_comp = MEDfieldnComponent(fid, index + 1);
96  if (num_comp <= 0) {
97  SETERRQ(m_field.get_comm(), MOFEM_IMPOSIBLE_CASE,
98  "Could not get number of components for MED field");
99  }
100 
101  char name[MED_NAME_SIZE + 1], mesh_name[MED_NAME_SIZE + 1];
102  char dt_unit[MED_SNAME_SIZE + 1];
103  std::vector<char> comp_name(num_comp * MED_SNAME_SIZE + 1);
104  std::vector<char> comp_unit(num_comp * MED_SNAME_SIZE + 1);
105  med_int num_steps = 0;
106  med_type_champ type;
107  med_bool local_mesh;
108  if (MEDfieldInfo(fid, index + 1, name, mesh_name, &local_mesh, &type,
109  &comp_name[0], &comp_unit[0], dt_unit, &num_steps) < 0) {
110  SETERRQ(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
111  "Could not get MED field info");
112  }
113 
114  std::string field_name = std::string(name);
115  fieldNames[field_name] = FieldData();
116  fieldNames[field_name].fieldName = field_name;
117  fieldNames[field_name].meshName = std::string(mesh_name);
118  fieldNames[field_name].localMesh = (local_mesh == MED_TRUE);
119  for (int ff = 0; ff != num_comp; ff++) {
120  fieldNames[field_name].componentNames.push_back(
121  std::string(&comp_name[ff * MED_SNAME_SIZE], MED_SNAME_SIZE));
122  fieldNames[field_name].componentUnits.push_back(
123  std::string(&comp_unit[ff * MED_SNAME_SIZE], MED_SNAME_SIZE));
124  }
125  fieldNames[field_name].dtUnit = std::string(&dt_unit[0]);
126  fieldNames[field_name].ncSteps = num_steps;
127 
128  if (verb > 0) {
129  std::ostringstream ss;
130  ss << fieldNames[name] << std::endl;
131  CHKERR PetscPrintf(m_field.get_comm(), ss.str().c_str());
132  }
133  }
134  if (MEDfileClose(fid) < 0) {
135  SETERRQ1(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
136  "Unable to close file '%s'", file.c_str());
137  }
139 }
std::map< std::string, FieldData > fieldNames
MoFEM::Core & cOre
core database
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:482
#define CHKERR
Inline error check.
Definition: definitions.h:601
double FieldData
Field data type.
Definition: Types.hpp:36
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1791
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:412

◆ medGetFieldNames() [2/2]

MoFEMErrorCode MoFEM::MedInterface::medGetFieldNames ( int  verb = 1)

get field names in MED file

File name is get form command line

Parameters
verbverbosity level
Returns
error code

Definition at line 141 of file MedInterface.cpp.

141  {
143  if (medFileName.empty()) {
145  }
148 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:482
MoFEMErrorCode getFileNameFromCommandLine(int verb=1)
Get MED file name from command line.
#define CHKERR
Inline error check.
Definition: definitions.h:601
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:412
MoFEMErrorCode medGetFieldNames(const string &file, int verb=1)
Get field names in MED file.
std::string medFileName
MED file name.

◆ query_interface()

MoFEMErrorCode MoFEM::MedInterface::query_interface ( const MOFEMuuid uuid,
UnknownInterface **  iface 
) const
virtual

Implements MoFEM::UnknownInterface.

Definition at line 50 of file MedInterface.cpp.

51  {
53  *iface = NULL;
54  if (uuid == IDD_MOFEMMedInterface) {
55  *iface = const_cast<MedInterface *>(this);
57  }
58  SETERRQ(PETSC_COMM_SELF, MOFEM_DATA_INCONSISTENCY, "unknown interface");
60 }
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:506
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:513
static const MOFEMuuid IDD_MOFEMMedInterface

◆ readFamily()

MoFEMErrorCode MoFEM::MedInterface::readFamily ( const string &  file,
const int  index,
const std::map< int, Range > &  family_elem_mapint,
std::map< string, Range > &  group_elem_map,
int  verb = 1 
)
private

read family and groups

Parameters
filefile name
indexmesh index
family_elem_mapintmap of families and elements
group_elem_mapmap of groups and elements
verbverbosity level
Returns
error code

Definition at line 497 of file MedInterface.cpp.

499  {
500  //
501  Interface &m_field = cOre;
503 
504  med_idt fid = MEDfileOpen(file.c_str(), MED_ACC_RDONLY);
505  if (fid < 0) {
506  SETERRQ1(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
507  "Unable to open file '%s'", file.c_str());
508  }
509  med_int v[3], vf[3];
510  MEDlibraryNumVersion(&v[0], &v[1], &v[2]);
511  MEDfileNumVersionRd(fid, &vf[0], &vf[1], &vf[2]);
512  // if(verb>1) {
513  // PetscPrintf(
514  // m_field.get_comm(),
515  // "Reading MED file V%d.%d.%d using MED library V%d.%d.%d\n",
516  // vf[0], vf[1], vf[2], v[0], v[1], v[2]
517  // );
518  // }
519  if (vf[0] < 2 || (vf[0] == 2 && vf[1] < 2)) {
520  SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
521  "Cannot read MED file older than V2.2");
522  }
523 
524  // clear groups
525  group_elem_map.clear();
526 
527  med_int num_families = MEDnFamily(fid, meshNames[index].c_str());
528  if (num_families < 0) {
529  SETERRQ(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
530  "Could not read MED families");
531  }
532  for (int i = 0; i < num_families; i++) {
533  med_int num_attrib =
534  (vf[0] == 2)
535  ? MEDnFamily23Attribute(fid, meshNames[index].c_str(), i + 1)
536  : 0;
537  med_int num_groups = MEDnFamilyGroup(fid, meshNames[index].c_str(), i + 1);
538  if (num_attrib < 0 || num_groups < 0) {
539  SETERRQ(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
540  "Could not read MED groups or attributes");
541  }
542 
543  std::vector<med_int> attribId(num_attrib + 1);
544  std::vector<med_int> attrib_val(num_attrib + 1);
545  std::vector<char> attrib_des(MED_COMMENT_SIZE * num_attrib + 1);
546  std::vector<char> group_names(MED_LNAME_SIZE * num_groups + 1);
547  char family_name[MED_NAME_SIZE + 1];
548  med_int family_num;
549 
550  if (vf[0] == 2) { // MED2 file
551  if (MEDfamily23Info(fid, meshNames[index].c_str(), i + 1, family_name,
552  &attribId[0], &attrib_val[0], &attrib_des[0],
553  &family_num, &group_names[0]) < 0) {
554  SETERRQ1(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
555  "Could not read info for MED2 family %d", i + 1);
556  }
557  } else {
558  if (MEDfamilyInfo(fid, meshNames[index].c_str(), i + 1, family_name,
559  &family_num, &group_names[0]) < 0) {
560  SETERRQ1(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
561  "Could not read info for MED3 family %d", i + 1);
562  }
563  }
564 
565  // cerr << family_name << " " << family_num << " " << num_groups << endl;
566  for (int g = 0; g != num_groups; g++) {
567  std::string name =
568  std::string(&group_names[MED_LNAME_SIZE * g], MED_LNAME_SIZE - 1);
569  name.resize(NAME_TAG_SIZE - 1);
570  if (family_elem_map.find(family_num) == family_elem_map.end()) {
571  PetscPrintf(
572  PETSC_COMM_SELF,
573  "Warring: \n Family %d not read, likely type of element is not "
574  "added "
575  "to moab database. Currently only triangle, quad, tetrahedral and "
576  "hexahedral elements are read to moab database\n",
577  family_num);
578  } else {
579  group_elem_map[name].merge(family_elem_map.at(family_num));
580  // cerr << string(&group_names[MED_LNAME_SIZE*g]) << endl;
581  }
582  }
583  }
584 
585  if (MEDfileClose(fid) < 0) {
586  SETERRQ1(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
587  "Unable to close file '%s'", file.c_str());
588  }
589 
591 }
MoFEM::Core & cOre
core database
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:482
std::vector< std::string > meshNames
list of meshes in MED file
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1791
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:412
FTensor::Index< 'i', 2 > i
[Common data]
Definition: ContactOps.hpp:26

◆ readFields()

MoFEMErrorCode MoFEM::MedInterface::readFields ( const std::string &  file_name,
const std::string &  field_name,
const bool  load_series = false,
const int  only_step = -1,
int  verb = 1 
)

Read fields

Parameters
file_namefile name
file_indexmesh index
loadSeriesload field into series
onlyStepread only one step
Returns
error code

Definition at line 656 of file MedInterface.cpp.

659  {
660 
661  Interface &m_field = cOre;
663  med_idt fid = MEDfileOpen((char *)file_name.c_str(), MED_LECTURE);
664  if (fid < 0) {
665  SETERRQ1(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
666  "Unable to open file '%s'", file_name.c_str());
667  }
668 
669  med_int num_comp = MEDfieldnComponentByName(fid, field_name.c_str());
670  if (num_comp <= 0) {
671  SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
672  "Could not get number of components for MED field");
673  }
674 
675  char meshName[MED_NAME_SIZE + 1];
676  char dtUnit[MED_SNAME_SIZE + 1];
677  std::vector<char> compName(num_comp * MED_SNAME_SIZE + 1);
678  std::vector<char> compUnit(num_comp * MED_SNAME_SIZE + 1);
679  med_int numSteps = 0;
680  med_type_champ type;
681  med_bool localMesh;
682  if (MEDfieldInfoByName(fid, field_name.c_str(), meshName, &localMesh, &type,
683  &compName[0], &compUnit[0], dtUnit, &numSteps) < 0) {
684  SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
685  "Could not get MED field info");
686  }
687 
688  // Get meshset
689  MeshsetsManager *meshsets_manager_ptr;
690  CHKERR m_field.getInterface(meshsets_manager_ptr);
691  const CubitMeshSets *cubit_meshset_ptr;
692  CHKERR meshsets_manager_ptr->getCubitMeshsetPtr(meshName, &cubit_meshset_ptr);
693  EntityHandle meshset = cubit_meshset_ptr->getMeshset();
694 
695  int num_comp_msh = (num_comp <= 1)
696  ? 1
697  : (num_comp <= 3) ? 3 : (num_comp <= 9) ? 9 : num_comp;
698 
699  // Create tag to store nodal or cell values read form med file. Note that tag
700  // has prefix MED to avoid collison with other tags.
701  Tag th;
702  std::string tag_name = "MED_" + field_name;
703  {
704  std::vector<double> def_val(num_comp_msh, 0);
705  CHKERR m_field.get_moab().tag_get_handle(
706  tag_name.c_str(), num_comp_msh, MB_TYPE_DOUBLE, th,
707  MB_TAG_CREAT | MB_TAG_SPARSE, &def_val[0]);
708  }
709 
710  // Warning! The ordering of the elements in the last two lists is
711  // important: it should match the ordering of the MSH element types
712  // (when elements are saved without tags, this governs the order
713  // with which we implicitly index them in GModel::readMED)
714  const med_entity_type entType[] = {MED_NODE, MED_CELL, MED_NODE_ELEMENT};
715  const med_geometrie_element eleType[] = {
716  MED_NONE, MED_SEG2, MED_TRIA3, MED_QUAD4, MED_TETRA4, MED_HEXA8,
717  MED_PENTA6, MED_PYRA5, MED_SEG3, MED_TRIA6, MED_QUAD9, MED_TETRA10,
718  MED_HEXA27, MED_POINT1, MED_QUAD8, MED_HEXA20, MED_PENTA15, MED_PYRA13};
719  // const int nodesPerEle[] = {0, 2, 3, 4, 4, 8, 6, 5, 3, 6, 9, 10, 27, 1, 8,
720  // 20, 15, 13};
721 
722  std::vector<std::pair<int, int>> pairs;
723  for (unsigned int i = 0; i < sizeof(entType) / sizeof(entType[0]); i++) {
724  for (unsigned int j = 0; j < sizeof(eleType) / sizeof(eleType[0]); j++) {
725  if ((!i && !j) || j) {
726  med_int n = numSteps;
727  if (n > 0) {
728  pairs.push_back(std::pair<int, int>(i, j));
729  numSteps = std::max(numSteps, n);
730  }
731  if (!i && !j)
732  break; // MED_NOEUD does not care about eleType
733  }
734  }
735  }
736 
737  if (numSteps < 1 || pairs.empty()) {
738  SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
739  "Nothing to import from MED file");
740  }
741 
742  if (load_series) {
743  SETERRQ(m_field.get_comm(), MOFEM_NOT_IMPLEMENTED, "Not yet implemented");
744  }
745 
746  for (int step = (only_step == -1) ? 0 : only_step; step < numSteps; step++) {
747 
748  if (!load_series && only_step != step)
749  continue;
750 
751  // cerr << only_step << " " << step << endl;
752 
753  // FIXME: in MED3 we might want to loop over all profiles instead
754  // of relying of the default one
755 
756  // FIXME: MED3 allows to store multi-step meshes; we should
757 
758  for (unsigned int pair = 0; pair < pairs.size(); pair++) {
759 
760  // get step info
761  med_entite_maillage ent = entType[pairs[pair].first];
762  med_geometrie_element ele = eleType[pairs[pair].second];
763  med_int numdt, numit, ngauss;
764  med_float dt;
765  if (MEDfieldComputingStepInfo(fid, field_name.c_str(), step + 1, &numdt,
766  &numit, &dt) < 0) {
767  SETERRQ(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
768  "Could not read step info");
769  }
770 
771  char locName[MED_NAME_SIZE + 1], profileName[MED_NAME_SIZE + 1];
772 
773  // get number of values in the field (numVal takes the number of
774  // Gauss points or the number of nodes per element into account,
775  // but not the number of components)
776  med_int profileSize;
777  med_int numVal = MEDfieldnValueWithProfile(
778  fid, field_name.c_str(), numdt, numit, ent, ele, 1,
779  MED_COMPACT_STMODE, profileName, &profileSize, locName, &ngauss);
780  numVal *= ngauss;
781 
782  if (numVal <= 0)
783  continue;
784 
785  // int mult = 1;
786  // if(ent == MED_NODE_ELEMENT) {
787  // mult = nodesPerEle[pairs[pair].second];
788  //}
789  // else if(ngauss != 1){
790  // mult = ngauss;
791  //}
792 
793  // read field data
794  std::vector<double> val(numVal * num_comp);
795  if (MEDfieldValueWithProfileRd(fid, field_name.c_str(), numdt, numit, ent,
796  ele, MED_COMPACT_STMODE, profileName,
797  MED_FULL_INTERLACE, MED_ALL_CONSTITUENT,
798  (unsigned char *)&val[0]) < 0) {
799  SETERRQ(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
800  "Could not read field values");
801  }
802 
803  if (verb > 2) {
804  // FIXME: This not looks ok for me
805  cerr << ent << " " << ele << endl;
806  cerr << string(meshName) << " : " << string(profileName) << " : "
807  << string(locName) << " : " << profileSize << " : " << ngauss
808  << endl;
809  }
810 
811  switch (ent) {
812  case MED_CELL: {
813  EntityType ent_type = MBMAXTYPE;
814  switch (ele) {
815  case MED_TETRA4:
816  case MED_TETRA10:
817  ent_type = MBTET;
818  break;
819  case MED_HEXA8:
820  ent_type = MBHEX;
821  break;
822  default:
823  PetscPrintf(PETSC_COMM_SELF,
824  "Warring:\n Not yet implemented for this cell %d\n", ele);
825  }
826  if (ent_type != MBMAXTYPE) {
827  if (ngauss == 1) {
828  Range ents;
829  CHKERR m_field.get_moab().get_entities_by_type(meshset, ent_type,
830  ents, true);
831  double e_vals[num_comp_msh];
832  bzero(e_vals, sizeof(double) * num_comp_msh);
833  std::vector<double>::iterator vit = val.begin();
834  for (Range::iterator eit = ents.begin(); eit != ents.end(); eit++) {
835  for (int ii = 0; ii != num_comp; ii++, vit++) {
836  e_vals[ii] = *vit;
837  }
838  CHKERR m_field.get_moab().tag_set_data(th, &*eit, 1, e_vals);
839  }
840  } else {
841  Range ents;
842  CHKERR m_field.get_moab().get_entities_by_type(meshset, ent_type,
843  ents, true);
844  if (ents.size() * ngauss * num_comp != val.size()) {
845  SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
846  "data inconsistency");
847  }
848  // FIXME simply average gauss values, far from perfect need fix
849  double e_vals[num_comp_msh];
850  std::vector<double>::iterator vit = val.begin();
851  for (Range::iterator eit = ents.begin(); eit != ents.end(); eit++) {
852  bzero(e_vals, sizeof(double) * num_comp_msh);
853  for (int gg = 0; gg != ngauss; gg++) {
854  for (int ii = 0; ii != num_comp; ii++, vit++) {
855  e_vals[ii] += *vit / ngauss;
856  }
857  }
858  CHKERR m_field.get_moab().tag_set_data(th, &*eit, 1, e_vals);
859  }
860  }
861  }
862  // SETERRQ1(
863  // m_field.get_comm(),
864  // MOFEM_NOT_IMPLEMENTED,
865  // "Not implemented for more gauss pts ngauss = %d",
866  // ngauss
867  // );
868  } break;
869  case MED_NODE:
870  case MED_NODE_ELEMENT:
871  default:
872  PetscPrintf(PETSC_COMM_SELF,
873  "Warning: \n Entity type %d not implemented\n", ent);
874  }
875  }
876  }
877 
879 }
MoFEM::Core & cOre
core database
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:506
FTensor::Index< 'n', 2 > n
Definition: PlasticOps.hpp:68
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:513
#define CHKERR
Inline error check.
Definition: definitions.h:601
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1791
FTensor::Index< 'j', 2 > j
Definition: ContactOps.hpp:27
FTensor::Index< 'i', 2 > i
[Common data]
Definition: ContactOps.hpp:26

◆ readMed() [1/2]

MoFEMErrorCode MoFEM::MedInterface::readMed ( const string &  file,
int  verb = 1 
)

read MED file

Parameters
filefiled name
verbverbosity level
Returns
error code

Definition at line 150 of file MedInterface.cpp.

150  {
151  Interface &m_field = cOre;
153 
154  med_idt fid = MEDfileOpen(file.c_str(), MED_ACC_RDONLY);
155  if (fid < 0) {
156  SETERRQ1(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
157  "Unable to open file '%s'", file.c_str());
158  }
159 
160  med_int v[3], vf[3];
161  MEDlibraryNumVersion(&v[0], &v[1], &v[2]);
162  MEDfileNumVersionRd(fid, &vf[0], &vf[1], &vf[2]);
163 
164  if (verb > 0) {
165  PetscPrintf(m_field.get_comm(),
166  "Reading MED file V%d.%d.%d using MED library V%d.%d.%d\n",
167  vf[0], vf[1], vf[2], v[0], v[1], v[2]);
168  }
169  if (vf[0] < 2 || (vf[0] == 2 && vf[1] < 2)) {
170  SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
171  "Cannot read MED file older than V2.2");
172  }
173 
174  for (int i = 0; i < MEDnMesh(fid); i++) {
175  char mesh_name[MED_NAME_SIZE + 1], mesh_desc[MED_COMMENT_SIZE + 1];
176  bzero(mesh_name, MED_NAME_SIZE);
177  bzero(mesh_desc, MED_COMMENT_SIZE);
178  med_int space_dim;
179  med_mesh_type mesh_type;
180  med_int mesh_dim, n_step;
181  char dt_unit[MED_SNAME_SIZE + 1];
182  char axis_name[3 * MED_SNAME_SIZE + 1], axis_unit[3 * MED_SNAME_SIZE + 1];
183  med_sorting_type sorting_type;
184  med_axis_type axis_type;
185  if (MEDmeshInfo(fid, i + 1, mesh_name, &space_dim, &mesh_dim, &mesh_type,
186  mesh_desc, dt_unit, &sorting_type, &n_step, &axis_type,
187  axis_name, axis_unit) < 0) {
188  SETERRQ(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
189  "Unable to read mesh information");
190  }
191  meshNames.push_back(std::string(mesh_name));
192  if (verb > 0) {
193  PetscPrintf(m_field.get_comm(), "Check mesh %s nsteps %d\n", mesh_name,
194  n_step);
195  }
196  }
197 
198  std::map<int, Range> family_elem_map;
199  std::map<string, Range> group_elem_map;
200 
201  for (unsigned int ii = 0; ii != meshNames.size(); ii++) {
202  CHKERR readMesh(file, ii, family_elem_map, verb);
203  CHKERR readFamily(file, ii, family_elem_map, group_elem_map, verb);
204  CHKERR makeBlockSets(group_elem_map, verb);
205  }
206 
207  if (MEDfileClose(fid) < 0) {
208  SETERRQ1(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
209  "Unable to close file '%s'", file.c_str());
210  }
211 
213 }
MoFEMErrorCode makeBlockSets(const std::map< string, Range > &group_elem_map, int verb=1)
make from groups meshsets
MoFEMErrorCode readMesh(const string &file, const int index, std::map< int, Range > &family_elem_map, int verb=1)
read mesh from MED file
MoFEM::Core & cOre
core database
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:482
MoFEMErrorCode readFamily(const string &file, const int index, const std::map< int, Range > &family_elem_mapint, std::map< string, Range > &group_elem_map, int verb=1)
read family and groups
std::vector< std::string > meshNames
list of meshes in MED file
#define CHKERR
Inline error check.
Definition: definitions.h:601
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1791
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:412
FTensor::Index< 'i', 2 > i
[Common data]
Definition: ContactOps.hpp:26

◆ readMed() [2/2]

MoFEMErrorCode MoFEM::MedInterface::readMed ( int  verb = 1)

read MED file

File name is form command line

Parameters
verbverbosity level
Returns
error code

Definition at line 640 of file MedInterface.cpp.

640  {
642  if (medFileName.empty()) {
644  }
645  CHKERR readMed(medFileName, verb);
647 }
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:482
MoFEMErrorCode getFileNameFromCommandLine(int verb=1)
Get MED file name from command line.
MoFEMErrorCode readMed(const string &file, int verb=1)
read MED file
#define CHKERR
Inline error check.
Definition: definitions.h:601
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:412
std::string medFileName
MED file name.

◆ readMesh()

MoFEMErrorCode MoFEM::MedInterface::readMesh ( const string &  file,
const int  index,
std::map< int, Range > &  family_elem_map,
int  verb = 1 
)
private

read mesh from MED file

Parameters
filefile name
indexindex of mesh
family_elem_mapmap of families and elements
verbverbosity level
Returns
error code

Definition at line 238 of file MedInterface.cpp.

240  {
241 
242  Interface &m_field = cOre;
244 
245  med_idt fid = MEDfileOpen(file.c_str(), MED_ACC_RDONLY);
246  if (fid < 0) {
247  SETERRQ1(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
248  "Unable to open file '%s'", file.c_str());
249  }
250  med_int v[3], vf[3];
251  MEDlibraryNumVersion(&v[0], &v[1], &v[2]);
252  MEDfileNumVersionRd(fid, &vf[0], &vf[1], &vf[2]);
253  // if(verb>1) {
254  // PetscPrintf(
255  // m_field.get_comm(),
256  // "Reading MED file V%d.%d.%d using MED library V%d.%d.%d\n",
257  // vf[0], vf[1], vf[2], v[0], v[1], v[2]
258  // );
259  // }
260  if (vf[0] < 2 || (vf[0] == 2 && vf[1] < 2)) {
261  SETERRQ(m_field.get_comm(), MOFEM_DATA_INCONSISTENCY,
262  "Cannot read MED file older than V2.2");
263  }
264 
265  char mesh_name[MED_NAME_SIZE + 1], mesh_desc[MED_COMMENT_SIZE + 1];
266  bzero(mesh_name, MED_NAME_SIZE + 1);
267  bzero(mesh_desc, MED_COMMENT_SIZE + 1);
268  med_int space_dim;
269  med_mesh_type mesh_type;
270  med_int mesh_dim, n_step;
271  char dt_unit[MED_SNAME_SIZE + 1];
272  char axis_name[3 * MED_SNAME_SIZE + 1], axis_unit[3 * MED_SNAME_SIZE + 1];
273  med_sorting_type sorting_type;
274  med_axis_type axis_type;
275  if (MEDmeshInfo(fid, index + 1, mesh_name, &space_dim, &mesh_dim, &mesh_type,
276  mesh_desc, dt_unit, &sorting_type, &n_step, &axis_type,
277  axis_name, axis_unit) < 0) {
278  SETERRQ(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
279  "Unable to read mesh information");
280  }
281  if (verb > 0) {
282  PetscPrintf(m_field.get_comm(), "Reading mesh %s nsteps %d\n", mesh_name,
283  n_step);
284  }
285 
286  switch (axis_type) {
287  case MED_CARTESIAN:
288  break;
289  case MED_SPHERICAL:
290  case MED_CYLINDRICAL:
291  default:
292  SETERRQ(m_field.get_comm(), MOFEM_NOT_IMPLEMENTED,
293  "Curvilinear coordinate system implemented");
294  }
295  if (space_dim < 2) {
296  SETERRQ1(m_field.get_comm(), MOFEM_NOT_IMPLEMENTED,
297  "Not implemented for space dim %d", space_dim);
298  }
299 
300  EntityHandle mesh_meshset;
301  {
302  MeshsetsManager *meshsets_manager_ptr;
303  CHKERR m_field.getInterface(meshsets_manager_ptr);
304  int max_id = 0;
306  max_id = (max_id < cit->getMeshsetId()) ? cit->getMeshsetId() : max_id;
307  }
308  max_id++;
309  CHKERR meshsets_manager_ptr->addMeshset(BLOCKSET, max_id,
310  std::string(mesh_name));
311  CubitMeshSet_multiIndex::index<
312  Composite_Cubit_msId_And_MeshSetType_mi_tag>::type::iterator cit;
313  cit =
314  meshsets_manager_ptr->getMeshsetsMultindex()
315  .get<Composite_Cubit_msId_And_MeshSetType_mi_tag>()
316  .find(boost::make_tuple(max_id, CubitBCType(BLOCKSET).to_ulong()));
317  max_id++;
318  mesh_meshset = cit->getMeshset();
319  meshMeshsets.push_back(mesh_meshset);
320  }
321 
322  med_bool change_of_coord, geo_transform;
323  med_int num_nodes = MEDmeshnEntity(
324  fid, mesh_name, MED_NO_DT, MED_NO_IT, MED_NODE, MED_NO_GEOTYPE,
325  MED_COORDINATE, MED_NO_CMODE, &change_of_coord, &geo_transform);
326  if (num_nodes < 0) {
327  SETERRQ(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
328  "Could not read number of MED nodes");
329  }
330  if (num_nodes == 0) {
331  SETERRQ(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
332  "No nodes in MED mesh");
333  }
334  if (verb > 0) {
335  PetscPrintf(m_field.get_comm(), "Read number of nodes %d\n", num_nodes);
336  }
337 
338  std::vector<med_float> coord_med(space_dim * num_nodes);
339  if (MEDmeshNodeCoordinateRd(fid, mesh_name, MED_NO_DT, MED_NO_IT,
340  MED_NO_INTERLACE, &coord_med[0]) < 0) {
341  SETERRQ(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
342  "Could not read MED node coordinates");
343  }
344 
345  // Add vertices to moab
346  ReadUtilIface *iface;
347  vector<double *> arrays_coord;
348  EntityHandle startv;
349  CHKERR m_field.get_moab().query_interface(iface);
350  CHKERR iface->get_node_coords(3, num_nodes, 0, startv, arrays_coord);
351  Range verts(startv, startv + num_nodes - 1);
352  std::copy(&coord_med[0 * num_nodes], &coord_med[1 * num_nodes],
353  arrays_coord[0]);
354  std::copy(&coord_med[1 * num_nodes], &coord_med[2 * num_nodes],
355  arrays_coord[1]);
356  if (space_dim == 2) {
357  std::fill(arrays_coord[2], &arrays_coord[2][num_nodes], 0.);
358  } else {
359  std::copy(&coord_med[2 * num_nodes], &coord_med[3 * num_nodes],
360  arrays_coord[2]);
361  }
362  CHKERR m_field.get_moab().add_entities(mesh_meshset, verts);
363  family_elem_map.clear();
364 
365  // get family for vertices
366  {
367  std::vector<med_int> nodes_tags(num_nodes, 0);
368  if (MEDmeshEntityFamilyNumberRd(fid, mesh_name, MED_NO_DT, MED_NO_IT,
369  MED_NODE, MED_NO_GEOTYPE,
370  &nodes_tags[0]) < 0) {
371  nodes_tags.clear();
372  // SETERRQ(
373  // m_field.get_comm(),
374  // MOFEM_OPERATION_UNSUCCESSFUL,
375  // "No family number for elements: using 0 as default family number"
376  // );
377  }
378  for (int i = 0; i < num_nodes; i++) {
379  // cerr << verts[i] << " " /*<< ele_tags[j] << " "*/ << nodes_tags[i] <<
380  // endl;
381  family_elem_map[nodes_tags.empty() ? i : nodes_tags[i]].insert(verts[i]);
382  }
383  }
384 
385  // read elements (loop over all possible MSH element types)
386  for (EntityType ent_type = MBVERTEX; ent_type < MBMAXTYPE; ent_type++) {
387 
388  med_geometrie_element type = moab2med_element_type(ent_type);
389  if (type == MED_NONE)
390  continue;
391 
392  // get number of cells
393  med_bool change_of_coord;
394  med_bool geo_transform;
395  med_int num_ele = MEDmeshnEntity(
396  fid, mesh_name, MED_NO_DT, MED_NO_IT, MED_CELL, type, MED_CONNECTIVITY,
397  MED_NODAL, &change_of_coord, &geo_transform);
398 
399  // get connectivity
400  if (num_ele <= 0)
401  continue;
402  int num_nod_per_ele = type % 100;
403  std::vector<med_int> conn_med(num_ele * num_nod_per_ele);
404  if (MEDmeshElementConnectivityRd(fid, mesh_name, MED_NO_DT, MED_NO_IT,
405  MED_CELL, type, MED_NODAL,
406  MED_FULL_INTERLACE, &conn_med[0]) < 0) {
407  SETERRQ(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
408  "Could not read MED elements");
409  }
410 
411  // cerr << "type " << ent_type << " ";
412  // cerr << "num_ele " << num_ele << " " << num_nod_per_ele << endl;;
413 
414  Range ents;
415 
416  if (ent_type != MBVERTEX) {
417  EntityHandle *conn_moab;
418  EntityHandle starte;
419  CHKERR iface->get_element_connect(num_ele, num_nod_per_ele, ent_type, 0,
420  starte, conn_moab);
421  switch (ent_type) {
422  // FIXME: Some connectivity could not work, need to run and test
423  case MBTET: {
424  int ii = 0;
425  for (int ee = 0; ee != num_ele; ee++) {
426  EntityHandle n[4];
427  for (int nn = 0; nn != num_nod_per_ele; nn++) {
428  // conn_moab[ii] = verts[conn_med[ii]-1];
429  n[nn] = verts[conn_med[ii + nn] - 1];
430  }
431  EntityHandle n0 = n[0];
432  n[0] = n[1];
433  n[1] = n0;
434  for (int nn = 0; nn != num_nod_per_ele; nn++, ii++) {
435  conn_moab[ii] = n[nn];
436  }
437  }
438  } break;
439  default: {
440  int ii = 0;
441  for (int ee = 0; ee != num_ele; ee++) {
442  for (int nn = 0; nn != num_nod_per_ele; nn++, ii++) {
443  // cerr << conn_med[ii] << " ";
444  conn_moab[ii] = verts[conn_med[ii] - 1];
445  }
446  // cerr << endl;
447  }
448  }
449  }
450  CHKERR iface->update_adjacencies(starte, num_ele, num_nod_per_ele,
451  conn_moab);
452  ents = Range(starte, starte + num_ele - 1);
453  } else {
454  // This is special case when in med vertices are defined as elements
455  int ii = 0;
456  std::vector<EntityHandle> conn_moab(num_ele * num_nod_per_ele);
457  for (int ee = 0; ee != num_ele; ++ee)
458  for (int nn = 0; nn != num_nod_per_ele; ++nn, ++ii)
459  conn_moab[ii] = verts[conn_med[ii] - 1];
460  ents.insert_list(conn_moab.begin(), conn_moab.end());
461  }
462 
463  // Add elements to family meshset
464  CHKERR m_field.get_moab().add_entities(mesh_meshset, ents);
465 
466  // get family for cells
467  {
468  std::vector<med_int> fam(num_ele, 0);
469  if (MEDmeshEntityFamilyNumberRd(fid, mesh_name, MED_NO_DT, MED_NO_IT,
470  MED_CELL, type, &fam[0]) < 0) {
471  SETERRQ(
472  m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
473  "No family number for elements: using 0 as default family number");
474  }
475  // std::vector<med_int> ele_tags(num_ele);
476  // if(MEDmeshEntityNumberRd(
477  // fid, mesh_name,MED_NO_DT,MED_NO_IT,MED_CELL,type,&ele_tags[0]) < 0
478  // ) {
479  // ele_tags.clear();
480  // }
481  for (int j = 0; j < num_ele; j++) {
482  // cerr << ents[j] << " " /*<< ele_tags[j] << " "*/ << fam[j] << endl;
483  family_elem_map[fam[j]].insert(ents[j]);
484  }
485  }
486  }
487 
488  if (MEDfileClose(fid) < 0) {
489  SETERRQ1(m_field.get_comm(), MOFEM_OPERATION_UNSUCCESSFUL,
490  "Unable to close file '%s'", file.c_str());
491  }
492 
494 }
MoFEM::Core & cOre
core database
FTensor::Index< 'n', 2 > n
Definition: PlasticOps.hpp:68
#define MoFEMFunctionReturn(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:482
static med_geometrie_element moab2med_element_type(const EntityType type)
std::vector< EntityHandle > meshMeshsets
meshset for each mesh
#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:601
std::bitset< 32 > CubitBCType
Definition: Types.hpp:62
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1791
FTensor::Index< 'j', 2 > j
Definition: ContactOps.hpp:27
#define MoFEMFunctionBegin
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:412
FTensor::Index< 'i', 2 > i
[Common data]
Definition: ContactOps.hpp:26

◆ writeMed()

MoFEMErrorCode MoFEM::MedInterface::writeMed ( const string &  file,
int  verb = 1 
)

write MED file

Parameters
filefile name
verbverbosity level
Returns
error code

Definition at line 649 of file MedInterface.cpp.

649  {
650  Interface &m_field = cOre;
652  SETERRQ(m_field.get_comm(), MOFEM_NOT_IMPLEMENTED, "Not yet implemented");
654 }
MoFEM::Core & cOre
core database
#define MoFEMFunctionBeginHot
First executable line of each MoFEM function, used for error handling. Final line of MoFEM functions ...
Definition: definitions.h:506
#define MoFEMFunctionReturnHot(a)
Last executable line of each PETSc function used for error handling. Replaces return()
Definition: definitions.h:513
DeprecatedCoreInterface Interface
Definition: Interface.hpp:1791

Member Data Documentation

◆ cOre

MoFEM::Core& MoFEM::MedInterface::cOre
private

core database

Definition at line 128 of file MedInterface.hpp.

◆ fieldNames

std::map<std::string, FieldData> MoFEM::MedInterface::fieldNames

Definition at line 124 of file MedInterface.hpp.

◆ flgFile

PetscBool MoFEM::MedInterface::flgFile
private

true if file name given in command line

Definition at line 130 of file MedInterface.hpp.

◆ medFileName

std::string MoFEM::MedInterface::medFileName

MED file name.

Definition at line 125 of file MedInterface.hpp.

◆ meshMeshsets

std::vector<EntityHandle> MoFEM::MedInterface::meshMeshsets

meshset for each mesh

Definition at line 123 of file MedInterface.hpp.

◆ meshNames

std::vector<std::string> MoFEM::MedInterface::meshNames

list of meshes in MED file

Definition at line 122 of file MedInterface.hpp.


The documentation for this struct was generated from the following files: