C++ main module for emicrom Package  1.0
EMM_MultiScaleCDGrid.h
Go to the documentation of this file.
1 #ifndef EMM_MultiScaleCDGrid_H
2 #define EMM_MultiScaleCDGrid_H
3 
4 #include "EMM_MultiScaleGrid.h"
5 
6 
127 class EMM_MultiScaleCDGrid : public virtual EMM_MultiScaleGrid {
128 
130  // ATTRIBUTES
131 
132 
133 
134 public:
135  // METHODS
136 
137  // CONSTRUCTORS
138 
141  EMM_MultiScaleCDGrid(void);
142 
143  // DESTRUCTORS
144 
147  virtual ~EMM_MultiScaleCDGrid(void);
148 
149 
150 public:
154  inline static SP::EMM_MultiScaleCDGrid New() {
155  SP::EMM_MultiScaleCDGrid ret(new EMM_MultiScaleCDGrid(),
157  ret->setThis(ret);
158  return ret;
159  };
160 
161 
177  virtual void initialize(const tDimension& dim,
178  const tUInteger& Nx,
179  const tUInteger& Ny,
180  const tUInteger& Nz,
181  const tBoolean& Px,
182  const tBoolean& Py,
183  const tBoolean& Pz,
184  const tUInteger& l);
185 
186 public:
187 
236  void meanValuesFromFineToCoarseGrid(const tUIndex& nCells,
237  const tDimension& dim,
238  const tReal* Mf,
239  tReal *Ml) const;
240 
241 
242 
287  const tDimension& dim,
288  tReal *Ml) const {
290  }
291 
292 private:
335  const tDimension& dim,
336  tReal *Ml) const;
337 
338 public:
339 
340 
341 
342  /* \brief reset the the value of the field M at the fine grid
343  * @param[in] nCells : number of cells of the mesh
344  * @param[in] dim: dimension of each point of the mesh
345  * @param[out] M: magnetization values of size nCells x dim of the coarse grid
346  * @return false if the centered zone is empty
347  *
348  * Set to 0 the values of M at the fine grid
349  *
350  * the algorithm is as follow:
351  * - the segment indices of zone z is in \f$ [i_{min},i_{max}[ \times [j_{min},j_{max}[ \times [k_{min},k_{max}[ \f$
352  * - for zone 0 \f$ [i_{min},i_{max}[=[0,N_x/2[\f$
353  * - for zone 1 \f$ [i_{min},i_{max}[=[N_x/2,N_x[\f$
354  * - the zone is considered as a sequence of N blocks of size S.
355  * - Each block are set to 0. the first element of block is at index \f$(i_s,j_s,k_s) \f$ where
356  * - \f$ \forall s, i_s=i_{min} \f$ and \f$ \forall s,j_{s+1}=j_s+1 ,k_{s+1}=k_s+1 \f$ if the blocks are oriented in the x-direction (\f$N_x \neq 1\f$)
357  * - \f$ \forall s, j_s=j_{min} \f$ and \f$ \forall s,i_{s+1}=i_s+1 ,k_{s+1}=k_s+1 \f$ if the blocks are oriented in the y-direction (\f$N_x \eq 1 \f$ and\f$N_y \neq 1 \f$ )
358  * - \f$ \forall s, k_s=k_{min} \f$ and \f$ \forall s, i_{s+1}=i_s+1 ,j_{s+1}=j_s+1 \f$ if the blocks are oriented in the z-direction (\f$N_x \eq 1 \f$ and\f$N_y \eq 1 \f$ and \f$ $N_z \neq 1 \f$)
359  * - if \f$ i_{s+1}>=i_{max} \f$ then \f$ i_{s+1}=i_{min} \f$
360  * - if \f$ j_{s+1}>=j_{max} \f$ then \f$ j_{s+1}=j_{min} \f$
361  * - if \f$ k_{s+1}>=j_{max} \f$ then \f$ k_{s+1}=k_{min} \f$
362  */
363  tBoolean resetValuesWithinCenteredZone(const tUIndex& nCells,const tDimension& dim,tReal *Mz) const;
364 
392  void addValuesFromCoarseGridToFinestGrid(const tUIndex& nCells,
393  const tDimension& dim,
394  const tUInteger& twoPowerL,
395  const tReal* Ml,
396  tReal* Mf) const;
397 
398 
399 protected:
400 
413  const tUIndex& nCells,
414  const tDimension& dim,
415  const tReal* Ml,
416  tReal *Mz,
417  tReal *Mlp1,
418  tReal *H0) const {
419  computeMagnetizationFieldAtNextLevel(nCells,dim,Ml,Mlp1);
420 
421  }
422 
436  const tUIndex& nCells,
437  const tDimension& dim,
438  tReal* Ml,
439  tReal *Mz,
440  tReal *H0) const {
441  computeDemagnetizedExcitationFieldFromLevel(twoPowerL,nCells,dim,Ml,H0);
442 
443 
444  }
445 
446 
447 
448 private:
449 
460  const tDimension& dim,
461  const tReal* Ml,
462  tReal *Mlp1) const;
463 
476  const tUIndex& nCells,
477  const tDimension& dim,
478  tReal *Ml,
479  tReal *H0) const;
480 
481 
482 
483 public:
484 
485  //OTHER methods
486 
487 
488 };
489 
490 #endif
virtual void computeZonalDemagnetizedFieldAndNextLevelMagnetizationField(const tUInteger &twoPowerL, const tUIndex &nCells, const tDimension &dim, const tReal *Ml, tReal *Mz, tReal *Mlp1, tReal *H0) const
compute the zonal demagnetized field added to demagnetized field at level 0 and compute the magnetiza...
Definition: EMM_MultiScaleCDGrid.h:412
static SP::EMM_MultiScaleCDGrid New()
build a new instance of class
Definition: EMM_MultiScaleCDGrid.h:154
virtual void initialize(const tDimension &dim, const tUInteger &Nx, const tUInteger &Ny, const tUInteger &Nz, const tBoolean &Px, const tBoolean &Py, const tBoolean &Pz, const tUInteger &l)
set the discretization
Definition: EMM_MultiScaleCDGrid.cpp:24
This class describes the building of fields on multiscale grid initialized by the initialize() method...
Definition: EMM_MultiScaleGrid.h:62
#define tUInteger
Definition: types.h:91
void computeMagnetizationFieldAtNextLevel(const tUIndex &nCells, const tDimension &dim, const tReal *Ml, tReal *Mlp1) const
compute the magntization field at level l+1 for field at level l
Definition: EMM_MultiScaleCDGrid.cpp:640
tBoolean resetValuesWithinCenteredZone(const tUIndex &nCells, const tDimension &dim, tReal *Mz) const
Definition: EMM_MultiScaleCDGrid.cpp:435
virtual void computeZonalCenteredDemagnetizedFieldFromLevel(const tUInteger &twoPowerL, const tUIndex &nCells, const tDimension &dim, tReal *Ml, tReal *Mz, tReal *H0) const
compute the centered demagnetized field of level l outside zone anad add it to demagnetized field at ...
Definition: EMM_MultiScaleCDGrid.h:435
SP_OBJECT(EMM_MultiScaleCDGrid)
void computeDemagnetizedExcitationFieldFromLevel(const tUInteger &twoPowerL, const tUIndex &nCells, const tDimension &dim, tReal *Ml, tReal *H0) const
compute the magnetic exitation of the grid at level l and add it to the magnetic excitation field of ...
Definition: EMM_MultiScaleCDGrid.cpp:658
#define tBoolean
Definition: types.h:139
void meanValuesFromFineToCoarseGrid(const tUIndex &nCells, const tDimension &dim, const tReal *Mf, tReal *Ml) const
compute the field in a corse field from its fine grid.
Definition: EMM_MultiScaleCDGrid.cpp:39
void completeValuesOutsideFineGridByPeriodicity(const tUIndex &nCells, const tDimension &dim, tReal *Ml) const
complete the values of the field in the coarse grid is set from its values in its included fine grid ...
Definition: EMM_MultiScaleCDGrid.h:286
#define tDimension
Definition: EMM_Types.h:10
#define tUIndex
Definition: types.h:126
EMM_MultiScaleCDGrid(void)
create
Definition: EMM_MultiScaleCDGrid.cpp:17
This class describes the building of fields on multiscale centered dioptic grids initialized by the i...
Definition: EMM_MultiScaleCDGrid.h:127
void addValuesFromCoarseGridToFinestGrid(const tUIndex &nCells, const tDimension &dim, const tUInteger &twoPowerL, const tReal *Ml, tReal *Mf) const
add the value of the field defined in coarse grid bigger than its finest grid into the field defined...
Definition: EMM_MultiScaleCDGrid.cpp:478
void completeValuesOutsideFineGridByPeriodicityByExclusion(const tUIndex &nCells, const tDimension &dim, tReal *Ml) const
complete the values of the field in the coarse grid is set from its values in its included fine grid ...
Definition: EMM_MultiScaleCDGrid.cpp:289
virtual ~EMM_MultiScaleCDGrid(void)
destroy
Definition: EMM_MultiScaleCDGrid.cpp:20
DEFINE_SPTR(EMM_MultiScaleCDGrid)
#define tReal
Definition: types.h:118
class Free introduced for deleting a smart pointer
Definition: CORE_Object.h:141