1 #ifndef SM_ZeemanOperator_H
2 #define SM_ZeemanOperator_H
206 inline void setBext(std::initializer_list<tReal>&& values) {
213 inline void setBext(
const std::vector<tReal>& values) {
214 mBext.resize(values.size());
216 for_each(values.begin(),values.end(),
234 tReal *B)
const override {
248 tReal& E)
const override{
292 const tReal *Bext_i,*Bext_id;
299 const tReal *mu_id=mu;
305 for (
tIndex i=0;i<nParticles;i++) {
310 for (d=0;d<dim;d++) {
316 E-=(*Bext_id)*(*mu_id);
341 const tReal *H)
const override {
345 const tReal *mu_i=mu;
363 const tReal *mu)
const override{
375 const tReal *mu)
const {
391 const tReal *Mui_d=mu;
394 for (
tIndex i=0;i<nParticles;i++) {
397 for (d=0;d<dim;d++) {
398 E-=(*Bext_id)*(*Mui_d);
tUCInt tDimension
Definition: CORE_StdPtrField.h:567
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:94
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
This class is describes an operator.
Definition: SM_Operator.h:18
void setName(const tString &name)
set the name
Definition: SM_Operator.h:95
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: SM_Operator.h:80
virtual void copy(const SM_Operator &op)
copy
Definition: SM_Operator.h:112
This class is a simulation of one trajectory class for Stoch Microm package.
Definition: SM_System.h:51
This class is describes an implmentation of operator with the class I.
Definition: SM_TemplatedOperator.h:18
This class is describes a Zeeman operator interface.
Definition: SM_ZeemanOperator.h:27
void setZeemanParticlesNumber(const tIndex &p)
set zeeman particlules number
Definition: SM_ZeemanOperator.h:119
virtual void discretize(const SM_System &system) override
discretize the operator : do nothing by default
Definition: SM_ZeemanOperator.cpp:5
tReal * getBext(const tIndex &t)
return Bext at time step index t
Definition: SM_ZeemanOperator.h:174
void setBext(std::initializer_list< tReal > &&values)
set the Bext value
Definition: SM_ZeemanOperator.h:206
tDimension mDimension
Definition: SM_ZeemanOperator.h:43
virtual void computeMagneticFieldAndEnergy(const tIndex &t, const SM_Network &network, const tReal *mu, tReal *B, tReal &E) const override
compute the magnetic field at time t by virtual method
Definition: SM_ZeemanOperator.h:244
static CORE_UniquePointer< SM_ZeemanOperator > New()
build a new instance of the operator
Definition: SM_ZeemanOperator.h:71
const tIndex & getZeemanTimeStepsNumber() const
return the number of time steps for the zeeman operatpr
Definition: SM_ZeemanOperator.h:152
virtual tReal computeEnergy(const SM_Network &network, const tReal *mu, const tReal *H) const override
compute the energy
Definition: SM_ZeemanOperator.h:339
virtual tReal computeEnergy(const tIndex &t, const SM_Network &network, const tReal *mu) const override
compute the energy
Definition: SM_ZeemanOperator.h:361
tIndex mZeemanParticlesNumber
Definition: SM_ZeemanOperator.h:42
const tIndex & getZeemanParticlesNumber() const
return the number of particles for the zeeman operatpr
Definition: SM_ZeemanOperator.h:147
void computeTemplatedMagneticField(const tIndex &t, const SM_Network &network, const tReal *mu, tReal *B) const
compute the magnetic field
Definition: SM_ZeemanOperator.h:259
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SM_ZeemanOperator.h:98
virtual void copy(const SM_Operator &op)
copy
Definition: SM_ZeemanOperator.h:133
SM_ZeemanOperator(void)
create a zeeman operator interface
Definition: SM_ZeemanOperator.h:51
const std::valarray< tReal > & getBextAsArray() const
return Bext as an array
Definition: SM_ZeemanOperator.h:193
virtual void computeMagneticField(const tIndex &t, const SM_Network &network, const tReal *mu, tReal *B) const override
compute the magnetic field at time t by virtual method
Definition: SM_ZeemanOperator.h:231
void computeTemplatedMagneticFieldAndEnergy(const tIndex &t, const SM_Network &network, const tReal *mu, tReal *B, tReal &E) const
compute the magnetic field
Definition: SM_ZeemanOperator.h:275
const tReal * getBext() const
return Bext at time 0
Definition: SM_ZeemanOperator.h:180
tReal * getBext()
return Bext
Definition: SM_ZeemanOperator.h:186
virtual CORE_UniquePointer< SM_Operator > NewInstance() const override
create a New instance of this @retrun an unique pointer to the instance
Definition: SM_ZeemanOperator.h:79
std::valarray< tReal > mBext
Definition: SM_ZeemanOperator.h:44
std::valarray< tReal > & getBextAsArray()
return Bext as an array
Definition: SM_ZeemanOperator.h:199
const tDimension & getZeemanDimension() const
return the dimension of the zeeman operatpr
Definition: SM_ZeemanOperator.h:156
const tReal * getBext(const tIndex &t) const
return Bext at time step index t
Definition: SM_ZeemanOperator.h:167
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: SM_ZeemanOperator.h:109
virtual ~SM_ZeemanOperator(void)
destroy
Definition: SM_ZeemanOperator.h:61
void setZeemanTimeStepsNumber(const tIndex &n)
set zeeman time steps
Definition: SM_ZeemanOperator.h:125
void setBext(const std::vector< tReal > &values)
set the Bext value
Definition: SM_ZeemanOperator.h:213
tReal computeTemplatedEnergy(const tIndex &t, const SM_Network &network, const tReal *mu) const
compute the energy
Definition: SM_ZeemanOperator.h:373
tIndex mZeemanTimeStepsNumber
Definition: SM_ZeemanOperator.h:41
typename std::unique_ptr< T, CORE_Object::Delete > CORE_UniquePointer
Definition: sp.h:8
#define tIndex
Definition: types.h:157
#define tMemSize
Definition: types.h:166
#define tBoolean
Definition: types.h:151
#define tReal
Definition: types.h:137