llg3d.solvers¶
Define various types of solvers.
Example
To initialize one of the solver classes:
>>> from llg3d.parameters import RunParameters
>>> from llg3d.solvers.numpy import NumPySolver
>>> solver = NumPySolver(**RunParameters(solver="numpy").as_dict())
Functions
|
Return the rank of the current MPI process. |
|
Return the number of parallel MPI processes. |
|
Get the solver class based on the solver name. |
- get_size()[source]¶
Return the number of parallel MPI processes.
Use environment variables to avoid initializing MPI unnecessarily.
- Returns:
Number of MPI processes if in an MPI environment, else 1.
- Return type:
int
- get_rank()[source]¶
Return the rank of the current MPI process.
Use environment variables to avoid initializing MPI unnecessarily.
- Returns:
Rank of the current MPI process if in an MPI environment, else 0.
- Return type:
int
- get_solver_class(solver_name)[source]¶
Get the solver class based on the solver name.
- Parameters:
solver_name (str) – Name of the solver (“mpi”, “numpy”, “opencl”, “jax”)
- Returns:
The solver class
- Raises:
ValueError – If the selected solver is not compatible with MPI or if the solver name is unknown
- Return type:
type[BaseSolver]
Example
>>> Solver = get_solver_class("numpy") >>> Solver.__name__ "NumPySolver"
Modules
Define the base solver class. |
|
Experimental solvers live here. |
|
Mathematical utility functions for solvers. |
|
LLG3D solver using MPI. |
|
LLG3D solver using NumPy. |
|
LLG3D solver using OpenCL. |
|
Profiling utilities for solvers. |