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: object

Metadata for a physical array or scalar stored on a GainMedium.

shape is evaluated against the current MeshTopology so 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: object

Handle returned by GainMedium.get(...).

It carries the property’s physical description, dtype, expected shape, and a value setter 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: object

Regular rectangular helper that generates a 2D triangular base mesh.

xExtent and yExtent describe the transverse footprint. zExtent and tileSizeZ define the sampled crystal levels used for beta arrays.

property numberOfLevels

Number of z sample planes generated from zExtent and tileSizeZ.

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: object

Triangular base mesh extruded through z levels into wedge prisms.

points are transverse (x, y) coordinates. trianglePointIndices connect those points into the 2D base mesh. levels and thickness describe the z sampling used by betaCells and betaVolume.

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 Grid helper.

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 betaCells index 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: object

Mesh plus material/state properties required by ASE and pump models.

Use get(name) to inspect a property handle, including expected array shape, then set prop.value or call set(name, value). Arrays may be supplied in matrix shape and are stored internally in Fortran order.

Parameters:
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 self for 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 betaCells entry.

listProperties()

Return metadata for all known gain-medium properties.

get(name)

Return a GainMediumProperty handle by canonical name or alias.

set(name, value)

Validate and store one physical property.

property dntdAse

ASE contribution to d beta / dt at the sample points.

property numberOfLevels

Number of z sample planes in the attached topology.

pyInclude.geometry.core.GainMediumGeometry

alias of MeshTopology