Hide menu
cadex::MeshAlgo_NetgenFactory::Parameters Struct Reference

Defines parameters used by the Netgen meshing algorithm. More...

Public Types

enum  Granularity {
  VeryCoarse, Coarse, Moderate, Fine,
  VeryFine, Custom
}
 Defines the policy of mesh element construction. More...
 

Public Member Functions

 Parameters ()
 Constructor. More...
 
void SetGranularity (Granularity theVal)
 Sets mesh granularity policy. More...
 

Public Attributes

double myGlobAbsMaxSize
 Absolute value of the global maximum size of element edge. More...
 
double myGlobRelMaxSize
 Relative value of the global maximum size of element edge. More...
 
double myLocRelMaxSize
 Relative value of the local maximum size of element edge. More...
 
double myGlobAbsMinSize
 Absolute value of the global minimum size of element edge. More...
 
double myGlobRelMinSize
 Relative value of the global minimum size of element edge. More...
 
Granularity myGranularity
 Pre-defined or custom granularity of the element construction. More...
 
double myGrading
 Element size growth. More...
 
unsigned int mySegPerEdge
 Segments per original Edge. More...
 
double myCrv
 Segments per original Edge's curvature. More...
 
unsigned int myOptSteps
 Number of steps in surface mesh optimization. More...
 
bool myIsVolumeMesh
 Specifies if 3D volume mesh should be generated after generating 2D surface mesh. More...
 
unsigned int myVolumeOptSteps
 Number of steps in volume mesh optimization. More...
 

Detailed Description

Defines parameters used by the Netgen meshing algorithm.

Warning
This class is a part of Advanced Meshers add-on, which is licensed separately from the base CAD Exchanger SDK.

