pyInclude.geometry.core
Geometry, topology, and gain-medium state containers for Python users.
- class pyInclude.geometry.core.PhysicalPropertySpec(name, dtype, shape, description, default=None)
Bases:
objectMetadata for a physical array or scalar stored on a
GainMedium.shapeis evaluated against the currentMeshTopologyso properties can describe point, prism, triangle, surface, or scalar data.- Parameters:
name (str)
dtype (object)
shape (callable)
description (str)
default (callable | None)
- class pyInclude.geometry.core.GainMediumProperty(medium, spec)
Bases:
objectHandle returned by
GainMedium.get(...).It carries the property’s physical description, dtype, expected shape, and a
valuesetter that validates arrays before storing them on the medium.- meta()
Return serializable metadata for docs, inspection, or UI tooling.
- class pyInclude.geometry.core.Grid(xExtent=None, yExtent=None, zExtent=None, tileSizeX=1.0, tileSizeY=None, tileSizeZ=None, origin=(0.0, 0.0), **aliases)
Bases:
objectRegular rectangular helper that generates a 2D triangular base mesh.
xExtentandyExtentdescribe the transverse footprint.zExtentandtileSizeZdefine the sampled crystal levels used for beta arrays.- property numberOfLevels
Number of z sample planes generated from
zExtentandtileSizeZ.
- property thickness
Distance between adjacent z levels.
- constructPoints()
Return transverse topology points with shape
(numberOfPoints, 2).
- class pyInclude.geometry.core.MeshTopology(points, trianglePointIndices, levels=None, thickness=None, metadata=<factory>)
Bases:
objectTriangular base mesh extruded through z levels into wedge prisms.
pointsare transverse(x, y)coordinates.trianglePointIndicesconnect those points into the 2D base mesh.levelsandthicknessdescribe the z sampling used bybetaCellsandbetaVolume.- Parameters:
points (ndarray)
trianglePointIndices (ndarray)
levels (int | None)
thickness (float | None)
metadata (dict)
- points: ndarray
Transverse coordinates with shape
(numberOfPoints, 2).
- trianglePointIndices: ndarray
Triangle vertex indices with shape
(numberOfTriangles, 3).
- levels: int | None = None
Number of z sample planes; at least two when simulation data is used.
- thickness: float | None = None
Distance between adjacent z sample planes.
- metadata: dict
Importer or construction metadata kept for tooling and round-trips.
- classmethod fromPoints(points, numberOfLevels=None)
Delaunay-triangulate transverse points into a
MeshTopology.
- classmethod fromGrid(grid)
Construct topology from a regular
Gridhelper.
- classmethod fromGmsh(gmsh, *, numberOfLevels=None, thickness=None)
Import a planar gmsh triangle mesh and attach z sampling.
- classmethod fromFile(filename, format=None, numberOfLevels=None, thickness=None)
Load supported mesh formats: legacy VTK, planar STL, or gmsh.
- numberOfLevels(levels)
Set the number of z sample planes and return
self.
- withThickness(thickness)
Set the spacing between adjacent z levels and return
self.
- levelCoordinates()
Return z coordinates for every level as
0, thickness, ....
- pointIndexAt(x, y, *, tol=1e-12)
Return the topology point index for a transverse coordinate.
- levelIndexAt(z, *, tol=1e-12)
Return the z-level index for a physical z coordinate.
- betaCellIndexAt(x, y, z, *, tol=1e-12, flat=False)
Return the
betaCellsindex for a physical(x, y, z)point.
- property numberOfTriangles
Number of base triangles, and therefore prisms per z interval.
- property numberOfPoints
Number of transverse sample points per z level.
- property numberOfPrisms
Total number of wedge prisms in the extruded mesh.
- asGainMedium()
Wrap this topology in an empty
GainMedium.
- class pyInclude.geometry.core.GainMedium(topology, physical=<factory>)
Bases:
objectMesh plus material/state properties required by ASE and pump models.
Use
get(name)to inspect a property handle, including expected array shape, then setprop.valueor callset(name, value). Arrays may be supplied in matrix shape and are stored internally in Fortran order.- Parameters:
topology (MeshTopology)
physical (dict)
- topology: MeshTopology
Geometry and z-level sampling for this medium.
- physical: dict
Canonical physical arrays and scalars stored by property name.
- classmethod fromVtk(filename, *, numberOfLevels=None, thickness=None)
Load topology and physical fields from a legacy VTK wedge file.
- classmethod fromFile(filename, format=None, *, numberOfLevels=None, thickness=None)
Load a gain medium; currently supports legacy VTK files.
- withPhysicalProperties(**properties)
Set several physical properties and return
selffor chaining.
- toVtk(filename)
Write this gain medium to a legacy ASCII VTK wedge file.
- emptyBetaCells(fill=0.0)
Create a correctly shaped point-level beta array filled with
fill.
- betaCellIndexAt(x, y, z, *, tol=1e-12, flat=False)
Forward coordinate lookup for a
betaCellsentry.
- listProperties()
Return metadata for all known gain-medium properties.
- get(name)
Return a
GainMediumPropertyhandle by canonical name or alias.
- set(name, value)
Validate and store one physical property.
- property dntdAse
ASE contribution to
d beta / dtat the sample points.
- property numberOfLevels
Number of z sample planes in the attached topology.
- pyInclude.geometry.core.GainMediumGeometry
alias of
MeshTopology