1 #ifndef SM_LandauLifschitzSystem_H
2 #define SM_LandauLifschitzSystem_H
8 #include "SM_LandauLifschitzFunction.h"
11 #include "SM_StochasticOutput.h"
14 #include "SM_MultiStochasticFunctions.h"
17 #include "SM_Network.h"
20 #include "SM_Material.h"
23 #include "SM_TimeStepper.h"
26 #include "SM_Operator.h"
29 #include "SM_NoiseRateFunction.h"
32 #include "SM_TemperatureNoiseRate.h"
71 CORE_UniquePointer<SM_LandauLifschitzFunction> mLLFunction;
83 CORE_UniquePointer<SM_NoiseRateFunctionInterface> mNoiseRateFunction;
95 tBoolean mIsBrownianNull=
false;
96 tBoolean mIsRealBrownianVariable;
100 tReal mRelaxationTolerance;
102 tReal mRelaxationValue;
111 mIsRealBrownianVariable=
true;
113 mRelaxationTolerance=1.e-8;
162 mem+=(mLLFunction.get()==
null)?0:mLLFunction->getContentsMemorySize();
167 mem+=(mNoiseRateFunction.get()==
null)?0:mNoiseRateFunction->getMemorySize();
266 mNoiseRateFunction=std::move(f);
273 return (mNoiseRateFunction.get()!=
null);
279 return *mNoiseRateFunction.get();
285 return *mNoiseRateFunction.get();
294 "setNoiseTemperature(const tReal& T)",
295 "no noise rate function");
321 mRelaxationTolerance=eps;
327 return mRelaxationTolerance;
333 return mRelaxationValue;
339 return mRelaxationValue;
363 const tIndex& nHParticles,
const tReal* H)
const=0;
374 const tIndex& startH,
const tReal* H)
const;
388 return mIsBrownianNull;
394 mIsRealBrownianVariable=v;
400 return mIsRealBrownianVariable;
424 return *mLLFunction.get();
431 return *mLLFunction.get();
440 mLLFunction=std::move(llF);
450 virtual void normalize(
const tBoolean& isAdimensionized)
override {
457 if (isAdimensionized) {
531 template<
class StochOutputI>
552 template<
class StochOutputImplement>
565 const std::function<
void(
const tReal&,
const tReal& ,
const tReal&,tReal& )>& F);
574 template<
class StochOutputImpl>
578 const std::function<
void(
const tReal&,
const tReal& ,
const tReal&,tReal& )>& F);
604 const tReal& dt,
const tReal& bdt,
const tReal& epsilon,
605 const tBoolean& incdWt,tReal* dWt,
642 const tIndex& start,
const tIndex& end,
643 const tReal& dt,
const tReal& bdt,
const tReal& epsilon,
644 const tBoolean& incdWt,tReal* dWt,tReal* H) {
691 template<
class StochFImpl>
693 tIndex start,tIndex end,
694 const tReal& dt,
const tReal& bdt,
const tReal& epsilon,
695 const tBoolean& incdWt,tReal* dWt,tReal* H) {
766 const tIndex& nDeltaS,
const tReal *deltaS,
767 const tIndex& nS,
const tReal* S,
781 const tIndex& nDeltaS,
const tReal *deltaSt,
783 const tIndex& nS,
const tReal* S,
792 virtual tString
toString()
const override;
795 #include "SM_LandauLifschitzSystem.hpp"
this class describes the exceptions raised for CORE package
Definition: CORE_Exception.h:17
virtual tMemSize getContentsMemorySize() const override
return the memory size of the included associations
Definition: CORE_Field.h:102
const T * getValues() const
get the values of the array for reading
Definition: CORE_Field.h:323
tIndex getElementsNumber() const
return the number values of the container
Definition: CORE_Field.h:135
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: CORE_Object.h:278
static constexpr tDimension DIM
space dimension
Definition: SM_Constants.h:80
This class describes a landau lifschitz function of the form :
Definition: SM_LandauLifschitzFunction.h:30
void setGamma(const tReal &gamma)
set the alpha parameter
Definition: SM_LandauLifschitzFunction.h:153
This class is a simulation of one trajectory class for Stoch Magnet package.
Definition: SM_LandauLifschitzSystem.h:59
SM_RealField & getBrownianField()
get the generated brownian variable for reading
Definition: SM_LandauLifschitzSystem.h:412
virtual void setNoiseTemperature(const tReal &T) override
set the noise as a temperature in Kelvin
Definition: SM_LandauLifschitzSystem.h:291
void setLandauLifschitzFunction(CORE_UniquePointer< SM_LandauLifschitzFunction > llF)
set the landau lifschitz function
Definition: SM_LandauLifschitzSystem.h:439
tReal & getRelaxationValue()
get the relaxation value to detect relaxation for writing
Definition: SM_LandauLifschitzSystem.h:338
tIndex & getTimeIndex()
get the time index
Definition: SM_LandauLifschitzSystem.h:227
SM_RealField & getMagneticField()
get the magnetic field for writting
Definition: SM_LandauLifschitzSystem.h:488
const SM_RealField & getMagneticField() const
get the magnetic field for writting
Definition: SM_LandauLifschitzSystem.h:474
const SM_RealField & getMagneticMomentDirectionsVariation() const
get the variation of the direction of the magnetic moments for writting
Definition: SM_LandauLifschitzSystem.h:480
void setRelaxationTolerance(const tReal &eps)
set the relaxation tolerance to detect relaxation
Definition: SM_LandauLifschitzSystem.h:320
virtual tString toString() const override
turn the class into a string representation
Definition: SM_LandauLifschitzSystem.cpp:485
const SM_NoiseRateFunctionInterface & getNoiseRateFunction() const
get the noise rate function
Definition: SM_LandauLifschitzSystem.h:284
virtual ~SM_LandauLifschitzSystem(void)
destroy the class
Definition: SM_LandauLifschitzSystem.h:126
void resetTime()
reset time
Definition: SM_LandauLifschitzSystem.h:240
const tBoolean & isBrownianNull() const
get if the brownian variable is null
Definition: SM_LandauLifschitzSystem.h:387
SM_NoiseRateFunctionInterface & getNoiseRateFunction()
get the noise rate function
Definition: SM_LandauLifschitzSystem.h:278
static void ComputeMagneticMomentDirectionsSliceAtNextTimeStep(tIndex startS, tIndex endS, const tIndex &nDeltaS, const tReal *deltaS, const tIndex &nS, const tReal *S, tReal *nextS)
compute for all particle indices in [start,end[
Definition: SM_LandauLifschitzSystem.cpp:298
tBoolean stochasticJRun(const tIndex &steppersNumber, SM_StochasticFunctionsInterface &stochasticFunctions, const std::function< void(const tReal &, const tReal &, const tReal &, tReal &)> &F)
compute the steppers number of system for reaching the relaxed state
Definition: SM_LandauLifschitzSystem.cpp:130
void setIsRelaxed(const tBoolean &isRelaxed)
set if the system runs until relaxation
Definition: SM_LandauLifschitzSystem.h:308
virtual tBoolean initializeMagneticMomentDirections() override
initialize magnetic moments direction _ time step index = 0
Definition: SM_LandauLifschitzSystem.h:188
virtual void computeVariationMagneticField(const tReal &dt, SM_RealField &H) const =0
computes
void setIsBrownianNull(const tBoolean &v)
set if the brownian variable is null
Definition: SM_LandauLifschitzSystem.h:382
const tBoolean & isRealBrownianVariable() const
get if the brownian variable is a field or a real
Definition: SM_LandauLifschitzSystem.h:399
virtual tReal computeNetTorque(const tIndex &nParticles, const tReal *S, const tIndex &nHParticles, const tReal *H) const =0
compute Net Torque
tBoolean deterministicRun(const tIndex &steppersNumber, SM_StochasticOutput< StochOutputI > &stochasticOutput)
compute deterministic running of steppers number of the system with computing statistics
Definition: SM_LandauLifschitzSystem.hpp:12
const tIndex & getTimeIndex() const
get the time index
Definition: SM_LandauLifschitzSystem.h:221
void computeVariationMagneticFieldSlice(const tIndex &start, const tIndex &end, const tReal &dt, tReal *H) const
computes for particle indices in [start,end[
Definition: SM_LandauLifschitzSystem.h:615
tReal computeNetSliceTorque(const tIndex &startS, const tIndex &endS, const tReal *S, const tIndex &startH, const tReal *H) const
compute Net Torque for all particules in indices in [start,end[
Definition: SM_LandauLifschitzSystem.cpp:230
virtual tBoolean computeMagneticMomentDirectionsAtNextTimeStep(const tReal &dt, const tReal &epsilon_t, const SM_RealField &deltaSt, SM_RealField &St)=0
compute direction of magnetic moments at next time
tBoolean hasNoiseRateFunction() const
return true if the noise rate function is not null
Definition: SM_LandauLifschitzSystem.h:272
const tReal & getTime() const
get the time
Definition: SM_LandauLifschitzSystem.h:214
tReal & getTime()
get the time
Definition: SM_LandauLifschitzSystem.h:234
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SM_LandauLifschitzSystem.h:160
const tReal & getRelaxationValue() const
get the relaxation value to detect relaxation for reading
Definition: SM_LandauLifschitzSystem.h:332
virtual void computeBrownianVariationMagneticField(SM_MultiStochasticFunctionsInterface &stochFs, const tReal &dt, const tReal &bdt, const tReal &epsilon, const tBoolean &incdWt, tReal *dWt, SM_RealField &H)=0
add stochastic brownian field
const SM_TimeStepper & getTimeStepper() const
get the time stepper
Definition: SM_LandauLifschitzSystem.h:200
virtual void discretize() override
discretize the system
Definition: SM_LandauLifschitzSystem.h:506
void setIsRealBrownianVariable(const tBoolean &v)
set if the brownian variable is a field or a real
Definition: SM_LandauLifschitzSystem.h:393
const tReal & getRelaxationTolerance() const
get the relaxation tolerance to detect relaxation
Definition: SM_LandauLifschitzSystem.h:326
virtual void normalize(const tBoolean &isAdimensionized) override
normalize the system
Definition: SM_LandauLifschitzSystem.h:450
const tReal & getNoiseRate() const
get the noise rate
Definition: SM_LandauLifschitzSystem.h:251
void computeBrownianVariationMagneticFieldSliceWithSCStochasticFunctions(SM_StochasticFunctions< StochFImpl > &randF, tIndex start, tIndex end, const tReal &dt, const tReal &bdt, const tReal &epsilon, const tBoolean &incdWt, tReal *dWt, tReal *H)
add stochastic brownian field for particle indices in [start,end[
Definition: SM_LandauLifschitzSystem.h:692
SM_RealField & getMagneticMomentDirectionsVariation()
get the variation of the direction of the magnetic moments for writting
Definition: SM_LandauLifschitzSystem.h:495
virtual tULLInt getGeneratedRandomNumbers() const override
get the generated of random number within a stochastic run per one step of run
Definition: SM_LandauLifschitzSystem.h:519
SM_TimeStepper & getTimeStepper()
get the time stepper
Definition: SM_LandauLifschitzSystem.h:206
tReal & getNoiseRate()
get the noise rate
Definition: SM_LandauLifschitzSystem.h:259
SM_LandauLifschitzSystem(void)
create a class
Definition: SM_LandauLifschitzSystem.h:108
virtual tBoolean updateInitialMagneticMomentDirections(const SM_RealField &S0)
update the initial unit direction of spins
Definition: SM_LandauLifschitzSystem.h:177
tReal computeNetTorque() const
compute Net Torque
Definition: SM_LandauLifschitzSystem.h:347
const SM_LandauLifschitzFunction & getLandauLifschitzFunction() const
get the Landau Lifschitz function return the Landau lifschitz function for reading
Definition: SM_LandauLifschitzSystem.h:423
const SM_RealField & getBrownianField() const
get the generated brownian variable for reading
Definition: SM_LandauLifschitzSystem.h:406
tBoolean stochasticRun(const tIndex &steppersNumber, SM_MultiStochasticFunctionsInterface &sfs)
compute the steppers number of system without stochastic output
Definition: SM_LandauLifschitzSystem.cpp:3
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SM_LandauLifschitzSystem.h:148
const tBoolean & isRelaxed() const
get if the system runs until relaxation
Definition: SM_LandauLifschitzSystem.h:314
SM_LandauLifschitzFunction & getLandauLifschitzFunction()
get the Landau Lifschitz function
Definition: SM_LandauLifschitzSystem.h:430
void computeBrownianVariationMagneticFieldSlice(SM_StochasticFunctionsInterface &randF, const tIndex &start, const tIndex &end, const tReal &dt, const tReal &bdt, const tReal &epsilon, const tBoolean &incdWt, tReal *dWt, tReal *H)
add stochastic brownian field for particle indices in [start,end[
Definition: SM_LandauLifschitzSystem.h:641
void setNoiseRateFunction(CORE_UniquePointer< SM_NoiseRateFunctionInterface > &f)
gst the noise rate function
Definition: SM_LandauLifschitzSystem.h:265
This class describes a multi stochastic functions based on same random number generator which impleme...
Definition: SM_MultiStochasticFunctionsInterface.h:18
const tInteger & getParticlesNumber() const
return the particles number
Definition: SM_Network.h:349
This class describes a noise rate function.
Definition: SM_NoiseRateFunctionInterface.h:13
void setNoiseRate(const tReal &eps)
set the noise rate
Definition: SM_NoiseRateFunctionInterface.h:96
void adimensionize(const tReal &cField)
adimensionize
Definition: SM_NoiseRateFunctionInterface.h:89
This class describes a stochastic functions based on same random number generator which implement ran...
Definition: SM_StochasticFunctionsInterface.h:18
virtual tReal normalRandom()=0
compute a normal random number
This class describes a stochastic functions with templated methods.
Definition: SM_StochasticFunctions.h:25
tReal scNormalRandom()
compute a normal random number by static casting method
Definition: SM_StochasticFunctions.h:114
this class implements the virtual methods of its base class SM_StochasticOutputComponent with templat...
Definition: SM_StochasticOutput.h:24
This class is a one simulation of a beam for Stoch Magnet package.
Definition: SM_System.h:53
virtual void discretize()
discretize the system
Definition: SM_System.h:546
const SM_RealField & getMagneticMomentDirections() const
get the unit direction of spins at time
Definition: SM_System.h:267
virtual void normalize(const tBoolean &isAdimensionized)
normalize the system
Definition: SM_System.h:431
const SM_Network & getNetwork() const
get the network
Definition: SM_System.h:170
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SM_System.h:140
const SM_Material & getMaterial() const
get the material of the network
Definition: SM_System.h:193
virtual void setNoiseTemperature(const tReal &T)
set the noise as a temperature in Kelvin
Definition: SM_System.h:392
virtual tBoolean initializeMagneticMomentDirections()
initialize magnetic moments direction
Definition: SM_System.h:283
virtual tBoolean updateInitialMagneticMomentDirections(const SM_RealField &S0)
update the initial unit direction of spins
Definition: SM_System.h:241
static tReal ComputeTemperatureNoiseRate(const tReal &T, const SM_LandauLifschitzSystem &system)
compte the noise rate of the system corresponding to temperature
Definition: SM_TemperatureNoiseRate.cpp:15
This class is describes a time stepper.
Definition: SM_TimeStepper.h:13
virtual void adimensionize(const tReal &cT)
adimensionize operator with characteric field value in J
Definition: SM_TimeStepper.h:92