gvec.core.state#

gvec.state - low-level python API for postprocessing

The gvec.state module provides the State class which wraps the src/pygvec/state.f90 fortran module. It provides an encapsulation for the state of the GVEC library, allowing safe postprocessing routines. This module checks the input arguments and handles the initialization and finalization of the Fortran state.

  1. gvec library - src/*

  2. fortran API - src/pygvec/*
    • 1 & 2 are compiled into the gveclib (static) library

  3. fortran wrapping layer - f90wrap_* - autogenerated by f90wrap

  4. C wrapping layer - _libpygvecmodule.c - autogenerated by f2py
    • 3 & 4 are compiled into the _libpygvec* shared library which can be imported in python

  5. python wrapping layer - lib.py - autogenerated by f90wrap

  6. low-level python API - state.py
    • ensures safe access to the underlying layers

  7. high-level python API - comp.py, run.py

class gvec.core.state.State(parameterfile: str | Path, statefile: str | Path | None = None)#

Bases: object

A class for encapsulating the ‘state’ of the GVEC library with all relevant parameters and variables.

bind(force: bool = False)#

Bind this State object to the Fortran library. Allocate & initialize everything.

compute(ev: Dataset, *quantities: str)#

Compute the target equilibrium quantity and add it to the given evaluation dataset.

This method will recursively determine prerequisites, compute them and add them to the dataset as needed.

Parameters:
  • ev (xr.Dataset) – The evaluation dataset with the target grid (rad, pol, tor), coordinates (rho, theta, zeta) and possibly some precomputed quantities.

  • *quantities (str) – One or more names of the quantities to compute. See the default table of available quantities or call table_of_quantities to see all options.

See also

gvec.core.compute.compute

this function as a standalone function.

evaluate

create a new grid in logical coordinates and compute target quantities.

evaluate_sfl

create a new grid in straight-fieldline coordinates and compute target quantities.

evaluate(*quantities: str, rho: Literal['int'] | int | float | DataArray | ndarray | Sequence | None = 'int', theta: Literal['int'] | int | float | DataArray | ndarray | Sequence | None = 'int', zeta: Literal['int'] | int | float | DataArray | ndarray | Sequence | None = 'int') Dataset#

Evaluate the specified quantities on a grid in logical coordinates (rho, theta, zeta). This function creates an xarray Dataset with a specified grid and evaluates the desired quantities and recursively determined prerequisites on that grid.

Parameters:
  • state (State) – The gvec.State object to evaluate the quantities for.

  • *quantities (str) –

    The names of (registered) quantities to evaluate, e.g. "pos", "B", "mod_B".

    See the default table of available quantities or call table_of_quantities to see all options.

  • rho ("int" | int | float | 1D array | None, default: "int") –

    The specification of the radial, radius-like coordinate (\(\rho\)), defined in the interval \([0, 1]\). It can be specified as:

    • The literal string "int" to use the integration points from the state object.

    • An integer number of points (e.g. rho=10) to create a uniform grid (offset at the magnetic axis).

    • A float value (e.g. rho=0.5) to evaluate at a single point.

    • A 1D array-like (list, numpy.ndarray) of values.

    • An xarray.DataArray containing at least the required dimension rad respectively.

    • None to omit this dimension and coordinate.

  • theta ("int" | int | float | 1D array | None, default: "int") –

    The specification of the poloidal, angle-like coordinate (\(\vartheta\)), defined in the interval \([0, 2\pi)\). It can be specified as:

    • The literal string "int" to use the integration points from the state object.

    • An integer number of points (e.g. theta=10) to create a uniform grid.

    • A float value (e.g. theta=0.5) to evaluate at a single point.

    • A 1D array-like (list, numpy.ndarray) of values.

    • An xarray.DataArray containing at least the required dimension pol respectively.

    • None to omit this dimension and coordinate.

  • zeta ("int" | int | float | 1D array | None, default: "int") –

    The specification of the toroidal, angle-like coordinate (\(\zeta\)), defined in the interval \([0, 2\pi)\). It can be specified as:

    • The literal string "int" to use the integration points from the state object (distributed on a single field-period).

    • An integer number of points (e.g. zeta=10) to create a uniform grid (on a single field-period).

    • A float value (e.g. zeta=0.5) to evaluate at a single point.

    • A 1D array-like (list, numpy.ndarray) of values.

    • An xarray.DataArray containing at least the required dimension tor respectively.

    • None to omit this dimension and coordinate.

Returns:

An xarray Dataset containing the evaluated quantities and prerequisites on the specified grid.

The returned Dataset has dimensions ("rad", "pol", "tor") corresponding to the radial, poloidal, and toroidal directions, with respective coordinates rho(rad), theta(pol), and zeta(tor).

Return type:

xarray.Dataset

See also

gvec.core.compute.evaluate

this function as a standalone function.

gvec.core.state.State.evaluate

this function as a method of gvec.State.

gvec.core.compute.compute

compute quantities and add them to an existing dataset.

gvec.core.compute.evaluate_sfl

evaluate quantities on a grid in straight-fieldline coordinates.

evaluate_base_list_rtz_all(quantity: str, rhothetazeta: ndarray)#
evaluate_base_list_tz(quantity: str, derivs: str | None, rho: ndarray, thetazeta: ndarray)#
evaluate_base_list_tz_all(quantity: str, rho: ndarray, thetazeta: ndarray)#
evaluate_base_tens(quantity: str, derivs: str | None, rho: ndarray, theta: ndarray, zeta: ndarray)#
evaluate_base_tens_all(quantity: str, rho: ndarray, theta: ndarray, zeta: ndarray)#
evaluate_boozer_list_tz_all(sfl_boozer: t_sfl_boozer, quantity: str, rad: ndarray, thetazeta: ndarray)#
evaluate_hmap(X1: ndarray, X2: ndarray, zeta: ndarray, dX1_dr: ndarray, dX2_dr: ndarray, dX1_dt: ndarray, dX2_dt: ndarray, dX1_dz: ndarray, dX2_dz: ndarray) tuple[ndarray, ndarray, ndarray, ndarray]#
evaluate_hmap_derivs(X1: ndarray, X2: ndarray, zeta: ndarray) tuple[ndarray, ndarray, ndarray, ndarray, ndarray, ndarray]#
evaluate_hmap_only(X1: ndarray, X2: ndarray, zeta: ndarray) tuple[ndarray, ndarray, ndarray, ndarray]#
evaluate_jac_h_derivs(X1: ndarray, X2: ndarray, zeta: ndarray, dX1_dr: ndarray, dX2_dr: ndarray, dX1_dt: ndarray, dX2_dt: ndarray, dX1_dz: ndarray, dX2_dz: ndarray) tuple[ndarray, ndarray, ndarray]#
evaluate_metric_derivs(X1: ndarray, X2: ndarray, zeta: ndarray, dX1_dr: ndarray, dX2_dr: ndarray, dX1_dt: ndarray, dX2_dt: ndarray, dX1_dz: ndarray, dX2_dz: ndarray, dX1_drr: ndarray, dX2_drr: ndarray, dX1_drt: ndarray, dX2_drt: ndarray, dX1_drz: ndarray, dX2_drz: ndarray, dX1_dtt: ndarray, dX2_dtt: ndarray, dX1_dtz: ndarray, dX2_dtz: ndarray, dX1_dzz: ndarray, dX2_dzz: ndarray) tuple[ndarray, ndarray, ndarray, ndarray, ndarray, ndarray, ndarray, ndarray, ndarray, ndarray, ndarray, ndarray, ndarray, ndarray, ndarray, ndarray, ndarray, ndarray]#
evaluate_profile(quantity: str, rho: ndarray, deriv: int = 0)#

Evaluate 1D profiles at the provided positions of the radial coordinate rho.

Parameters:
  • quantity (str) – name of the profile. Has to be either "iota" (rotational transform), "p" (pressure), "chi" (poloidal magn. flux), "Phi" (toroidal magn. flux)

  • rho (ndarray) – Positions at the radial flux coordinate rho.

  • deriv (int, optional) – Order of the derivative in rho. Note that for some quantities not all derivatives can be calculated, e.g. for rotational transform and pressure the maximum is deriv=4. Defaults to 0.

Raises:
  • ValueError – If quantity is not a string, or if an invalid quantity is provided or if rho` is not a 1D array or if rho is not in [0, 1].

  • NotImplementedError – If deriv > 1 for quantity="chi".

Returns:

result – profile values at rho.

Return type:

ndarray

evaluate_rho2_profile(quantity: str, rho2: ndarray, deriv: int = 0)#

Evaluate 1D profiles at the provided positions of the radial coordinate rho2\(=s=\rho^2\). Note: Use this routine to obtain derivarives with respect to \(s\) coordinate, else use evaluate_profile.

Parameters:
  • quantity (str) – name of the profile. Has to be either "iota" (rotational transform), "p" (pressure), "chi" (poloidal magn. flux), "Phi" (toroidal magn. flux)

  • rho2 (ndarray) – Positions at the radial flux coordinate \(s=\rho^2\).

  • deriv (int, optional) – Order of the derivative, in coordinate \(s=rho^2\) (!). Defaults to 0.

Raises:

ValueError – If quantity is not a string, or if an invalid quantity is provided or if rho` is not a 1D array or if rho is not in [0, 1].

Returns:

result – Profile values at rho2.

Return type:

ndarray

evaluate_sfl(*quantities: str, rho: int | float | DataArray | ndarray | Sequence | Literal['int'], theta: int | float | DataArray | ndarray | Sequence, zeta: int | float | DataArray | ndarray | Sequence, sfl: Literal['boozer', 'pest'], **boozer_kwargs) Dataset#

Evaluate the specified quantities on a grid in straight-fieldline coordinates (Boozer or PEST). This function creates an xarray Dataset with a specified grid and evaluates the desired quantities and recursively determined prerequisites on that grid.

Parameters:
  • state (State) – The gvec.State object to evaluate the quantities for.

  • *quantities (str) –

    The names of (registered) quantities to evaluate, e.g. "pos", "B", "mod_B".

    See the default table of available quantities or call table_of_quantities to see all options.

  • rho ("int" | int | float | 1D array) –

    The specification of the radial, radius-like coordinate (\(\rho\)), defined in the interval \([0, 1]\). It can be specified as:

    • The literal string "int" to use the integration points from the state object.

    • An integer number of points (e.g. rho=10) to create a uniform grid.

    • A float value (e.g. rho=0.5) to evaluate at a single point.

    • A 1D array-like (list, numpy.ndarray) of values.

    • An xarray.DataArray containing at least the dimension rad.

  • theta (int | float | 1D, 2D or 3D array) –

    The specification of the poloidal, angle-like coordinate (\(\vartheta\), \(\vartheta_P\) or \(\vartheta_B\)), defined in the interval \([0, 2\pi)\). It can be specified as:

    • An integer number of points (e.g. theta=10) to create a uniform grid.

    • A float value (e.g. theta=0.5) to evaluate at a single point.

    • A 1D array-like (list, numpy.ndarray) of values.

    • A 2D array-like with assumed dimensions (pol, tor).

    • A 3D array-like with assumed dimensions (rad, pol, tor).

    • An xarray.DataArray containing at least the dimension pol.

  • zeta (int | float | 1D, 2D or 3D array) –

    The specification of the toroidal, angle-like coordinate (\(\zeta\) or \(\zeta_B\)), defined in the interval \([0, 2\pi)\). For equidistant grids, the grid will only cover one field period (i.e. \([0, 2\pi/N_{FP})\)). It can be specified as:

    • An integer number of points (e.g. zeta=10) to create a uniform grid (on a single field-period).

    • A float value (e.g. zeta=0.5) to evaluate at a single point.

    • A 1D array-like (list, numpy.ndarray) of values.

    • A 2D array-like with assumed dimensions (pol, tor).

    • A 3D array-like with assumed dimensions (rad, pol, tor).

    • An xarray.DataArray containing at least the dimension tor.

  • sfl ("boozer" | "pest") – The type of straight-fieldline coordinates to use for the grid.

  • boozer_kwargs (optional) – Additional keyword arguments to pass to the get_boozer method of the state object. These can be used to specify the Boozer transform parameters. For example the maximum mode number factor boozer_kwargs={'MNfactor': 3}.

Returns:

An xarray Dataset containing the evaluated quantities and prerequisites on the specified grid.

The returned Dataset has (at least) dimensions ("rad", "pol", "tor") corresponding to the radial, poloidal, and toroidal directions. With 1D or equidistant coordinates, the respective coordinates are rho(rad), theta_P(pol) or theta_B(pol), and zeta(tor) or zeta_B(tor). The logical coordinates are then normal data variables of more dimensions in the dataset.

Return type:

xarray.Dataset

See also

gvec.core.compute.evaluate_sfl

this function as a standalone function.

gvec.core.state.State.evaluate_sfl

this function as a method of gvec.State.

gvec.core.compute.compute

compute quantities and add them to an existing dataset.

gvec.core.compute.evaluate

evaluate quantities on a grid in logical coordinates.

get_boozer(rho: ndarray, MNfactor: int = 5, *, M: int | None = None, N: int | None = None, M_nyq: int | None = None, N_nyq: int | None = None, sincos: Literal['sin', 'cos', 'sincos'] = 'sin', recompute_lambda: bool = True)#

Initialize a new Boozer potential with M poloidal and N toroidal nodes for all fluxsurfaces given by rho.

Parameters:
  • rho – Array of (radius-like) flux surface labels.

  • MNfactor – Multiplication factor between the maximum M, N of the equilbrium and the maximum M, N of the Boozer potential. Only used if M, N are not explicitly given.

  • M – Number of poloidal nodes of the Boozer potential \(\nu_B\). Defaults to the maximum number of nodes of the basis.

  • N – Number of toroidal nodes of the Boozer potential \(\nu_B\). Defaults to the maximum number of nodes of the basis.

Returns:

Straight-fieldline Boozer object (wrapped Fortran object).

Return type:

sfl_boozer

get_boozer_angles(sfl_boozer: t_sfl_boozer, tz_list: ndarray, rad: int | None = None)#

Find the logical angles (theta, zeta) for the corresponding (theta_B, zeta_B) coordinates on the Boozer surface.

Parameters:
  • sfl_boozer (lib.Modgvec_Sfl_Boozer.t_sfl_boozer) – The Boozer potential object to use.

  • tz_list (2D array or Sequence of shape (2, n)) – The list of (theta_B, zeta_B) coordinates for which to find the logical angles. The first row contains theta_B and the second row contains zeta_B.

  • rad (int, optional) – The (optional) radial index of the surface (with respect to the sfl_boozer object) on which to find the angles.

Returns:

The logical angles (theta, zeta) corresponding to the input (theta_B, zeta_B) coordinates. If rad is None, returns a 3D array of shape (2, n, nrho), where nrho is the number of radial surfaces in sfl_boozer. If rad is specified, returns a 2D array of shape (2, n).

Return type:

2D or 3D np.ndarray

get_integration_points(quantity: str = 'LA')#
get_mn_max(quantity: str = 'all') tuple[int, int]#
get_pest_angles(rho: ndarray, tz_list: ndarray)#

Find the logical theta angle for the corresponding (theta_P, zeta) coordinates on the flux surface.

Parameters:
  • rho (1D array)

  • tz_list (2D array of shape (2, n) or 3D array of shape (2, n, rho.size)) – The list of (theta_P, zeta) coordinates for which to find the logical angles. The first row contains theta_P and the second row contains zeta. If a 2D array is given, the same postions are searched for on each surface.

Returns:

The logical theta angle corresponding to the input (theta_P, zeta) coordinates.

Return type:

2D np.ndarray of shape (n, rho.size)

property name#

The name of the configuration / ProjectName in the parameter file.

classmethod new(parameters: Mapping, rundir: str | Path | None = None)#
property nfp#
plot_3d_surface(quantity: str = 'mod_B', rho: float | ndarray | list = 1.0, ntheta: int = 41, nzeta: int = 51, period: Literal['single', 'half', 'full'] = 'single', to_file: str | None = None, surface_kwargs: dict = {})#

Generate a 3D surface plot with the quantity provided by quantity on it at a given rho position and poloidal and toroidal resolution ntheta and nzeta per field period.

Parameters:
  • state (GVEC state object)

  • quantity (str, optional) – Equilibrium quantity to plot on the surface. Default is "mod_B".

  • rho (float, optional) – Radial position of the surface. Default 1.0.

  • ntheta (int) – Poloidal resolution. Default 41.

  • nzeta (int) – Toroidal resolution, per field period Default 51.

  • period (str) – Plot the "full" surface, a "single" field period or "half" a field period. Default "single"

  • surface_kwargs (dict, optional) – Keyword arguments for the surface plot. i.e. dict(opacity=0.5)

  • to_file (str) – If a string, will automatically save the plot to a file with the given input in the current working directory. Recommended to use this if the plots don’t display. Default is None

Return type:

plotly.plot object

plot_fourier_on_surface(quantity: str = 'mod_B', rho: float = 1.0, ntheta: int = 101, nzeta: int = 101, sfl: Literal['pest', 'boozer'] | None = None, limit: float | None = 1e-15, plot_kwargs: dict[str] = {}, **boozer_kwargs)#

Diagnostic plot for plotting the Fourier modes of a given quantitity on a flux surface.

Parameters:
  • state (GVEC state object)

  • quantities (str, optional) – Quantitiy to plot. Default mod_B

  • rho (float, optional) – The flux surface label(s) to plot. Default is 1.0.

  • ntheta (int, optional) – Resolution in theta. Default is 101

  • nzeta (int, optional) – Resolution in zeta. Default is 101

  • sfl (str, optional) – Plot surfaces in "boozer", "pest" or regular \(\theta-\zeta\) (None) coordinates. Default is "boozer"

  • limit (float, optional) – Cut-off value for the Fourier amplitudes to plot. Default is 1e-15

  • plot_kwargs (dict, optional) – Any **kwargs to send to the plt.figure() function. For example plot_kwargs={'figsize': (8,8)}. See the matplotlib documentation for a list of kwargs.

  • boozer_kwargs (optional) – Additional keyword arguments to pass to the get_boozer method of the state object. These can be used to specify the Boozer transform parameters. For example the maximum mode number factor boozer_kwargs={'MNfactor': 3}.

Return type:

matplotlib.pyplot.figure object and numpy.ndarray of matplotlib.axis._axis.Axes object(s).

plot_on_axis(quantities: str | list[str] = 'mod_B', nzeta: int | ndarray = 51, subplot_grid: list[int] | None = None, plot_kwargs: dict = {})#

Plot a equilibrium quantity (or list of) along the magnetic axis. Note that the quantities are always evaluated off-axis (rho=[1.1e-4,2.2e-4,3.3e-4], theta=0) and extrapolated quadratically to rho=0.

Parameters:
  • state (GVEC state object)

  • quantities (str, list[str], optional) – Default is "mod_B".

  • nzeta (int, numpy.ndarray, optional) – zeta resolution or array of points to plot at. Default is 51.

  • subplot_grid (list[int], None, optional) – The grid shape of [nrow,ncol] for the subplots. If None, grid will be automatically determined. Default is None.

  • plot_kwargs (dict, optional) –

    Any **kwargs to send to the plt.figure() function. For example plot_kwargs={'figsize': (8,8)}. See the matplotlib documentation for a list of kwargs.

Return type:

matplotlib.pyplot.figure object and numpy.ndarray of matplotlib.axis._axis.Axes object(s).

plot_on_flux_surface(quantities: str | list[str] = 'mod_B', rho: float | ndarray | list = 1.0, ntheta: int = 51, nzeta: int = 51, subplot_grid: list[int] | None = None, share_axis: bool = True, share_contours: bool = False, levels: int | ndarray | list = 10, sfl: Literal['pest', 'boozer'] | None = 'boozer', style: Literal['contour', 'filled-contour'] = 'contour', plot_kwargs: dict = {}, **boozer_kwargs)#

Plot an equilibrium quantity over the two angles \((\vartheta, \zeta)\) of a flux surface at (a) given rho value(s). Alternatively, plot multiple quantities on a single rho surface.

Parameters:
  • state (GVEC state object)

  • quantities (str, list[str], optional) – Plot either a single quantitiy on a number of rho surfaces or a number of quantities on a single rho surface. Default mod_B

  • rho (float, numpy.ndarray, list, optional) – The flux surface label(s) to plot. Default is 1.0.

  • ntheta (int) – Resolution in theta. Default is 11

  • nzeta (int) – Resolution in zeta. Default is 11

  • subplot_grid (list[int], optional) – The grid shape for the subplots. If None, grid will be automatically determined. Default is None.

  • share_axis (bool, optional) – If True, all subplots will share their x and y axes. Default True.

  • levels (int, numpy.ndarray, optional) – If int then chooses number of levels in the contour plot. If an numpy.ndarray or list then plots contours at given values. Default is 10

  • sfl (str, optional) – Plot surfaces in "boozer", "pest" or regular \((\theta,\zeta)\) ("None") coordinates. Default is "boozer"

  • style (str, optional) – Use "contour" (False) or "filled-contour" (True) in plotting. Default is "filled-contour" (filled contour).

  • plot_kwargs (dict, optional) –

    Any **kwargs to send to the plt.figure() function. For example plot_kwargs={'figsize': (8,8)}. See the matplotlib documentation for a list of kwargs.

  • boozer_kwargs (optional) – Additional keyword arguments to pass to the get_boozer method of the state object. These can be used to specify the Boozer transform parameters. For example the maximum mode number factor boozer_kwargs={'MNfactor': 3}.

Return type:

matplotlib.pyplot.figure object and numpy.ndarray of matplotlib.axis._axis.Axes object(s).

plot_poloidal_plane(quantity: None | str = 'mod_B', nrho: int = 21, ntheta: int = 51, zeta: int | float | ndarray | list[float] = 9, subplot_grid: list[int] | None = None, share_axis: bool = False, rho_contours: int = 4, rho_contours_color: str | None = None, theta_contours: int = 8, theta_contours_color: str | None = None, sfl: Literal['pest'] | None = 'pest', plot_kwargs: dict = {})#

Plot a poloidal plane with some equilibrium quantity on it. Defaults to plotting \(|B|\)

Parameters:
  • state (GVEC state object)

  • quantity (str, optional) – The quantity to plot. Default is "mod_B". If None, no contours are plotted.

  • nrho (int, optional) – The radial resolution of the slices. Default is 51

  • ntheta (int, optional) – The poloidal resolution of the slices. Default is 51

  • zeta (int, float, ndarray, optional) – The number of equally spaced slices (int), the specific zeta value (float) or values (np.ndarray). Default is 9.

  • subplot_grid (list[int], None, optional) – The grid shape for the subplots. If None, grid will be automatically determined. Default is None.

  • share_axis (bool) – If True, all subplots will share their X1 and X2 axis positions. Default False

  • rho_contours (int, optional) – The number of rho contours to plot. If 0, no contours are plotted. Default 4

  • rho_contours_color (str, optional) – The color of the rho contours. Default "white"

  • theta_contours (int, optional) – The number of theta contours to plot. If 0, no contours are plotted. Default 8

  • theta_contours_color (str, optional) – The color of the theta contours. Default "white"

  • sfl ("pest" or None, optional) – Plot the theta contours or pest contours (\(\theta^\star\)). Default "pest".

  • plot_kwargs (dict, optional) –

    Any **kwargs to send to the plt.figure() function. For example plot_kwargs={'figsize': (8,8)}. See the matplotlib documentation for a list of kwargs.

Return type:

matplotlib.pyplot.figure object and numpy.ndarray of matplotlib.axis._axis.Axes object(s).

plot_radial_profile(quantities: str | list[str] = ['iota', 'p', 'I_tor', 'I_pol'], nrho: int | ndarray = 101, subplot_grid: list[int] | None = None, xaxis: Literal['rho', 'rho_squared'] = 'rho', n_rationals: int = 3, plot_kwargs: dict = {})#

Plot the radial profile of given equilibrium quantities.

Parameters:
  • state (GVEC state object)

  • quantities (str, list[str], optional) – Default is ["iota","p","I_tor","I_pol"].

  • nrho (int, numpy.ndarray) – The number of or specific 1D array of radial points to plot at. Default is 101

  • subplot_grid (list[int], None, optional) – The grid shape for the subplots. If None, grid will be automatically determined. Default is None.

  • xaxis ("rho" or "rho_squared", optional) – What quantity to plot on the x axis. Default is "rho".

  • n_rationals (int, optional) – If non-zero, show the largest \(n\) rationals on any iota profile plot. Default 3

  • plot_kwargs (dict, optional) –

    Any **kwargs to send to the plt.figure() function. For example plot_kwargs={'figsize': (8,8)}. See the matplotlib documentation for a list of kwargs.

Return type:

matplotlib.pyplot.figure object and numpy.ndarray of matplotlib.axis._axis.Axes object(s).

property rundir#
property stdout: str#
unbind(cleanup: bool = False)#

Unbind this State object from the Fortran library. Finalize & deallocate everything.

gvec.core.state.find_state(rundir: str | Path | None = None)#

Load a State object from a given run-directory. Use the latest statefile which is found.

gvec.core.state.find_states(rundir: str | Path | None = None)#

Load a Sequence of State objects from a given run-directory.

gvec.core.state.load_state(parameterfile: Path | str, statefile: Path | str)#

Load a State object from a given parameterfile (.ini) and statefile (.dat).