Namespace for geometry objects.
Class diagram for steps.geom namespace.
Top-level geometry container to which a number of compartment objects and patches objects may be grouped.
A steps.geom.Geom object is parent to the following objects:
Construction:
g = steps.geom.Geom()
Create a geometry container object.
Removes the steps.geom.Comp object with identifier string comp_id (if defined) from the geometry container.
Syntax:
delComp(comp_id)
Removes the steps.geom.Patch object with identifier string patch_id (if defined) from the geometry container.
Syntax:
delPatch(patch_id)
Returns a list of references to all steps.geom.Comp compartment objects in the geometry container.
Syntax:
getAllComps()
Returns a list of references to all steps.geom.Patch patch objects in the geometry container.
Syntax:
getAllPatches()
Returns a reference to the steps.model.Comp compartment object with identifier string comp_id (if defined).
Syntax:
getComp(comp_id)
Removes the steps.geom.Patch object with identifier string patch_id (if defined) from the geometry container.
Syntax:
getPatch(patch_id)
Base class for compartment objects. It provides basic functionality and data that is shared by the derived class steps.geom.TmComp (that is used to describe a compartment in a tetrahedral mesh):
This base class can be used directly with well-mixed solvers.
Relationship between Compartments and Patches
It is necessary to explain the inner/outer relationship between compartments and patches. When a patch object is created (a surface of a compartment, which may be shared with another compartment). it is necessary to arbitrarily label the compartment(s) “inner” and “outer” (if a patch is connected to only one compartment then the compartment must be labelled “inner” by convention). This is necessary in order to fully describe the surface reaction rules. Accordingly, compartments also store a list of connections, “inner” patches and “outer” patches. So if a patch1 is created with comp1 as it’s “inner” compartment, comp1 knows patch 1 as an “outer” patch. The labelling is purely defined when creating the Patch objects, bearing in mind the stoichiometry defined in the surface reaction objects. This may seem a little confusing at first, but will become clearer when experience is gained with these objects.
Construction:
comp = steps.geom.Comp(id, container, vol = 0.0)
Construct a compartment object with identifier string id and assign container as the parent geometry container. Optionally set volume to vol (in m^3).
Add volume system identifier string volsys_id to the compartment object.
Syntax:
addVolsys(volsys_id)
Removes volume system identifier string volsys_id from this compartment.
Syntax:
delVolsys(volsys_id)
Returns a reference to the parent steps.geom.Geom container object.
Syntax:
getContainer()
Get the identifier string of the compartment.
Syntax:
getID()
Returns a list of references to steps.geom.Patch patch objects: the ‘inner’ patches.
Syntax:
getIPatches()
Returns a list of references to steps.geom.Patch patch objects: the ‘outer’ patches.
Syntax:
getOPatches()
Get the volume of the compartment (in m^3).
Syntax:
getVol()
Returns a list of the volume system identifier strings which have been added to the compartment.
Syntax:
getVolsys()
Set the identifier string of the compartment.
Syntax:
setID(name)
Set the volume of the compartment (in m^3).
Syntax:
setVol(vol)
Base class for patch objects. A patch is a piece of 2D surface surrounding (part of) a 3D compartment, which may be connected to another compartment. It provides basic functionality and descriptive data that is shared by the derived class steps.geom.TmPatch (that is used to describe a surface comprised of triangles in a tetrahedral mesh):
This base class can be used directly with well-mixed solvers.
Construction:
patch = steps.geom.Patch(id, container, icomp, ocomp = None, area = 0.0)
Construct a patch object with identifier string id, assign container as the parent geometry container and assign icomp as the “inner” compartment. Assign also ocomp as the “outer” compartment (if required) and optionally set the area to area (in m^2).
Add surface system identifier string surfsys_id to the patch object.
Syntax:
addSurfsys(surfsys_id)
Removes surface system identifier string surfsys_id from this patch.
Syntax:
delSurfsys(surfsys_id)
Get the area of the patch (in m^2).
Syntax:
getArea()
Returns a reference to the parent steps.geom.Geom container object.
Syntax:
getContainer()
Returns a reference to the steps.geom.Comp compartment object representing the inner compartment.
Syntax:
getIComp()
Get the identifier string of the patch.
Syntax:
getID()
Returns a reference to the steps.geom.Comp compartment object representing the outer compartment.
Syntax:
getOComp()
Returns a list of the surface system identifier strings which have been added to the patch.
Syntax:
getSurfsys()
Set the area of the patch (in m^2).
Syntax:
setArea(area)
Set the identifier string of the patch.
Syntax:
setID(name)
Main container class for static tetrahedral meshes. This class stores the vertices points, 3D tetrahedral and 2D triangular elements that comprise the mesh. The indices of the elements will be stored as unsigned integers (a positive integer or zero) beginning at zero and incremented by 1. For example, if there are ntets number of tetrahedrons in the mesh, the indices of the tetrahedrons will be [0,1,2,..., (ntets-1)]. In addition, this class computes and contains some auxiliary data from the mesh:
Auxiliary data is also stored for each tetrahedron:
And for each triangle:
Construction1:
mesh = steps.geom.Tetmesh(verts, tets, tris)
Construct a Tetmesh container by the “first” method: Supply a list of all vertices verts (by Cartesian coordinates), supply a list of all tetrahedrons tets (by indices of the 4 vertices) and supply a full or partial list of triangles tris (by indices of the 3 vertices). Indexing in STEPS begins at zero, so the first 3 coordinates in verts will describe the zeroth vertex, t he next 3 coordinates will describe the 1st vertex and so on. Labelling of the vertices in tets and tris should follow this indexing. Lists must be one-dimensional. Length of verts = nverts*3 where nverts is the total number of vertices; length of tets = ntets*4 where ntets is the total number of tetrahedrons; maximum length of tris ntris*3 where ntris is the total number of triangles. For example, if we have just three tetrahedrons; tet0=[0,1,2,3], tet1=[0,1,3,4] and tet2=[1,3,4,5] then the required one-dimensional list tets=[0,1,2,3,0,1,3,4,1,3,4,5].
Construct a Tetmesh container by the “second” method: Supply only the number of vertices nverts, the number of tetrahedrons ntets and the number of triangles ntris to the initializer, then use set methods to supply the vertex, tetrahedron and triangle information one by one. It is up to the user to make sure all information is supplied and then call setup() explicitly. It is highly recommended to use the first constructor wherever possible due to t he scope for user error when using this method.
Returns the total number of tetrahedrons in the mesh.
Syntax:
countTets()
Returns the total number of triangles in the mesh.
Syntax:
countTris()
Returns the total number of vertices in the mesh.
Syntax:
countVertices()
Removes the steps.geom.Comp object with identifier string comp_id (if defined) from the geometry container.
Syntax:
delComp(comp_id)
Removes the steps.geom.Patch object with identifier string patch_id (if defined) from the geometry container.
Syntax:
delPatch(patch_id)
Returns the index of the tetrahedron which encompasses a given point p (given in Cartesian coordinates x,y,z). Returns -1 if p is a position outside the mesh.
Syntax:
findTetByPoint(p)
Returns a list of references to all steps.geom.Comp compartment objects in the geometry container.
Syntax:
getAllComps()
Returns a list of references to all steps.geom.Patch patch objects in the geometry container.
Syntax:
getAllPatches()
Returns the maximal Cartesian coordinate of the rectangular bounding box of the mesh.
Syntax:
getBoundMax()
Returns the minimal Cartesian coordinate of the rectangular bounding box of the mesh.
Syntax:
getBoundMin()
Returns a reference to the steps.model.Comp compartment object with identifier string comp_id (if defined).
Syntax:
getComp(comp_id)
Returns the total volume of the mesh.
Syntax:
getMeshVolume()
Removes the steps.geom.Patch object with identifier string patch_id (if defined) from the geometry container.
Syntax:
getPatch(patch_id)
Returns the tetrahedron with index tidx in the container by its four vertex indices.
Returns the barycenter of the tetrahedron with index tidx.
Syntax:
getTetBarycenter(tidx)
Returns a reference to a steps.geom.Comp object: the compartment which tetrahedron with index tidx belongs to. Returns None if tetrahedron not assigned to a compartment.
Syntax:
getTetComp(tidx)
Returns the radius-edge-ratio (a quality measurement) of tetrahedron with index tidx.
Syntax:
getTetQualityRER(tidx)
Returns the indices of the four neighbouring tetrahedrons of tetrahedron with index tidx. An index of -1 indicates no neighbour (tetrahedron is on the mesh border).
Syntax:
getTetTetNeighb(tidx)
Returns the indices of the four neighbouring triangles of tetrahedron with index tidx.
Syntax:
getTetTriNeighb(tidx)
Returns the volume of the tetrahedron with index tidx.
Syntax:
getTetVol(tidx)
Returns the triangle with index tidx in the container by its three vertex indices.
Syntax:
getTri(tidx)
Returns the area of the triangle with index tidx.
Syntax:
getTriArea(tidx)
Returns the Cartesian coordinates of the barycenter of triangle with index tidx.
Syntax:
getTriBarycenter(tidx)
Returns a list of triangles that form the mesh boundary. Support function for steps.utilities.visual.
Syntax:
getTriBoundary()
Returns the normal vector of the triangle with index tidx.
Syntax:
getTriNorm(tidx)
Returns a reference to a step.geom.TmPatch object: the patch which triangle with index tidx belongs to. Returns None if triangle not assigned to a patch.
Syntax:
getTriPatch(tidx)
Returns the indices of the two neighbouring tetrahedrons of triangle with index tidx. An index of -1 indicates no neighbour (triangle is on the mesh border).
Syntax:
getTriTetNeighb(tidx)
Returns the coordinates of vertex with index vidx in the container.
Syntax:
getVertex(vidx)
Check if setup() has been called, either internally by the first constructor, or by the user if the second constructor was used.
Syntax:
isSetupDone()
Set the tetrahedron with index tidx formed by vertices vidx0, vidx1, vidx2, vidx3. Should be called ntets number of times to supply tetrahedron information if the second constructor is used. Cannot be called after setup() has been called.
Syntax:
setTet(tidx, vidx0, vidx1, vidx2, vidx3)
Set the triangle with index tidx formed by vertices vidx0, vidx1, vidx2. Should be called ntris number of times to supply triangle information if the second constructor is used. Cannot be called after setup() has been called.
Syntax:
setTri(tidx, vidx0, vidx1, vidx2)
Set a vertex with index vidx to coordinates x, y, z. Should be used nverts number of times to supply all vertex information if the second constructor is used. Cannot be called after setup() has been called.
Syntax:
setVertex(vidx, x, y, z)
Setup the Tetmesh object by computing the auxiliary data. This method should be called when the second constructor is used and all vertex, tetrahedron and triangle information has been supplied with the set methods. The first constructor calls this method internally, so setup does not have to be called when using the first constructor.
Syntax:
setup()
Derived class from base steps.geom.Comp class. It provides the same functionality as the steps.geom.Comp class extended for annotation of a group of tetrahedrons in a Tetmesh. The volume is the total volume of the encapsulated tetrahedrons.
Construction:
tmcomp = steps.geom.Comp(id, container, tets)
Construct a TmComp object with identifier string id and assign container as the parent Tetmesh container. Set the group of tetrahedrons that describe this compartment with tets.
Add volume system identifier string volsys_id to the compartment object.
Syntax:
addVolsys(volsys_id)
Returns the number of tetrahedrons assigned to the compartment.
Syntax:
countTets()
Removes volume system identifier string volsys_id from this compartment.
Syntax:
delVolsys(volsys_id)
Returns a list of indices of all tetrahedrons assigned to the compartment.
Syntax:
getAllTetIndices()
Returns the maximal Cartesian coordinate of the rectangular bounding box of the compartment.
Syntax:
getBoundMax()
Returns the minimal Cartesian coordinate of the rectangular bounding box of the compartment.
Syntax:
getBoundMin()
Returns a reference to the parent steps.geom.Geom container object.
Syntax:
getContainer()
Get the identifier string of the compartment.
Syntax:
getID()
Returns a list of references to steps.geom.Patch patch objects: the ‘inner’ patches.
Syntax:
getIPatches()
Returns a list of references to steps.geom.Patch patch objects: the ‘outer’ patches.
Syntax:
getOPatches()
Get the volume of the compartment (in m^3).
Syntax:
getVol()
Returns a list of the volume system identifier strings which have been added to the compartment.
Syntax:
getVolsys()
Returns a list of Booleans describing if tetrahedrons tets are assigned to the compartment.
Syntax:
isTetInside(tets)
Set the identifier string of the compartment.
Syntax:
setID(name)
Derived class from base steps.geom.Patch class. It provides the same functionality as the steps.geom.Patch class extended for annotation of a group of triangles in a Tetmesh. The area is the total area of the encapsulated triangles.
Construction:
tmpatch = steps.geom.Comp(id, container, tris, icomp, ocomp = None)
Construct a TmPatch object with identifier string id and assign container as the parent geometry container. Assign icomp as the “inner” compartment and assign also ocomp as the “outer” compartment (if required).
Add surface system identifier string surfsys_id to the patch object.
Syntax:
addSurfsys(surfsys_id)
Removes surface system identifier string surfsys_id from this patch.
Syntax:
delSurfsys(surfsys_id)
Returns a list of indices of all triangles assigned to the patch.
Syntax:
getAllTriIndices()
Get the area of the patch (in m^2).
Syntax:
getArea()
Returns a reference to the parent steps.geom.Geom container object.
Syntax:
getContainer()
Returns a reference to the steps.geom.Comp compartment object representing the inner compartment.
Syntax:
getIComp()
Get the identifier string of the patch.
Syntax:
getID()
Returns a reference to the steps.geom.Comp compartment object representing the outer compartment.
Syntax:
getOComp()
Returns a list of the surface system identifier strings which have been added to the patch.
Syntax:
getSurfsys()
Returns a list of Booleans describing if triangles tris are assigned to the patch.
Syntax:
isTriInside(tris)
Set the identifier string of the patch.
Syntax:
setID(name)