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, NDArray, NDArray, 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
|
x position |
ymesh |
NDArray
|
y position |
fld |
NDArray
|
field values |
meta |
Varf
|
metadata |
get_meshes_vec
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
|
x position |
ymesh |
NDArray
|
y position |
fldx |
NDArray
|
x component |
fldy |
NDArray
|
y component |
plot_scalar
plot_scalar(
step: Step,
var: str,
field: Optional[NDArray] = None,
axis: Optional[Axes] = None,
conf: Optional[Config] = None,
**extra: Any
) -> tuple[Figure, Axes, QuadMesh, Optional[Colorbar]]
Plot scalar field.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
step |
Step
|
a |
required |
var |
str
|
the scalar field name. |
required |
field |
Optional[NDArray]
|
if not None, it is plotted instead of |
None
|
axis |
Optional[Axes]
|
the |
None
|
conf |
Optional[Config]
|
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 |
Optional[Colorbar]
|
colorbar |
plot_iso
plot_iso(
axis: Axes,
step: Step,
var: str,
field: Optional[NDArray] = None,
conf: Optional[Config] = 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 |
Optional[NDArray]
|
if not None, it is plotted instead of |
None
|
conf |
Optional[Config]
|
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 |
Optional[Config]
|
configuration. |
None
|