glow package

GLOW (Geometry Layout Oriented Workflow) is a Python is a Python package providing 2D unstructured geometries to the DRAGON5 lattice transport computer code.

Subpackages

Submodules

glow.main module

class TdtSetup(geom_type: GeometryType = GeometryType.TECHNOLOGICAL, property_type: PropertyType = PropertyType.MATERIAL, albedo: float | None = None, type_geo: LatticeGeometryType = LatticeGeometryType.ISOTROPIC, symmetry_type: SymmetryType = SymmetryType.FULL)[source]

Bases: object

Dataclass holding the settings for configuring how to export the TDT file for the lattice’s geometry layout.

Notes

The albedo attribute can have values between 0.0 and 1.0, with the latter case indicating the ALBE 1.0 BC used in DRAGON5 with a uniform tracking (i.e. LatticeGeometryType.ISOTROPIC). If None, the value that corresponds to the type of geometry of the lattice is used, i.e. 0.0 for values of LatticeGeometryType greater than zero, 1.0 otherwise.

albedo: float | None = None

Identifying the value for the albedo applied to the lattice’s BCs.

geom_type: GeometryType = 0

Identifying the type of geometry of the lattice’s cells.

property_type: PropertyType = 0

Identifying the type of property associated to lattice’s regions.

symmetry_type: SymmetryType = 0

Identifying the value for the symmetry type applied to the lattice.

type_geo: LatticeGeometryType = 0

Identifying the value for the typegeo related to the layout.

analyse_and_generate_tdt(lattices: List[Lattice], filename: str, tdt_config: TdtSetup = TdtSetup(GeometryType.TECHNOLOGICAL, PropertyType.MATERIAL, None), compound_to_export: Any | None = None) None[source]

Function that analyses the given lattices, as instance of the Lattice class, to extract information about the characteristics of its geometry and the properties associated to its regions. A TDT file, whose name is provided as second parameter, is generated, collecting all this information. Users can also specify to analyse the lattice according to:

  • the geometry type of its cells;

  • the type of property associated to the lattice regions;

  • the value for the albedo applied to the lattice’s BCs. If None, a default value that corresponds to the lattice’s geometry type is adopted;

  • the value for the typegeo parameter;

  • the type of symmetry applied to the single lattice or the colorset.

When exporting one or more Lattice instances provided by the input list, the typegeo and the symmetry type values of the TdtSetup instance are neglected. The values of the corresponding attributes for the first lattice in the list (taken as reference) are considered instead.

If the compound_to_export parameter is provided, it will be the one to be analysed and exported, according to the property information stored in the provided lattices. The indicated compound object must be a portion of the lattices, otherwise the successive steps of the analysis will fail. The values for the typegeo parameter and the symmetry type provided in the TdtSetup instance are considered regardless of what set in the list of involved lattices, even if only one lattice is present. Users should note that these two values must match with the provided compound. If values that do not match with the shape of the compound are provided, the validity of the results in DRAGON cannot be assured.

Parameters:
  • lattices (List[Lattice]) – The object storing the information about the geometry and the properties of the lattices.

  • filename (str) – The name of the output TDT file.

  • tdt_config (TdtSetup) – Dataclass providing the settings for exporting the TDT representation of the geometry layout of the lattice.

  • compound_to_export (Any | None = None) – The compound object to analyse and export to TDT, if present. If None is given, the lattices are considered instead.

Raises:

RuntimeError – When multiple lattices, and no compound, are provided and they do not have the same SymmetryType.FULL symmetry. When a compound is provided and the corresponding lattices do not have the same SymmetryType.FULL symmetry. In case of inconsistencies in the values of the TdTSetup settings. If the analysis fails due to the compound not been part of the lattices, no property found for a region, the impossibility to get the borders of the layout to export.