C++ mpi module for stochmagnet_main Package
Public Member Functions | Protected Member Functions | List of all members
SM_LandauLifschitzFunction Class Referenceabstract

This class describes a landau lifschitz function of the form : More...

#include <SM_LandauLifschitzFunction.h>

Inheritance diagram for SM_LandauLifschitzFunction:
Inheritance graph
[legend]
Collaboration diagram for SM_LandauLifschitzFunction:
Collaboration graph
[legend]

Public Member Functions

virtual tMemSize getMemorySize () const
 return the memory size of the class and the memory size of all its attributes/associations More...
 
void copy (const SM_LandauLifschitzFunction &LL)
 copy the LL function More...
 
void setAlphaFunction (const LambdaF &L)
 set the alpha function More...
 
void setGamma (const tReal &gamma)
 set the alpha parameter \( \alpha=\frac{\gamma }{\lambda^2 +1} \) More...
 
void setLambda (const tReal &v)
 set the lambda parameter \( \alpha=\frac{\gamma }{\lambda^2 +1} \) More...
 
void setAlpha (const tReal &v)
 set the alpha parameter directly without setting setGamma() More...
 
void setIsSNormalized (const tBoolean &v)
 set true if M is supposed to be normalized More...
 
const tReal & getGamma () const
 get the gamma parameter More...
 
const tReal & getAlpha () const
 get the alpha parameter More...
 
const tReal & getLambda () const
 get the lambda parameter More...
 
tBoolean isSNormalized () const
 return true if M is supposed to be normalized More...
 
void computeFunction (const tIndex &nParticles, const SM_RealField &S, const SM_RealField &B, SM_RealField &F) const
 computes the magnetic function More...
 
void computeFunction (const tIndex &nSParticles, const tReal *S, const tIndex &nBParticles, const tReal *B, tReal *F) const
 compute the magnetic function More...
 
virtual tString toString () const override
 turn the class into a string More...
 
- Public Member Functions inherited from SM_Object
 SM_Object (void)
 create
 
virtual ~SM_Object (void)
 destroy
 
- Public Member Functions inherited from CORE_Object
template<class T >
std::shared_ptr< T > getSharedPointer ()
 return the shared pointer for this More...
 
template<class T >
std::shared_ptr< const T > getConstSharedPointer () const
 return a const shared pointer for this More...
 
virtual tMemSize getContentsMemorySize () const
 return nthe memory size of the included associations More...
 
template<class T >
tBoolean isInstanceOf () const
 test if the clas T is an instance of this class More...
 
tString getClassName () const
 return the name of the class More...
 
tString getPointerString () const
 retrun the pointer of the class as a string More...
 
tString getIdentityString () const
 retrun the string identification of the class More...
 

Protected Member Functions

 SM_LandauLifschitzFunction (void)
 create
 
virtual ~SM_LandauLifschitzFunction (void)
 destroy
 
virtual void computeLLFunction (const tIndex &nSParticles, const tReal *S, const tIndex &nBParticles, const tReal *B, tReal *F) const =0
 compute the magnetic function More...
 
virtual void computeNLLFunction (const tIndex &nSParticles, const tReal *S, const tIndex &nBParticles, const tReal *B, tReal *F) const =0
 compute the normalized magnetic function More...
 
