|
C++ mpi module for stochmagnet_main Package
|
This class is describes a demagnetized operator. More...
#include <SM_MacroCellsDemagnetizedField.h>


Public Member Functions | |
| virtual tMemSize | getMemorySize () const |
| return the memory size of the class and the memory size of all its attributes/associations More... | |
| virtual tMemSize | getContentsMemorySize () const |
| return the memory size of the included associations More... | |
| virtual CORE_UniquePointer< SM_MacroCellsDemagnetizedField > | newInstance () const =0 |
| create a New instance of this More... | |
| void | setStorage (const tFlag &f) |
| set storage type More... | |
| const tFlag & | getStorage () const |
| yet storage type in {NO_STORAGE,PACKED_STORAGE} | |
| const SM_RealField & | getField () const |
| get the demagnetized field on macro cells | |
| SM_RealField & | getField () |
| get the demagnetized field on macro cells | |
| tBoolean | hasMatrix () const |
| return true if the matrix exists | |
| void | setMatrix (CORE_UniquePointer< SM_PackedBlockMatrix< tReal, SM_Constants::DIM >> matrix) |
| set matrix | |
| SM_PackedBlockMatrix< tReal, SM_Constants::DIM > & | getMatrix () |
| get matrix | |
| const SM_PackedBlockMatrix< tReal, SM_Constants::DIM > & | getMatrix () const |
| get matrix | |
| const tReal & | getLambdaH () const |
| get lambda H More... | |
| const tReal & | getLambdaHs () const |
| get self lambda Hs More... | |
| virtual void | discretize (const SM_Material &material, const SM_MacroCellsNetwork &network) |
| discretize the field More... | |
| virtual void | computeMatrix (const SM_Material &material, const SM_MacroCellsNetwork &network)=0 |
| compute the matrix ot he demagnetized operator More... | |
| virtual void | computeField (const SM_MacroCellsNetwork &network, const SM_MacroCellsMagnetizationField &M)=0 |
| compute the demagnetized field on macro cells network More... | |
| void | computeSeparatedFieldSlice (const tReal &lambdaH, const tReal &lambdaHs, const tReal *P, const tReal *eP, const tReal *M_P, const tInteger &nMacroCells, const tReal *X, tReal *H) const |
| compute Hdem[X]=F_{P,M}(X) More... | |
| virtual tString | toString () const override |
| return string representaton of the operator | |
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... | |
| 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... | |
Static Public Attributes | |
| static constexpr tFlag | PACKED_STORAGE =1 |
| the storage if in a packed matrix | |
| static constexpr tFlag | NO_STORAGE =0 |
| no storage | |
Protected Member Functions | |
| SM_MacroCellsDemagnetizedField (void) | |
| create a network class | |
| virtual | ~SM_MacroCellsDemagnetizedField (void) |
| destroy | |
| void | computeBlocksSymmetricMatrix (const tReal &lambdaH, const tReal &lambdaHs, const tReal *vMCsVolume, const tReal *vMCsX, const tInteger &start, const tInteger &end, tReal *supBlocksValues, tReal *diagBlocksValues) const |
| compute the column blocks matrix (i,j) j in [start,end] and j in [0,i] More... | |
| void | computeBlocksGeneralMatrix (const tReal &lambdaH, const tReal &lambdaHs, const tReal *vMCsVolumes, const tInteger &nX, const tReal *vX, const tInteger &nP, const tReal *vP, tReal *supBlocksValues) const |
| compute the column blocks matrix (i,j) j in [start,end] and j in [0,i] More... | |
| void | computeFieldSlice (const tReal &lambdaH, const tReal &lambdaHs, const tReal *P, const tReal *eP, const tReal *M_P, const tInteger &nMacroCells, const tReal *X, const tReal *M_X, const tReal *iMCsVolume, tReal *H) const |
| compute Hdem[X]=F_{P,M}(X) 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 | |
Static Protected Member Functions | |
| static void | BuildPackedBlockMatrix (tReal lambdaH, const tReal &lambdaHs, const tReal &Wi, tInteger i, tInteger j, const tReal *Xi, const tReal *Xj, tReal *vBij, tReal &rij, std::array< tReal, SM_Constants::DIM > &U) |
| build the symmetric block element of the superior matrix in a packed storage More... | |
| static void | BuildPackedSupBlockMatrix (tReal lambdaH, tInteger i, tInteger j, const tReal *Xi, const tReal *Xj, tReal *vBij, tReal &rij, std::array< tReal, SM_Constants::DIM > &U) |
| build the symmetric block element of the superior matrix in a packed storage More... | |
| static void | BuildDiagonalBlockMatrix (const tReal &V, const tReal &lambdaHs, tReal &diag) |
| build the diagonal block element of the matrix More... | |
| static void | BuildPackedDiagonalBlockMatrix (const tReal &V, const tReal &lambdaHs, tReal *iDiag) |
| build the diagonal block element of the matrix More... | |
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... | |
This class is describes a demagnetized operator.
To improve the simulation accuracy and time computing of the dipolar field done by EMM_DipolarOperator, an other approach consists in discretizing the network in macro cells with a fixed cell size with is prefered to be a multiple of the unit cell size.
The position of each macro cell \(p_{mc}\) is defined from the magnetic center of mass of the particles of the macro cell: \( p_{mc}=\frac{\sum_{p_j \in \omega_{mc}} \tilde \mu^j_s . p_j}{\sum_{p_j \in \omega_{mc}} \tilde \mu^j} \) where \(\omega_{mc} \) is the domain of the macro cell at index \(mc\).
The magnetization of the macro cell is the sum of the atomic moments of the particles in the macro cell: \( M_{mc}=\sum_{p_j \in \omega_{mc}} \tilde \mu^j_s . S_j \)
The demagnetized field within each macro cell p is
\( H^p_{dem}=\frac{\mu_0}{4.\pi} \left ( \sum_{q\neq p} \frac{3 <M^q,u_{pq}>_3.u_{pq} - M^q}{r^3_{pq}} \right) - \frac{\mu_0}{3.V_p} M^p \)
where \(r_{pq}\) if the vector direction from macro cell \(p\) to macro cell \(q\) and the unit vector \(u_{pq}=\frac{r_{pq}}{|r_{pq}|}\) and \(V_p\) is the effective volume of the macro cell defined by:
\( V_p = n^a_p . \frac{a^3}{N_a} \)
when \(n^a_p\) is the number of particles inside the macro cell, \(a\) is the unit cell size and \(N_a\) the number of atoms in the unit cell size. The last term of the equation represents the demagnetized field generated by the particles in the macro cell to themselves.
The dipolar field of each particle is the demagnetized field defined of the macro cell to which it belongs.
|
inlinestaticprotected |
build the diagonal block element of the matrix
| [in] | V | volume of the macro cells |
| [in] | lambdaHs | demagnetized factor for the iteraction between the macro cell and itself |
| [out] | diag | : value of the diagonal block |
|
inlinestaticprotected |
build the symmetric block element of the superior matrix in a packed storage
| [in] | lambdaH | : demagnatized interaction factor for 2 different macro cells |
| [in] | lambdaHs | : demagnatized interaction factor for a macro cell with itself |
| [in] | Wi | : weight of the macro cell i |
| [in] | i | index of the macro cell in interaction |
| [in] | j | index of the macro cell in interaction |
| [in] | Xi | mass center of the macro cell i |
| [in] | Xj | mass center of the macro cell j |
| [out] | vBij | values of the block (i,j) of the demagnetized matrix |
| [out] | rij | distance between the 2 mass centers |
| [out] | U | orrientation between the 2 mass centers |
|
inlinestaticprotected |
build the diagonal block element of the matrix
| [in] | V | volume of the macro cell |
| [in] | lambdaHs | demagnetized factor for the iteraction between the macro cell and itself |
| [out] | iDiag | : iterator on values of the diagonal block of size dim x (dim-1) / 2 |
|
inlinestaticprotected |
build the symmetric block element of the superior matrix in a packed storage
| [in] | lambdaH | : demagnatized factor for 2 different macro cells |
| [in] | i | index of the macro cell in interaction |
| [in] | j | index of the macro cell in interaction |
| [in] | Xi | mass center of the macro cell i |
| [in] | Xj | mass center of the macro cell j |
| [out] | vBij | values of the block (i,j) of the demagnetized matrix |
| [out] | rij | distance between the 2 mass centers |
| [out] | U | orrientation between the 2 mass centers |
|
protected |
compute the column blocks matrix (i,j) j in [start,end] and j in [0,i]
| [in] | lambdaH | : coefficient foer interactive Hdem between 2 differents macro cell |
| [in] | lambdaHs | : coefficient for interactive Hdem between one macro cell and itself |
| [in] | vMCsVolumes | iterator on volume of macro cells |
| [in] | nX | number of values of X for all macro cells |
| [in] | vX | values of X for all macro cells |
| [in] | nP | number of values of P for all macro cells |
| [in] | vP | values of P mass center for all macro cells |
| [out] | supBlocksValues | sup block values of the whole matrix |
|
protected |
compute the column blocks matrix (i,j) j in [start,end] and j in [0,i]
| [in] | lambdaH | : coefficient foer interactive Hdem between 2 differents macro cell |
| [in] | lambdaHs | : coefficient foer interactive Hdem between one macro cell and itself |
| [in] | vMCsVolume | volume of each macro cell |
| [in] | vMCsX | mass center for each macro cell |
| [in] | start | index of start block |
| [in] | end | : index of end block |
| [out] | supBlocksValues | iterator on sup block values of the whole matrix |
| [out] | diagBlocksValues | iterator on diagonal block values of the whole matrix |
|
pure virtual |
compute the demagnetized field on macro cells network
| [in] | network | network of macro cell |
| [in] | M | : magnetezation fieldl on macro cell |
Implemented in SMOMPI_OneMasterMacroCellsDemagnetizedField, SMOMPI_AllMasterMacroCellsDemagnetizedField, and SMOMPI_NoMasterMacroCellsDemagnetizedField.
|
protected |
compute Hdem[X]=F_{P,M}(X)
| [in] | lambdaH | physical parameter for interaction between M at 2 different macro cells |
| [in] | lambdaHs | physical parameter for interaction between M and itself (0 if \( P \cap X = \emptyset \)) |
| [in] | P | : iterator on start macro cell P |
| [in] | eP | : iterator on end macro cell P |
| [in] | M_P | : iterator on M at start macro cell P for all macro cells P |
| [in] | nMacroCells | : number of macro cells X to compute Hdem[X] |
| [in] | X | : iterator on start macro cell X. The number of X macro cell (m) is nMacroCells |
| [in] | M_X | : iterator on M at start macro cell X for all macro cells X of number nMacroCells |
| [in] | iMCsVolume | iterator at volume in Angstrom of start macro cell |
| [out] | H | : hdem[X] \( \forall x \in X, H_{dip)(x)+= \lambda_H . \sum_{y \in P } (3*<U_{xy},M_y>*U_{xy}}-M_y))/|y-x|^3 - \frac{\lambda_{H_s}}{N_x}.M_x \) with
|
|
pure virtual |
compute the matrix ot he demagnetized operator
| [in] | material | : material used to build the matrix |
| [in] | network | macro cells network of the part of the domaain of core coreId |
Implemented in SMOMPI_OneMasterMacroCellsDemagnetizedField, SMOMPI_AllMasterMacroCellsDemagnetizedField, and SMOMPI_NoMasterMacroCellsDemagnetizedField.
| void SM_MacroCellsDemagnetizedField::computeSeparatedFieldSlice | ( | const tReal & | lambdaH, |
| const tReal & | lambdaHs, | ||
| const tReal * | P, | ||
| const tReal * | eP, | ||
| const tReal * | M_P, | ||
| const tInteger & | nMacroCells, | ||
| const tReal * | X, | ||
| tReal * | H | ||
| ) | const |
compute Hdem[X]=F_{P,M}(X)
| [in] | lambdaH | physical parameter for interaction between M at 2 different macro cells |
| [in] | lambdaHs | physical parameter for interaction between M and itself (0 if \( P \cap X = \emptyset \)) |
| [in] | P | : iterator on start macro cell P |
| [in] | eP | : iterator on end macro cell P |
| [in] | M_P | : iterator on M at start macro cell P for all macro cells P |
| [in] | nMacroCells | : number of macro cells X to compute Hdem[X] |
| [in] | X | : iterator on start macro cell X. The number of X macro cell (m) is nMacroCells |
| [out] | H | : hdem[X] \( \forall x \in X, H_{dip)(x)+= \lambda_H . \sum_{y \in P } (3*<U_{xy},M_y>*U_{xy}}-M_y))/|y-x|^3 \) with
|
|
virtual |
discretize the field
| [in] | material | : material of the network |
| [in] | network | : macro cells network of the part of the domaain of core coreId
|
Reimplemented in SMOMPI_OneMasterMacroCellsDemagnetizedField, SMOMPI_NoMasterMacroCellsDemagnetizedField, and SMOMPI_AllMasterMacroCellsDemagnetizedField.
|
inlinevirtual |
return the memory size of the included associations
Reimplemented from CORE_Object.
Reimplemented in SMOMPI_OneMasterMacroCellsDemagnetizedField, SMOMPI_NoMasterMacroCellsDemagnetizedField, and SMOMPI_AllMasterMacroCellsDemagnetizedField.
|
inline |
get lambda H
|
inline |
get self lambda Hs
|
inlinevirtual |
return the memory size of the class and the memory size of all its attributes/associations
Reimplemented from SM_Object.
Reimplemented in SMOMPI_OneMasterMacroCellsDemagnetizedField, SMOMPI_NoMasterMacroCellsDemagnetizedField, and SMOMPI_AllMasterMacroCellsDemagnetizedField.
|
pure virtual |
create a New instance of this
Implemented in SMOMPI_OneMasterMacroCellsDemagnetizedField, SMOMPI_NoMasterMacroCellsDemagnetizedField, and SMOMPI_AllMasterMacroCellsDemagnetizedField.
|
inline |
set storage type
| [in] | f | storage type in {NO_STORAGE,PACKED_STORAGE} |