[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
6.3.1 Characteristic lengths
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 characteristic lengths at the geometrical points of the model (with thePoint
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).
-
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 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 anAttractor
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.
-
A
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 list)
Here are the mesh commands that are related to the specification of characteristic lengths:
-
Characteristic Length { expression-list } = expression;
Modify the characteristic length of the points whose identification numbers are listed in expression-list. The new value is given by expression.
-
Field[expression] = string;
Create a new field (with id number expression), of type string.
-
Field[expression].string = char-expression | expression | expression-list;
Set the option string of the expression-th field.
-
Background Field = expression;
Select the expression-th field as the one used to compute element sizes. Only one background field can be given; if you want to combine several field, use the
Min
orMax
field (see below).
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 the distance from curves, in which case each curve
is replaced by NNodesByEdge equidistant nodes and the distance from those
nodes is computed.
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:{}
-
-
BoundaryLayer
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 which element 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
-
-
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 = div(norm(grad(Field[IField])))
Options:
-
Delta
Step of the finite differences
type: float
default value:0
-
IField
Field index
type: integer
default value:1
-
-
Cylinder
The value of this field is VIn inside a frustrated cylinder, VOut outside.
The cylinder is given by
||dX||^2 < R^2 &&
(X-X0).A < ||A||^2
dX = (X - X0) - ((X - X0).A)/(||A||^2) . A
Options:
-
Radius
Radius
type: float
default value:0
-
VIn
Value inside the cylinder
type: float
default value:0
-
VOut
Value outside the cylinder
type: float
default value:0
-
XAxis
X component of the cylinder axis
type: float
default value:0
-
XCenter
X coordinate of the cylinder center
type: float
default value:0
-
YAxis
Y component of the cylinder axis
type: float
default value:0
-
YCenter
Y coordinate of the cylinder center
type: float
default value:0
-
ZAxis
Z component of the cylinder axis
type: float
default value:1
-
ZCenter
Z coordinate of the cylinder center
type: float
default value:0
-
-
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 = 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](atan(y/x), asin(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 contain
x, y, z for spatial coordinates, F0, F1, ... for field values, and
and mathematical functions.
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 eigenvalue of the Hessian matrix of
Field[IField], with the gradients evaluated by finite differences:
F = max(eig(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
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 coordinates:
F = Field[IField](FX,FY,FZ)
See the MathEval Field help to get a description of valid FX, FY
and FZ expressions.
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
direction, and v are the values on each node.
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 which element 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] | [ ? ] |