70 std::map<tString,CORE_UniquePointer<SM_Operator>>
mOperators;
149 [&](
const auto& op) {
150 mem+=op.first.size();
151 mem+=op.second->getMemorySize();
281 if (op.get()!=
null)
mOperators[op->getName()]=std::move(op);
290 return op->second.get();
299 const std::map<tString,CORE_UniquePointer<SM_Operator>>& operators=system.
getOperators();
301 for_each(operators.begin(),operators.end(),
302 [&](
const auto& op) {
303 cop=op.second->NewInstance();
304 cop->copy(*op.second.get());
305 mOperators[op.first]=std::move(cop);
311 const std::map<tString,CORE_UniquePointer<SM_Operator>>&
getOperators()
const {
326 names.push_back(op.first);
364 op.second->discretize(*
this);
395 memset(B,0,
sizeof(
tReal)*N);
399 op.second->computeMagneticField(t,network,mu,B);
418 memset(B,0,
sizeof(
tReal)*N);
421 tReal &Et=(*Es);Es++;
425 op.second->computeMagneticFieldAndEnergy(t,network,mu,B,*Es_p);
445 tReal *mu_tpdt)
const=0;
tUCInt tDimension
Definition: CORE_StdPtrField.h:567
virtual tMemSize getContentsMemorySize() const override
return the memory size of the included associations
Definition: CORE_Field.h:93
void setElementsNumber(const tInteger &n)
set the number of element of the container
Definition: CORE_Field.h:112
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: CORE_Object.h:259
void normalize()
normalize all the elements of the field return false if the method is not compatible with the floatin...
Definition: CORE_StdPtrField.h:403
void initialize(const Q &v)
initailize all the values with v
Definition: CORE_StdPtrField.h:178
This class describes a landau lifschitz function of the form :
Definition: SM_LandauLifschitzFunction.h:26
void setAlpha(const tReal &v)
set the alpha parameter
Definition: SM_LandauLifschitzFunction.h:107
void setBeta(const tReal &v)
set the beta parameter
Definition: SM_LandauLifschitzFunction.h:113
This class is describes a a network.
Definition: SM_Network.h:18
tDimension getDimension() const
return the dimension
Definition: SM_Network.h:133
tInteger getParticlesNumber() const
return the particles number
Definition: SM_Network.h:146
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SM_Network.h:106
This class describes a noise rate function.
Definition: SM_NoiseRateFunction.h:13
This class is a base class for Stoch Microm package.
Definition: SM_Object.h:19
This class is describes an operator.
Definition: SM_Operator.h:18
This class describes a stochastic function interface to generate random numbers.
Definition: SM_StochasticFunction.h:15
This class is a simulation of one trajectory class for Stoch Microm package.
Definition: SM_System.h:51
tIndex getOperatorsNumber() const
get the operator with name
Definition: SM_System.h:317
SM_TimeStepper mTimeStepper
Definition: SM_System.h:67
virtual void discretize()
discretize the system
Definition: SM_System.h:354
SM_LandauLifschitzFunction mLLFunction
Definition: SM_System.h:61
tBoolean makeRelaxation(const SM_StochasticFunction *randomFunction, tReal *mu, tReal *Es)
compute the relaxation process by calling only virtual methods
Definition: SM_System.cpp:3
SM_System(void)
create a class
Definition: SM_System.h:90
SM_Network & getNetwork()
get the network
Definition: SM_System.h:171
const std::map< tString, CORE_UniquePointer< SM_Operator > > & getOperators() const
get the operators
Definition: SM_System.h:311
CORE_UniquePointer< SM_NoiseRateFunction > mNoiseRateFunction
Definition: SM_System.h:80
const SM_LandauLifschitzFunction & getLandauLifschitzFunction() const
get the Landau Lifschitz function return the Landau lifschitz function for reading
Definition: SM_System.h:262
const SM_NoiseRateFunction & getNoiseRateFunction() const
get the noise rate function
Definition: SM_System.h:251
SM_RealField & getMagneticField()
get the magnetic field
Definition: SM_System.h:345
void setInitialMagneticMoment(const std::valarray< tReal > &mu0)
set the initial Magnetic Moment by moving
Definition: SM_System.h:198
const SM_RealField & getInitialMagneticMoment() const
set the initial Magnetic Moment
Definition: SM_System.h:224
SM_RealField mB
Definition: SM_System.h:74
void copyOperators(const SM_System &system)
copy the operator
Definition: SM_System.h:298
void setInitialMagneticMoment(const tIndex &N, const std::array< tReal, 3 > &mu0)
set the initial Magnetic Moment by copy
Definition: SM_System.h:215
std::map< tString, CORE_UniquePointer< SM_Operator > > mOperators
Definition: SM_System.h:70
SM_NoiseRateFunction & getNoiseRateFunction()
get the noise rate function
Definition: SM_System.h:245
void addOperator(CORE_UniquePointer< SM_Operator > op)
add operator
Definition: SM_System.h:280
SM_TimeStepper & getTimeStepper()
get the time stepper
Definition: SM_System.h:186
SM_Network mNetwork
Definition: SM_System.h:64
void setNoiseRateFunction(CORE_UniquePointer< SM_NoiseRateFunction > &f)
gst the noise rate function
Definition: SM_System.h:237
const SM_Network & getNetwork() const
get the network
Definition: SM_System.h:165
virtual tMemSize getContentsMemorySize() const
return the memory size of the included associations
Definition: SM_System.h:140
void setInitialMagneticMoment(const SM_RealField &mu0)
set the initial Magnetic Moment by moving
Definition: SM_System.h:206
virtual void getOperatorNames(std::vector< tString > &names) const
get the operator names
Definition: SM_System.h:323
virtual tString toString() const override
turn the class into a string representation
Definition: SM_System.cpp:126
const SM_Operator * getOperator(const tString &name) const
get the operator with name
Definition: SM_System.h:287
virtual tBoolean computeMuAtNextTimeStep(const tReal &dt, const tReal &epsilon_t, const tIndex &nParticles, const tDimension &dim, const tReal *mu_t, tReal *mu_tpdt) const =0
compute mu at time step
virtual ~SM_System(void)
destroy the class
Definition: SM_System.h:106
const SM_TimeStepper & getTimeStepper() const
get the time stepper
Definition: SM_System.h:180
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SM_System.h:128
void computeMagneticField(const tIndex &t, const SM_Network &network, const tReal *mu, tReal *B) const
compute the magnetic field at time step index t by calling the virtual method SM_Operator::computeMag...
Definition: SM_System.h:387
SM_LandauLifschitzFunction & getLandauLifschitzFunction()
get the Landau Lifschitz function
Definition: SM_System.h:269
void computeMagneticFieldAndEnergies(const tIndex &t, const SM_Network &network, const tReal *mu, tReal *B, tReal *Es) const
compute the magnetic field by calling the virtual method SM_Operator::computeMagneticField()
Definition: SM_System.h:409
SM_RealField mMu0
Definition: SM_System.h:77
This class is describes a time stepper.
Definition: SM_TimeStepper.h:13
typename std::unique_ptr< T, CORE_Object::Delete > CORE_UniquePointer
Definition: sp.h:8
#define tIndex
Definition: types.h:157
#define tString
Definition: types.h:147
#define tMemSize
Definition: types.h:166
#define tBoolean
Definition: types.h:151
#define tReal
Definition: types.h:137