gmsh-TingyuanDoc
0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
|
Go to the documentation of this file.
11 #include "GmshConfig.h"
13 #include "GmshVersion.h"
25 #if defined(HAVE_FLTK)
27 #if (FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION >= 4)
29 #elif (FL_MAJOR_VERSION == 1) && (FL_MINOR_VERSION == 3) && (FL_PATCH_VERSION >= 3)
32 #error "Gmsh requires FLTK >= 1.3.3"
36 #if defined(HAVE_PETSC)
41 #include "Standard_Version.hxx"
48 #if defined(HAVE_POST)
52 #if defined(HAVE_PARSER)
68 std::vector<std::pair<std::string, std::string> >
GetUsage()
70 typedef std::pair<std::string, std::string> mp;
72 s.push_back(mp(
"(Related option names, if any, are given between parentheses)",
74 s.push_back(mp(
"Geometry:",
""));
75 s.push_back(mp(
"-0",
"Output model, then exit"));
76 s.push_back(mp(
"-tol value",
"Set geometrical tolerance (Geometry.Tolerance)"));
77 s.push_back(mp(
"-match",
"Match geometries and meshes"));
78 s.push_back(mp(
"Mesh:",
""));
79 s.push_back(mp(
"-1, -2, -3",
"Perform 1D, 2D or 3D mesh generation, then exit"));
80 s.push_back(mp(
"-format string",
"Select output mesh format: " +
82 s.push_back(mp(
"-bin",
"Create binary files when possible (Mesh.Binary)"));
83 s.push_back(mp(
"-refine",
"Perform uniform mesh refinement, then exit"));
84 s.push_back(mp(
"-barycentric_refine",
"Perform barycentric mesh refinement, "
86 s.push_back(mp(
"-reclassify angle",
"Reclassify surface mesh, then exit"));
87 s.push_back(mp(
"-reparam angle",
"Reparametrize surface mesh, then exit"));
88 s.push_back(mp(
"-part int",
"Partition after batch mesh generation "
89 "(Mesh.NbPartitions)"));
90 s.push_back(mp(
"-part_weight [tri,quad,tet,hex,pri,pyr,trih] int",
91 "Weight of a triangle/quad/etc. during partitioning "
92 "(Mesh.Partition[Tri,Quad,...]Weight)"));
93 s.push_back(mp(
"-part_split",
"Save mesh partitions in separate files "
94 "(Mesh.PartitionSplitMeshFiles)"));
95 s.push_back(mp(
"-part_[no_]topo",
"Create the partition topology "
96 "(Mesh.PartitionCreateTopology)"));
97 s.push_back(mp(
"-part_[no_]ghosts",
"Create ghost cells "
98 "(Mesh.PartitionCreateGhostCells)"));
99 s.push_back(mp(
"-part_[no_]physicals",
"Create physical groups for partitions "
100 "(Mesh.PartitionCreatePhysicals)"));
101 s.push_back(mp(
"-part_topo_pro",
"Save the partition topology .pro file "
102 "(Mesh.PartitionTopologyFile)"));
103 s.push_back(mp(
"-preserve_numbering_msh2",
"Preserve element numbering in MSH2 "
104 "format (Mesh.PreserveNumberingMsh2)"));
105 s.push_back(mp(
"-save_all",
"Save all elements (Mesh.SaveAll)"));
106 s.push_back(mp(
"-save_parametric",
"Save nodes with their parametric "
107 "coordinates (Mesh.SaveParametric)"));
108 s.push_back(mp(
"-save_topology",
"Save model topology (Mesh.SaveTopology)"));
109 s.push_back(mp(
"-algo string",
"Select mesh algorithm: auto, meshadapt, del2d, "
110 "front2d, delquad, quadqs, initial2d, del3d, front3d, mmg3d, hxt, "
111 "initial3d (Mesh.Algorithm and Mesh.Algorithm3D)"));
112 s.push_back(mp(
"-smooth int",
"Set number of mesh smoothing steps "
113 "(Mesh.Smoothing)"));
114 s.push_back(mp(
"-order int",
"Set mesh order (Mesh.ElementOrder)"));
115 s.push_back(mp(
"-optimize[_netgen]",
"Optimize quality of tetrahedral elements "
116 "(Mesh.Optimize[Netgen])"));
117 s.push_back(mp(
"-optimize_threshold",
"Optimize tetrahedral elements that have a "
118 "quality less than a threshold (Mesh.OptimizeThreshold)"));
119 s.push_back(mp(
"-optimize_ho",
"Optimize high order meshes "
120 "(Mesh.HighOrderOptimize)"));
121 s.push_back(mp(
"-ho_[min,max,nlayers]",
"High-order optimization parameters "
122 "(Mesh.HighOrderThreshold[Min,Max], Mesh.HighOrderNumLayers)"));
123 s.push_back(mp(
"-clscale value",
"Set mesh element size factor "
124 "(Mesh.MeshSizeFactor)"));
125 s.push_back(mp(
"-clmin value",
"Set minimum mesh element size "
126 "(Mesh.MeshSizeMin)"));
127 s.push_back(mp(
"-clmax value",
"Set maximum mesh element size "
128 "(Mesh.MeshSizeMax)"));
129 s.push_back(mp(
"-clextend value",
"Extend mesh element sizes from boundaries "
130 "(Mesh.MeshSizeExtendFromBoundary)"));
131 s.push_back(mp(
"-clcurv value",
"Compute mesh element size from curvature, with "
132 "value the target number of elements per 2*pi radians "
133 "(Mesh.MeshSizeFromCurvature)"));
134 s.push_back(mp(
"-aniso_max value",
"Set maximum anisotropy for bamg "
136 s.push_back(mp(
"-smooth_ratio value",
"Set smoothing ration between mesh sizes "
137 "at nodes of a same edge for bamg (Mesh.SmoothRatio)"));
138 s.push_back(mp(
"-epslc1d value",
"Set accuracy of evaluation of mesh size field "
139 "for 1D mesh (Mesh.LcIntegrationPrecision)"));
140 s.push_back(mp(
"-swapangle value",
"Set the threshold angle (in degrees) between "
141 "two adjacent faces below which a swap is allowed "
142 "(Mesh.AllowSwapAngle)"));
143 s.push_back(mp(
"-rand value",
"Set random perturbation factor "
144 "(Mesh.RandomFactor)"));
145 s.push_back(mp(
"-bgm file",
"Load background mesh from file"));
146 s.push_back(mp(
"-check",
"Perform various consistency checks on mesh"));
147 s.push_back(mp(
"-ignore_periocity",
"Ignore periodic boundaries "
148 "(Mesh.IgnorePeriodicity)"));
149 #if defined(HAVE_FLTK)
150 s.push_back(mp(
"Post-processing:",
""));
151 s.push_back(mp(
"-link int",
"Select link mode between views "
152 "(PostProcessing.Link)"));
153 s.push_back(mp(
"-combine",
"Combine views having identical names into "
154 "multi-time-step views"));
155 s.push_back(mp(
"Solver:",
""));
156 s.push_back(mp(
"-listen string",
"Always listen to incoming connection requests "
157 "(Solver.AlwaysListen) on the given socket "
158 "(uses Solver.SocketName if not specified)"));
159 s.push_back(mp(
"-minterpreter string",
"Name of Octave interpreter "
160 "(Solver.OctaveInterpreter)"));
161 s.push_back(mp(
"-pyinterpreter string",
"Name of Python interpreter "
162 "(Solver.OctaveInterpreter)"));
163 s.push_back(mp(
"-run",
"Run ONELAB solver(s)"));
164 s.push_back(mp(
"Display:",
""));
165 s.push_back(mp(
"-n",
"Hide all meshes and post-processing views on startup "
166 "(View.Visible, Mesh.[Points,Lines,SurfaceEdges,...])"));
167 s.push_back(mp(
"-nodb",
"Disable double buffering (General.DoubleBuffer)"));
168 s.push_back(mp(
"-numsubedges",
"Set num of subdivisions for high order element "
169 "display (Mesh.NumSubEdges)"));
170 s.push_back(mp(
"-fontsize int",
"Specify the font size for the GUI "
171 "(General.FontSize)"));
172 s.push_back(mp(
"-theme string",
"Specify FLTK GUI theme (General.FltkTheme)"));
173 s.push_back(mp(
"-display string",
"Specify display (General.Display)"));
174 s.push_back(mp(
"-camera",
"Use camera mode view (General.CameraMode)"));
175 s.push_back(mp(
"-stereo",
"OpenGL quad-buffered stereo rendering "
176 "(General.Stereo)"));
177 s.push_back(mp(
"-gamepad",
"Use gamepad controller if available"));
179 s.push_back(mp(
"Other:",
""));
180 s.push_back(mp(
"-, -parse_and_exit",
"Parse input files, then exit"));
181 s.push_back(mp(
"-save",
"Save output file, then exit"));
182 s.push_back(mp(
"-o file",
"Specify output file name"));
183 s.push_back(mp(
"-new",
"Create new model before merge next file"));
184 s.push_back(mp(
"-merge",
"Merge next files"));
185 s.push_back(mp(
"-open",
"Open next files"));
186 s.push_back(mp(
"-log filename",
"Log all messages to filename"));
187 #if defined(HAVE_FLTK)
188 s.push_back(mp(
"-a, -g, -m, -s, -p",
"Start in automatic, geometry, mesh, "
189 "solver or post-processing mode (General.InitialModule)"));
191 s.push_back(mp(
"-pid",
"Print process id on stdout"));
192 s.push_back(mp(
"-watch pattern",
"Pattern of files to merge as they become "
193 "available (General.WatchFilePattern)"));
194 s.push_back(mp(
"-bg file",
"Load background (image or PDF) file "
195 "(General.BackgroundImageFileName)"));
196 s.push_back(mp(
"-v int",
"Set verbosity level (General.Verbosity)"));
197 s.push_back(mp(
"-string \"string\"",
"Parse command string at startup"));
198 s.push_back(mp(
"-setnumber name value",
"Set constant, ONELAB or option number "
200 s.push_back(mp(
"-setstring name value",
"Set constant, ONELAB or option string "
202 s.push_back(mp(
"-nopopup",
"Don't popup dialog windows in scripts "
203 "(General.NoPopup)"));
204 s.push_back(mp(
"-noenv",
"Don't modify the environment at startup"));
205 s.push_back(mp(
"-nolocale",
"Don't modify the locale at startup"));
206 s.push_back(mp(
"-option file",
"Parse option file at startup"));
207 s.push_back(mp(
"-convert files",
"Convert files into latest binary formats, "
209 s.push_back(mp(
"-nt int",
"Set number of threads (General.NumThreads)"));
210 s.push_back(mp(
"-cpu",
"Report CPU times for all operations"));
211 s.push_back(mp(
"-version",
"Show version number"));
212 s.push_back(mp(
"-info",
"Show detailed version information"));
213 s.push_back(mp(
"-help",
"Show command line usage"));
214 s.push_back(mp(
"-help_options",
"Show all options"));
218 std::vector<std::pair<std::string, std::string> >
221 std::string cc = ctrl;
222 #if defined(__APPLE__)
223 if(cc.empty()) cc =
"Cmd+";
225 if(cc.empty()) cc =
"Ctrl+";
227 typedef std::pair<std::string, std::string> mp;
229 s.push_back(mp(
"Left arrow",
"Go to previous time step"));
230 s.push_back(mp(
"Right arrow",
"Go to next time step"));
231 s.push_back(mp(
"Up arrow",
"Make previous view visible"));
232 s.push_back(mp(
"Down arrow",
"Make next view visible"));
233 s.push_back(mp(
"0",
"Reload geometry"));
234 s.push_back(mp(cc +
"0 or 9",
"Reload full project"));
235 s.push_back(mp(
"1 or F1",
"Mesh lines"));
236 s.push_back(mp(
"2 or F2",
"Mesh surfaces"));
237 s.push_back(mp(
"3 or F3",
"Mesh volumes"));
238 s.push_back(mp(
"Escape",
"Cancel lasso zoom/selection, toggle mouse "
239 "selection ON/OFF"));
240 s.push_back(mp(
"e",
"End/accept selection in geometry creation mode"));
241 s.push_back(mp(
"g",
"Go to geometry module"));
242 s.push_back(mp(
"m",
"Go to mesh module"));
243 s.push_back(mp(
"p",
"Go to post-processing module"));
244 s.push_back(mp(
"q",
"Abort selection in geometry creation mode"));
245 s.push_back(mp(
"s",
"Go to solver module"));
246 s.push_back(mp(
"x",
"Toggle x coordinate freeze in geometry creation mode"));
247 s.push_back(mp(
"y",
"Toggle y coordinate freeze in geometry creation mode"));
248 s.push_back(mp(
"z",
"Toggle z coordinate freeze in geometry creation mode"));
249 s.push_back(mp(
"Shift+a",
"Bring all windows to front"));
250 s.push_back(mp(
"Shift+g",
"Show geometry options"));
251 s.push_back(mp(
"Shift+m",
"Show mesh options"));
252 s.push_back(mp(
"Shift+o",
"Show general options"));
253 s.push_back(mp(
"Shift+p",
"Show post-processing options"));
254 s.push_back(mp(
"Shift+s",
"Show solver options"));
255 s.push_back(mp(
"Shift+u",
"Show post-processing view plugins"));
256 s.push_back(mp(
"Shift+w",
"Show post-processing view options"));
257 s.push_back(mp(
"Shift+x",
"Move only along x coordinate in geometry "
259 s.push_back(mp(
"Shift+y",
"Move only along y coordinate in geometry "
261 s.push_back(mp(
"Shift+z",
"Move only along z coordinate in geometry "
263 s.push_back(mp(
"Shift+Escape",
"Enable full mouse selection"));
264 s.push_back(mp(cc +
"d",
"Attach/detach menu"));
265 s.push_back(mp(cc +
"e",
"Export project"));
266 s.push_back(mp(cc +
"f",
"Enter full screen"));
267 s.push_back(mp(cc +
"i",
"Show statistics window"));
268 s.push_back(mp(cc +
"j",
"Save model options"));
269 s.push_back(mp(cc +
"l",
"Show message console"));
270 #if defined(__APPLE__)
271 s.push_back(mp(cc +
"m",
"Minimize window"));
273 s.push_back(mp(cc +
"n",
"Create new project file"));
274 s.push_back(mp(cc +
"o",
"Open project file"));
275 s.push_back(mp(cc +
"q",
"Quit"));
276 s.push_back(mp(cc +
"r",
"Rename project file"));
277 s.push_back(mp(cc +
"s",
"Save mesh in default format"));
278 s.push_back(mp(
"Shift+" + cc +
"c",
"Show clipping plane window"));
279 s.push_back(mp(
"Shift+" + cc +
"h",
"Show current options and workspace "
281 s.push_back(mp(
"Shift+" + cc +
"j",
"Save options as default"));
282 s.push_back(mp(
"Shift+" + cc +
"m",
"Show manipulator window"));
283 s.push_back(mp(
"Shift+" + cc +
"n",
"Show option window"));
284 s.push_back(mp(
"Shift+" + cc +
"o",
"Merge file(s)"));
285 s.push_back(mp(
"Shift+" + cc +
"r",
"Open next-to-last opened file"));
286 s.push_back(mp(
"Shift+" + cc +
"u",
"Show plugin window"));
287 s.push_back(mp(
"Shift+" + cc +
"v",
"Show visibility window"));
288 s.push_back(mp(
"Alt+a",
"Loop through axes modes"));
289 s.push_back(mp(
"Alt+b",
"Hide/show bounding boxes"));
290 s.push_back(mp(
"Alt+c",
"Loop through predefined color schemes"));
291 s.push_back(mp(
"Alt+e",
"Hide/Show element outlines for visible post-pro "
293 s.push_back(mp(
"Alt+f",
"Change redraw mode (fast/full)"));
294 s.push_back(mp(
"Alt+h",
"Hide/show all post-processing views"));
295 s.push_back(mp(
"Alt+i",
"Hide/show all post-processing view scales"));
296 s.push_back(mp(
"Alt+l",
"Hide/show geometry lines"));
297 s.push_back(mp(
"Alt+m",
"Toggle visibility of all mesh entities"));
298 s.push_back(mp(
"Alt+n",
"Hide/show all post-processing view annotations"));
299 s.push_back(mp(
"Alt+o",
"Change projection mode (orthographic/perspective)"));
300 s.push_back(mp(
"Alt+p",
"Hide/show geometry points"));
301 s.push_back(mp(
"Alt+r",
"Loop through range modes for visible post-pro "
303 s.push_back(mp(
"Alt+s",
"Hide/show geometry surfaces"));
304 s.push_back(mp(
"Alt+t",
"Loop through interval modes for visible post-pro "
306 s.push_back(mp(
"Alt+v",
"Hide/show geometry volumes"));
307 s.push_back(mp(
"Alt+w",
"Enable/disable all lighting"));
308 s.push_back(mp(
"Alt+x",
"Set X view"));
309 s.push_back(mp(
"Alt+y",
"Set Y view"));
310 s.push_back(mp(
"Alt+z",
"Set Z view"));
311 s.push_back(mp(
"Alt+1",
"Set 1:1 view"));
312 s.push_back(mp(
"Alt+Shift+a",
"Hide/show small axes"));
313 s.push_back(mp(
"Alt+Shift+b",
"Hide/show mesh volume faces"));
314 s.push_back(mp(
"Alt+Shift+c",
"Loop through predefined colormaps"));
315 s.push_back(mp(
"Alt+Shift+d",
"Hide/show mesh surface faces"));
316 s.push_back(mp(
"Alt+Shift+l",
"Hide/show mesh lines"));
317 s.push_back(mp(
"Alt+Shift+p",
"Hide/show mesh nodes"));
318 s.push_back(mp(
"Alt+Shift+s",
"Hide/show mesh surface edges"));
319 s.push_back(mp(
"Alt+Shift+t",
"Same as Alt+t, but with numeric mode "
321 s.push_back(mp(
"Alt+Shift+v",
"Hide/show mesh volume edges"));
322 s.push_back(mp(
"Alt+Shift+x",
"Set -X view"));
323 s.push_back(mp(
"Alt+Shift+y",
"Set -Y view"));
324 s.push_back(mp(
"Alt+Shift+z",
"Set -Z view"));
325 s.push_back(mp(
"Alt+Shift+1",
"Reset bounding box around visible entities"));
326 s.push_back(mp(
"Alt+" + cc +
"+1",
"Sync scale between viewports"));
332 typedef std::pair<std::string, std::string> mp;
334 s.push_back(mp(
"Move",
"Highlight the entity under the mouse pointer and "
335 "display its properties / Resize a lasso zoom or a lasso "
337 s.push_back(mp(
"Left button",
"Rotate / Select an entity / Accept a lasso "
338 "zoom or a lasso selection"));
339 s.push_back(mp(
"Ctrl+Left button",
"Start a lasso zoom or a lasso "
341 s.push_back(mp(
"Middle button",
"Zoom / Unselect an entity / Accept a lasso "
342 "zoom or a lasso unselection"));
343 s.push_back(mp(
"Ctrl+Middle button",
"Orthogonalize display"));
344 s.push_back(mp(
"Right button",
"Pan / Cancel a lasso zoom or a lasso "
345 "(un)selection / Pop-up menu on post-processing view button"));
346 s.push_back(mp(
"Ctrl+Right button",
"Reset to default viewpoint"));
352 Msg::Direct(
"Usage: %s [options] [files]", name.c_str());
353 std::vector<std::pair<std::string, std::string> > s =
GetUsage();
354 for(std::size_t i = 0; i < s.size(); i++) {
355 std::string a = s[i].first, b = s[i].second;
358 if(a.size() < 20) a.resize(20,
' ');
366 std::vector<std::string> s;
367 s.push_back(std::string(
"Version : ") + GMSH_VERSION);
368 s.push_back(std::string(
"License : ") + GMSH_SHORT_LICENSE);
369 s.push_back(std::string(
"Build OS : ") + GMSH_OS);
370 s.push_back(std::string(
"Build date : ") + GMSH_DATE);
371 s.push_back(std::string(
"Build host : ") + GMSH_HOST);
372 s.push_back(std::string(
"Build options :") + GMSH_CONFIG_OPTIONS);
373 #if defined(HAVE_FLTK)
376 sprintf(tmp,
"%d.%d.%d", FL_MAJOR_VERSION, FL_MINOR_VERSION,
378 s.push_back(std::string(
"FLTK version : ") + tmp);
381 #if defined(HAVE_PETSC)
384 sprintf(tmp,
"%d.%d.%d (%s arithmtic)", PETSC_VERSION_MAJOR,
385 PETSC_VERSION_MINOR, PETSC_VERSION_SUBMINOR,
386 #
if defined(PETSC_USE_COMPLEX)
392 s.push_back(std::string(
"PETSc version : ") + tmp);
395 #if defined(HAVE_OCC)
398 sprintf(tmp,
"%d.%d.%d", OCC_VERSION_MAJOR, OCC_VERSION_MINOR,
399 OCC_VERSION_MAINTENANCE);
400 s.push_back(std::string(
"OCC version : ") + tmp);
403 #if defined(HAVE_MED)
406 sprintf(tmp,
"%d.%d.%d", MED_NUM_MAJEUR, MED_NUM_MINEUR, MED_NUM_RELEASE);
407 s.push_back(std::string(
"MED version : ") + tmp);
410 s.push_back(std::string(
"Packaged by : ") + GMSH_PACKAGER);
411 s.push_back(
"Web site : https://gmsh.info");
412 s.push_back(
"Issue tracker : https://gitlab.onelab.info/gmsh/gmsh/issues");
419 for(std::size_t i = 0; i < s.size(); i++)
Msg::Direct(
"%s", s[i].c_str());
423 std::size_t &i,
bool exitOnError)
425 if(i < 0 || i >= argv.size())
return false;
427 if(argv[i] ==
"-0") {
431 else if(argv[i] ==
"-tol") {
440 else if(argv[i] ==
"-match") {
444 else if(argv[i] ==
"-scale") {
453 else if(argv[i] ==
"-autoex") {
465 std::size_t &i,
bool exitOnError)
467 if(i < 0 || i >= argv.size())
return false;
469 if(argv[i] ==
"-check") {
473 else if(argv[i] ==
"-1") {
477 else if(argv[i] ==
"-2") {
481 else if(argv[i] ==
"-3") {
485 else if(argv[i] ==
"-4") {
489 else if(argv[i] ==
"-save") {
493 else if(argv[i] ==
"-refine") {
497 else if(argv[i] ==
"-barycentric_refine") {
501 else if(argv[i] ==
"-reclassify") {
503 if(i < argv.size()) {
512 else if(argv[i] ==
"-reparam") {
514 if(i < argv.size()) {
523 else if(argv[i] ==
"-quadlayout") {
527 else if(argv[i] ==
"-part") {
529 if(i < argv.size()) {
538 else if(argv[i] ==
"-part_weight" || argv[i] ==
"-partWeight") {
544 if(i < argv.size()) {
545 if(argv[i] ==
"tri" || argv[i] ==
"triangle") {
549 else if(argv[i] ==
"quad" || argv[i] ==
"quadrangle") {
553 else if(argv[i] ==
"tet" || argv[i] ==
"tetrahedron") {
557 else if(argv[i] ==
"hex" || argv[i] ==
"hexahedron") {
561 else if(argv[i] ==
"pri" || argv[i] ==
"prism") {
565 else if(argv[i] ==
"pyr" || argv[i] ==
"pyramid") {
569 else if(argv[i] ==
"trih" || argv[i] ==
"trihedron") {
572 atoi(argv[i].c_str()));
575 Msg::Error(
"Bad argument for 'partWeight' (%s)", argv[i].c_str());
584 else if(argv[i] ==
"-part_split" || argv[i] ==
"-part_split_files" ||
585 argv[i] ==
"-oneFilePerPart") {
589 else if(argv[i] ==
"-preserve_numbering_msh2" ||
590 argv[i] ==
"-preserveNumberingMsh2") {
594 else if(argv[i] ==
"-part_topo_pro" || argv[i] ==
"-savePartTopology") {
598 else if(argv[i] ==
"-part_topo") {
602 else if(argv[i] ==
"-part_no_topo") {
606 else if(argv[i] ==
"-part_physicals") {
610 else if(argv[i] ==
"-part_no_physicals") {
614 else if(argv[i] ==
"-part_ghosts") {
618 else if(argv[i] ==
"-part_no_ghosts") {
622 else if(argv[i] ==
"-saveall" || argv[i] ==
"-save_all") {
626 else if(argv[i] ==
"-switch_tags") {
630 else if(argv[i] ==
"-optimize") {
632 "Gmsh optimizes tetrahedral meshes by default");
634 "control which elements are optimized");
635 Msg::Warning(
"Option '-optimize_threshold 0' leads to no optimization");
639 else if(argv[i] ==
"-optimize_threshold") {
648 else if(argv[i] ==
"-optimize_netgen") {
652 else if(argv[i] ==
"-optimize_ho" || argv[i] ==
"-hoOptimize") {
656 else if(argv[i] ==
"-ho_min") {
665 else if(argv[i] ==
"-ho_max") {
674 else if(argv[i] ==
"-ho_nlayers") {
683 else if(argv[i] ==
"-debugSurface") {
692 else if(argv[i] ==
"-aniso_max" || argv[i] ==
"-anisoMax") {
701 else if(argv[i] ==
"-smooth_ratio" || argv[i] ==
"-smoothRatio") {
710 else if(argv[i] ==
"-bgm") {
719 else if(argv[i] ==
"-size_field") {
726 Msg::Error(
"Missing number of layers per gap");
736 Msg::Error(
"Missing number of elements density");
744 Msg::Info(
"Gradation must be > 1 : set to 1.05");
752 else if(argv[i] ==
"-vmsh") {
754 if(i < argv.size()) {
762 else if(argv[i] ==
"-convert") {
765 while(i < argv.size()) {
766 std::string fileName = std::string(argv[i]) +
"_new";
767 #if defined(HAVE_POST)
771 #if defined(HAVE_POST)
773 for(std::size_t j = n; j <
PView::list.size(); j++)
774 PView::list[j]->write(fileName, 1, (j == n) ?
false :
true);
786 else if(argv[i] ==
"-meshscale") {
795 else if(argv[i] ==
"-rand") {
804 else if(argv[i] ==
"-clscale") {
806 if(i < argv.size()) {
809 Msg::Error(
"Mesh element size factor must be > 0");
818 else if(argv[i] ==
"-clmin") {
827 else if(argv[i] ==
"-clmax") {
829 if(i < argv.size()) {
832 Msg::Error(
"Maximum length size must be > 0");
841 else if(argv[i] ==
"-clextend") {
850 else if(argv[i] ==
"-ignore_periodicity" ||
851 argv[i] ==
"-ignorePeriodicity") {
855 else if(argv[i] ==
"-edgelmin") {
864 else if(argv[i] ==
"-epslc1d") {
866 if(i < argv.size()) {
868 atof(argv[i++].c_str()));
870 Msg::Error(
"Integration accuracy must be > 0");
879 else if(argv[i] ==
"-swapangle") {
888 else if(argv[i] ==
"-clcurv") {
890 if(i < argv.size()) {
898 else if(argv[i] ==
"-clcurviso") {
902 else if(argv[i] ==
"-smooth") {
911 else if(argv[i] ==
"-order" || argv[i] ==
"-degree") {
920 else if(argv[i] ==
"-numsubedges") {
929 else if(argv[i] ==
"-statreport") {
939 else if(argv[i] ==
"-append_statreport") {
949 else if(argv[i] ==
"-bin") {
953 else if(argv[i] ==
"-save_parametric" || argv[i] ==
"-parametric") {
957 else if(argv[i] ==
"-save_topology" || argv[i] ==
"-save_entities") {
961 else if(argv[i] ==
"-algo") {
963 if(i < argv.size()) {
964 if(argv[i] ==
"MeshAdapt" || argv[i] ==
"meshadapt" ||
967 else if(argv[i] ==
"auto")
969 else if(argv[i] ==
"Delaunay2D" || argv[i] ==
"del2d" ||
972 else if(argv[i] ==
"FrontalDelaunay2D" || argv[i] ==
"front2d" ||
973 argv[i] ==
"frontal")
975 else if(argv[i] ==
"bamg")
977 else if(argv[i] ==
"DelaunayFrontalForQuads" || argv[i] ==
"delquad")
979 else if(argv[i] ==
"PackingOfParallelograms" || argv[i] ==
"pack")
981 else if(argv[i] ==
"QuadQuasiStructured" || argv[i] ==
"quadqs")
983 else if(argv[i] ==
"initial2d")
985 else if(argv[i] ==
"del3d" || argv[i] ==
"gmsh3d")
987 else if(argv[i] ==
"front3d" || argv[i] ==
"netgen")
989 else if(argv[i] ==
"mmg3d")
991 else if(argv[i] ==
"rtree3d")
993 else if(argv[i] ==
"hxt")
995 else if(argv[i] ==
"initial3d")
1008 else if(argv[i] ==
"-quad") {
1013 else if(argv[i] ==
"-format" || argv[i] ==
"-f") {
1015 if(i < argv.size()) {
1016 double version = 0.;
1020 Msg::Error(
"Unknown mesh format '%s'", argv[i].c_str());
1035 else if(argv[i] ==
"-dual") {
1039 else if(argv[i] ==
"-voronoi") {
1043 else if(argv[i] ==
"-nomesh") {
1060 std::size_t &i,
bool exitOnError)
1062 if(i < 0 || i >= argv.size())
return false;
1064 if(argv[i] ==
"-noview") {
1068 else if(argv[i] ==
"-link") {
1077 else if(argv[i] ==
"-smoothview") {
1081 else if(argv[i] ==
"-combine") {
1093 std::size_t &i,
bool exitOnError)
1095 if(i < 0 || i >= argv.size())
return false;
1097 if(argv[i] ==
"-run") {
1104 else if(argv[i] ==
"-onelab") {
1106 if(i + 1 < argv.size() && argv[i + 1].size() && argv[i + 1][0] !=
'-') {
1110 else if(i < argv.size()) {
1115 Msg::Error(
"Missing client name and/or address of ONELAB server");
1119 else if(argv[i] ==
"-socket") {
1129 else if(argv[i] ==
"-listen") {
1132 if(i < argv.size() && argv[i].size() && argv[i][0] !=
'-')
1135 else if(argv[i] ==
"-minterpreter") {
1144 else if(argv[i] ==
"-pyinterpreter") {
1161 std::size_t &i,
bool exitOnError)
1163 if(i < 0 || i >= argv.size())
return false;
1165 if(argv[i] ==
"-" || argv[i] ==
"-parse_and_exit") {
1169 else if(argv[i] ==
"-log") {
1177 else if(argv[i] ==
"-new") {
1181 else if(argv[i] ==
"-open") {
1185 else if(argv[i] ==
"-merge") {
1189 else if(argv[i] ==
"-pid") {
1194 else if(argv[i] ==
"-a") {
1198 else if(argv[i] ==
"-g") {
1202 else if(argv[i] ==
"-m") {
1206 else if(argv[i] ==
"-s") {
1210 else if(argv[i] ==
"-p") {
1214 else if(argv[i] ==
"-nopopup") {
1218 else if(argv[i] ==
"-watch") {
1220 if(i < argv.size()) {
1221 std::string tmp = argv[i++];
1222 if(tmp.size() > 2 && tmp[0] ==
'"' && tmp[tmp.size() - 1] ==
'"')
1224 tmp.substr(1, tmp.size() - 2));
1233 else if(argv[i] ==
"-string") {
1242 else if(argv[i] ==
"-setstring") {
1244 if(i + 1 < argv.size()) {
1245 std::string n(argv[i]), cat, opt, v = argv[i + 1], olName;
1254 #if defined(HAVE_PARSER)
1262 Msg::Error(
"Missing name and/or value for string definition");
1266 else if(argv[i] ==
"-setnumber") {
1268 if(i + 1 < argv.size()) {
1269 std::string n(argv[i]), cat, opt, olName;
1270 double v = atof(argv[i + 1].c_str());
1279 #if defined(HAVE_PARSER)
1287 Msg::Error(
"Missing name and/or value for number definition");
1291 else if(argv[i] ==
"-setlist" || argv[i] ==
"-setlistofnumbers") {
1293 if(i + 1 < argv.size() && argv[i].size() && argv[i][0] !=
'-') {
1294 std::string n(argv[i]);
1295 std::vector<double> v;
1296 int s = atoi(argv[i + 1].c_str()), j = 0;
1298 while(j < s && i < argv.size()) {
1299 v.push_back(atof(argv[i].c_str()));
1304 Msg::Error(
"Missing values in list (got %d instead of %d)", j, s);
1307 #if defined(HAVE_PARSER)
1314 "Missing name and/or value for definition of list of numbers");
1318 else if(argv[i] ==
"-option") {
1327 else if(argv[i] ==
"-cpu") {
1332 else if(argv[i] ==
"-o") {
1341 else if(argv[i] ==
"-windows") {
1350 else if(argv[i] ==
"-tiles") {
1359 else if(argv[i] ==
"-bg") {
1368 else if(argv[i] ==
"-version" || argv[i] ==
"--version") {
1369 fprintf(stdout,
"%s\n", GMSH_VERSION);
1373 else if(argv[i] ==
"-info" || argv[i] ==
"--info") {
1377 else if(argv[i] ==
"-help" || argv[i] ==
"--help") {
1378 Msg::Direct(
"Gmsh, a 3D mesh generator with pre- and post-processing "
1380 Msg::Direct(
"Copyright (C) 1997-2022 C. Geuzaine and J.-F. Remacle");
1384 else if(argv[i] ==
"-help_options") {
1385 std::vector<std::string> s;
1387 for(std::size_t i = 0; i < s.size(); i++)
1391 else if(argv[i] ==
"-v" || argv[i] ==
"-verbose") {
1400 else if(argv[i] ==
"-nt") {
1409 else if(argv[i] ==
"-n") {
1419 else if(argv[i] ==
"-nodb") {
1423 else if(argv[i] ==
"-camera") {
1427 else if(argv[i] ==
"-stereo") {
1431 else if(argv[i] ==
"-gamepad") {
1435 else if(argv[i] ==
"-fontsize") {
1444 else if(argv[i] ==
"-deltafontsize") {
1453 else if(argv[i] ==
"-theme" || argv[i] ==
"-scheme") {
1462 else if(argv[i] ==
"-display") {
1485 #if defined(HAVE_PARSER)
1486 if(readConfigFiles) {
1500 while(i < argv.size()) {
1501 if(argv[i].size() && argv[i][0] ==
'-') {
1512 else if(argv[i] ==
"-term") {
1516 #if defined(__APPLE__)
1517 else if(argv[i] ==
"-psn") {
1524 #if defined(HAVE_PETSC) || defined(HAVE_MPI)
1526 Msg::Warning(
"Skipping unknown option '%s'", argv[i].c_str());
1529 Msg::Error(
"Unknown option '%s'", argv[i].c_str());
static bool GetSolverOption(const std::vector< std::string > &argv, std::size_t &i, bool exitOnError)
double opt_mesh_volume_faces(OPT_ARGS_NUM)
double opt_general_num_threads(OPT_ARGS_NUM)
std::string GetKnownFileFormats(bool onlyMeshFormats)
std::vector< std::pair< std::string, std::string > > GetMouseUsage()
double opt_mesh_partition_split_mesh_files(OPT_ARGS_NUM)
bool SplitOptionName(const std::string &fullName, std::string &category, std::string &name, int &index)
double opt_mesh_smooth_ratio(OPT_ARGS_NUM)
static std::map< std::string, std::string > & GetCommandLineStrings()
const char * GetGmshPackager()
int createAppendMeshStatReport
double opt_mesh_partition_create_topology(OPT_ARGS_NUM)
static void SetInfoMem(bool val)
double opt_mesh_ho_threshold_max(OPT_ARGS_NUM)
double opt_mesh_lc_extend_from_boundary(OPT_ARGS_NUM)
std::string opt_solver_socket_name(OPT_ARGS_STR)
static void Info(const char *fmt,...)
double opt_mesh_file_format(OPT_ARGS_NUM)
double opt_mesh_binary(OPT_ARGS_NUM)
std::vector< std::pair< std::string, std::string > > GetShortcutsUsage(const std::string &ctrl)
double opt_mesh_optimize_threshold(OPT_ARGS_NUM)
void CreateOutputFile(const std::string &fileName, int format, bool status)
static void Warning(const char *fmt,...)
std::string opt_general_watch_file_pattern(OPT_ARGS_STR)
double opt_mesh_partition_create_physicals(OPT_ARGS_NUM)
static void Error(const char *fmt,...)
double opt_mesh_lc_integration_precision(OPT_ARGS_NUM)
double opt_mesh_nb_smoothing(OPT_ARGS_NUM)
double opt_mesh_algo3d(OPT_ARGS_NUM)
static void SetExecutableName(const std::string &name)
#define ALGO_2D_PACK_PRLGRMS
double opt_mesh_lines(OPT_ARGS_NUM)
double opt_mesh_partition_metis_algorithm(OPT_ARGS_NUM)
double opt_general_gamepad(OPT_ARGS_NUM)
const char * GetGmshBuildHost()
double opt_mesh_msh_file_version(OPT_ARGS_NUM)
static bool GetGeometryOption(const std::vector< std::string > &argv, std::size_t &i, bool exitOnError)
double opt_mesh_partition_hex_weight(OPT_ARGS_NUM)
double opt_mesh_ho_optimize(OPT_ARGS_NUM)
std::vector< std::string > files
double opt_mesh_surface_faces(OPT_ARGS_NUM)
double opt_post_smooth(OPT_ARGS_NUM)
int GetGmshPatchVersion()
double opt_mesh_partition_trih_weight(OPT_ARGS_NUM)
const char * GetGmshVersion()
static bool GetMeshOption(const std::vector< std::string > &argv, std::size_t &i, bool exitOnError)
std::string opt_solver_python_interpreter(OPT_ARGS_STR)
static bool GetPostProcessingOption(const std::vector< std::string > &argv, std::size_t &i, bool exitOnError)
double opt_geometry_scaling_factor(OPT_ARGS_NUM)
int GetGmshMinorVersion()
double opt_general_fontsize(OPT_ARGS_NUM)
static bool GetOtherOption(const std::vector< std::string > &argv, std::size_t &i, bool exitOnError)
double opt_mesh_aniso_max(OPT_ARGS_NUM)
double opt_general_camera_mode(OPT_ARGS_NUM)
void ParseString(const std::string &str, bool inCurrentModelDir)
static void SetOnelabString(const std::string &name, const std::string &val, bool visible=true, bool persistent=false, bool readOnly=false, int changedValue=3, const std::string &kind="")
double opt_mesh_lc_min(OPT_ARGS_NUM)
std::string opt_solver_octave_interpreter(OPT_ARGS_STR)
#define ALGO_2D_FRONTAL_QUAD
void PrintOptions(int num, int level, int diff, int help, const char *filename, std::vector< std::string > *vec)
double opt_mesh_nodes(OPT_ARGS_NUM)
const char * GetGmshShortLicense()
void setFileName(const std::string &fileName)
double opt_mesh_algo_recombine(OPT_ARGS_NUM)
std::map< std::string, gmsh_yysymbol > gmsh_yysymbols
static void InitializeOnelab(const std::string &name, const std::string &sockname="")
void OpenProject(const std::string &fileName, bool errorIfMissing)
double opt_general_stereo_mode(OPT_ARGS_NUM)
double opt_solver_listen(OPT_ARGS_NUM)
double opt_mesh_scaling_factor(OPT_ARGS_NUM)
double opt_post_link(OPT_ARGS_NUM)
double opt_general_nopopup(OPT_ARGS_NUM)
double opt_mesh_lc_from_curvature_iso(OPT_ARGS_NUM)
double opt_mesh_dual(OPT_ARGS_NUM)
void GmshSetStringOption(const std::string &category, const std::string &name, std::string value, int index)
double opt_mesh_partition_qua_weight(OPT_ARGS_NUM)
double opt_mesh_voronoi(OPT_ARGS_NUM)
std::string opt_general_gui_theme(OPT_ARGS_STR)
double opt_mesh_ho_nlayers(OPT_ARGS_NUM)
double opt_mesh_partition_tet_weight(OPT_ARGS_NUM)
std::string outputFileName
double opt_mesh_partition_create_ghost_cells(OPT_ARGS_NUM)
double opt_mesh_volume_edges(OPT_ARGS_NUM)
const char * GetGmshBuildDate()
double opt_mesh_allow_swap_edge_angle(OPT_ARGS_NUM)
static void Exit(int level)
const char * GetGmshBuildOptions()
#define ALGO_2D_MESHADAPT
double opt_mesh_order(OPT_ARGS_NUM)
double opt_mesh_partition_num(OPT_ARGS_NUM)
double opt_geometry_tolerance(OPT_ARGS_NUM)
double opt_mesh_preserve_numbering_msh2(OPT_ARGS_NUM)
double opt_mesh_lc_max(OPT_ARGS_NUM)
double opt_mesh_tolerance_edge_length(OPT_ARGS_NUM)
contextGeometryOptions geom
int GetGmshMajorVersion()
std::string meshStatReportFileName
std::string opt_general_display(OPT_ARGS_STR)
void PrintUsage(const std::string &name)
std::string opt_general_background_image_filename(OPT_ARGS_STR)
double opt_mesh_save_all(OPT_ARGS_NUM)
static std::map< std::string, std::vector< double > > & GetCommandLineNumbers()
static void Direct(const char *fmt,...)
double opt_mesh_optimize(OPT_ARGS_NUM)
static std::vector< std::string > & GetCommandLineArgs()
double opt_general_initial_context(OPT_ARGS_NUM)
double opt_mesh_rand_factor(OPT_ARGS_NUM)
std::vector< std::string > GetBuildInfo()
#define ALGO_2D_INITIAL_ONLY
std::map< std::string, std::vector< std::string > > gmsh_yystringsymbols
const char * GetGmshBuildOS()
int GetFileFormatFromExtension(const std::string &ext, double *version)
double opt_mesh_ho_threshold_min(OPT_ARGS_NUM)
double opt_mesh_recombine_all(OPT_ARGS_NUM)
double opt_mesh_save_topology(OPT_ARGS_NUM)
#define ALGO_3D_INITIAL_ONLY
static void SetVerbosity(int val)
int launchSolverAtStartup
const char * GetGmshExtraVersion()
double opt_mesh_switch_elem_tags(OPT_ARGS_NUM)
double opt_general_double_buffer(OPT_ARGS_NUM)
double opt_mesh_num_sub_edges(OPT_ARGS_NUM)
void GetOptions(bool readConfigFiles, bool exitOnError)
double opt_mesh_algo2d(OPT_ARGS_NUM)
double opt_mesh_lc_from_curvature(OPT_ARGS_NUM)
bool IsOnelabName(const std::string &name, std::string &cleanName)
static void SetOnelabNumber(const std::string &name, double val, bool visible=true, bool persistent=false, bool readOnly=false, int changedValue=3)
std::vector< std::pair< std::string, std::string > > GetUsage()
static std::vector< PView * > list
double opt_mesh_partition_tri_weight(OPT_ARGS_NUM)
double opt_mesh_partition_pri_weight(OPT_ARGS_NUM)
double opt_view_visible(OPT_ARGS_NUM)
int ParseFile(const std::string &fileName, bool close, bool errorIfMissing)
double opt_mesh_lc_factor(OPT_ARGS_NUM)
double opt_mesh_save_parametric(OPT_ARGS_NUM)
double opt_geometry_match_geom_and_mesh(OPT_ARGS_NUM)
#define ALGO_2D_QUAD_QUASI_STRUCT
void GmshSetNumberOption(const std::string &category, const std::string &name, double value, int index)
double opt_mesh_surface_edges(OPT_ARGS_NUM)
double opt_mesh_optimize_netgen(OPT_ARGS_NUM)
double opt_mesh_partition_pyr_weight(OPT_ARGS_NUM)
static GModel * current(int index=-1)
double opt_mesh_ignore_periodicity(OPT_ARGS_NUM)
static void SetLogFile(const std::string &name)
double opt_mesh_partition_save_topology_file(OPT_ARGS_NUM)
static void SetInfoCpu(bool val)