CSPropDiscMaterial
- class CSXCAD.CSProperties.CSPropDiscMaterial
Bases:
CSPropMaterialDiscrete material property loaded from an HDF5 file.
The file encodes a voxel grid of material indices that map to epsilon, mue, kappa, sigma, and density values.
- Parameters:
filename – str – path to the HDF5 material file
scale – float – spatial scale factor (default 1)
use_db_background – bool – index 0 maps to background (default True)
- GetDensityWeighted(coords)
Return density at the given coordinates.
- GetEpsilonWeighted(ny, coords)
Return epsilon at the given coordinates for direction ny (0/1/2).
- GetFileType()
Get the file type (0 = HDF5).
- GetFilename()
Get the HDF5 material file path.
- GetKappaWeighted(ny, coords)
Return kappa at the given coordinates for direction ny (0/1/2).
- GetMueWeighted(ny, coords)
Return mue at the given coordinates for direction ny (0/1/2).
- GetScale()
Get the spatial scale factor.
- GetSigmaWeighted(ny, coords)
Return sigma at the given coordinates for direction ny (0/1/2).
- GetTransform()
Return the affine transform applied to lookup coordinates.
Lazily creates one (as a no-op transform) if none has been set yet.
- GetUseDataBaseForBackground()
Get whether database index 0 is used as background material.
- ReadFile()
Read the material data from the HDF5 file. Returns True on success.
- SetFileType(ftype)
Set the file type (0 = HDF5).
- SetFilename(fn)
Set the HDF5 material file path.
- SetScale(val)
Set the spatial scale factor applied to mesh coordinates.
- SetTransform(transform)
Set the affine transform applied to lookup coordinates before the scale factor.
Ownership is transferred to the property. Use transform.copy() first if you need to keep an independent copy. Pass None to remove the transform.
- SetUseDataBaseForBackground(val)
Set whether database index 0 is used as background material.