The base class to define meshing algorithms. More...
Public Member Functions | |
| def | __init__ |
| Private constuctor. More... | |
| def | FindHypothesis |
| Finds a hypothesis in the study by its type name and parameters. More... | |
| def | FindAlgorithm |
| Finds the algorithm in the study by its type name. More... | |
| def | GetSubMesh |
| If the algorithm is global, returns 0; else returns the submesh associated to this algorithm. More... | |
| def | GetAlgorithm |
| Returns the wrapped mesher. More... | |
| def | GetCompatibleHypothesis |
| Gets the list of hypothesis that can be used with this algorithm. More... | |
| def | GetName |
| Gets the name of the algorithm. More... | |
| def | SetName |
| Sets the name to the algorithm. More... | |
| def | GetId |
| Gets the id of the algorithm. More... | |
| def | Create |
| Private method. More... | |
| def | Assign |
| Private method. More... | |
| def | CompareHyp |
| def | CompareEqualHyp |
| def | Hypothesis |
| Private method. More... | |
| def | MainShapeEntry |
| Returns entry of the shape to mesh in the study. More... | |
| def | ViscousLayers |
| Defines "ViscousLayers" hypothesis to give parameters of layers of prisms to build near mesh boundary. More... | |
| def | ViscousLayers2D |
| Defines "ViscousLayers2D" hypothesis to give parameters of layers of quadrilateral elements to build near mesh boundary. More... | |
| def | ReversedEdgeIndices |
| Transform a list of either edges or tuples (edge, 1st_vertex_of_edge) into a list acceptable to SetReversedEdges() of some 1D hypotheses. More... | |
Data Fields | |
| mesh | |
| geom | |
| subm | |
| algo | |
The base class to define meshing algorithms.
For each meshing algorithm, a python class inheriting from class Mesh_Algorithm should be defined. This descendant class should have two attributes defining the way it is created by class Mesh (see e.g. class StdMeshersBuilder_Segment in StdMeshersBuilder package):
meshMethod attribute defines name of method of class smesh.Mesh by calling which the python class of algorithm is created; this method is dynamically added to the smesh.Mesh class in runtime. For example, if in class MyPlugin_Algorithm this attribute is defined as then an instance of MyPlugin_Algorithm can be created by the direct invocation of the function of smesh.Mesh class: algoType defines type of algorithm and is used mostly to discriminate algorithms that are created by the same method of class smesh.Mesh. For example, if this attribute is specified in MyPlugin_Algorithm class as then it's creation code can be: | def __init__ | ( | self | ) |
Private constuctor.
| def FindHypothesis | ( | self, | |
| hypname, | |||
| args, | |||
| CompareMethod, | |||
| smeshpyD | |||
| ) |
Finds a hypothesis in the study by its type name and parameters.
Finds only the hypotheses created in smeshpyD engine.
| def FindAlgorithm | ( | self, | |
| algoname, | |||
| smeshpyD | |||
| ) |
Finds the algorithm in the study by its type name.
Finds only the algorithms, which have been created in smeshpyD engine.
| def GetSubMesh | ( | self | ) |
If the algorithm is global, returns 0;
else returns the submesh associated to this algorithm.
References Mesh_Algorithm.subm.
| def GetAlgorithm | ( | self | ) |
Returns the wrapped mesher.
References Mesh_Algorithm.algo.
| def GetCompatibleHypothesis | ( | self | ) |
Gets the list of hypothesis that can be used with this algorithm.
References Mesh_Algorithm.algo.
| def GetName | ( | self | ) |
Gets the name of the algorithm.
References Mesh_Algorithm.algo.
| def SetName | ( | self, | |
| name | |||
| ) |
Sets the name to the algorithm.
References Mesh_Algorithm.algo.
| def GetId | ( | self | ) |
Gets the id of the algorithm.
| def Create | ( | self, | |
| mesh, | |||
| geom, | |||
| hypo, | |||
so = "libStdMeshersEngine.so" |
|||
| ) |
Private method.
References Mesh_Algorithm.algo, Mesh_Algorithm.Assign(), and Mesh_Algorithm.FindAlgorithm().
| def Assign | ( | self, | |
| algo, | |||
| mesh, | |||
| geom | |||
| ) |
Private method.
References Mesh_Algorithm.algo, Mesh_Algorithm.geom, Mesh_Algorithm.mesh, and Mesh_Algorithm.subm.
| def CompareHyp | ( | self, | |
| hyp, | |||
| args | |||
| ) |
| def CompareEqualHyp | ( | self, | |
| hyp, | |||
| args | |||
| ) |
References Mesh_Algorithm.Hypothesis().
| def Hypothesis | ( | self, | |
| hyp, | |||
args = [], |
|||
so = "libStdMeshersEngine.so", |
|||
UseExisting = 0, |
|||
CompareMethod = "", |
|||
toAdd = True |
|||
| ) |
Private method.
References Mesh_Algorithm.CompareHyp(), Mesh_Algorithm.FindHypothesis(), Mesh_Algorithm.geom, Mesh_Algorithm.GetName(), and Mesh_Algorithm.mesh.
| def MainShapeEntry | ( | self | ) |
Returns entry of the shape to mesh in the study.
References Mesh_Algorithm.mesh, and Mesh_Algorithm.ViscousLayers().
| def ViscousLayers | ( | self, | |
| thickness, | |||
| numberOfLayers, | |||
| stretchFactor, | |||
faces = [], |
|||
isFacesToIgnore = True, |
|||
extrMethod = StdMeshers.SURF_OFFSET_SMOOTH |
|||
| ) |
Defines "ViscousLayers" hypothesis to give parameters of layers of prisms to build near mesh boundary.
This hypothesis can be used by several 3D algorithms: NETGEN 3D, MG-Tetra, Hexahedron(i,j,k)
| thickness | total thickness of layers of prisms |
| numberOfLayers | number of layers of prisms |
| stretchFactor | factor (>1.0) of growth of layer thickness towards inside of mesh |
| faces | list of geometrical faces (or their ids). Viscous layers are either generated on these faces or not, depending on the value of isFacesToIgnore parameter. |
| isFacesToIgnore | if True, the Viscous layers are not generated on the faces specified by the previous parameter (faces). |
| extrMethod | extrusion method defines how position of new nodes are found during prism construction and how creation of distorted and intersecting prisms is prevented. Possible values are:
|
References Mesh_Algorithm.algo, Mesh_Algorithm.geom, Mesh_Algorithm.GetCompatibleHypothesis(), Mesh_Algorithm.Hypothesis(), and Mesh_Algorithm.ViscousLayers2D().
| def ViscousLayers2D | ( | self, | |
| thickness, | |||
| numberOfLayers, | |||
| stretchFactor, | |||
edges = [], |
|||
isEdgesToIgnore = True |
|||
| ) |
Defines "ViscousLayers2D" hypothesis to give parameters of layers of quadrilateral elements to build near mesh boundary.
This hypothesis can be used by several 2D algorithms: NETGEN 2D, NETGEN 1D-2D, Quadrangle (mapping), MEFISTO, MG-CADSurf
| thickness | total thickness of layers of quadrilaterals |
| numberOfLayers | number of layers |
| stretchFactor | factor (>1.0) of growth of layer thickness towards inside of mesh |
| edges | list of geometrical edges (or their ids). Viscous layers are either generated on these edges or not, depending on the value of isEdgesToIgnore parameter. |
| isEdgesToIgnore | if True, the Viscous layers are not generated on the edges specified by the previous parameter (edges). |
References Mesh_Algorithm.algo, Mesh_Algorithm.geom, Mesh_Algorithm.GetCompatibleHypothesis(), and Mesh_Algorithm.Hypothesis().
| def ReversedEdgeIndices | ( | self, | |
| reverseList | |||
| ) |
Transform a list of either edges or tuples (edge, 1st_vertex_of_edge) into a list acceptable to SetReversedEdges() of some 1D hypotheses.
References Mesh_Algorithm.mesh.
| mesh |
| geom |
| subm |
| algo |