field
Plot scalar and vector fields.
valid_field_var
Whether a field variable is defined.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
var
|
str
|
the variable name to be checked. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
whether the var is defined in either |
get_meshes_fld
get_meshes_fld(
conf: Config, step: Step, var: str, walls: bool = False
) -> tuple[
NDArray[np.float64],
NDArray[np.float64],
NDArray[np.float64],
Varf,
]
Return scalar field along with coordinates meshes.
Only works properly in 2D geometry and 3D cartesian.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conf
|
Config
|
configuration. |
required |
step
|
Step
|
a |
required |
var
|
str
|
scalar field name. |
required |
walls
|
bool
|
consider the walls as the relevant mesh. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
xmesh |
NDArray[float64]
|
x position |
ymesh |
NDArray[float64]
|
y position |
fld |
NDArray[float64]
|
field values |
meta |
Varf
|
metadata |
get_meshes_vec
get_meshes_vec(
conf: Config, step: Step, var: str
) -> tuple[
NDArray[np.float64],
NDArray[np.float64],
NDArray[np.float64],
NDArray[np.float64],
]
Return vector field components along with coordinates meshes.
Only works properly in 2D geometry and 3D cartesian.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
conf
|
Config
|
configuration. |
required |
step
|
Step
|
a |
required |
var
|
str
|
vector field name. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
xmesh |
NDArray[float64]
|
x position |
ymesh |
NDArray[float64]
|
y position |
fldx |
NDArray[float64]
|
x component |
fldy |
NDArray[float64]
|
y component |
plot_scalar
plot_scalar(
step: Step,
var: str,
field: NDArray[float64] | None = None,
axis: Axes | None = None,
conf: Config | None = None,
**extra: Any
) -> tuple[Figure, Axes, QuadMesh, Colorbar | None]
Plot scalar field.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
step
|
Step
|
a |
required |
var
|
str
|
the scalar field name. |
required |
field
|
NDArray[float64] | None
|
if not None, it is plotted instead of |
None
|
axis
|
Axes | None
|
the |
None
|
conf
|
Config | None
|
configuration. |
None
|
extra
|
Any
|
options that will be passed on to |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
fig |
Figure
|
matplotlib figure |
axes |
Axes
|
matplotlib axes |
surf |
QuadMesh
|
surface returned by |
cbar |
Colorbar | None
|
colorbar |
plot_iso
plot_iso(
axis: Axes,
step: Step,
var: str,
field: NDArray[float64] | None = None,
conf: Config | None = None,
**extra: Any
) -> None
Plot isocontours of scalar field.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
axis
|
Axes
|
the |
required |
step
|
Step
|
a |
required |
var
|
str
|
the scalar field name. |
required |
field
|
NDArray[float64] | None
|
if not None, it is plotted instead of |
None
|
conf
|
Config | None
|
configuration. |
None
|
extra
|
Any
|
options that will be passed on to |
{}
|
plot_vec
Plot vector field.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
axis
|
Axes
|
the :class: |
required |
step
|
Step
|
a |
required |
var
|
str
|
the vector field name. |
required |
conf
|
Config | None
|
configuration. |
None
|