MeshOptions
- class compas_gmsh.options.MeshOptions
Bases:
object
Options for mesh generation in Gmsh.
Notes
There are three ways to specify the size of the mesh elements for a given geometry:
First, if Mesh.CharacteristicLengthFromPoints is set (it is by default), you can simply specify desired mesh element sizes at the geometrical points of the model (with the Point command: see Points). The size of the mesh elements will then be computed by linearly interpolating these values on the initial mesh (see Mesh: finite element mesh generation). This might sometimes lead to over-refinement in some areas, so that you may have to add “dummy” geometrical entities in the model in order to get the desired element sizes. This method works with all the algorithms implemented in the mesh module. The final element sizes are of course constrained by the structured algorithms for which the element sizes are explicitly specified (e.g., transfinite and extruded grids: see Structured grids).
Second, if Mesh.CharacteristicLengthFromCurvature is set (it is not by default), the mesh will be adapted with respect to the curvature of the geometrical entities.
Finally, you can specify general mesh size “fields”.
Fields are supported by all the algorithms except those based on Netgen. The list of available fields with their options is given below. The three aforementioned methods can be used simultaneously, in which case the smallest element size is selected at any given point. All element sizes are further constrained by the Mesh.CharacteristicLengthMin, Mesh.CharacteristicLengthMax and Mesh.CharacteristicLengthFactor.
- Attributes:
- algorithmMeshAlgorithm
The meshing algorithm to use.
- lminfloat
The minimum characteristic edge length for meshing. Note that the actual minimum edge length may deviate from this value. The deviation is captured in an efficiency index, which tends to be around 0.8. Use
MeshAlgortihmFrontalDelaunay
for best results.- lmaxfloat
The maximum characteristic edge length for meshing. Note that the actual maximum edge length may deviate from this value. The deviation is captured in an efficiency index, which tends to be around 0.8. Use
MeshAlgortihmFrontalDelaunay
for best results.- mesh_only_emptybool
Mesh only parts without existing mesh. Default is False.
- meshsize_extend_from_boundaryMeshSizeExtendFromBoundary
Compute mesh size from the boundary inwards.
- meshsize_minfloat
Minimum size of mesh elements. Default is 0.
- meshsize_maxfloat
Maximum size of mesh elements. Default is 1e+22.
- meshsize_from_curvaturebool
Define mesh size based on curvature. Default is False.
- meshsize_from_pointsbool
Define mesh size based values assigned to points. Default is True.
- min_nodes_circlefloat
Minimum number of nodes for discretising a circle. Default is 7.
- min_nodes_curvefloat
Minimum number of nodes for discretising a curve. Default is 3.