-from smesh import Mesh_Algorithm, AssureGeomPublished, IsEqual, ParseParameters
+##
+# @package StdMeshersDC
+# Python API for the standard meshing plug-in module.
+
+from smesh_algorithm import Mesh_Algorithm
+from smesh import AssureGeomPublished, IsEqual, ParseParameters
+#----------------------------
+# Mesh algo type identifiers
+#----------------------------
+
+## Algorithm type: Regular 1D algorithm, see StdMeshersDC_Segment
# import items of enum QuadType
for e in StdMeshers.QuadType._items: exec('%s = StdMeshers.%s'%(e,e))
# import items of enum QuadType
for e in StdMeshers.QuadType._items: exec('%s = StdMeshers.%s'%(e,e))
-# Public class: Mesh_Segment
-# --------------------------
-
-## Class to define a REGULAR 1D algorithm for discretization. It is created by
-# calling Mesh.Segment(geom=0)
+## Defines segment 1D algorithm for edges discretization.
+#
+# It can be created by calling smesh.Mesh.Segment(geom=0)
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
self.Create(mesh, geom, self.algoType)
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
self.Create(mesh, geom, self.algoType)
## Defines "LocalLength" hypothesis to cut an edge in several segments with the same length
# @param l for the length of segments that cut an edge
## Defines "LocalLength" hypothesis to cut an edge in several segments with the same length
# @param l for the length of segments that cut an edge
def _compareNumberOfSegments(self, hyp, args):
if hyp.GetNumberOfSegments() == args[0]:
if len(args) == 3:
def _compareNumberOfSegments(self, hyp, args):
if hyp.GetNumberOfSegments() == args[0]:
if len(args) == 3:
if self.geom is None:
raise RuntimeError, "Attemp to create SegmentAroundVertex_0D algoritm on None shape"
AssureGeomPublished( self.mesh, self.geom )
if self.geom is None:
raise RuntimeError, "Attemp to create SegmentAroundVertex_0D algoritm on None shape"
AssureGeomPublished( self.mesh, self.geom )
pass
status = self.mesh.mesh.AddHypothesis(self.geom, algo)
TreatHypoStatus(status, "SegmentAroundVertex_0D", name, True)
pass
status = self.mesh.mesh.AddHypothesis(self.geom, algo)
TreatHypoStatus(status, "SegmentAroundVertex_0D", name, True)
comFun = lambda hyp, args: IsEqual(hyp.GetLength(), args[0])
hyp = self.Hypothesis("SegmentLengthAroundVertex", [length], UseExisting=UseExisting,
CompareMethod=comFun)
comFun = lambda hyp, args: IsEqual(hyp.GetLength(), args[0])
hyp = self.Hypothesis("SegmentLengthAroundVertex", [length], UseExisting=UseExisting,
CompareMethod=comFun)
-## A regular 1D algorithm for discretization of a set of adjacent edges as one.
-# It is created by calling Mesh.Segment(COMPOSITE,geom=0)
+## Segment 1D algorithm for discretization of a set of adjacent edges as one edge.
+#
+# It is created by calling smesh.Mesh.Segment(smesh.COMPOSITE,geom=0)
def __init__(self, mesh, geom=0):
self.Create(mesh, geom, self.algoType)
def __init__(self, mesh, geom=0):
self.Create(mesh, geom, self.algoType)
-# Public class: Mesh_Segment_Python
-# ---------------------------------
-
-## Defines a segment 1D algorithm for discretization with python function
-# It is created by calling Mesh.Segment(PYTHON,geom=0)
+## Defines a segment 1D algorithm for discretization of edges with Python function
+#
+# It is created by calling smesh.Mesh.Segment(smesh.PYTHON,geom=0)
def __init__(self, mesh, geom=0):
import Python1dPlugin
self.Create(mesh, geom, self.algoType, "libPython1dEngine.so")
def __init__(self, mesh, geom=0):
import Python1dPlugin
self.Create(mesh, geom, self.algoType, "libPython1dEngine.so")
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
self.Create(mesh, geom, self.algoType)
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
self.Create(mesh, geom, self.algoType)
## Defines "MaxElementArea" hypothesis basing on the definition of the maximum area of each triangle
# @param area for the maximum area of each triangle
## Defines "MaxElementArea" hypothesis basing on the definition of the maximum area of each triangle
# @param area for the maximum area of each triangle
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
self.Create(mesh, geom, self.algoType)
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
self.Create(mesh, geom, self.algoType)
## Defines "QuadrangleParameters" hypothesis
# @param quadType defines the algorithm of transition between differently descretized
## Defines "QuadrangleParameters" hypothesis
# @param quadType defines the algorithm of transition between differently descretized
def TriangleVertex(self, vertex, UseExisting=0):
return self.QuadrangleParameters(QUAD_STANDARD,vertex,UseExisting)
def TriangleVertex(self, vertex, UseExisting=0):
return self.QuadrangleParameters(QUAD_STANDARD,vertex,UseExisting)
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
self.Create(mesh, geom, Hexa)
pass
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
self.Create(mesh, geom, Hexa)
pass
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
self.Create(mesh, geom, self.algoType)
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
self.Create(mesh, geom, self.algoType)
## Defines "Source Edge" hypothesis, specifying a meshed edge, from where
# a mesh pattern is taken, and, optionally, the association of vertices
## Defines "Source Edge" hypothesis, specifying a meshed edge, from where
# a mesh pattern is taken, and, optionally, the association of vertices
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
self.Create(mesh, geom, self.algoType)
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
self.Create(mesh, geom, self.algoType)
## Defines "Source Face" hypothesis, specifying a meshed face, from where
# a mesh pattern is taken, and, optionally, the association of vertices
## Defines "Source Face" hypothesis, specifying a meshed face, from where
# a mesh pattern is taken, and, optionally, the association of vertices
hyp.SetVertexAssociation( srcV1, srcV2, tgtV1, tgtV2 )
return hyp
hyp.SetVertexAssociation( srcV1, srcV2, tgtV1, tgtV2 )
return hyp
def __init__(self, mesh, geom=0):
StdMeshersDC_Projection2D.__init__(self, mesh, geom)
def __init__(self, mesh, geom=0):
StdMeshersDC_Projection2D.__init__(self, mesh, geom)
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
self.Create(mesh, geom, self.algoType)
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
self.Create(mesh, geom, self.algoType)
## Defines the "Source Shape 3D" hypothesis, specifying a meshed solid, from where
# the mesh pattern is taken, and, optionally, the association of vertices
## Defines the "Source Shape 3D" hypothesis, specifying a meshed solid, from where
# the mesh pattern is taken, and, optionally, the association of vertices
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
nbShells = len( SubShapeAll( shape, ShapeType["SHELL"] ))
if nbSolids == 0 or nbSolids == nbShells:
self.Create(mesh, geom, "Prism_3D")
nbShells = len( SubShapeAll( shape, ShapeType["SHELL"] ))
if nbSolids == 0 or nbSolids == nbShells:
self.Create(mesh, geom, "Prism_3D")
else:
self.algoType = "RadialPrism_3D"
self.Create(mesh, geom, "RadialPrism_3D")
self.distribHyp = self.Hypothesis("LayerDistribution", UseExisting=0)
self.nbLayers = None
else:
self.algoType = "RadialPrism_3D"
self.Create(mesh, geom, "RadialPrism_3D")
self.distribHyp = self.Hypothesis("LayerDistribution", UseExisting=0)
self.nbLayers = None
-# Public class: Mesh_RadialQuadrangle1D2D
-# -------------------------------
-
-## Defines a Radial Quadrangle 1D2D algorithm
-# It is created by calling Mesh.Quadrangle(RADIAL_QUAD,geom=0)
+## Defines a Radial Quadrangle 1D-2D algorithm
+#
+# It is created by calling smesh.Mesh.Quadrangle(smesh.RADIAL_QUAD,geom=0)
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
self.Create(mesh, geom, self.algoType)
self.distribHyp = None #self.Hypothesis("LayerDistribution2D", UseExisting=0)
self.nbLayers = None
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
self.Create(mesh, geom, self.algoType)
self.distribHyp = None #self.Hypothesis("LayerDistribution2D", UseExisting=0)
self.nbLayers = None
-# Public class: Mesh_UseExistingElements
-# --------------------------------------
-## Defines a Radial Quadrangle 1D2D algorithm
-# It is created by calling Mesh.UseExisting1DElements(geom=0)
+## Defines a Use Existing Elements 1D algorithm
+#
+# It is created by calling smesh.Mesh.UseExisting1DElements(geom=0)
+ ## Private constructor.
+ # @param mesh parent mesh object algorithm is assigned to
+ # @param geom geometry (shape/sub-shape) algorithm is assigned to;
+ # if it is @c 0 (default), the algorithm is assigned to the main shape
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
self.Create(mesh, geom, self.algoType)
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
self.Create(mesh, geom, self.algoType)
## Defines "Source edges" hypothesis, specifying groups of edges to import
# @param groups list of groups of edges
## Defines "Source edges" hypothesis, specifying groups of edges to import
# @param groups list of groups of edges
-# Public class: Mesh_UseExistingElements
-# --------------------------------------
-## Defines a Radial Quadrangle 1D2D algorithm
-# It is created by calling Mesh.UseExisting2DElements(geom=0)
+ pass # end of StdMeshersDC_UseExistingElements_1D class
+
+## Defines a Use Existing Elements 1D-2D algorithm
+#
+# It is created by calling smesh.Mesh.UseExisting2DElements(geom=0)
+ ## Private constructor.
+ # @param mesh parent mesh object algorithm is assigned to
+ # @param geom geometry (shape/sub-shape) algorithm is assigned to;
+ # if it is @c 0 (default), the algorithm is assigned to the main shape
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
self.Create(mesh, geom, self.algoType)
def __init__(self, mesh, geom=0):
Mesh_Algorithm.__init__(self)
self.Create(mesh, geom, self.algoType)
## Defines "Source faces" hypothesis, specifying groups of faces to import
# @param groups list of groups of faces
## Defines "Source faces" hypothesis, specifying groups of faces to import
# @param groups list of groups of faces
+ ## Private constructor.
+ # @param mesh parent mesh object algorithm is assigned to
+ # @param geom geometry (shape/sub-shape) algorithm is assigned to;
+ # if it is @c 0 (default), the algorithm is assigned to the main shape
def __init__(self, mesh, geom=0):
self.Create(mesh, geom, self.algoType)
self.hyp = None
def __init__(self, mesh, geom=0):
self.Create(mesh, geom, self.algoType)
self.hyp = None
## Defines "Body Fitting parameters" hypothesis
# @param xGridDef is definition of the grid along the X asix.
## Defines "Body Fitting parameters" hypothesis
# @param xGridDef is definition of the grid along the X asix.
## Defines a stub 1D algorithm, which enables "manual" creation of nodes and
# segments usable by 2D algoritms
## Defines a stub 1D algorithm, which enables "manual" creation of nodes and
# segments usable by 2D algoritms
+ ## Private constructor.
+ # @param mesh parent mesh object algorithm is assigned to
+ # @param geom geometry (shape/sub-shape) algorithm is assigned to;
+ # if it is @c 0 (default), the algorithm is assigned to the main shape
def __init__(self, mesh, geom=0):
self.Create(mesh, geom, self.algoType)
def __init__(self, mesh, geom=0):
self.Create(mesh, geom, self.algoType)
## Defines a stub 2D algorithm, which enables "manual" creation of nodes and
# faces usable by 3D algoritms
## Defines a stub 2D algorithm, which enables "manual" creation of nodes and
# faces usable by 3D algoritms
+ ## Private constructor.
+ # @param mesh parent mesh object algorithm is assigned to
+ # @param geom geometry (shape/sub-shape) algorithm is assigned to;
+ # if it is @c 0 (default), the algorithm is assigned to the main shape
def __init__(self, mesh, geom=0):
self.Create(mesh, geom, self.algoType)
def __init__(self, mesh, geom=0):
self.Create(mesh, geom, self.algoType)