mammos_mumag.parameters#
Parameters class.
Classes
  | 
Class storing simulation parameters.  | 
- class mammos_mumag.parameters.Parameters(size=1e-09, scale=0.0, state=<factory>, h_mag_on=True, h_start=<factory>, h_final=<factory>, h_step=<factory>, h_vect=<factory>, m_step=<factory>, m_final=<factory>, m_vect=<factory>, precond_iter=10, tol_fun=1e-10, tol_h_mag_factor=1.0, filepath=None)[source]#
 Class storing simulation parameters.
- Parameters:
 size (float) – Size of the mesh. This factor usually indicates the magnitude of the geometry, i.e., 1e-9 for nanometer meshes, 1e-9 for micrometer, etc.
scale (float) – Scale of the mesh. This factor can include other scaling, so that the total scale of the mesh is size * scale.
state (str) – Name of the initial magnetization state. Scripts recognize the strings flower, vortex, twisted, and random. Other strings are interpreted as the default case. The default case is a uniformly magnetized state.
h_mag_on (bool) – Whether the external field is on (True) or off (False).
h_start (Entity) – Strength of the external field that the hysteresis loop starts from.
h_final (Entity) – Strength of the external field that the hysteresis loop finishes at.
h_step (Entity) – Difference in field strength between two hysteresis loop measurements.
h_vect (Entity) – External field vector \(\mathbf{h}\) as a list of floats or a Vector entity. This vector is not necessarily normal. The property h will be the normalized field. If not defined, the external field is zero.
m_step (Entity) – Threshold at which the magnetization is saved. If in the hysteresis calculation the difference between two consecutive values of magnetization along the external field vector is bigger than this value, a new configuration index will appear on the output csv table. Different configurations mean that the magnetization is behaving differently, possibly changing states.
m_final (Entity) – Value of magnetization (along the external field direction) at which the hysteresis calculation will stop.
m_vect (Entity) – Magnetization field \(\mathbf{m}\) as a list of floats or a Vector entity.
precond_iter (int) – Conjugate gradient iterations for inverse Hessian approximation.
tol_fun (float) – Total energy tolerance to obtain the equilibrium configuration.
tol_h_mag_factor (float) – Factor defining the tolerance for the magnetostatic scalar potential according to the formula tol_u = tol_fun * tol_h_mag_factor.
filepath (Path | None) – Path of parameter file to read at initialization. In this case all other parameters will be overwritten (if specified in the parameter file).
- read(fname)[source]#
 Read parameter file.
- Parameters:
 - Raises:
 NotImplementedError – Wrong file format.
- Return type:
 None
- read_p2(fpath)[source]#
 Read parameter file in p2 format.
The speciality of this file format is that magnetization values are stored in Tesla for readability. Hence, they need to be converted to A/m first. Furthermore, in this format some of the names have a special formatting.
- read_yaml(fpath)[source]#
 Read parameter file in yaml format.
We expect the parameters to be saved using the module
mammos_entity.ioand use the functionmammos_entity.io.entities_from_file().