![]() |
ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
|
#include <config/config.hpp>#include "magnetostatics/stoner_wohlfarth_thermal.hpp"#include "cell_system/CellStructure.hpp"#include "cells.hpp"#include "constraints/Constraints.hpp"#include "constraints/HomogeneousMagneticField.hpp"#include "errorhandling.hpp"#include "random.hpp"#include "rotation.hpp"#include "thermostat.hpp"#include "virtual_sites/relative.hpp"#include <nlopt.hpp>#include <cassert>#include <cmath>#include <numbers>#include <tuple>#include <utility>#include <vector>
Include dependency graph for stoner_wohlfarth_thermal.cpp:Go to the source code of this file.
Functions | |
| static double | phi_objective (unsigned n, const double *x, double *grad, void *my_func_data) |
| Objective (energy) function for the Stoner-Wohlfarth phi minimisation. | |
| static double | get_phi_at_energy_min (double theta, double h, double phi0, double ani_param, double tau0_inv, double dt, double const &noise) |
| Find the in-plane angle phi corresponding to the correct energy minimum for the thermal Stoner-Wohlfarth particles. | |
| static auto | get_external_field () |
| Collect external homogeneous magnetic field from active constraints. | |
| void | stoner_wohlfarth_no_field (Particle &p, Utils::Vector3d const &e_k, double const kT, double const noise) |
| Simplified Stoner-Wohlfarth update in field-free case. | |
| static void | stoner_wohlfarth_main (Particle &p, Utils::Vector3d const &e_k, Utils::Vector3d const &ext_fld_dpl, double const kT, double const noise) |
| Update virtual site dipole moment according to the full in-field (incl. | |
| void | run_magnetodynamics (CellStructure &cell_structure, Thermostat::Thermostat const &thermostat) |
| Run magnetodynamics update for local virtual particles. | |
Variables | |
| static constexpr double | eps_phi = 1e-3 |
| static constexpr double | eps_abs = 1e-15 |
| static constexpr double | eps_rel = 1e-15 |
Collect external homogeneous magnetic field from active constraints.
Iterate over constraints and sum the homogeneous magnetic field vectors provided by Constraints::HomogeneousMagneticField objects.
Definition at line 156 of file stoner_wohlfarth_thermal.cpp.
References System::get_system(), and stream.
Referenced by run_magnetodynamics().
|
static |
Find the in-plane angle phi corresponding to the correct energy minimum for the thermal Stoner-Wohlfarth particles.
| theta | Angle between anisotropy director and external field (rad). |
| h | Reduced field (external + dipolar) normalised by H_k. |
| phi0 | Initial in-plane angle guess (rad). |
| ani_param | Inverse thermal energy factor ( \(1/(k_B T V)\) scaled). |
| tau0_inv | Attempt frequency inverse (1/tau0). |
| dt | Time increment for switching probability. |
| noise | Uniform random number in (0,1) used for the kinetic MC step. |
Definition at line 91 of file stoner_wohlfarth_thermal.cpp.
References eps_abs, eps_phi, eps_rel, params, phi_objective(), and stream.
Referenced by stoner_wohlfarth_main().
|
static |
Objective (energy) function for the Stoner-Wohlfarth phi minimisation.
Evaluate the magnetic energy (normalized by the anisotropy field) for a given in-plane angle phi according to Eq. 5 in [32]. Assumes minima lie in the plane phi = zeta and uses trig identities to reduce the expression.
| n | Number of optimization variables (should be 1: phi). |
| x | Pointer to variables; x[0] is the angle phi. |
| grad | If non-null, gradient is written to grad[0]. |
| my_func_data | Pointer to a double[2] array with {theta, h}. |
Definition at line 66 of file stoner_wohlfarth_thermal.cpp.
References params, and stream.
Referenced by get_phi_at_energy_min().
| void run_magnetodynamics | ( | CellStructure & | cell_structure, |
| Thermostat::Thermostat const & | thermostat | ||
| ) |
Run magnetodynamics update for local virtual particles.
Iterate over local particles and update the dipole moment of virtual particles according to the thermal Stoner-Wohlfarth model. Collect active homogeneous external magnetic fields from constraints and add the per-particle dipolar contribution before performing either the simplified no-field update or the full thermal Stoner-Wohlfarth update.
| cell_structure | CellStructure providing access to local particles. |
| thermostat | thermostat used to access Philox RNG state and seeds. |
Definition at line 258 of file stoner_wohlfarth_thermal.cpp.
References Particle::dip_fld(), CellStructure::for_each_local_particle(), get_external_field(), get_reference_particle(), Particle::id(), Particle::is_virtual(), Thermostat::Thermostat::kT, Thermostat::Thermostat::langevin, Particle::stoner_wohlfarth_is_enabled(), stoner_wohlfarth_main(), stoner_wohlfarth_no_field(), stream, THERMO_LANGEVIN, Thermostat::Thermostat::thermo_switch, and Utils::uniform().
Referenced by System::System::integrate().
|
static |
Update virtual site dipole moment according to the full in-field (incl.
dipole field) thermal Stoner-Wohlfarth model (incl. the kinetic MC step)
| [in,out] | p | Virtual particle to update (modified). |
| e_k | Anisotropy director of the reference particle. | |
| ext_fld_dpl | External homogeneous magnetic field + total dipolar field acting on the particle. | |
| kT | Thermal energy from thermostat. | |
| noise | Uniform random number in (0,1) used for the kinetic MC step. |
Definition at line 216 of file stoner_wohlfarth_thermal.cpp.
References convert_dip_to_quat(), Particle::dipm(), get_phi_at_energy_min(), Particle::magnetic_anisotropy_energy(), Particle::magnetic_anisotropy_field_inv(), Particle::quat(), Particle::saturation_magnetization(), Particle::stoner_wohlfarth_dt_incr(), Particle::stoner_wohlfarth_phi_0(), Particle::stoner_wohlfarth_tau0_inv(), stream, and vector_product().
Referenced by run_magnetodynamics().
| void stoner_wohlfarth_no_field | ( | Particle & | p, |
| Utils::Vector3d const & | e_k, | ||
| double const | kT, | ||
| double const | noise | ||
| ) |
Simplified Stoner-Wohlfarth update in field-free case.
| [in,out] | p | Virtual particle to update. |
| e_k | Anisotropy director of the reference particle. | |
| kT | Thermal energy from thermostat. | |
| noise | Uniform random number in (0,1) used for the kinetic MC step. |
Definition at line 177 of file stoner_wohlfarth_thermal.cpp.
References convert_dip_to_quat(), Particle::dipm(), Particle::magnetic_anisotropy_energy(), Particle::quat(), Particle::saturation_magnetization(), Particle::stoner_wohlfarth_dt_incr(), Particle::stoner_wohlfarth_phi_0(), Particle::stoner_wohlfarth_tau0_inv(), and stream.
Referenced by run_magnetodynamics().
Definition at line 48 of file stoner_wohlfarth_thermal.cpp.
Referenced by get_phi_at_energy_min().
Definition at line 46 of file stoner_wohlfarth_thermal.cpp.
Referenced by get_phi_at_energy_min().
Definition at line 50 of file stoner_wohlfarth_thermal.cpp.
Referenced by get_phi_at_energy_min().