void computeSliceLLFunction (tIndex start, tIndex end, const tIndex &nSParticles, const tReal *S, const tIndex &nBParticles, const tReal *B, tReal *F) const
 compute the magnetic function for particle indices in [start,end[ More...
 
void computeSliceNLLFunction (tIndex start, tIndex end, const tIndex &nSParticles, const tReal *S, const tIndex &nBParticles, const tReal *B, tReal *F) const
 compute the normalized magnetic function for particle indices in [start,end[ More...
 
- Protected Member Functions inherited from CORE_Object
 CORE_Object ()
 build an instance of the object
 
virtual ~CORE_Object ()
 destroy the instance of object std

 

Additional Inherited Members

- Static Public Member Functions inherited from CORE_Object
static tBoolean EnableMemoryStack (const tBoolean &isMemoryChecked)
 enable the memory stack More...
 
static void EnableMemoryStack ()
 enable the memory stack
 
static void DisableMemoryStack ()
 disable the memory stack
 
static tBoolean IsMemoryStackEnabled ()
 return trur if the memory stack is enabled
 
static tString MemoryStackToString ()
 get the memory stack in string More...
 
static tIndex GetRegisteredClassesNumber ()
 get the memory stack in string More...
 

Detailed Description

This class describes a landau lifschitz function of the form :

\( f(\mu,b)= \displaystyle -\gamma/(1+\lambda^2) \left ( \mu \wedge b + \lambda( \mu \cdot b \mu - |\mu|^2 b ) \right ) \).

The normalized formultation on the landau lifschitz function when \( |\mu|=1 \) is :

\( f(\mu,b)= \displaystyle \alpha(\gamma,\lambda) \left ( \mu \wedge b + \lambda ( \mu \cdot b \mu - b ) \right ) \).

with \( alpha=-\frac{\gamma}{1+\lambda^2} \) by default

The main method to compute the function is the method SM_LandauLifschitzFunction::computeFunction()

Author
Stephane Despreaux
Version
1.0

Member Function Documentation

◆ computeFunction() [1/2]

void SM_LandauLifschitzFunction::computeFunction ( const tIndex &  nParticles,
const SM_RealField S,
const SM_RealField B,
SM_RealField F 
) const
inline

computes the magnetic function

Parameters
[in]nParticlesnumber of particles to compute LL function (S may be greater than nParticles because of halo particles)
[in]Sthe magnetic moment directions
[in]Bthe total magnetic field
[out]Fthe return output vector

\( F=f(S,B)= \displaystyle alpha. \left ( S \wedge B + \lambda S \wedge ( S \wedge B ) \right ) \). or \( F=f(S,B)= \displaystyle alpha. \left ( S \wedge B + \lambda ( <S,B> S - |S|^2 . B ) \right ) \).

◆ computeFunction() [2/2]

void SM_LandauLifschitzFunction::computeFunction ( const tIndex &  nSParticles,
const tReal *  S,
const tIndex &  nBParticles,
const tReal *  B,
tReal *  F 
) const
inline

compute the magnetic function

Parameters
[in]nSParticles: number of particles of S
[in]Sthe magnetic moment
[in]nBParticles: number of particles of B
[in]Bthe total magnetic field
[out]Fthe return output vector of size of B \( F=f(S,B)= \displaystyle alpha. \left ( S \wedge B + \lambda S \wedge ( S \wedge B ) \right ) \). or \( F=f(S,B)= \displaystyle alpha. \left ( S \wedge B + \lambda ( <S,B> S - |S|^2 . B ) \right ) \).

◆ computeLLFunction()

virtual void SM_LandauLifschitzFunction::computeLLFunction ( const tIndex &  nSParticles,
const tReal *  S,
const tIndex &  nBParticles,
const tReal *  B,
tReal *  F 
) const
protectedpure virtual

compute the magnetic function

Parameters
[in]nSParticles: number of particles of mu
[in]Sthe magnetic moment
[in]nBParticles: number of particles of B
[in]Bthe total magnetic field
[out]Fthe return output vector

Implemented in SMOMPI_LandauLifschitzFunction.

◆ computeNLLFunction()

virtual void SM_LandauLifschitzFunction::computeNLLFunction ( const tIndex &  nSParticles,
const tReal *  S,
const tIndex &  nBParticles,
const tReal *  B,
tReal *  F 
) const
protectedpure virtual

compute the normalized magnetic function

Parameters
[in]nSParticles: number of particles of mu
[in]Sthe magnetic moment
[in]nBParticles: number of particles of B
[in]Bthe total magnetic field
[out]Fthe return output vector

\( F=f(\mu,b)= \displaystyle alpha. \left ( \mu \wedge B + \lambda \mu \wedge ( \mu \wedge B ) \right ) \). or \( F=f(\mu,b)= \displaystyle alpha. \left ( \mu \wedge B + \lambda ( <\mu,B> mu - |mu|^2 . B ) \right ) \).

Implemented in SMOMPI_LandauLifschitzFunction.

◆ computeSliceLLFunction()

void SM_LandauLifschitzFunction::computeSliceLLFunction ( tIndex  start,
tIndex  end,
const tIndex &  nSParticles,
const tReal *  S,
const tIndex &  nBParticles,
const tReal *  B,
tReal *  F 
) const
inlineprotected

compute the magnetic function for particle indices in [start,end[

Parameters
[in]start: index of the start particle
[in]end: index of the end particle
[in]nSParticles: number of S Particles
[in]Sthe magnetic moment
[in]nBParticles: number of B Particles
[in]Bthe total magnetic field
[out]Fthe return output vector

\( F=f(\mu,b)= \displaystyle alpha. \left ( \mu \wedge B + \lambda \mu \wedge ( \mu \wedge B ) \right ) \). or \( F=f(\mu,b)= \displaystyle alpha. \left ( \mu \wedge B + \lambda ( <\mu,B> mu - |mu|^2 . B ) \right ) \).

◆ computeSliceNLLFunction()

void SM_LandauLifschitzFunction::computeSliceNLLFunction ( tIndex  start,
tIndex  end,
const tIndex &  nSParticles,
const tReal *  S,
const tIndex &  nBParticles,
const tReal *  B,
tReal *  F 
) const
inlineprotected

compute the normalized magnetic function for particle indices in [start,end[

Parameters
[in]start: index of the start particle
[in]end: index of the end particle
[in]nSParticles: number of S Particles
[in]Sthe magnetic moment
[in]nBParticles: number of B Particles
[in]Bthe total magnetic field
[out]Fthe return output vector

\( F=f(\S,b)= \displaystyle alpha. \left ( \S \wedge B + \lambda \S \wedge ( \S \wedge B ) \right ) \). or \( F=f(\S,b)= \displaystyle alpha. \left ( \S \wedge B + \lambda ( <\S,B> S - |S|^2 . B ) \right ) \).

◆ copy()

void SM_LandauLifschitzFunction::copy ( const SM_LandauLifschitzFunction LL)
inline

copy the LL function

Parameters
[in]LL: the function to copy

◆ getAlpha()

const tReal& SM_LandauLifschitzFunction::getAlpha ( ) const
inline

get the alpha parameter

Returns
alpha value

◆ getGamma()

const tReal& SM_LandauLifschitzFunction::getGamma ( ) const
inline

get the gamma parameter

Returns
gamma value

◆ getLambda()

const tReal& SM_LandauLifschitzFunction::getLambda ( ) const
inline

get the lambda parameter

Returns
lambda value

◆ getMemorySize()

virtual tMemSize SM_LandauLifschitzFunction::getMemorySize ( ) const
inlinevirtual

return the memory size of the class and the memory size of all its attributes/associations

Returns
the memory size of the class and the memory size of its attributes/associations in bytes The mamory size is :
  • the added size of the base classes which contains:
    • the primary attributes size depends on the order: (first delare the smallest attributes size
    • all virtual functions costs <pointer-size> (4 32xor 8 64x) bytes by virtual function
    • virtual inherihtance will increase of (4 or 8) bytes
  • we add the size of the contains values of the attributes : for example the size of a string is the length of the string 1 octet = 1 byte 1 Ko = 1024 bytes 1 Mo = 1024 Ko 1 Go = 1024 Mo

Reimplemented from SM_Object.

Reimplemented in SMOMPI_LandauLifschitzFunction.

◆ isSNormalized()

tBoolean SM_LandauLifschitzFunction::isSNormalized ( ) const
inline

return true if M is supposed to be normalized

Returns
true if M is supposed to be normalized

◆ setAlpha()

void SM_LandauLifschitzFunction::setAlpha ( const tReal &  v)
inline

set the alpha parameter directly without setting setGamma()

Parameters
[in]valpha value

◆ setAlphaFunction()

void SM_LandauLifschitzFunction::setAlphaFunction ( const LambdaF &  L)
inline

set the alpha function

Parameters
[in]L: function= Ecxmaple of function
L=([](const tReal& gamma,const tReal& lambda,tReal& alpha) {
alpha=lambda;
alpha*=alpha;
alpha+=1;
alpha/=alpha;
alpha*=gamma;
return alpha;
});

◆ setGamma()

void SM_LandauLifschitzFunction::setGamma ( const tReal &  gamma)
inline

set the alpha parameter \( \alpha=\frac{\gamma }{\lambda^2 +1} \)

Parameters
[in]gammagamma value

◆ setIsSNormalized()

void SM_LandauLifschitzFunction::setIsSNormalized ( const tBoolean &  v)
inline

set true if M is supposed to be normalized

Parameters
[in]v: true to normalize M

◆ setLambda()

void SM_LandauLifschitzFunction::setLambda ( const tReal &  v)
inline

set the lambda parameter \( \alpha=\frac{\gamma }{\lambda^2 +1} \)

Parameters
[in]vlambda value

◆ toString()

virtual tString SM_LandauLifschitzFunction::toString ( ) const
inlineoverridevirtual

turn the class into a string

Returns
the string representation of the class

Reimplemented from CORE_Object.


The documentation for this class was generated from the following file: