C++ mpi module for stochmagnet_main Package
Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
SMOMPI_CrystalStructuresGridBuilder Class Reference

This class builds a grid of crystal structure with OMP/MPI implementation. It implements the virtual abstract method SMOMPI_CrystalStructureGridBuilder::buildNetwork() of base class SM_CrystalStructuresGridBuilder. More...

#include <SMOMPI_CrystalStructuresGridBuilder.h>

Inheritance diagram for SMOMPI_CrystalStructuresGridBuilder:
Inheritance graph
[legend]
Collaboration diagram for SMOMPI_CrystalStructuresGridBuilder:
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...
 
virtual tMemSize getContentsMemorySize () const
 return the memory size of the included associations More...
 
virtual void buildNetwork (const SM_CrystalStructure &cStructure, const std::array< tBoolean, SM_Constants::DIM > &isPeriodic, const std::array< tReal, SM_Constants::DIM > &X0, const std::array< tInteger, SM_Constants::DIM > &Ns, const std::valarray< tMask > &mask, SM_Network &network) final
 build the network from a grid paver and a mask on crystal structure on grid More...
 
- Public Member Functions inherited from SM_CrystalStructuresGridBuilder
void setCrystalStructuresBuilder (CORE_UniquePointer< SM_CrystalStructuresBuilder > builder)
 set the crystal structures builder
 
void setCrystalStructuresBuilder (const SM_CrystalStructure &c)
 set the crystal structures builder
 
const SM_CrystalStructuresBuildergetCrystalStructuresBuilder () const
 set the crystal structures builder
 
virtual tBoolean buildDomainNetwork (const SM_CrystalStructure &cStructure, const std::array< tBoolean, SM_Constants::DIM > &isPeriodic, const tString &domainExpression, SM_Network &network) final
 build the network from domain expression More...
 
- Public Member Functions inherited from SM_NetworkBuilder
void buildPaverNetwork (const SM_CrystalStructure &cStructure, const std::array< tBoolean, SM_Constants::DIM > &isPeriodic, const std::array< tInteger, SM_Constants::DIM > &Ns, SM_Network &network)
 build the network from a grid paver More...
 
void buildPaverNetwork (const SM_CrystalStructure &cStructure, const std::array< tReal, SM_Constants::DIM > &X0, const std::array< tInteger, SM_Constants::DIM > &Ns, SM_Network &network)
 build the network from a grid paver More...
 
void buildPaverNetwork (const SM_CrystalStructure &cStructure, const std::array< tInteger, SM_Constants::DIM > &Ns, SM_Network &network)
 build the network from a grid paver More...
 
void buildPaverNetwork (const SM_CrystalStructure &cStructure, const std::array< tBoolean, SM_Constants::DIM > &isPeriodic, const std::array< tReal, SM_Constants::DIM > &X0, const std::array< tInteger, SM_Constants::DIM > &Ns, SM_Network &network)
 build the network from a grid paver 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...
 
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...
 
virtual tString toString () const
 return the string representation of the object node More...
 

Static Public Member Functions

static CORE_UniquePointer< SelfClassNew ()
 create a new unique instance of This class More...
 
- Static Public Member Functions inherited from SM_NetworkGridBuilder
static tIndex BuildBlock (const std::array< tInteger, SM_Constants::DIM > &nCs, const tInteger *iBlocksNumber, const tInteger *iBlockIndex, const tReal &margin, const tReal *iX0, const tReal *iHs, tInteger *iI0, tInteger *iI1, tReal *iBlockMinPoint, tReal *iBlockMaxPoint)
 buid a block within a grid domain More...
 
static tIndex GetCellsNumberInBlock (const std::array< tInteger, SM_Constants::DIM > &nCs, const tInteger *iBlocksNumber, const tInteger *iBlockIndex)
 buid a block within a grid domain More...
 
