From d6f4ceb55cc6c4cb5e860e3a37cae4f7aa2a8a2d Mon Sep 17 00:00:00 2001 From: Christophe Geuzaine <cgeuzaine@ulg.ac.be> Date: Tue, 9 Aug 2011 11:31:21 +0000 Subject: [PATCH] General.SaveOptions=2 will now save per-model options automatically on exit --- Common/DefaultOptions.h | 4 +- Common/GmshMessage.cpp | 6 +- doc/texinfo/opt_fields.texi | 58 +++++++++++++++ doc/texinfo/opt_general.texi | 48 ++++++++++--- doc/texinfo/opt_geometry.texi | 10 +-- doc/texinfo/opt_mesh.texi | 30 +++++--- doc/texinfo/opt_plugin.texi | 130 +++++++++++++++++++++++++++++++++- doc/texinfo/opt_solver.texi | 7 +- 8 files changed, 264 insertions(+), 29 deletions(-) diff --git a/Common/DefaultOptions.h b/Common/DefaultOptions.h index 4bd0da08e6..356d24aab7 100644 --- a/Common/DefaultOptions.h +++ b/Common/DefaultOptions.h @@ -805,8 +805,8 @@ StringXNumber GeneralOptions_Number[] = { "Z coordinate of the center of rotation" }, { F|S, "SaveOptions" , opt_general_options_save, 0. , - "Automatically save current options in General.OptionsFileName each time " - "you quit Gmsh?" }, + "Automatically save current options in General.OptionsFileName (1) or per model (2)" + "each time you quit Gmsh?" }, { F|S, "SaveSession" , opt_general_session_save, 1. , "Automatically save session specific information in General.SessionFileName " "each time you quit Gmsh?" }, diff --git a/Common/GmshMessage.cpp b/Common/GmshMessage.cpp index 86fe9bbfef..f5f303a706 100644 --- a/Common/GmshMessage.cpp +++ b/Common/GmshMessage.cpp @@ -120,9 +120,13 @@ void Msg::Exit(int level) if(CTX::instance()->sessionSave) PrintOptions(0, GMSH_SESSIONRC, 0, 0, (CTX::instance()->homeDir + CTX::instance()->sessionFileName).c_str()); - if(CTX::instance()->optionsSave) + if(CTX::instance()->optionsSave == 1) PrintOptions(0, GMSH_OPTIONSRC, 1, 0, (CTX::instance()->homeDir + CTX::instance()->optionsFileName).c_str()); + else if(CTX::instance()->optionsSave == 2){ + std::string fileName = GModel::current()->getFileName() + ".opt"; + PrintOptions(0, GMSH_FULLRC, 1, 0, fileName.c_str()); + } } #endif diff --git a/doc/texinfo/opt_fields.texi b/doc/texinfo/opt_fields.texi index c6d3ad2196..f991020068 100644 --- a/doc/texinfo/opt_fields.texi +++ b/doc/texinfo/opt_fields.texi @@ -16,6 +16,18 @@ default value: @code{@{@}} Indices of surfaces in the geometric model (Warning, this feature is still experimental. It might (read: will probably) give wrong results for complex surfaces)@* type: list@* default value: @code{@{@}} +@item FieldX +Id of the field to use as x coordinate.@* +type: integer@* +default value: @code{-1} +@item FieldY +Id of the field to use as y coordinate.@* +type: integer@* +default value: @code{-1} +@item FieldZ +Id of the field to use as z coordinate.@* +type: integer@* +default value: @code{-1} @item NNodesByEdge Number of nodes used to discretized each curve@* type: integer@* @@ -26,6 +38,44 @@ type: list@* default value: @code{@{@}} @end table +@item AttractorAnisoCurve +Compute the distance from the nearest curve in a list. Then the mesh size can be specified independently in the direction normal to the curve and in the direction parallel to the curve (Each curve is replaced by NNodesByEdge equidistant nodes and the distance from those nodes is computed.)@* +Options:@* +@table @code +@item EdgesList +Indices of curves in the geometric model@* +type: list@* +default value: @code{@{@}} +@item NNodesByEdge +Number of nodes used to discretized each curve@* +type: integer@* +default value: @code{20} +@item dMax +Maxmium distance, above this distance from the curves, prescribe the maximum mesh sizes.@* +type: float@* +default value: @code{0.5} +@item dMin +Minimum distance, bellow this distance from the curves, prescribe the minimum mesh sizes.@* +type: float@* +default value: @code{0.1} +@item lMaxNormal +Maximum mesh size in the direction normal to the closest curve.@* +type: float@* +default value: @code{0.5} +@item lMaxTangent +Maximum mesh size in the direction tangeant to the closest curve.@* +type: float@* +default value: @code{0.5} +@item lMinNormal +Minimum mesh size in the direction normal to the closest curve.@* +type: float@* +default value: @code{0.05} +@item lMinTangent +Minimum mesh size in the direction tangeant to the closest curve.@* +type: float@* +default value: @code{0.5} +@end table + @item BoundaryLayer hwall * ratio^(dist/hwall)@* Options:@* @@ -202,10 +252,18 @@ Evaluate Field[IField] in geographic coordinates (longitude, latitude):@* F = Field[IField](atan(y/x), asin(z/sqrt(x^2+y^2+z^2))@* Options:@* @table @code +@item FromStereo +if = 1, the mesh is in stereographic coordinates. xi = 2Rx/(R+z), eta = 2Ry/(R+z)@* +type: integer@* +default value: @code{0} @item IField Index of the field to evaluate.@* type: integer@* default value: @code{1} +@item RadiusStereo +radius of the sphere of the stereograpic coordinates@* +type: float@* +default value: @code{6371000} @end table @item MathEval diff --git a/doc/texinfo/opt_general.texi b/doc/texinfo/opt_general.texi index af95f8af01..a8ba9f6264 100644 --- a/doc/texinfo/opt_general.texi +++ b/doc/texinfo/opt_general.texi @@ -81,27 +81,27 @@ Saved in: @code{General.SessionFileName} @item General.RecentFile1 Most recent opened file@* -Default value: @code{""}@* +Default value: @code{"untitled.geo"}@* Saved in: @code{General.SessionFileName} @item General.RecentFile2 2nd most recent opened file@* -Default value: @code{""}@* +Default value: @code{"untitled.geo"}@* Saved in: @code{General.SessionFileName} @item General.RecentFile3 3rd most recent opened file@* -Default value: @code{""}@* +Default value: @code{"untitled.geo"}@* Saved in: @code{General.SessionFileName} @item General.RecentFile4 4th most recent opened file@* -Default value: @code{""}@* +Default value: @code{"untitled.geo"}@* Saved in: @code{General.SessionFileName} @item General.RecentFile5 5th most recent opened file@* -Default value: @code{""}@* +Default value: @code{"untitled.geo"}@* Saved in: @code{General.SessionFileName} @item General.SessionFileName @@ -229,6 +229,26 @@ Y position (in pixels) of background image (< 0: measure from bottom edge; >= 1e Default value: @code{100000}@* Saved in: @code{General.OptionsFileName} +@item General.Camera +Enable camera view mode@* +Default value: @code{0}@* +Saved in: @code{General.OptionsFileName} + +@item General.CameraAperture +Camera aperture in degrees@* +Default value: @code{40}@* +Saved in: @code{General.OptionsFileName} + +@item General.CameraEyeSeparationRatio +Eye separation ratio in % for stereo rendering@* +Default value: @code{1.5}@* +Saved in: @code{General.OptionsFileName} + +@item General.CameraFocalLengthRatio +Camera Focal length ratio@* +Default value: @code{1}@* +Saved in: @code{General.OptionsFileName} + @item General.Clip0A First coefficient in equation for clipping plane 0 (`A' in `AX+BY+CZ+D=0')@* Default value: @code{1}@* @@ -306,7 +326,7 @@ Saved in: @code{-} @item General.Clip3D Fourth coefficient in equation for clipping plane 3@* -Default value: @code{0}@* +Default value: @code{1}@* Saved in: @code{-} @item General.Clip4A @@ -326,7 +346,7 @@ Saved in: @code{-} @item General.Clip4D Fourth coefficient in equation for clipping plane 4@* -Default value: @code{0}@* +Default value: @code{1}@* Saved in: @code{-} @item General.Clip5A @@ -346,7 +366,7 @@ Saved in: @code{-} @item General.Clip5D Fourth coefficient in equation for clipping plane 5@* -Default value: @code{0}@* +Default value: @code{1}@* Saved in: @code{-} @item General.ClipFactor @@ -399,6 +419,11 @@ Vertical position (in pixels) of the upper left corner of the contextual windows Default value: @code{150}@* Saved in: @code{General.SessionFileName} +@item General.DisplayBorderFactor +Border factor for model display (0: model fits window size exactly)@* +Default value: @code{0.333333}@* +Saved in: @code{General.OptionsFileName} + @item General.DoubleBuffer Use a double buffered graphic window (on Unix, should be set to 0 when working on a remote host without GLX)@* Default value: @code{1}@* @@ -835,7 +860,7 @@ Default value: @code{0}@* Saved in: @code{-} @item General.SaveOptions -Automatically save current options in General.OptionsFileName each time you quit Gmsh?@* +Automatically save current options in General.OptionsFileName (1) or per model (2)each time you quit Gmsh?@* Default value: @code{0}@* Saved in: @code{General.SessionFileName} @@ -934,6 +959,11 @@ Use trackball rotation mode@* Default value: @code{1}@* Saved in: @code{General.OptionsFileName} +@item General.TrackballHyperbolicSheet +Use hyperbolic sheet away from trackball center for z-rotations@* +Default value: @code{1}@* +Saved in: @code{General.OptionsFileName} + @item General.TrackballQuaternion0 First trackball quaternion component (used if General.Trackball=1)@* Default value: @code{0}@* diff --git a/doc/texinfo/opt_geometry.texi b/doc/texinfo/opt_geometry.texi index b5280aea25..2fdabbe5f6 100644 --- a/doc/texinfo/opt_geometry.texi +++ b/doc/texinfo/opt_geometry.texi @@ -91,12 +91,12 @@ Saved in: @code{General.OptionsFileName} @item Geometry.OCCFixSmallEdges Fix small edges in STEP, IGES and BRep models@* -Default value: @code{1}@* +Default value: @code{0}@* Saved in: @code{General.OptionsFileName} @item Geometry.OCCFixSmallFaces Fix small faces in STEP, IGES and BRep models@* -Default value: @code{1}@* +Default value: @code{0}@* Saved in: @code{General.OptionsFileName} @item Geometry.OCCSewFaces @@ -110,17 +110,17 @@ Default value: @code{0}@* Saved in: @code{General.OptionsFileName} @item Geometry.OffsetX -Model diplay offset along X-axis (in model coordinates)@* +Model display offset along X-axis (in model coordinates)@* Default value: @code{0}@* Saved in: @code{-} @item Geometry.OffsetY -Model diplay offset along Y-axis (in model coordinates)@* +Model display offset along Y-axis (in model coordinates)@* Default value: @code{0}@* Saved in: @code{-} @item Geometry.OffsetZ -Model diplay offset along Z-axis (in model coordinates)@* +Model display offset along Z-axis (in model coordinates)@* Default value: @code{0}@* Saved in: @code{-} diff --git a/doc/texinfo/opt_mesh.texi b/doc/texinfo/opt_mesh.texi index f6c3a04075..40be028218 100644 --- a/doc/texinfo/opt_mesh.texi +++ b/doc/texinfo/opt_mesh.texi @@ -5,12 +5,12 @@ @ftable @code @item Mesh.Algorithm -2D mesh algorithm (1=MeshAdapt, 5=Delaunay, 6=Frontal)@* -Default value: @code{1}@* +2D mesh algorithm (1=MeshAdapt, 2=Automatic, 5=Delaunay, 6=Frontal, 7=bamg, 8=delquad)@* +Default value: @code{2}@* Saved in: @code{General.OptionsFileName} @item Mesh.Algorithm3D -3D mesh algorithm (1=Delaunay, 4=Frontal)@* +3D mesh algorithm (1=Delaunay, 4=Frontal, 5=Frontal Delaunay, 6=Frontal Hex, 7=MMG3D)@* Default value: @code{1}@* Saved in: @code{General.OptionsFileName} @@ -25,7 +25,7 @@ Default value: @code{1e+33}@* Saved in: @code{General.OptionsFileName} @item Mesh.AllowSwapAngle -Treshold angle (in degrees) between faces normals under which we allow an edge swap@* +Threshold angle (in degrees) between faces normals under which we allow an edge swap@* Default value: @code{10}@* Saved in: @code{General.OptionsFileName} @@ -194,6 +194,11 @@ Display mesh hexahedra?@* Default value: @code{1}@* Saved in: @code{General.OptionsFileName} +@item Mesh.HighOrderNoMetric +Don't use metric computation to create high-order meshes.@* +Default value: @code{0}@* +Saved in: @code{General.OptionsFileName} + @item Mesh.LabelSampling Label sampling rate (display one label every `LabelSampling' elements)@* Default value: @code{1}@* @@ -279,6 +284,11 @@ Split MSH file by mesh partition@* Default value: @code{0}@* Saved in: @code{General.OptionsFileName} +@item Mesh.MultiplePassesMeshes +Do a first simple mesh and use it for complex background meshes (curvatures...)@* +Default value: @code{0}@* +Saved in: @code{General.OptionsFileName} + @item Mesh.PartitionHexWeight Weight of hexahedral element for METIS load balancing@* Default value: @code{1}@* @@ -309,11 +319,6 @@ Weight of triangle for METIS load balancing@* Default value: @code{1}@* Saved in: @code{General.OptionsFileName} -@item Mesh.PartitionByExtrusion -Special partitioner that annotates all all extruded elements to the same node as the source element@* -Default value: @code{0}@* -Saved in: @code{General.OptionsFileName} - @item Mesh.NbHexahedra Number of hexahedra in the current mesh (read-only)@* Default value: @code{0}@* @@ -460,7 +465,7 @@ Default value: @code{0}@* Saved in: @code{General.OptionsFileName} @item Mesh.RemeshParametrization -Remsh Parametrization (0=harmonic, 1=conformal)@* +Remsh Parametrization (0=harmonic, 1=conformal, 2=rbf harmonic)@* Default value: @code{0}@* Saved in: @code{General.OptionsFileName} @@ -559,6 +564,11 @@ Display surface mesh element numbers?@* Default value: @code{0}@* Saved in: @code{General.OptionsFileName} +@item Mesh.SwitchElementTags +Invert elementary and physical tags when reading the mesh@* +Default value: @code{0}@* +Saved in: @code{General.OptionsFileName} + @item Mesh.Tangents Display size of tangent vectors (in pixels)@* Default value: @code{0}@* diff --git a/doc/texinfo/opt_plugin.texi b/doc/texinfo/opt_plugin.texi index 705d07d7c5..fb4908f9c5 100644 --- a/doc/texinfo/opt_plugin.texi +++ b/doc/texinfo/opt_plugin.texi @@ -37,6 +37,21 @@ Default value: @code{14} Default value: @code{-1} @end table +@item Plugin(Bubbles) +Plugin(Bubbles) constructs a geometry consisting of `bubbles' inscribed in the Voronoi of an input triangulation. `ShrinkFactor' allows to change the size of the bubbles. The plugin expects a triangulation in the `z = 0' plane to exist in the current model. + +Plugin(Bubbles) creates one `.geo' file. +String options: +@table @code +@item OutputFile +Default value: @code{"bubbles.geo"} +@end table +Numeric options: +@table @code +@item ShrinkFactor +Default value: @code{0} +@end table + @item Plugin(Curl) Plugin(Curl) computes the curl of the field in the view `View'. @@ -49,6 +64,58 @@ Numeric options: Default value: @code{-1} @end table +@item Plugin(CutBox) +Plugin(CutBox) cuts the view `View' with a rectangular box defined by the 4 points (`X0',`Y0',`Z0') (origin), (`X1',`Y1',`Z1') (axis of U), (`X2',`Y2',`Z2') (axis of V) and (`X3',`Y3',`Z3') (axis of W). + +The number of points along U, V, W is set with the options `NumPointsU', `NumPointsV' and `NumPointsW'. + +If `ConnectPoints' is zero, the plugin creates points; otherwise, the plugin generates hexahedra, quadrangles, lines or points depending on the values of `NumPointsU', `NumPointsV' and `NumPointsW'. + +If `Boundary' is zero, the plugin interpolates the view inside the box; otherwise the plugin interpolates the view at its boundary. + +If `View' < 0, the plugin is run on the current view. + +Plugin(CutBox) creates one new view. +Numeric options: +@table @code +@item X0 +Default value: @code{0} +@item Y0 +Default value: @code{0} +@item Z0 +Default value: @code{0} +@item X1 +Default value: @code{1} +@item Y1 +Default value: @code{0} +@item Z1 +Default value: @code{0} +@item X2 +Default value: @code{0} +@item Y2 +Default value: @code{1} +@item Z2 +Default value: @code{0} +@item X3 +Default value: @code{0} +@item Y3 +Default value: @code{0} +@item Z3 +Default value: @code{1} +@item NumPointsU +Default value: @code{20} +@item NumPointsV +Default value: @code{20} +@item NumPointsW +Default value: @code{20} +@item ConnectPoints +Default value: @code{1} +@item Boundary +Default value: @code{1} +@item View +Default value: @code{-1} +@end table + @item Plugin(CutGrid) Plugin(CutGrid) cuts the view `View' with a rectangular grid defined by the 3 points (`X0',`Y0',`Z0') (origin), (`X1',`Y1',`Z1') (axis of U) and (`X2',`Y2',`Z2') (axis of V). @@ -176,6 +243,14 @@ Default value: @code{0} Default value: @code{-1} @end table +@item Plugin(DiscretizationError) +Plugin(DiscretizationError) computes the error between the mesh and the geometry. It does so by supersampling the elements and computing the distance between the supersampled points dans their projection on the geometry. +Numeric options: +@table @code +@item SuperSamplingNodes +Default value: @code{10} +@end table + @item Plugin(Distance) Plugin(Distance) computes distances to physical entities in a mesh. @@ -281,6 +356,27 @@ Default value: @code{1} Default value: @code{-1} @end table +@item Plugin(FieldFromAmplitudePhase) +Plugin(FieldFromAmplitudePhase) builds a complex field 'u' from amplitude 'a' (complex) and phase 'phi' given in two different 'Views' u = a * exp(k*phi), with k the wavenumber. + +The result is to be interpolated in a sufficiently fine mesh: 'MeshFile'. + +Plugin(FieldFromAmplitudePhase) generates one new view. +String options: +@table @code +@item MeshFile +Default value: @code{"fine.msh"} +@end table +Numeric options: +@table @code +@item Wavenumber +Default value: @code{5} +@item AmplitudeView +Default value: @code{0} +@item PhaseView +Default value: @code{1} +@end table + @item Plugin(GSHHS) Plugin(GSHHS) read different kind of contour lines data and write a .geo file on the surface of a sphere (the Earth). @@ -318,7 +414,7 @@ If the "iField" option is set, consecutive points closer than the value of the f If "MinStraitsFactor" > 0 and if a field iField is provided, coastlines closer than MinStraitsFactor * field(IField) are merged and inner corners which form an angle < pi/3 are removed. -The output is always in stereographic coordinates, if the "WritePolarSphere" option is not 0, a sphere is added to the geo file. +The output is always in stereographic coordinates, if the "WritePolarSphere" option is greater than 0, a sphere is added to the geo file. WARNING: this plugin is still experimental and needs polishing and error-handling. In particular, it will probably crash if an inexistant field id is given or if the input/output cannot be open. String options: @@ -542,6 +638,8 @@ Default value: @code{-1} Default value: @code{-1} @item OtherView Default value: @code{-1} +@item ForceInterpolation +Default value: @code{0} @end table @item Plugin(MinMax) @@ -604,6 +702,8 @@ Default value: @code{-1} Default value: @code{-1} @item OtherView Default value: @code{-1} +@item ForceInterpolation +Default value: @code{0} @end table @item Plugin(ModulusPhase) @@ -622,6 +722,34 @@ Default value: @code{1} Default value: @code{-1} @end table +@item Plugin(NearToFarField) +Plugin(NearToFarField) computes the far field pattern from the near electric and magnetic fields on a surface (regular grid) enclosing the radiating device (antenna). + +Parameters: the wavenumber, the far field distance (radious) and angular discretisation, i.e. the number of divisions for phi in [0, 2*Pi] and theta in [0, Pi]. + +If `View' < 0, the plugin is run on the current view. + +Plugin(NearToFarField) creates one new view. +Numeric options: +@table @code +@item Wavenumber +Default value: @code{1} +@item FarDistance +Default value: @code{1} +@item NumPointsPhi +Default value: @code{120} +@item NumPointsTheta +Default value: @code{60} +@item EView +Default value: @code{0} +@item HView +Default value: @code{1} +@item Normalize +Default value: @code{1} +@item dB +Default value: @code{1} +@end table + @item Plugin(NearestNeighbor) Plugin(NearestNeighbor) computes the distance from each point in `View' to its nearest neighbor. diff --git a/doc/texinfo/opt_solver.texi b/doc/texinfo/opt_solver.texi index bea79b07ff..1c7d350f0f 100644 --- a/doc/texinfo/opt_solver.texi +++ b/doc/texinfo/opt_solver.texi @@ -17,7 +17,7 @@ Saved in: @code{General.OptionsFileName} @item Solver.Help0 Help string for solver 0@* Default value: @code{"A General environment for the treatment of Discrete Problems. -Copyright (C) 1997-2010 Patrick Dular and Christophe Geuzaine. +Copyright (C) 1997-2011 Patrick Dular and Christophe Geuzaine. Visit http://www.geuz.org/getdp/ for more info"}@* Saved in: @code{General.OptionsFileName} @@ -746,4 +746,9 @@ Automatically display messages produced by solver 4@* Default value: @code{1}@* Saved in: @code{General.OptionsFileName} +@item Solver.Timeout +Time (in seconds) before closing the socket if no connection is happening.@* +Default value: @code{5}@* +Saved in: @code{General.OptionsFileName} + @end ftable -- GitLab