Case
- class Case(*, config, loader='openfoam', case_type=CaseType.RECONSTRUCTED)[source]
Bases:
objectInitialize a new case and load it using the specified ParaView reader.
The case is the central object everything revolves around. Create it by passing a config instance with the correct case path. Then you can set the loader to load OpenFoam or MeshFree cases.
- Parameters:
config (Config) – The preloaded configuration object providing the case path.
loader (LoaderType) – The reader type to use. Can be “openfoam”, “ensight”, or “file”. Capitalization does not matter. The “file” specifier allows to read arbitrary file types, such as stl, vtu, pvd
case_type (CaseType) – The type of case to load (e.g., reconstructed).
- Returns:
None
- Raises:
TypeError – If the loader is incompatible with the case type.
- get_blocknames()[source]
Get all multiblock names from the case. :return List[str]: A list containing the hierarchical names of all blocks in the dataset’s VTK data assembly.
- log_blocknames()[source]
Log all multiblock names available in the case.
This prints a formatted list of all block names to the application logger.
- Returns:
None
- get_case()[source]
Get the underlying ParaView case object.
- Returns:
The internal ParaView data source representing the loaded case.
- set_mesh_regions(mesh_regions)[source]
Set the mesh regions that determine which parts of the case are rendered.
- Parameters:
mesh_regions (List[str]) – A list of region names to be rendered.Common default is
["internalMesh"].- Returns:
None
- get_range(field_name, force_update=False)[source]
Get the minimum and maximum values of a scalar field in the loaded case.
This method searches first in point data and then in cell data. If the field does not exist,
Noneis returned. On the first call, or whenforce_updateisTrue, the pipeline is updated which may take additional time.- Parameters:
- Return Optional[Tuple[float, float]]:
A
(min, max)tuple representing the field range, orNoneif the field is not found.- Return type:
- set_point_arrays(point_arrays)[source]
Set the active point arrays for the case.
- Parameters:
point_arrays (List[str]) – A list of point array names to enable on the data source.
- Returns:
None
- set_cell_arrays(cell_arrays)[source]
Set the active cell arrays for the case.
- Parameters:
cell_arrays (List[str]) – A list of cell array names to enable on the data source.
- Returns:
None
- get_time_step_count()[source]
Get the number of available time steps in the loaded case.
- Return int:
The total number of time steps.
- Return type:
- log_patch_array_info()[source]
Log all available mesh regions and their current selection status.
The output lists each mesh region along with its activation flag and is written to the application logger.
- Returns:
None
- log_cell_arrays()[source]
Log all available cell arrays.
This prints a formatted list of cell array names to the application logger, allowing the user to inspect which fields are available for cell‑based operations.
- Returns:
None
- log_point_arrays()[source]
Log all available point arrays.
This prints a formatted list of point array names to the application logger, allowing inspection of which point-based fields are available.
- Returns:
None
- get_patch_array_info()[source]
Get all available mesh regions and their activation status.
Each entry contains: -
name(str): The mesh region name. -status(int):1if selected,0if not selected.