simulations.magnetization
¶
Classes:
|
Base class for all magnetization simulations. |
-
class
udkm1Dsim.simulations.magnetization.
Magnetization
(S, force_recalc, **kwargs)¶ Bases:
udkm1Dsim.simulations.simulation.Simulation
Base class for all magnetization simulations.
- Parameters
S (Structure) – sample to do simulations with.
force_recalc (boolean) – force recalculation of results.
- Keyword Arguments
save_data (boolean) – true to save simulation results.
cache_dir (str) – path to cached data.
disp_messages (boolean) – true to display messages from within the simulations.
progress_bar (boolean) – enable tqdm progress bar.
- Attributes
S (Structure) – sample structure to calculate simulations on.
force_recalc (boolean) – force recalculation of results.
save_data (boolean) – true to save simulation results.
cache_dir (str) – path to cached data.
disp_messages (boolean) – true to display messages from within the simulations.
progress_bar (boolean) – enable tqdm progress bar.
Methods:
get_hash
(delays, **kwargs)Calculates an unique hash given by the delays as well as the sample structure hash for relevant magnetic parameters.
get_magnetization_map
(delays, **kwargs)Returns an absolute magnetization_map for the sample structure.
calc_magnetization_map
(delays, **kwargs)Calculates an absolute
magnetization_map
for the sample structure.conv_with_function
(y, x, handle)Convolutes the array \(y(x)\) with a function given by the handle on the argument array \(x\).
disp_message
(message)Wrapper to display messages for that class.
save
(full_filename, data, *args)Save data to file.
-
get_hash
(delays, **kwargs)¶ Calculates an unique hash given by the delays as well as the sample structure hash for relevant magnetic parameters. Optionally, part of the
strain_map
andtemp_map
are used.- Parameters
delays (ndarray[float]) – delay grid for the simulation.
**kwargs (ndarray[float], optional) – optional strain and temperature profile.
- Returns
hash (str) – unique hash.
-
get_magnetization_map
(delays, **kwargs)¶ Returns an absolute magnetization_map for the sample structure. The angles for gamma and phi must be in radians as pure numpy arrays. The magnetization_map can depend on the
temp_map
andstrain_map
that can be also calculated for the sample structure.- Parameters
delays (ndarray[Quantity]) – delays range of simulation [s].
**kwargs (ndarray[float], optional) – optional strain and temperature profile.
- Returns
magnetization_map (ndarray[float]) – spatio-temporal absolute magnetization profile.
-
calc_magnetization_map
(delays, **kwargs)¶ Calculates an absolute
magnetization_map
for the sample structure. The angles for gamma and phi must be in radians as pure numpy arrays. Themagnetization_map
can depend on thetemp_map
andstrain_map
that can be also calculated for the sample structure.This method is just an interface and should be overwritten for the actual simulations.
- Parameters
delays (ndarray[Quantity]) – delays range of simulation [s].
**kwargs (ndarray[float], optional) – optional strain and temperature profile.
- Returns
magnetization_map (ndarray[float]) – spatio-temporal absolute magnetization profile.
-
conv_with_function
(y, x, handle)¶ Convolutes the array \(y(x)\) with a function given by the handle on the argument array \(x\).
- Parameters
y (ndarray[float]) – y data.
x (ndarray[float]) – x data.
handle (@lamdba) – convolution function.
- Returns
y_conv (ndarray[float]) – convoluted data.
-
disp_message
(message)¶ Wrapper to display messages for that class.
- Parameters
message (str) – message to display.
-
save
(full_filename, data, *args)¶ Save data to file. The variable name can be handed as variable argument.
- Parameters
full_filename (str) – full file name to data file.
data (ndarray) – actual data to save.
*args (str, optional) – variable name within the data file.