render_config.FieldMaterial#

class FieldMaterial#

Bases: MaterialBase

FieldMaterial maps scalar field values to colors for flow visualization.

Example

>>> FieldMaterial.rainbow(field="pressure", min_value=0, max_value=100000)

Attributes

opacity: float#

The transparency of the material 1 is fully opaque, 0 is fully transparent

Default:

1

output_field: Literal['Cp', 'Cpt', 'gradW', 'kOmega', 'Mach', 'mut', 'mutRatio', 'nuHat', 'primitiveVars', 'qcriterion', 'residualNavierStokes', 'residualTransition', 'residualTurbulence', 's', 'solutionNavierStokes', 'solutionTransition', 'solutionTurbulence', 'T', 'velocity', 'velocity_x', 'velocity_y', 'velocity_z', 'velocity_magnitude', 'pressure', 'vorticity', 'vorticityMagnitude', 'vorticity_x', 'vorticity_y', 'vorticity_z', 'wallDistance', 'numericalDissipationFactor', 'residualHeatSolver', 'VelocityRelative', 'lowMachPreconditionerSensor', 'velocity_m_per_s', 'velocity_x_m_per_s', 'velocity_y_m_per_s', 'velocity_z_m_per_s', 'velocity_magnitude_m_per_s', 'pressure_pa'] | str | UserVariable#

Scalar field applied to the surface via the colormap

min: Expression | UnytQuantity | float#

Reference min value (in solver units) representing the left boundary of the colormap

max: Expression | UnytQuantity | float#

Reference max value (in solver units) representing the right boundary of the colormap

colormap: list[tuple[Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=255)])], Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=255)])], Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=0), Le(le=255)])]]]#

List of key colors distributed evenly across the gradient, defines value to color mappings

Methods

classmethod check_runtime_expression(v)#

Ensure the output field is a runtime expression but not a constant value.

classmethod check_range_single_value(v)#

Ensure the min/max range is a single value.

classmethod check_range_dimensions(v, info)#

Ensure the min/max range has the same dimensions as the field.

Parameters:

info (ValidationInfo)

classmethod check_iso_value_for_string_field(v, info)#

Ensure the iso_value is float when string field is used.

Parameters:

info (ValidationInfo)

classmethod rainbow(field, min_value, max_value, opacity=1)#

Create a rainbow-style colormap for scalar fields.

Example

>>> FieldMaterial.rainbow("velocity_magnitude")
classmethod orizon(field, min_value, max_value, opacity=1)#

Create an Orizon-style (blue–orange) colormap.

Example

>>> FieldMaterial.orizon("temperature")
classmethod viridis(field, min_value, max_value, opacity=1)#

Create a Viridis colormap.

Example

>>> FieldMaterial.viridis("vorticity")
classmethod magma(field, min_value, max_value, opacity=1)#

Create a Magma colormap.

Example

>>> FieldMaterial.magma("density")
classmethod airflow(field, min_value, max_value, opacity=1)#

Create an Airflow-style visualization colormap.

Example

>>> FieldMaterial.airflow("pressure_coefficient")