template<tUCInt R>
static tBoolean IsPointInBlock (std::array< tInteger, SM_Constants::DIM > &I, const tReal *iBlockMinPoint, const tReal *iBlockMaxPoint, const tReal *iX0, const tReal *iHs, tReal *iP)
 return true if the point P=X0+(I+0.5R).Hs is in [blockMinPoint,blockMaxPoint[ More...
 
static tBoolean GetCenterFacePointInBlock (const tDimension &d, const std::array< tDimension, SM_Constants::HDIM > &hyperplanBase, const std::array< tInteger, SM_Constants::DIM > &faceElementIndices, const std::array< tReal, SM_Constants::DIM > &blockMinPoint, const std::array< tReal, SM_Constants::DIM > &blockMaxPoint, std::array< tUCInt, SM_Constants::HDIM > &moveIndices, const std::array< tReal, SM_Constants::DIM > &X0, const std::array< tReal, SM_Constants::DIM > &H, std::array< tReal, SM_Constants::DIM > &P)
 return true if the point at center of face of the d-surface is in [blockMinPoint,blockMaxPoint[ More...
 
template<tBoolean R>
static void GetPointWithIndices (std::array< tInteger, SM_Constants::DIM > &I, const tReal *iX0, const tReal *iHs, tReal *iP)
 get the point with indices within the cell of indices I with relative position R in {0,1} More...
 
static void GetCenterFacePoint (const tDimension &d, const std::array< tDimension, SM_Constants::HDIM > &hyperplanBase, const std::array< tInteger, SM_Constants::DIM > &faceElementIndices, std::array< tUCInt, SM_Constants::HDIM > &movesIndices, const std::array< tReal, SM_Constants::DIM > &X0, const std::array< tReal, SM_Constants::DIM > &H, std::array< tReal, SM_Constants::DIM > &P)
 get the point located at center of element of d-surface whith faceElementIndices More...
 
static void GetCellVertices (const std::array< tInteger, SM_Constants::DIM > &cellIndices, const std::array< tInteger, SM_Constants::DIM > &nPs, const std::array< tBoolean, SM_Constants::DIM > &isPeriodic, std::array< tUCInt, SM_Constants::DIM > &moveIndices, std::array< tInteger, SM_Constants::DIM > &vertexIndices, std::map< tIndex, tIndex > &vertices)
 get the vertices at summit of cells More...
 
static void GetFaceVertices (const tDimension &d, const std::array< tDimension, SM_Constants::HDIM > &hyperplanBase, const std::array< tInteger, SM_Constants::DIM > faceElementIndices, const std::array< tInteger, SM_Constants::DIM > &nPs, const std::array< tBoolean, SM_Constants::DIM > &isPeriodic, std::array< tUCInt, SM_Constants::HDIM > &moveIndices, std::array< tInteger, SM_Constants::DIM > &vertexIndices, tIndex &vertexIndex, std::map< tIndex, tIndex > &vertices)
 get the vertices at summit of face More...
 
static tBoolean IsFaceInDomain (const tDimension &d, const std::array< tDimension, SM_Constants::HDIM > &hyperplanBase, const tInteger *iFaceElementIndices, const std::array< tInteger, SM_Constants::DIM > &nCs, const std::array< tBoolean, SM_Constants::DIM > &isPeriodic, const tBoolean &incMask, const tMask *vMask, std::array< tInteger, SM_Constants::DIM > &connectedCellIndices)
 return true if the face is in domain More...
 
static void GetConnectedDomainCellsToVertex (const std::array< tInteger, SM_Constants::DIM > &vertexIndices, const std::array< tInteger, SM_Constants::DIM > &Ns, const std::array< tBoolean, SM_Constants::DIM > &isPeriodic, const tBoolean &incMask, const tMask *vMask, std::array< tUCInt, SM_Constants::DIM > &moveIndices, std::array< tInteger, SM_Constants::DIM > &connectedCellIndices, std::map< tIndex, tIndex > &connectedCells)
 get the cells in domain and connected to vertex More...
 
static void GetConnectedDomainCellsToFace (const tDimension &d, const std::array< tDimension, SM_Constants::HDIM > &hyperplanBase, const tInteger *iFaceElementIndices, const std::array< tInteger, SM_Constants::DIM > &nCs, const std::array< tBoolean, SM_Constants::DIM > &isPeriodic, const tBoolean &incMask, const tMask *vMask, std::array< tInteger, SM_Constants::DIM > &connectedCellIndices, std::map< tIndex, tIndex > &connectedCells)
 get the cells in domain and connected to face More...
 
static void GetConnectedDomainFacesToVertex (const std::array< tInteger, SM_Constants::DIM > &vertexIndices, const tDimension &d, const std::array< tDimension, SM_Constants::HDIM > &hyperplanBase, const std::array< tInteger, SM_Constants::DIM > &facesElementsNumber, const std::array< tInteger, SM_Constants::DIM > &nCs, const std::array< tBoolean, SM_Constants::DIM > &isPeriodic, const tBoolean &incMask, const tMask *vMask, std::array< tUCInt, SM_Constants::HDIM > &moveIndices, std::array< tInteger, SM_Constants::DIM > &cellIndices, tIndex &index, std::array< tInteger, SM_Constants::DIM > &faceElementIndices, std::map< tIndex, tIndex > &connectedFaces)
 get the faces in domain and connected to vertex More...
 
static void GetConnectedDomainFacesToFace (const tDimension &p, const std::array< tDimension, SM_Constants::HDIM > &pHyperplanBase, const tInteger *iFaceElementIndices, const tDimension &q, const std::array< tDimension, SM_Constants::HDIM > &qHyperplanBase, const std::array< tInteger, SM_Constants::DIM > &qFacesElementsNumber, const std::array< tInteger, SM_Constants::DIM > &nCs, const std::array< tBoolean, SM_Constants::DIM > &isPeriodic, const tBoolean &incMask, const tMask *vMask, std::array< tInteger, SM_Constants::DIM > &connectedCellIndices, tIndex &cellIndex, std::array< tInteger, SM_Constants::DIM > &connectedFaceIndices, std::map< tIndex, tIndex > &connectedFaces)
 get the faces in q-surfaces domain and connected to face in p-surface More...
 
static void BuildVerticesWeight (const std::array< tInteger, SM_Constants::DIM > &nCs, const std::array< tInteger, SM_Constants::DIM > &nPs, const std::array< tBoolean, SM_Constants::DIM > &isPeriodic, const std::valarray< tMask > &mask, tReal *iVerticesWeight, tUCInt *iConnectedCellsNumber, tIndex *iConnectedCells)
 build the weight of vertex More...
 
static void BuildFacesWeight (const tDimension &d, const std::array< tDimension, SM_Constants::HDIM > &hyperplanBase, const std::array< tInteger, SM_Constants::DIM > &nCs, const std::array< tInteger, SM_Constants::DIM > &nPs, const std::array< tBoolean, SM_Constants::DIM > &isPeriodic, const std::valarray< tMask > &mask, tReal *iFacesWeight, tUCInt *iConnectedCellsNumber, tIndex *iConnectedCells)
 build the weight of vertex at center of faces More...
 
static void BuildCellsWeight (const std::array< tInteger, SM_Constants::DIM > &nCs, const std::valarray< tMask > &mask, tReal *iCellsWeight, tUCInt *iConnectedCellsNumber, tIndex *iConnectedCells)
 build the weight of vertex at center of cells More...
 
static void BuildCellsParticlesNumber (const std::array< tInteger, SM_Constants::DIM > Ns, const std::valarray< tReal > &elementsWeight, const std::valarray< tUCInt > &elementsConnectedCellsNumber, const std::valarray< tIndex > &elementsConnectedCells, std::valarray< tReal > &cellsParticlesNumber)
 build the number of particles within each cell More...
 
static void BuildElementsVolume (const std::valarray< tReal > &elementsWeight, const std::valarray< tUCInt > &elementsConnectedCellsNumber, const std::valarray< tIndex > &elementsConnectedCells, const std::valarray< tReal > &cellsParticlesNumber, std::valarray< tReal > &elementsVolume)
 build the volume of each element More...
 
- 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...
 

Protected Member Functions

 SMOMPI_CrystalStructuresGridBuilder (void)
 create a network class
 
virtual ~SMOMPI_CrystalStructuresGridBuilder (void)
 destroy
 
- Protected Member Functions inherited from SM_CrystalStructuresGridBuilder
 SM_CrystalStructuresGridBuilder (void)
 create a network class
 
virtual ~SM_CrystalStructuresGridBuilder (void)
 destroy
 
- Protected Member Functions inherited from SM_NetworkGridBuilder
 SM_NetworkGridBuilder (void)
 create a network class
 
virtual ~SM_NetworkGridBuilder (void)
 destroy
 
- Protected Member Functions inherited from SM_NetworkBuilder
 SM_NetworkBuilder (void)
 create a network class
 
virtual ~SM_NetworkBuilder (void)
 destroy
 
- 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 Attributes inherited from SM_NetworkGridBuilder
static tUCInt N_HYPERPLAN_MOVES
 number of moves per hyperplan
 
static tUCInt N_SPACE_MOVES
 number of moves in space
 

Detailed Description

This class builds a grid of crystal structure with OMP/MPI implementation. It implements the virtual abstract method SMOMPI_CrystalStructureGridBuilder::buildNetwork() of base class SM_CrystalStructuresGridBuilder.

This method :

Member Function Documentation

◆ buildNetwork()

void SMOMPI_CrystalStructuresGridBuilder::buildNetwork ( const SM_CrystalStructure cStructure,
const std::array< tBoolean, SM_Constants::DIM > &  isPeriodic,
const std::array< tReal, SM_Constants::DIM > &  X0,
const std::array< tInteger, SM_Constants::DIM > &  Ns,
const std::valarray< tMask > &  mask,
SM_Network network 
)
finalvirtual

build the network from a grid paver and a mask on crystal structure on grid

Parameters
[in]cStructure: crystal structure
[in]isPeriodic: periodic in direction
[in]X0: minimum point of the domain
[in]Nsnetwork number of cells per direction
[in]mask: indicator of the inside cell flag
[out]network: build network

Implements SM_NetworkBuilder.

◆ getContentsMemorySize()

virtual tMemSize SMOMPI_CrystalStructuresGridBuilder::getContentsMemorySize ( ) const
inlinevirtual

return the memory size of the included associations

Returns
the memory size of the storage in bytes 1 Kb = 1024 bytes 1 Mb = 1024 Kb 1 Gb = 1024 Mb 1 Tb = 1024 Gb 1 Hb = 1024 Tb

Reimplemented from SM_CrystalStructuresGridBuilder.

◆ getMemorySize()

virtual tMemSize SMOMPI_CrystalStructuresGridBuilder::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_CrystalStructuresGridBuilder.

◆ New()

static CORE_UniquePointer<SelfClass> SMOMPI_CrystalStructuresGridBuilder::New ( )
inlinestatic

create a new unique instance of This class

Returns
an unique pointer to an instance of this class

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