Contains the following parameters:

  • Maximum element size (length of its segment). It can be set using absolute and/or relative values. If respective value is negative then it is ignored. Relative values must be within a (0., 1.] range. At least absolute or one relative value must be defined. The maximum value will not exceed the lowest one specified via absolute or relative values.
  • Minimum element size. The same conditions (as to maximum value) apply. Respectively, the minimum value will be greater than one specified via absolute or relative values.
  • Mesh granularity (policy of computing mesh element - e.g. size growth, minimum number of segments per original Edge, coefficient to amplify Edge's curvature).
  • Number of optimization steps after the mesh has been computed. If the value is 0 then no optimization is performed.

Parameters can be set using direct access to data members. Some parameters can be set to pre-defined values with SetGranularity() called with value different from Custom.

The the following parameters set in CAD Exchanger GUI can be programmatically set as demonstrated below:

MeshAlgo_NetgenFactory::Parameters aP;
aP.myGlobAbsMaxSize= 20.;
aP.myGlobAbsMinSize= 2.;
aP.myGlobRelMaxSize = aP.myLocRelMaxSize = aP.myGlobRelMinSize = -1.; //ignore
aP.SetGranularity (MeshAlgo_NetgenFactory::Parameters::Custom);
aP.myGrading = 1.;
aP.mySegPerEdge = 1;
aP.myCrv = 1.5;
aP.myOptSteps = 3;
aMF.SetParameters (aP);
See also
sdk_meshing_advalgos.
Examples
meshing/netgen/main.cxx.

Member Enumeration Documentation

◆ Granularity

Defines the policy of mesh element construction.

Provides pre-defined value for Parameters::myGrading, Parameters::mySegPerEdge, Parameters::myCrv. See Parameters::SetGranularity().

Constructor & Destructor Documentation

◆ Parameters()

cadex::MeshAlgo_NetgenFactory::Parameters::Parameters ( )
inline

Constructor.

Constructs parameters with myGlobAbsMaxSize as -1., myGlobRelMaxSize as -1., myLocRelMaxSize as 10% (1./10.) of the corresponding bounding box diagonal, myGlobAbsMinSize as -1., myGlobRelMinSize as 1% (1./100.), myOptSteps as 3. myGranularity as Moderate, myIsVolumeMesh as false, myVolumeOptSteps as 2.

Member Function Documentation

◆ SetGranularity()

void cadex::MeshAlgo_NetgenFactory::Parameters::SetGranularity ( Granularity  theVal)
inline

Sets mesh granularity policy.

Sets the values as follows:

  VeryCoarse Coarse Moderate Fine VeryFine
myGrading 0.7 0.5 0.3 0.2 0.1
mySegPerEdge 1 1 1 2 3
myCrv 1.0 1.5 2.0 3.0 5.0

If theVal is Custom then does nothing.

Examples
meshing/netgen/main.cxx.

Member Data Documentation

◆ myCrv

cadex::MeshAlgo_NetgenFactory::Parameters::myCrv

Segments per original Edge's curvature.

Coefficient to be multiplied by the local curvature of the original Edge. For instance, 1.5 would mean that if the original Edge's curve has a local curvature value of 1.6 then at least 3 segments will be created (1.6 * 1.5 rounded to 3).

Must be positive. Automatically set to a pre-defined value when calling SetGranularity() with a value different from Custom.

◆ myGlobAbsMaxSize

cadex::MeshAlgo_NetgenFactory::Parameters::myGlobAbsMaxSize

Absolute value of the global maximum size of element edge.

Value specified in the length units of CAD Exchanger, i.e. millimeters (see Measurement Units).

Ignored, if negative.

◆ myGlobAbsMinSize

cadex::MeshAlgo_NetgenFactory::Parameters::myGlobAbsMinSize

Absolute value of the global minimum size of element edge.

Value specified in the length units of CAD Exchanger, i.e. millimeters (see Measurement Units).

Ignored, if negative.

◆ myGlobRelMaxSize

cadex::MeshAlgo_NetgenFactory::Parameters::myGlobRelMaxSize

Relative value of the global maximum size of element edge.

Coefficient which is multiplied by the value by the diagonal of the bounding box of the parent shape (Shell or Solid). If there is no parent Shell or Solid (i.e. there is free Face only) then is equivalent to myLocAbsMaxSize and is applied to the Face.

Must be within a (0., 1.] range. Ignored, if negative.

◆ myGlobRelMinSize

cadex::MeshAlgo_NetgenFactory::Parameters::myGlobRelMinSize

Relative value of the global minimum size of element edge.

Coefficient which is multiplied by the value by the diagonal of the bounding box of the smallest Face in parent Shell or Solid. If there is no parent Shell or Solid (i.e. there is free Face only) then is applied to the Face.

Must be within a (0., 1.] range. Ignored, if negative.

◆ myGrading

cadex::MeshAlgo_NetgenFactory::Parameters::myGrading

Element size growth.

Relative maximum change of the element size comparing to its neighbors. For instance, 0.5 would mean that the element size should be not greater than 1.5 times the neighbor element size.

Must be positive. Automatically set to a pre-defined value when calling SetGranularity() with a value different from Custom.

◆ myGranularity

cadex::MeshAlgo_NetgenFactory::Parameters::myGranularity

Pre-defined or custom granularity of the element construction.

Affects the maximum mesh edge element size depending on original (geometrical) Edge and neighbor elements.

See also
SetGranularity(), myGrading, mySegPerEdge, myCrv.

◆ myIsVolumeMesh

cadex::MeshAlgo_NetgenFactory::Parameters::myIsVolumeMesh

Specifies if 3D volume mesh should be generated after generating 2D surface mesh.

Default is false.

See also
myVolumeOptSteps.

◆ myLocRelMaxSize

cadex::MeshAlgo_NetgenFactory::Parameters::myLocRelMaxSize

Relative value of the local maximum size of element edge.

Coefficient which is multiplied by the value by the diagonal of the bounding box of the parent Face.

Must be within a (0., 1.] range. Ignored, if negative.

◆ myOptSteps

cadex::MeshAlgo_NetgenFactory::Parameters::myOptSteps

Number of steps in surface mesh optimization.

Must be non-negative. Default is 3. If set to 0 then no optimization is performed.

◆ mySegPerEdge

cadex::MeshAlgo_NetgenFactory::Parameters::mySegPerEdge

Segments per original Edge.

Minimum number of mesh segments to be created for each original Edge. For instance, 2 would mean that at least 2 segments will be created for each Edge.

Must be positive. Automatically set to a pre-defined value when calling SetGranularity() with a value different from Custom.

◆ myVolumeOptSteps

cadex::MeshAlgo_NetgenFactory::Parameters::myVolumeOptSteps

Number of steps in volume mesh optimization.

Must be non-negative. Default is 2. If set to 0 then no optimization is performed. Only used if myIsVolumeMesh is true.

MeshAlgo_NetgenFactory()
Constructor.
Definition: MeshAlgo_NetgenFactory.cxx:258