gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
GModelIO_MATLAB.cpp
Go to the documentation of this file.
1 // Gmsh - Copyright (C) 1997-2022 C. Geuzaine, J.-F. Remacle
2 //
3 // See the LICENSE.txt file in the Gmsh root directory for license information.
4 // Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
5 
6 #include <utility>
7 
8 #include "GModel.h"
9 #include "OS.h"
10 #include "MPoint.h"
11 #include "MLine.h"
12 #include "MTriangle.h"
13 #include "MQuadrangle.h"
14 #include "MTetrahedron.h"
15 #include "MHexahedron.h"
16 #include "MPrism.h"
17 #include "MPyramid.h"
18 #include "StringUtils.h"
19 
20 std::string getMATLABName(int type);
21 
22 void writeElementsMATLAB(FILE *fp, const GEntity *entity, int filetype,
23  bool binary, int physical)
24 {
25  if(filetype != 0) return;
26  for(std::size_t j = 0; j < entity->getNumMeshElements(); j++) {
27  if(entity->getMeshElement(j)->getTypeForMSH())
28  entity->getMeshElement(j)->writeMATLAB(fp, filetype, entity->tag(),
29  physical, binary);
30  }
31  return;
32 }
33 
35  const GEntity *entity, int physical,
36  std::vector<std::vector<std::pair<MElement *, int> > > &elems)
37 {
38  for(std::size_t j = 0; j < entity->getNumMeshElements(); j++) {
39  int elemtype = entity->getMeshElement(j)->getTypeForMSH();
40  if(elemtype)
41  elems[elemtype - 1].push_back(
42  std::make_pair(entity->getMeshElement(j), physical));
43  }
44  return;
45 }
46 
47 int GModel::writeMATLAB(const std::string &name, bool binary, bool saveAll,
48  double scalingFactor, int filetype)
49 {
50  // File type
51  int SIMPLE = 0; // very simple with only triangles
52  int LOAD_GMSH2 = 1; // structure same as utils/converters/matlab/load_gmsh2.m
53 
54  // Hardcoded...
55  filetype = LOAD_GMSH2;
56 
57  if(binary) {
58  // TODO
60  "Binary format not available for Matlab, saving into ASCII format");
61  binary = false;
62  }
63 
64  FILE *fp = Fopen(name.c_str(), binary ? "wb" : "w");
65  if(!fp) {
66  Msg::Error("Unable to open file '%s'", name.c_str());
67  return 0;
68  }
69 
70  // if there are no physicals we save all the elements
71  if(noPhysicalGroups()) saveAll = true;
72 
73  // get the number of vertices and index the vertices in a continuous
74  // sequence
75  int numVertices = indexMeshVertices(saveAll);
76 
77  fprintf(fp, "\%\% Matlab mesh\n");
78  fprintf(fp, "\%\% %s, Created by Gmsh\n", getName().c_str());
79  if(binary)
80  fprintf(fp, "\%\% BINARY\n");
81  else
82  fprintf(fp, "\%\% ASCII\n");
83 
84  // get all the entities in the model
85  std::vector<GEntity *> entities;
86  getEntities(entities);
87 
88  // Print mesh vertices
89  if(filetype == SIMPLE) {
90  fprintf(fp, "gVertices = %d;\n", numVertices);
91  fprintf(fp, "gXYZ = [\n");
92  for(std::size_t i = 0; i < entities.size(); i++)
93  for(std::size_t j = 0; j < entities[i]->mesh_vertices.size(); j++)
94  entities[i]->mesh_vertices[j]->writeMATLAB(fp, filetype, binary,
95  scalingFactor);
96  fprintf(fp, "];\n");
97  // triangles
98  fprintf(fp, "\%\%\n");
99  fprintf(fp, "gTri=[\n");
100  for(std::size_t i = 0; i < entities.size(); i++) {
101  if(saveAll)
102  writeElementsMATLAB(fp, entities[i], filetype, binary, 0);
103  else if(entities[i]->getPhysicalEntities().size()) {
104  for(std::size_t k = 0; k < entities[i]->getPhysicalEntities().size();
105  k++) {
106  int physical = entities[i]->getPhysicalEntities()[k];
107  writeElementsMATLAB(fp, entities[i], filetype, binary, physical);
108  }
109  }
110  }
111  fprintf(fp, "];\n");
112  fprintf(fp, "nTri=size(gTri,1);\n");
113  }
114 
115  // int nelemtype = 0; //number of element type
116  if(filetype == LOAD_GMSH2) {
117  fprintf(fp, "clear msh;\n");
118  fprintf(fp, "msh.nbNod = %d;\n", numVertices);
119  fprintf(fp, "msh.POS = [\n");
120  for(std::size_t i = 0; i < entities.size(); i++)
121  for(std::size_t j = 0; j < entities[i]->mesh_vertices.size(); j++)
122  entities[i]->mesh_vertices[j]->writeMATLAB(fp, filetype, binary,
123  scalingFactor);
124  fprintf(fp, "];\n");
125  fprintf(fp, "msh.MAX = max(msh.POS);\n");
126  fprintf(fp, "msh.MIN = min(msh.POS);\n");
127  // We have to store every element in an array and then store them in the
128  // file.
129  std::vector<std::vector<std::pair<MElement *, int> > > elems(MSH_MAX_NUM);
130  // loop on each element and fill the vectors of connectivity
131  for(std::size_t i = 0; i < entities.size(); i++) {
132  if(saveAll)
133  storePairMATLAB(entities[i], 0, elems);
134  else {
135  for(std::size_t iphys = 0;
136  iphys < entities[i]->getPhysicalEntities().size(); iphys++) {
137  int physical = entities[i]->getPhysicalEntities()[iphys];
138  storePairMATLAB(entities[i], physical, elems);
139  }
140  }
141  }
142  // Store in Matlab structure
143  for(int elemtype = 1; elemtype < MSH_MAX_NUM + 1; elemtype++) {
144  if(elems[elemtype - 1].empty()) continue;
145  fprintf(fp, "msh.%s =[\n", getMATLABName(elemtype).c_str());
146  // writes
147  for(std::size_t i = 0; i < elems[elemtype - 1].size(); i++) {
148  elems[elemtype - 1][i].first->writeMATLAB(
149  fp, filetype, elems[elemtype - 1][i].second, binary);
150  }
151  fprintf(fp, "];\n");
152  }
153  }
154 
155  fclose(fp);
156  return 1;
157 }
158 
159 // This should be updated whenever a new element is available in GMSH; see
160 // src/common/GmshDefines.h
161 std::string getMATLABName(int type)
162 {
163  switch(type) {
164  case MSH_LIN_2: return "LINES";
165  case MSH_TRI_3: return "TRIANGLES";
166  case MSH_QUA_4: return "QUADS";
167  case MSH_TET_4: return "TETS";
168  case MSH_HEX_8: return "HEXAS";
169  case MSH_PRI_6: return "PRISMS";
170  case MSH_PYR_5: return "PYRAMIDS";
171  case MSH_LIN_3: return "LINES3";
172  case MSH_TRI_6: return "TRIANGLES6";
173  case MSH_QUA_9: return "QUADS9";
174  case MSH_TET_10: return "TETS10";
175  case MSH_HEX_27: return "HEXAS27";
176  case MSH_PRI_18: return "PRISMS18";
177  case MSH_PYR_14: return "PYRAMIDS14";
178  case MSH_PNT: return "PNT";
179  case MSH_QUA_8: return "QUADS8";
180  case MSH_HEX_20: return "HEXAS20";
181  case MSH_PRI_15: return "PRISMS15";
182  case MSH_PYR_13: return "PYRAMIDS13";
183  case MSH_TRI_9: return "TRIANGLES9";
184  case MSH_TRI_10: return "TRIANGLES10";
185  case MSH_TRI_12: return "TRIANGLES12";
186  case MSH_TRI_15: return "TRIANGLES15";
187  case MSH_TRI_15I: return "TRIANGLES15I";
188  case MSH_TRI_21: return "TRIANGLES21";
189  case MSH_LIN_4: return "LINES4";
190  case MSH_LIN_5: return "LINES5";
191  case MSH_LIN_6: return "LINES6";
192  case MSH_TET_20: return "TETS20";
193  case MSH_TET_35: return "TETS35";
194  case MSH_TET_56: return "TETS56";
195  case MSH_TET_22: return "TETS22";
196  case MSH_TET_28: return "TETS28";
197  case MSH_POLYG_: return "POLYG_";
198  case MSH_POLYH_: return "POLYH_";
199  case MSH_QUA_16: return "QUADS16";
200  case MSH_QUA_25: return "QUADS25";
201  case MSH_QUA_36: return "QUADS36";
202  case MSH_QUA_12: return "QUADS12";
203  case MSH_QUA_16I: return "QUADS16I";
204  case MSH_QUA_20: return "QUADS20";
205  case MSH_TRI_28: return "TRIANGLES28";
206  case MSH_TRI_36: return "TRIANGLES36";
207  case MSH_TRI_45: return "TRIANGLES45";
208  case MSH_TRI_55: return "TRIANGLES55";
209  case MSH_TRI_66: return "TRIANGLES66";
210  case MSH_QUA_49: return "QUADS49";
211  case MSH_QUA_64: return "QUADS64";
212  case MSH_QUA_81: return "QUADS81";
213  case MSH_QUA_100: return "QUADS100";
214  case MSH_QUA_121: return "QUADS121";
215  case MSH_TRI_18: return "TRIANGLES18";
216  case MSH_TRI_21I: return "TRIANGLES21I";
217  case MSH_TRI_24: return "TRIANGLES24";
218  case MSH_TRI_27: return "TRIANGLES27";
219  case MSH_TRI_30: return "TRIANGLES30";
220  case MSH_QUA_24: return "QUADS24";
221  case MSH_QUA_28: return "QUADS28";
222  case MSH_QUA_32: return "QUADS32";
223  case MSH_QUA_36I: return "QUADS36I";
224  case MSH_QUA_40: return "QUADS40";
225  case MSH_LIN_7: return "LINES7";
226  case MSH_LIN_8: return "LINES8";
227  case MSH_LIN_9: return "LINES9";
228  case MSH_LIN_10: return "LINES10";
229  case MSH_LIN_11: return "LINES11";
230  case MSH_LIN_B: return "LINESB";
231  case MSH_TRI_B: return "TRIANGLESB";
232  case MSH_POLYG_B: return "POLYG_B";
233  case MSH_LIN_C: return "LINESC";
234  case MSH_TET_84: return "TETS84";
235  case MSH_TET_120: return "TETS120";
236  case MSH_TET_165: return "TETS165";
237  case MSH_TET_220: return "TETS220";
238  case MSH_TET_286: return "TETS286";
239  case MSH_TET_34: return "TETS34";
240  case MSH_TET_40: return "TETS40";
241  case MSH_TET_46: return "TETS46";
242  case MSH_TET_52: return "TETS52";
243  case MSH_TET_58: return "TETS58";
244  case MSH_LIN_1: return "LINES1";
245  case MSH_TRI_1: return "TRIANGLES1";
246  case MSH_QUA_1: return "QUADS1";
247  case MSH_TET_1: return "TETS1";
248  case MSH_HEX_1: return "HEXAS1";
249  case MSH_PRI_1: return "PRISMS1";
250  case MSH_PRI_40: return "PRISMS40";
251  case MSH_PRI_75: return "PRISMS75";
252  case MSH_HEX_64: return "HEXAS64";
253  case MSH_HEX_125: return "HEXAS125";
254  case MSH_HEX_216: return "HEXAS216";
255  case MSH_HEX_343: return "HEXAS343";
256  case MSH_HEX_512: return "HEXAS512";
257  case MSH_HEX_729: return "HEXAS729";
258  case MSH_HEX_1000: return "HEXAS1000";
259  case MSH_HEX_32: return "HEXAS32";
260  case MSH_HEX_44: return "HEXAS44";
261  case MSH_HEX_56: return "HEXAS56";
262  case MSH_HEX_68: return "HEXAS68";
263  case MSH_HEX_80: return "HEXAS80";
264  case MSH_HEX_92: return "HEXAS92";
265  case MSH_HEX_104: return "HEXAS104";
266  case MSH_PRI_126: return "PRISMS126";
267  case MSH_PRI_196: return "PRISMS196";
268  case MSH_PRI_288: return "PRISMS288";
269  case MSH_PRI_405: return "PRISMS405";
270  case MSH_PRI_550: return "PRISMS550";
271  case MSH_PRI_24: return "PRISMS24";
272  case MSH_PRI_33: return "PRISMS33";
273  case MSH_PRI_42: return "PRISMS42";
274  case MSH_PRI_51: return "PRISMS51";
275  case MSH_PRI_60: return "PRISMS60";
276  case MSH_PRI_69: return "PRISMS69";
277  case MSH_PRI_78: return "PRISMS78";
278  case MSH_PYR_30: return "PYRAMIDS30";
279  case MSH_PYR_55: return "PYRAMIDS55";
280  case MSH_PYR_91: return "PYRAMIDS91";
281  case MSH_PYR_140: return "PYRAMIDS140";
282  case MSH_PYR_204: return "PYRAMIDS204";
283  case MSH_PYR_285: return "PYRAMIDS285";
284  case MSH_PYR_385: return "PYRAMIDS385";
285  case MSH_PYR_21: return "PYRAMIDS21";
286  case MSH_PYR_29: return "PYRAMIDS29";
287  case MSH_PYR_37: return "PYRAMIDS37";
288  case MSH_PYR_45: return "PYRAMIDS45";
289  case MSH_PYR_53: return "PYRAMIDS53";
290  case MSH_PYR_61: return "PYRAMIDS61";
291  case MSH_PYR_69: return "PYRAMIDS69";
292  case MSH_PYR_1: return "PYRAMIDS1";
293  case MSH_PNT_SUB: return "PNT_SUB";
294  case MSH_LIN_SUB: return "LINESSUB";
295  case MSH_TRI_SUB: return "TRIANGLESSUB";
296  case MSH_TET_SUB: return "TETSSUB";
297  case MSH_TET_16: return "TETS16";
298  case MSH_TRI_MINI: return "TRIANGLESMINI";
299  case MSH_TET_MINI: return "TETSMINI";
300  case MSH_TRIH_4: return "TRIH_4";
301  }
302  return "";
303 }
MSH_TRI_27
#define MSH_TRI_27
Definition: GmshDefines.h:134
MSH_PRI_550
#define MSH_PRI_550
Definition: GmshDefines.h:192
MSH_TRI_10
#define MSH_TRI_10
Definition: GmshDefines.h:100
MSH_LIN_2
#define MSH_LIN_2
Definition: GmshDefines.h:80
MSH_HEX_729
#define MSH_HEX_729
Definition: GmshDefines.h:177
MSH_TRI_30
#define MSH_TRI_30
Definition: GmshDefines.h:135
MSH_HEX_8
#define MSH_HEX_8
Definition: GmshDefines.h:84
MSH_TRI_6
#define MSH_TRI_6
Definition: GmshDefines.h:88
MSH_TRI_15I
#define MSH_TRI_15I
Definition: GmshDefines.h:103
MTriangle.h
MSH_TRI_36
#define MSH_TRI_36
Definition: GmshDefines.h:122
MSH_TRI_28
#define MSH_TRI_28
Definition: GmshDefines.h:121
MSH_TET_286
#define MSH_TET_286
Definition: GmshDefines.h:155
MSH_LIN_SUB
#define MSH_LIN_SUB
Definition: GmshDefines.h:220
MSH_QUA_81
#define MSH_QUA_81
Definition: GmshDefines.h:128
MSH_HEX_80
#define MSH_HEX_80
Definition: GmshDefines.h:184
MSH_LIN_10
#define MSH_LIN_10
Definition: GmshDefines.h:144
MSH_PYR_45
#define MSH_PYR_45
Definition: GmshDefines.h:213
MSH_QUA_24
#define MSH_QUA_24
Definition: GmshDefines.h:136
MSH_PYR_91
#define MSH_PYR_91
Definition: GmshDefines.h:204
MSH_PNT
#define MSH_PNT
Definition: GmshDefines.h:94
MSH_TET_58
#define MSH_TET_58
Definition: GmshDefines.h:161
MElement::getTypeForMSH
virtual int getTypeForMSH() const
Definition: MElement.h:488
MSH_TRI_55
#define MSH_TRI_55
Definition: GmshDefines.h:124
MSH_PRI_15
#define MSH_PRI_15
Definition: GmshDefines.h:97
MSH_PRI_78
#define MSH_PRI_78
Definition: GmshDefines.h:200
OS.h
MSH_PRI_405
#define MSH_PRI_405
Definition: GmshDefines.h:191
MSH_TRI_24
#define MSH_TRI_24
Definition: GmshDefines.h:133
MSH_QUA_121
#define MSH_QUA_121
Definition: GmshDefines.h:130
MSH_PYR_14
#define MSH_PYR_14
Definition: GmshDefines.h:93
MSH_HEX_64
#define MSH_HEX_64
Definition: GmshDefines.h:172
MSH_TET_35
#define MSH_TET_35
Definition: GmshDefines.h:109
MSH_LIN_9
#define MSH_LIN_9
Definition: GmshDefines.h:143
MSH_QUA_4
#define MSH_QUA_4
Definition: GmshDefines.h:82
GModel::getName
std::string getName() const
Definition: GModel.h:329
Msg::Warning
static void Warning(const char *fmt,...)
Definition: GmshMessage.cpp:543
MSH_QUA_16
#define MSH_QUA_16
Definition: GmshDefines.h:115
Msg::Error
static void Error(const char *fmt,...)
Definition: GmshMessage.cpp:482
MSH_PNT_SUB
#define MSH_PNT_SUB
Definition: GmshDefines.h:219
getMATLABName
std::string getMATLABName(int type)
Definition: GModelIO_MATLAB.cpp:161
MSH_LIN_4
#define MSH_LIN_4
Definition: GmshDefines.h:105
MSH_TET_SUB
#define MSH_TET_SUB
Definition: GmshDefines.h:222
MSH_TRI_1
#define MSH_TRI_1
Definition: GmshDefines.h:164
MSH_PRI_75
#define MSH_PRI_75
Definition: GmshDefines.h:170
MSH_TRI_18
#define MSH_TRI_18
Definition: GmshDefines.h:131
GModel::empty
bool empty() const
Definition: GModel.cpp:311
MSH_TET_MINI
#define MSH_TET_MINI
Definition: GmshDefines.h:225
MSH_HEX_1
#define MSH_HEX_1
Definition: GmshDefines.h:167
MSH_TRI_12
#define MSH_TRI_12
Definition: GmshDefines.h:101
MSH_PYR_1
#define MSH_PYR_1
Definition: GmshDefines.h:218
MSH_LIN_1
#define MSH_LIN_1
Definition: GmshDefines.h:163
MPoint.h
MSH_HEX_104
#define MSH_HEX_104
Definition: GmshDefines.h:186
MSH_HEX_32
#define MSH_HEX_32
Definition: GmshDefines.h:180
MSH_HEX_512
#define MSH_HEX_512
Definition: GmshDefines.h:176
MSH_HEX_44
#define MSH_HEX_44
Definition: GmshDefines.h:181
MLine.h
MSH_PYR_29
#define MSH_PYR_29
Definition: GmshDefines.h:211
GEntity
Definition: GEntity.h:31
MSH_PYR_5
#define MSH_PYR_5
Definition: GmshDefines.h:86
MSH_HEX_125
#define MSH_HEX_125
Definition: GmshDefines.h:173
MSH_PRI_40
#define MSH_PRI_40
Definition: GmshDefines.h:169
MSH_QUA_100
#define MSH_QUA_100
Definition: GmshDefines.h:129
MSH_TRI_66
#define MSH_TRI_66
Definition: GmshDefines.h:125
MSH_HEX_343
#define MSH_HEX_343
Definition: GmshDefines.h:175
MSH_TET_40
#define MSH_TET_40
Definition: GmshDefines.h:158
Fopen
FILE * Fopen(const char *f, const char *mode)
Definition: OS.cpp:273
MSH_TET_16
#define MSH_TET_16
Definition: GmshDefines.h:223
MSH_TET_22
#define MSH_TET_22
Definition: GmshDefines.h:111
MSH_TRI_45
#define MSH_TRI_45
Definition: GmshDefines.h:123
MSH_TRI_3
#define MSH_TRI_3
Definition: GmshDefines.h:81
MSH_LIN_C
#define MSH_LIN_C
Definition: GmshDefines.h:149
MSH_PYR_385
#define MSH_PYR_385
Definition: GmshDefines.h:208
MSH_LIN_6
#define MSH_LIN_6
Definition: GmshDefines.h:107
MSH_TET_84
#define MSH_TET_84
Definition: GmshDefines.h:151
MHexahedron.h
MSH_TET_1
#define MSH_TET_1
Definition: GmshDefines.h:166
GEntity::getNumMeshElements
virtual std::size_t getNumMeshElements() const
Definition: GEntity.h:348
MSH_LIN_3
#define MSH_LIN_3
Definition: GmshDefines.h:87
MSH_TET_28
#define MSH_TET_28
Definition: GmshDefines.h:112
MSH_PYR_37
#define MSH_PYR_37
Definition: GmshDefines.h:212
MSH_TET_220
#define MSH_TET_220
Definition: GmshDefines.h:154
MSH_QUA_20
#define MSH_QUA_20
Definition: GmshDefines.h:120
MSH_TRI_SUB
#define MSH_TRI_SUB
Definition: GmshDefines.h:221
MSH_TRI_B
#define MSH_TRI_B
Definition: GmshDefines.h:147
MSH_HEX_1000
#define MSH_HEX_1000
Definition: GmshDefines.h:178
MSH_PYR_285
#define MSH_PYR_285
Definition: GmshDefines.h:207
MSH_PRI_288
#define MSH_PRI_288
Definition: GmshDefines.h:190
MSH_PRI_196
#define MSH_PRI_196
Definition: GmshDefines.h:189
MSH_QUA_8
#define MSH_QUA_8
Definition: GmshDefines.h:95
MSH_LIN_7
#define MSH_LIN_7
Definition: GmshDefines.h:141
MPyramid.h
MSH_HEX_20
#define MSH_HEX_20
Definition: GmshDefines.h:96
MSH_PRI_1
#define MSH_PRI_1
Definition: GmshDefines.h:168
MSH_PYR_53
#define MSH_PYR_53
Definition: GmshDefines.h:214
MSH_QUA_49
#define MSH_QUA_49
Definition: GmshDefines.h:126
MSH_QUA_36I
#define MSH_QUA_36I
Definition: GmshDefines.h:139
MSH_POLYG_B
#define MSH_POLYG_B
Definition: GmshDefines.h:148
MSH_LIN_11
#define MSH_LIN_11
Definition: GmshDefines.h:145
MSH_PYR_55
#define MSH_PYR_55
Definition: GmshDefines.h:203
MSH_TET_34
#define MSH_TET_34
Definition: GmshDefines.h:157
MSH_PRI_69
#define MSH_PRI_69
Definition: GmshDefines.h:199
MSH_QUA_64
#define MSH_QUA_64
Definition: GmshDefines.h:127
GEntity::tag
int tag() const
Definition: GEntity.h:280
MSH_PYR_204
#define MSH_PYR_204
Definition: GmshDefines.h:206
MSH_PYR_30
#define MSH_PYR_30
Definition: GmshDefines.h:202
MSH_LIN_B
#define MSH_LIN_B
Definition: GmshDefines.h:146
MSH_TET_165
#define MSH_TET_165
Definition: GmshDefines.h:153
MElement::writeMATLAB
virtual void writeMATLAB(FILE *fp, int filetype, int elementary=0, int physical=0, bool binary=false)
Definition: MElement.cpp:1711
MSH_TET_10
#define MSH_TET_10
Definition: GmshDefines.h:90
MSH_LIN_5
#define MSH_LIN_5
Definition: GmshDefines.h:106
MSH_QUA_25
#define MSH_QUA_25
Definition: GmshDefines.h:116
MSH_QUA_28
#define MSH_QUA_28
Definition: GmshDefines.h:137
GModel::getEntities
void getEntities(std::vector< GEntity * > &entities, int dim=-1) const
Definition: GModel.cpp:651
MSH_PRI_24
#define MSH_PRI_24
Definition: GmshDefines.h:194
MSH_HEX_68
#define MSH_HEX_68
Definition: GmshDefines.h:183
MSH_QUA_12
#define MSH_QUA_12
Definition: GmshDefines.h:118
MSH_PRI_51
#define MSH_PRI_51
Definition: GmshDefines.h:197
StringUtils.h
MSH_QUA_9
#define MSH_QUA_9
Definition: GmshDefines.h:89
MSH_QUA_1
#define MSH_QUA_1
Definition: GmshDefines.h:165
MSH_HEX_56
#define MSH_HEX_56
Definition: GmshDefines.h:182
MSH_PYR_140
#define MSH_PYR_140
Definition: GmshDefines.h:205
MSH_QUA_16I
#define MSH_QUA_16I
Definition: GmshDefines.h:119
MSH_TET_120
#define MSH_TET_120
Definition: GmshDefines.h:152
MSH_POLYH_
#define MSH_POLYH_
Definition: GmshDefines.h:114
MSH_TRIH_4
#define MSH_TRIH_4
Definition: GmshDefines.h:226
MSH_TRI_21I
#define MSH_TRI_21I
Definition: GmshDefines.h:132
MSH_PYR_69
#define MSH_PYR_69
Definition: GmshDefines.h:216
MSH_PRI_18
#define MSH_PRI_18
Definition: GmshDefines.h:92
MSH_QUA_36
#define MSH_QUA_36
Definition: GmshDefines.h:117
writeElementsMATLAB
void writeElementsMATLAB(FILE *fp, const GEntity *entity, int filetype, bool binary, int physical)
Definition: GModelIO_MATLAB.cpp:22
GEntity::getMeshElement
virtual MElement * getMeshElement(std::size_t index) const
Definition: GEntity.h:363
MSH_TET_4
#define MSH_TET_4
Definition: GmshDefines.h:83
MTetrahedron.h
MQuadrangle.h
MSH_HEX_27
#define MSH_HEX_27
Definition: GmshDefines.h:91
MSH_TET_52
#define MSH_TET_52
Definition: GmshDefines.h:160
MSH_PYR_61
#define MSH_PYR_61
Definition: GmshDefines.h:215
MSH_QUA_40
#define MSH_QUA_40
Definition: GmshDefines.h:140
MSH_POLYG_
#define MSH_POLYG_
Definition: GmshDefines.h:113
GModel::noPhysicalGroups
bool noPhysicalGroups()
Definition: GModel.cpp:828
MSH_MAX_NUM
#define MSH_MAX_NUM
Definition: GmshDefines.h:227
GModel::writeMATLAB
int writeMATLAB(const std::string &name, bool binary=false, bool saveAll=false, double scalingFactor=1.0, int filetype=1)
Definition: GModelIO_MATLAB.cpp:47
MSH_TRI_MINI
#define MSH_TRI_MINI
Definition: GmshDefines.h:224
MSH_PRI_60
#define MSH_PRI_60
Definition: GmshDefines.h:198
MPrism.h
MSH_TET_46
#define MSH_TET_46
Definition: GmshDefines.h:159
MSH_TET_20
#define MSH_TET_20
Definition: GmshDefines.h:108
MSH_TRI_15
#define MSH_TRI_15
Definition: GmshDefines.h:102
GModel.h
MSH_PYR_13
#define MSH_PYR_13
Definition: GmshDefines.h:98
MSH_PRI_6
#define MSH_PRI_6
Definition: GmshDefines.h:85
MSH_PYR_21
#define MSH_PYR_21
Definition: GmshDefines.h:210
storePairMATLAB
void storePairMATLAB(const GEntity *entity, int physical, std::vector< std::vector< std::pair< MElement *, int > > > &elems)
Definition: GModelIO_MATLAB.cpp:34
MSH_QUA_32
#define MSH_QUA_32
Definition: GmshDefines.h:138
MSH_HEX_216
#define MSH_HEX_216
Definition: GmshDefines.h:174
MSH_LIN_8
#define MSH_LIN_8
Definition: GmshDefines.h:142
MSH_TRI_9
#define MSH_TRI_9
Definition: GmshDefines.h:99
MSH_TRI_21
#define MSH_TRI_21
Definition: GmshDefines.h:104
GModel::indexMeshVertices
std::size_t indexMeshVertices(bool all, int singlePartition=0, bool renumber=true)
Definition: GModel.cpp:2135
MSH_PRI_33
#define MSH_PRI_33
Definition: GmshDefines.h:195
MSH_HEX_92
#define MSH_HEX_92
Definition: GmshDefines.h:185
MSH_PRI_126
#define MSH_PRI_126
Definition: GmshDefines.h:188
MSH_TET_56
#define MSH_TET_56
Definition: GmshDefines.h:110
MSH_PRI_42
#define MSH_PRI_42
Definition: GmshDefines.h:196