mammos_mumag.parameters#

Parameters class.

Classes

Parameters([size, scale, state, m_vect, ...])

Class storing simulation parameters.

class mammos_mumag.parameters.Parameters(size=1e-09, scale=0.0, state=<factory>, m_vect=<factory>, hmag_on=1, hstart=0.0, hfinal=0.0, hstep=0.0, h_vect=<factory>, mstep=1.0, mfinal=-0.8, iter_max=1000, precond_iter=10, tol_fun=1e-10, tol_hmag_factor=1.0, tol_u=1e-10, verbose=0, filepath=None)#

Class storing simulation parameters.

Parameters:
  • size (float) – Size of the mesh.

  • scale (float) – Scale of the mesh.

  • state (str) – Name of the state. Scripts recognize the strings flower, vortex, twisted, and random. Other strings are interpreted as the default case.

  • m_vect (list[float]) – Magnetization field \(\mathbf{m}\).

  • hmag_on (int) – 1 or 0 indicating whether the external field is on (1) or off (0).

  • hstart (float) – Initial external field.

  • hfinal (float) – Final external field.

  • hstep (float) – External field step.

  • h_vect (list[float]) – External field vector \(\mathbf{h}\).

  • mstep (float) – TODO

  • mfinal (float) – TODO

  • iter_max (int) – Max number of iterations of optimizer. TODO NOT USED AT THE MOMENT.

  • precond_iter (int) – conjugate gradient iterations for inverse Hessian approximation.

  • tol_fun (float) – Tolerance of the total energy.

  • tol_hmag_factor (float) – Factor defining the tolerance for the magnetostatic scalar potential.

  • tol_u (float) – TODO

  • verbose (int) – verbosity

  • filepath (Path | None) – TODO

filepath: Path | None = None#
property h: list[float]#

Direction of the external field.

h_vect: list[float] = FieldInfo(annotation=list[float], required=False, default_factory=<lambda>, metadata=[MinLen(min_length=3), MaxLen(max_length=3)])#
hfinal: float = 0.0#
hmag_on: int = 1#
hstart: float = 0.0#
hstep: float = 0.0#
iter_max: int = 1000#
property m: list[float]#

Normalized magnetization.

m_vect: list[float] = FieldInfo(annotation=list[float], required=False, default_factory=<lambda>, metadata=[MinLen(min_length=3), MaxLen(max_length=3)])#
mfinal: float = -0.8#
mstep: float = 1.0#
precond_iter: int = 10#
read(fname)#

Read parameter file in yaml or p2 format.

Simulation parameters are read and stored.

Parameters:

fname (str | Path) – File path

Raises:

NotImplementedError – Wrong file format.

Return type:

None

scale: float = 0.0#
size: float = 1e-09#
state: str = FieldInfo(annotation=str, required=False, default_factory=<lambda>)#
tol_fun: float = 1e-10#
tol_hmag_factor: float = 1.0#
tol_u: float = 1e-10#
verbose: int = 0#
write_p2(fname)#

Write parameter p2 file.

Parameters:

fname (str | Path) – File path

Return type:

None

write_yaml(fname)#

Write parameter yaml file.

Parameters:

fname (str | Path) – File path

Return type:

None