1 #ifndef SM_LandauLifschitzFunction_H
2 #define SM_LandauLifschitzFunction_H
164 throw SM_Exception(
"stochMagnet",
"SM_LandauLifschitzFunction::computeFunction(Mu,B,F)",
165 "incompatible size between Mu & B");
221 for (p=0;p<nParticles;p++) {
225 const tReal& mu0=(*iMu);iMu++;
226 const tReal& mu1=(*iMu);iMu++;
227 const tReal& mu2=(*iMu);iMu++;
229 const tReal& B0=(*iB);iB++;
230 const tReal& B1=(*iB);iB++;
231 const tReal& B2=(*iB);iB++;
233 sMuB=mu0*B0+mu1*B1+mu2*B2;
234 sMuMu=mu0*mu0+mu1*mu1+mu2*mu2;
235 (*iF)=
mAlpha*((mu1 * B2 - mu2 * B1) +
mBeta * (mu0 * sMuB - B0 * sMuMu));iF++;
236 (*iF)=
mAlpha*((mu2 * B0 - mu0 * B2) +
mBeta * (mu1 * sMuB - B1 * sMuMu));iF++;
237 (*iF)=
mAlpha*((mu0 * B1 - mu1 * B0) +
mBeta * (mu2 * sMuB - B2 * sMuMu));iF++;
275 for (p=0;p<nParticles;p++) {
279 const tReal& mu0=(*iMu);iMu++;
280 const tReal& mu1=(*iMu);iMu++;
281 const tReal& mu2=(*iMu);iMu++;
283 const tReal& B0=(*iB);iB++;
284 const tReal& B1=(*iB);iB++;
285 const tReal& B2=(*iB);iB++;
287 sMuB=mu0*B0+mu1*B1+mu2*B2;
290 (*iF)=
mAlpha*((mu1 * B2 - mu2 * B1) +
mBeta * (mu0 * sMuB - B0 ));iF++;
291 (*iF)=
mAlpha*((mu2 * B0 - mu0 * B2) +
mBeta * (mu1 * sMuB - B1 ));iF++;
292 (*iF)=
mAlpha*((mu0 * B1 - mu1 * B0) +
mBeta * (mu2 * sMuB - B2 ));iF++;
308 "F(M,B)="+std::to_string(
mAlpha)+
".( M ^ B + "+std::to_string(
mBeta)+
"<M,B>M - B )\n":
309 "F(M,B)="+std::to_string(
mAlpha)+
".( M ^ B + "+std::to_string(
mBeta)+
"<M,B>M - |M|^2 B )\n";
tUCInt tDimension
Definition: CORE_StdPtrField.h:567
K getDimension() const
get the dimension of the field
Definition: CORE_Field.h:143
tIndex getElementsNumber() const
return the number values of the container
Definition: CORE_Field.h:118
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
this class describes the exceptions raised for SM package
Definition: SM_Exception.h:14
This class describes a landau lifschitz function of the form :
Definition: SM_LandauLifschitzFunction.h:26
void computeFunction(const SM_RealField &Mu, const SM_RealField &B, SM_RealField &F) const
computes the magnetic function
Definition: SM_LandauLifschitzFunction.h:161
void setAlpha(const tReal &v)
set the alpha parameter
Definition: SM_LandauLifschitzFunction.h:107
virtual ~SM_LandauLifschitzFunction(void)
destroy
Definition: SM_LandauLifschitzFunction.h:66
tReal mAlpha
Definition: SM_LandauLifschitzFunction.h:38
virtual tString toString() const override
turn the class into a string
Definition: SM_LandauLifschitzFunction.h:306
void copy(const SM_LandauLifschitzFunction &LL)
copy the LL function
Definition: SM_LandauLifschitzFunction.h:99
virtual tMemSize getMemorySize() const
return the memory size of the class and the memory size of all its attributes/associations
Definition: SM_LandauLifschitzFunction.h:88
void setBeta(const tReal &v)
set the beta parameter
Definition: SM_LandauLifschitzFunction.h:113
tReal mBeta
Definition: SM_LandauLifschitzFunction.h:41
SM_LandauLifschitzFunction(void)
create
Definition: SM_LandauLifschitzFunction.h:53
void computeFunction(const tIndex &nParticles, const tDimension &dim, const tReal *mu, const tReal *B, tReal *F) const
compute the magnetic function
Definition: SM_LandauLifschitzFunction.h:184
tBoolean isMuNormalized() const
return true if M is supposed to be normalized
Definition: SM_LandauLifschitzFunction.h:144
void setIsMuNormalized(const tBoolean &v)
set true if M is supposed to be normalized
Definition: SM_LandauLifschitzFunction.h:120
void computeNLLFunction(const tIndex &nParticles, const tDimension &dim, const tReal *mu, const tReal *B, tReal *F) const
compute the normalized magnetic function
Definition: SM_LandauLifschitzFunction.h:257
const tReal & getAlpha() const
get the alpha parameter
Definition: SM_LandauLifschitzFunction.h:130
const tReal & getBeta() const
get the beta parameter
Definition: SM_LandauLifschitzFunction.h:137
tBoolean mIsMuNormalized
Definition: SM_LandauLifschitzFunction.h:44
void computeLLFunction(const tIndex &nParticles, const tDimension &dim, const tReal *mu, const tReal *B, tReal *F) const
compute the magnetic function
Definition: SM_LandauLifschitzFunction.h:203
This class is a base class for Stoch Microm package.
Definition: SM_Object.h:19
#define ASSERT_IN(a)
Definition: functions.h:601
#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