manpagez: man pages & more
info gmsh
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4.2.1 Characteristic lengths

There are three ways to specify the size of the mesh elements for a given geometry:

  1. First, if Mesh.CharacteristicLengthFromPoints is set (it is by default), you can simply specify characteristic lengths 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 characteristic lengths 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).

  2. 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.
  3. Finally, you can specify general characteristic lengths using mesh size “fields”. Various fields exist:
    • A PostView field specifies an explicit background mesh in the form of a scalar post-processing view (see Post-processing commands, and File formats) in which the nodal values are the target element sizes. This method is very general but it requires a first (usually rough) mesh and a way to compute the target sizes on this mesh (usually through an error estimation procedure, in an iterative process of mesh adaptation).

      (Note that you can also load a background mesh directly from the command line using the -bgm option (see section Command-line options), or in the GUI by selecting `Apply as background mesh' in the post-processing view option menu.)

    • A Box field specifies the size of the elements inside and outside of a parallelipipedic region.
    • A Threshold field specifies the size of the mesh according to the distance to some geometrical entities. These entities can for example be geometry points and lines specified by an Attractor field.
    • A MathEval field specifies the size of the mesh using an explicit mathematical function.
    • A Min field specifies the size as the minimum of the sizes computed using other 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 options (see section Mesh options)

Here are the mesh commands that are related to the specification of characteristic lengths:

Characteristic Length { expression-list } = expression;

Modifies the characteristic length of the points whose identification numbers are listed in expression-list. The new value is given by expression.

Field[expression] = string;
Field[expression].string = char-expression | expression | expression-list;
Background Field = expression;

Here is the list of all available fields with their associated options:

Attractor

Compute the distance from the nearest node in a list. It can also be used to compute distance from curves, in this case each curve is replaced by NNodesByEdge equidistant nodes and the distance from those nodes is computed.
The ANN library is used to find the nearest node: http://www.cs.umd.edu/~mount/ANN/
Options:

EdgesList

Indices of curves in the geometric model
type: list
default value: {}

FacesList

Indices of surfaces in the geometric model (Warning: might give strange results for complex surfaces)
type: list
default value: {}

NNodesByEdge

Number of nodes used to discetized each curve
type: integer
default value: 20

NodesList

Indices of nodes in the geomtric model
type: list
default value: {}

Box

The value of this field is VIn inside the box, VOut outside the box.
The box is given by Xmin<=x<=XMax && YMin<=y<=YMax && ZMin<=z<=ZMax
Options:

VIn

Value inside the box
type: float
default value: 0

VOut

Value outside the box
type: float
default value: 0

XMax

Maximum X coordinate of the box
type: float
default value: 0

XMin

Minimum X coordinate of the box
type: float
default value: 0

YMax

Maximum Y coordinate of the box
type: float
default value: 0

YMin

Minimum Y coordinate of the box
type: float
default value: 0

ZMax

Maximum Z coordinate of the box
type: float
default value: 0

ZMin

Minimum Z coordinate of the box
type: float
default value: 0

Curvature

Compute the curvature of Field[IField].
F = divergence( || grad( Field[IField] ) || )
Options:

Delta

Step of the finite differences
type: float
default value: 0

IField

Field index
type: integer
default value: 1

Gradient

Compute the finite difference gradient of Field[IField].
F = (Field[IField](X + Delta/2) - Field[IField](X - Delta/2))/Delta
Options:

Delta

Finite difference step
type: float
default value: 0

IField

Field index
type: integer
default value: 1

Kind

Component of the gradient to evaluate : 0 for X, 1 for Y, 2 for Z, 3 for the norm
type: integer
default value: 0

Laplacian

Compute finite difference the Laplacian of Field[IField].
F = divergence(gradient(Field[IField]))
F = G(x+d,y,z)+G(x-d,y,z)+G(x,y+d,z)+G(x,y-d,z)+ +G(x,y,z+d)+G(x,y,z-d)-6*G(x,y,z) where G=Field[IField] and d=delta

Options:

Delta

Finite difference step
type: float
default value: 0.1

IField

Field index
type: integer
default value: 1

LonLat

Evaluate Field[IField] in geographic coordinates (longitude,latitude).
F = Field[IField](arctan(y/x),arcsin(z/sqrt(x^2+y^2+z^2))
Options:

IField

Index of the field to evaluate.
type: integer
default value: 1

MathEval

Evaluate a mathematical expression. The expression can contains x, y, z for spatial coordinates, F0, F1, ... for field values, and mathematical functions. This evaluator is based on a modified version of the GNU libmatheval library.
Example : F2 + Sin(z)
Options:

F

Mathematical function to evaluate.
type: string
default value: "F2 + Sin(z)"

Max

Take the maximum value of a list of fields.
Options:

FieldsList

Field indices
type: list
default value: {}

MaxEigenHessian

Compute the maximum eigen value of the Hessian matrix of Field[IField]. Gradients are evaluated by finite differences, eigenvalues are computed using the GSL library.F = max ( eigenvalues ( grad ( grad ( Field[IField] ) ) ) )
Options:

Delta

Step used for the finite differences
type: float
default value: 0

IField

Field index
type: integer
default value: 1

Mean

Very simple smoother.
F = (G(x+delta,y,z)+G(x-delta,y,z) +G(x,y+delta,z)+G(x,y-delta,z) +G(x,y,z+delta)+G(x,y,z-delta) +G(x,y,z))/7 where G=Field[IField]
Options:

Delta

Distance used to compute the mean value
type: float
default value: 0.0001

IField

Field index
type: integer
default value: 0

Min

Take the minimum value of a list of fields.
Options:

FieldsList

Field indices
type: list
default value: {}

Param

Evaluate Field IField in parametric coordinate. See MathEval Field help to get a description of valid FX, FY and FZ expressions.
F = Field[IField](FX,FY,FZ)
Options:

FX

X component of parametric function
type: string
default value: ""

FY

Y component of parametric function
type: string
default value: ""

FZ

Z component of parametric function
type: string
default value: ""

IField

Field index
type: integer
default value: 1

PostView

Evaluate the post processing view IView.
Options:

CropNegativeValues

return LC_MAX instead of a negative value (this option is needed for backward compatibility with the BackgroundMesh option
type: boolean
default value: 1

IView

Post-processing view index
type: integer
default value: 0

Restrict

Restrict the application of a field to a given list of geometrical curves, surfaces or volumes.
Options:

EdgesList

Curve indices
type: list
default value: {}

FacesList

Surface indices
type: list
default value: {}

IField

Field index
type: integer
default value: 1

RegionsList

Volume indices
type: list
default value: {}

Structured

Linearly interpolate between data provided on a 3D rectangular structured grid. The format of the input file is :
Ox Oy Oz
Dx Dy Dz
nx ny nz
v(0,0,0) v(0,0,1) v(0,0,2) ...
v(0,1,0) v(0,1,1) v(0,1,2) ...
v(0,2,0) v(0,2,1) v(0,2,2) ...
... ... ...
v(1,0,0) ... ...
where O are the coordinates of the first node, D are the distances between nodes in each direction, n are the numbers of nodes in each directions, and v are the values on each nodes.
Options:

FileName

Name of the input file
type: path
default value: ""

TextFormat

True for ASCII input files, false for binary files (4 bite signed integers for n, double precision floating points for v, D and O)
type: boolean
default value: 0

Threshold

F = LCMin if Field[IField] <= DistMin
F = LCMax if Field[IField] >= DistMax
F = Interpolation between LcMin and LcMax if DistMin<Field[IField]<DistMax
Options:

DistMax

Distance from entity after whichelement size will be LcMax
type: float
default value: 10

DistMin

Distance from entity up to which element size will be LcMin
type: float
default value: 1

IField

Index of the field to evaluate
type: integer
default value: 0

LcMax

Element size outside DistMax
type: float
default value: 1

LcMin

Element size inside DistMin
type: float
default value: 0.1

Sigmoid

True to interpolate between LcMin and LcMax using a sigmoid, false to interpolate linearly
type: boolean
default value: 0

StopAtDistMax

True to not impose element size outside DistMax (i.e. F = a very big value if Field[IField]>DistMax)
type: boolean
default value: 0

UTM

Evaluate Field[IField] in Universal Transverse Mercator coordinates. The formulas for the coordinates transformation are taken from http://www.uwgb.edu/dutchs/UsefulData/UTMFormulas.HTM

Options:

IField

Index of the field to evaluate
type: integer
default value: 1

Zone

Zone of the UTM projection
type: integer
default value: 0


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]
© manpagez.com 2000-2024
Individual documents may contain additional copyright information.