kawin.diffusion (Plot)

kawin.kawin.diffusion.Plot

def _get_1D_mesh(model: DiffusionModel):

def _set_1D_xlim(ax, mesh: FiniteVolume1D, zScale, zOffset):

def plot1D(model: DiffusionModel, elements=None, zScale=1, zOffset=0, time=None, ax=None, plotUFrac=False, *args, **kwargs):

Plots composition profile of 1D mesh

Parameters
----------
model: Diffusion model
    Mesh in model must be Cartesian1D, Cylindrical1D, Spherical1D or any subclass of FiniteVolume1D
elements: list[str]
    List of elements to plot (can include the dependent/reference element)
    If elements is None, then it will plot the independent elements in the diffusion model
zScale: float (optional)
    Scaling for z-axis. Z will be divided by this, i.e. zScale = 1e-3 -> z is scaled from 1 to 1000
    Note: z is always in meters, so zScale represents the desired unit/meters
    Defaults to 0
zOffset: float (optional)
    Offset in meters to shift z axis (positive value will increase all z values)
    Defaults to 0
ax: matplotlib Axis (optional)
    Will be created if None

Returns
-------
matplotlib Axis

def plot1DTwoAxis(model: DiffusionModel, elementsL, elementsR, zScale=1, zOffset=0, time=None, axL=None, axR=None, plotUFrac=False, *args, **kwargs):

Plots composition profile of 1D mesh on left and right axes

Parameters
----------
model: Diffusion model
    Mesh in model must be Cartesian1D, Cylindrical1D, Spherical1D or any subclass of FiniteVolume1D
elementsL: list[str]
    List of elements to plot (can include the dependent/reference element)
elementsR: list[str]
    List of elements to plot (can include the dependent/reference element)
zScale: float (optional)
    Scaling for z-axis. Z will be divided by this, i.e. zScale = 1e-3 -> z is scaled from 1 to 1000
    Note: z is always in meters, so zScale represents the desired unit/meters
    Defaults to 0
zOffset: float (optional)
    Offset in meters to shift z axis (positive value will increase all z values)
    Defaults to 0
axL: matplotlib axis (optional)
    Left axis
    Will be created if None
axR: matplotlib axis (optional)
    Right axis
    Will be created if None

Returns
-------
matplotlib Axis for left axis
matplotlib Axis for right axis

def plot1DPhases(model: DiffusionModel, phases=None, zScale=1, zOffset=0, time=None, ax=None, *args, **kwargs):

Plots phase fractions over z

Parameters
----------
model: DiffusionModel
    Mesh in model must be Cartesian1D, Cylindrical1D, Spherical1D or any subclass of FiniteVolume1D
phases : list[str]
    Plots phases. If None, all phases in model are plotted
zScale: float (optional)
    Scaling for z-axis. Z will be divided by this, i.e. zScale = 1e-3 -> z is scaled from 1 to 1000
    Note: z is always in meters, so zScale represents the desired unit/meters
    Defaults to 0
zOffset: float (optional)
    Offset in meters to shift z axis (positive value will increase all z values)
    Defaults to 0
ax : matplotlib Axes object
    Axis to plot on

Returns
-------
matplotlib Axis

def plot1DFlux(model: DiffusionModel, elements=None, zScale=1, zOffset=0, time=None, ax=None, *args, **kwargs):

Plots flux of 1D mesh

Parameters
----------
model: Diffusion model
    Mesh in model must be Cartesian1D, Cylindrical1D, Spherical1D or any subclass of FiniteVolume1D
elements: list[str]
    List of elements to plot (can include the dependent/reference element)
    If elements is None, then it will plot the independent elements in the diffusion model
zScale: float (optional)
    Scaling for z-axis. Z will be divided by this, i.e. zScale = 1e-3 -> z is scaled from 1 to 1000
    Note: z is always in meters, so zScale represents the desired unit/meters
    Defaults to 0
zOffset: float (optional)
    Offset in meters to shift z axis (positive value will increase all z values)
    Defaults to 0
ax: matplotlib Axis (optional)
    Will be created if None

Returns
-------
matplotlib Axis

def plot2D(model: DiffusionModel, element, zScale=1, time=None, ax=None, plotUFrac=False, *args, **kwargs):

Plots a composition profile on a 2D mesh

Parameters
----------
model: DiffusionModel
    Mesh in model must be Cartesian2D
element: str
    Element to plot
zScale: float | list[float]
    Z axis scaling
    If float, will apply to both x and y axis
    If list, then first element applies to x and second element applies to y
ax: matplotlib Axis
    Will be generated if None

Returns
-------
matplotlib Axis (either same as input axis, or generated if no axis)
matplotlib ScalarMappable (mappable to add a colorbar with)

def plot2DPhases(model: DiffusionModel, phase, zScale=1, time=None, ax=None, *args, **kwargs):

Plots a composition profile on a 2D mesh

Parameters
----------
model: DiffusionModel
    Mesh in model must be Cartesian2D
phase: str
    phase to plot
zScale: float | list[float]
    Z axis scaling
    If float, will apply to both x and y axis
    If list, then first element applies to x and second element applies to y
ax: matplotlib Axis
    Will be generated if None

Returns
-------
matplotlib Axis (either same as input axis, or generated if no axis)
matplotlib ScalarMappable (mappable to add a colorbar with)

def plot2DFluxes(model: DiffusionModel, element, direction, zScale=1, time=None, ax=None, *args, **kwargs):

Plots flux in x or y direction of element

Parameters
----------
model: DiffusionModel
    Mesh in model must be Cartesian2D
element: str
    Element to plot
direction: str
    'x' or 'y'
zScale: float | list[float]
    Z axis scaling
    If float, will apply to both x and y axis
    If list, then first element applies to x and second element applies to y
ax: matplotlib Axis
    Will be generated if None

Returns
-------
matplotlib Axis (either same as input axis, or generated if no axis)
matplotlib ScalarMappable (mappable to add a colorbar with)