esys.pycad.Triangle Package¶
Classes¶
-
class
esys.pycad.Triangle.
Arc
(center, start, end)¶ Defines an arc which is strictly smaller than pi.
-
__init__
(center, start, end)¶ Creates an arc defined by the start point, end point and center.
-
getCenterPoint
()¶ Returns the center point.
-
getEndPoint
()¶ Returns the end point.
-
getStartPoint
()¶ Returns the start point.
-
isColocated
(primitive)¶ Returns True if curves are at the same position.
-
substitute
(sub_dict)¶ Returns a copy of self with substitutes for the primitives used to construct it given by the dictionary
sub_dict
. If a substitute for the object is given bysub_dict
the value is returned, otherwise a new instance with substituted arguments is returned.
-
-
class
esys.pycad.Triangle.
BSpline
(*points)¶ A BSpline curve. Control points may be repeated.
-
__init__
(*points)¶ Defines a curve from control points given by
points
.
-
-
class
esys.pycad.Triangle.
BezierCurve
(*points)¶ A Bezier curve.
-
__init__
(*points)¶ Defines a curve from control points given by
points
.
-
-
class
esys.pycad.Triangle.
CurveLoop
(*curves)¶ An oriented loop of one-dimensional manifolds (= curves and arcs).
The loop must be closed and the
Manifold1D
s should be oriented consistently.-
__init__
(*curves)¶ Creates a polygon from a list of line curves. The curves must form a closed loop.
-
collectPrimitiveBases
()¶ Returns primitives used to construct the CurveLoop.
-
getCurves
()¶ Returns the curves defining the CurveLoop.
-
getPolygon
()¶ Returns a list of start/end points of the 1D manifold from the loop. If not closed an exception is thrown.
-
isColocated
(primitive)¶ Returns True if each curve is collocated with a curve in
primitive
.
-
substitute
(sub_dict)¶ Returns a copy of self with substitutes for the primitives used to construct it given by the dictionary
sub_dict
. If a substitute for the object is given bysub_dict
the value is returned, otherwise a new instance with substituted arguments is returned.
-
-
class
esys.pycad.Triangle.
Design
(dim=2, keep_files=False)¶ Design for Triangle.
-
__init__
(dim=2, keep_files=False)¶ Initializes the Triangle design.
- Parameters
dim – spatial dimension
keep_files – flag to keep work files
-
getCommandString
()¶ Returns the Triangle command line:
triangle [-prq__a__uAcDjevngBPNEIOXzo_YS__iFlsCQVh] input_file see http://www.cs.cmu.edu/~quake/triangle.switch.html
-
getMeshFileName
()¶ Returns the name of the Triangle mesh file.
-
getMeshHandler
()¶ Returns a handle to a mesh meshing the design. In the current implementation a mesh file name in Triangle format is returned.
-
getScriptFileName
()¶ Returns the name of the gmsh script file.
-
getScriptString
()¶ Returns the Triangle script to generate the mesh.
-
setMeshFileName
(name=None)¶ Sets the name of the Triangle mesh file.
-
setOptions
(cmdLineArgs='')¶ Sets command line options for the mesh generator:
triangle [-prq__a__uAcDjevngBPNEIOXzo_YS__iFlsCQVh] input_file see http://www.cs.cmu.edu/~quake/triangle.switch.html
- Parameters
cmdLineArgs – the switches you would ordinarily use at the command line (e.g. cmdLineArgs=”pq25a7.5”)
-
setScriptFileName
(name=None)¶ Sets the filename for the Triangle input script. If no name is given a name with extension
poly
is generated.
-
-
class
esys.pycad.Triangle.
Line
(*points)¶ A line is defined by two points.
-
__init__
(*points)¶ Defines a line with start and end point.
-
-
class
esys.pycad.Triangle.
PlaneSurface
(loop, holes=[])¶ A plane surface with holes.
-
__init__
(loop, holes=[])¶ Creates a plane surface with holes.
- Parameters
- Note
A CurveLoop defining a hole should not have any lines in common with the exterior CurveLoop.
- Note
A CurveLoop defining a hole should not have any lines in common with another CurveLoop defining a hole in the same surface.
-
collectPrimitiveBases
()¶ Returns primitives used to construct the Surface.
-
getBoundary
()¶ Returns a list of the one-dimensional manifolds forming the boundary of the Surface (including holes).
-
getBoundaryLoop
()¶ Returns the loop defining the boundary.
-
getHoles
()¶ Returns the holes.
-
hasHole
()¶ Returns True if a hole is present.
-
isColocated
(primitive)¶ Returns True if each curve is collocated with a curve in
primitive
.
-
substitute
(sub_dict)¶ Returns a copy of self with substitutes for the primitives used to construct it given by the dictionary
sub_dict
. If a substitute for the object is given bysub_dict
the value is returned, otherwise a new instance with substituted arguments is returned.
-
-
class
esys.pycad.Triangle.
Point
(x=0.0, y=0.0, z=0.0, local_scale=1.0)¶ A three-dimensional point.
-
__init__
(x=0.0, y=0.0, z=0.0, local_scale=1.0)¶ Creates a point with coordinates
x
,y
,z
with the local refinement factorlocal_scale
. Ifx
is a list or similar it needs to have length less or equal 3. In this casey
andz
are overwritten byx[1]
andx[2]
.
-
collectPrimitiveBases
()¶ Returns primitives used to construct the primitive.
-
getCoordinates
()¶ Returns the coordinates of the point as a
numpy.ndarray
object.
-
getCoordinatesAsList
()¶ Returns the coordinates of the point as a
list
object.
-
getLocalScale
()¶ Returns the local refinement factor.
-
isColocated
(primitive)¶ Returns True if the
Point
primitive
is collocated (has the same coordinates) with self. That is, if |self - primitive| <= tol * max(|self|,|primitive|).
-
modifyBy
(transformation)¶ Modifies the coordinates by applying the given transformation.
-
setCoordinates
(x)¶ Sets the coordinates of the point from a
numpy.ndarray
objectx
.
-
setLocalScale
(factor=1.0)¶ Sets the local refinement factor.
-
substitute
(sub_dict)¶ Returns a copy of self with substitutes for the primitives used to construct it given by the dictionary
sub_dict
. If a substitute for the object is given bysub_dict
the value is returned, otherwise a new instance with substituted arguments is returned.
-
-
class
esys.pycad.Triangle.
PropertySet
(name, *items)¶ Defines a group of
Primitive
s which can be accessed through a name.-
__init__
(name, *items)¶ Initializes the Primitive instance object with a unique ID.
-
addItem
(*items)¶ Adds items. An item my be any
Primitive
but noPropertySet
.
-
addItems
(*items)¶ Adds items. An item my be any
Primitive
but noPropertySet
.
-
clearItems
()¶ Clears the list of items.
-
collectPrimitiveBases
()¶ Returns primitives used to construct the PropertySet.
-
getDim
()¶ Returns the dimensionality of the items.
-
getItems
()¶ Returns the list of items.
-
getManifoldClass
()¶ Returns the manifold class expected from items.
-
getName
()¶ Returns the name of the set.
-
getNumItems
()¶ Returns the number of items in the property set.
-
getTag
()¶ Returns the tag used for this property set.
-
setName
(name)¶ Sets the name.
-
-
class
esys.pycad.Triangle.
RuledSurface
(loop)¶ A ruled surface, i.e. a surface that can be interpolated using transfinite interpolation.
-
__init__
(loop)¶ Creates a ruled surface with boundary
loop
.- Parameters
loop –
CurveLoop
defining the boundary of the surface.
-
collectPrimitiveBases
()¶ Returns primitives used to construct the Surface.
-
getBoundary
()¶ Returns a list of the one-dimensional manifolds forming the boundary of the Surface (including holes).
-
getBoundaryLoop
()¶ Returns the loop defining the outer boundary.
-
hasHole
()¶ Returns True if a hole is present.
-
isColocated
(primitive)¶ Returns True if each curve is collocated with a curve in
primitive
.
-
substitute
(sub_dict)¶ Returns a copy of self with substitutes for the primitives used to construct it given by the dictionary
sub_dict
. If a substitute for the object is given bysub_dict
the value is returned, otherwise a new instance with substituted arguments is returned.
-
-
class
esys.pycad.Triangle.
Spline
(*points)¶ A spline curve defined through a list of control points.
-
__init__
(*points)¶ Defines a curve from control points given by
points
.
-
-
class
esys.pycad.Triangle.
SurfaceLoop
(*surfaces)¶ A loop of 2D primitives which defines the shell of a volume.
The loop must represent a closed shell, and the primitives should be oriented consistently.
-
__init__
(*surfaces)¶ Creates a surface loop.
-
collectPrimitiveBases
()¶ Returns primitives used to construct the SurfaceLoop.
-
getSurfaces
()¶ Returns the surfaces defining the SurfaceLoop.
-
isColocated
(primitive)¶ Returns True if each surface is collocated with a curve in
primitive
and vice versa.
-
substitute
(sub_dict)¶ Returns a copy of self with substitutes for the primitives used to construct it given by the dictionary
sub_dict
. If a substitute for the object is given bysub_dict
the value is returned, otherwise a new instance with substituted arguments is returned.
-
-
class
esys.pycad.Triangle.
Volume
(loop, holes=[])¶ A volume with holes.
-
__init__
(loop, holes=[])¶ Creates a volume with holes.
- Parameters
loop –
SurfaceLoop
defining the boundary of the surfaceholes – list of
SurfaceLoop
defining holes in the surface
- Note
A SurfaceLoop defining a hole should not have any surfaces in common with the exterior SurfaceLoop.
- Note
A SurfaceLoop defining a hole should not have any surfaces in common with another SurfaceLoop defining a hole in the same volume.
-
collectPrimitiveBases
()¶ Returns primitives used to construct the surface.
-
getBoundary
()¶ Returns a list of the 2-dimensional manifolds forming the surface of the Volume (including holes).
-
getHoles
()¶ Returns the holes in the volume.
-
getSurfaceLoop
()¶ Returns the loop forming the surface.
-
hasHole
()¶ Returns True if a hole is present.
-
isColocated
(primitive)¶ Returns True if each curve is collocated with a curve in
primitive
.
-
substitute
(sub_dict)¶ Returns a copy of self with substitutes for the primitives used to construct it given by the dictionary
sub_dict
. If a substitute for the object is given bysub_dict
the value is returned, otherwise a new instance with substituted arguments is returned.
-
Functions¶
-
esys.pycad.Triangle.
getMPIRankWorld
() → int :¶ Return the rank of this process in the MPI World.
-
esys.pycad.Triangle.
getMPIWorldMax
((int)arg1) → int :¶ Each MPI process calls this function with a value for arg1. The maximum value is computed and returned.
- Return type
int