llg3d.llg3d¶
Solver for the stochastic Landau-Lifshitz-Gilbert equation in 3D
Functions
|
Returns the Laplacian of m (* coeff_1) in 3D. |
|
Returns the s_i = a_i + b_i |
|
Returns the boundaries asynchronously: allows overlapping communication time of boundaries with calculations |
|
Returns the chemical element class from its name |
|
Returns the spatial average of m of shape (g.dims) using the midpoint method on each process |
|
Returns the spatial average of shape (g.dims[0],) in y and z of m of shape (g.dims) using the midpoint method |
|
Evaluates the command line and runs the simulation |
Returns parameter values as a string |
|
|
Argument parser for llg3d |
|
Initialization of phi |
|
Retrieves the x profile of the average of m in y and z |
|
Displays a progress bar (Source: https://stackoverflow.com/a/34482761/16593179) |
|
Simulates the system for N iterations Returns the computation time, output filename and the temporal average |
|
Runs a simulation for a given parameter set. |
|
Sweeps an array of temperature |
|
Initialization of theta |
|
Writes the run dictionary to a JSON file |
Classes
|
An argument parser compatible with MPI |
|
|
|
Abstract class for chemical elements |
|
Stores grid data |
|
|
|
- class ArgumentParser(prog=None, usage=None, description=None, epilog=None, parents=[], formatter_class=<class 'argparse.HelpFormatter'>, prefix_chars='-', fromfile_prefix_chars=None, argument_default=None, conflict_handler='error', add_help=True, allow_abbrev=True, exit_on_error=True)[source]¶
Bases:
ArgumentParser
An argument parser compatible with MPI
- class Element(T: float, H_ext: float, g: Grid, dt: float)[source]¶
Bases:
object
Abstract class for chemical elements
- class Grid(Jx: int, Jy: int, Jz: int, dx: float)[source]¶
Bases:
object
Stores grid data
- __init__(Jx: int, Jy: int, Jz: int, dx: float) None ¶
- calculate_laplacian(e: Element, g: Grid, m: ndarray, m_start_x: ndarray, m_end_x: ndarray, request_end: Request, request_start: Request) ndarray [source]¶
Returns the Laplacian of m (* coeff_1) in 3D. We start by calculating contributions in y and z, to wait for the end of communications in x.
- calculate_si(e: Element, g: Grid, m1: ndarray, m2: ndarray, m3: ndarray, R_alea: ndarray, boundaries) tuple[ndarray, ndarray, ndarray] [source]¶
Returns the s_i = a_i + b_i
- get_boundaries_x(g: Grid, m, blocking: bool = False) tuple[ndarray, ndarray, Request, Request] [source]¶
Returns the boundaries asynchronously: allows overlapping communication time of boundaries with calculations
- integral(g, m: ndarray) float [source]¶
Returns the spatial average of m of shape (g.dims) using the midpoint method on each process
- integral_yz(m: ndarray) ndarray [source]¶
Returns the spatial average of shape (g.dims[0],) in y and z of m of shape (g.dims) using the midpoint method
- profile(m: ndarray, m_xprof: ndarray)[source]¶
Retrieves the x profile of the average of m in y and z
- progress_bar(rank: int, it, prefix='', size=60, out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)[source]¶
Displays a progress bar (Source: https://stackoverflow.com/a/34482761/16593179)
- simulate(N: int, Jx: int, Jy: int, Jz: int, dx: float, T: float, H_ext: float, dt: float, n_average: int, n_integral: int, n_profile: int, element: ~llg3d.llg3d.Element = <class 'llg3d.llg3d.Cobalt'>, blocking: bool = False)[source]¶
Simulates the system for N iterations Returns the computation time, output filename and the temporal average