C++ main module for stochmagnet Package
1.0
|
This class is describes a a network. More...
#include <SM_Network.h>
Public Member Functions | |
SM_Network (void) | |
create a network class More... | |
virtual | ~SM_Network (void) |
destroy More... | |
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... | |
void | copy (const SM_Network &network) |
copy the network More... | |
tDimension | getDimension () const |
return the dimension More... | |
void | setParticlesNumber (const tInteger &nParticles) |
set the particles number More... | |
tInteger | getParticlesNumber () const |
return the particles number More... | |
tIndex | computeAloneParticlesNumber () const |
return the particles number More... | |
void | setParticlesCoordinates (std::initializer_list< tReal > &&coords) |
void set particles 3D-coordinates More... | |
void | setParticlesCoordinates (const std::initializer_list< tReal > &coords) |
void set particles 3D-coordinates More... | |
void | setParticlesCoordinates (const SM_RealField &coords) |
void set particles coordinates More... | |
const SM_RealField & | getParticlesCoordinates () const |
void get particles coordinates More... | |
SM_RealField & | getParticlesCoordinates () |
void get particles coordinates More... | |
void | setLambda (const tReal &L) |
set the lambda value More... | |
const tReal & | getLambda () const |
get the lambda value More... | |
void | setNeighbors (std::valarray< tUInt > &&neighborsNumber, std::valarray< tIndex > &&neighborsIndices, std::valarray< tReal > &&Js) |
set the neighbors by moving More... | |
void | setNeighbors (const std::valarray< tUInt > &neighborsNumber, const std::vector< tIndex > &neighborsIndices, const std::vector< tReal > &Js) |
set the neighbors by copy More... | |
tIndex | getConnectionsNumber () const |
get the number of connections More... | |
const std::valarray< tUInt > & | getNeighborsNumber () const |
get the neighbors number More... | |
std::valarray< tUInt > & | getNeighborsNumber () |
get the neighbors number More... | |
const std::valarray< tIndex > & | getNeighborsIndices () const |
std::valarray< tIndex > & | getNeighborsIndices () |
const std::valarray< tReal > & | getHeissenbergCoefficients () const |
get the Heissenberg coefficients More... | |
std::valarray< tReal > & | getHeissenbergCoefficients () |
get the Heissenberg coefficients More... | |
void | create3DGrid (const tIndex &Nx, const tIndex Ny, const tIndex Nz, const tReal &Hx, const tReal &Hy, const tReal &Hz, const tReal &J, const tBoolean &hasSelfInteraction) |
create a grid 3D of size Nx x Ny x Nz with distance between particles is hx x hy x hz the interaction between particles is modelized by J More... | |
virtual tString | toString () const override |
turn the class into a string representation More... | |
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 Member Functions | |
static CORE_UniquePointer< SM_Network > | New () |
build a new instance of a Network More... | |
static tBoolean | EnableMemoryStack (const tBoolean &isMemoryChecked) |
enable the memory stack More... | |
static void | EnableMemoryStack () |
enable the memory stack More... | |
static void | DisableMemoryStack () |
disable the memory stack More... | |
static tBoolean | IsMemoryStackEnabled () |
return trur if the memory stack is enabled More... | |
static tString | MemoryStackToString () |
get the memory stack in string More... | |
static tIndex | GetRegisteredClassesNumber () |
get the memory stack in string More... | |
Private Member Functions | |
template<class T > | |
std::shared_ptr< T > | setThis (std::unique_ptr< T, CORE_Object::Delete > &up) |
set the shared pointer from an unique pointer More... | |
Private Attributes | |
tReal | mLambda |
SM_RealField | mPoints |
std::valarray< tUInt > | mNeighborsNumber |
std::valarray< tIndex > | mNeighborsIndices |
std::valarray< tReal > | mJs |
std::weak_ptr< CORE_Object > | mThis |
This class is describes a a network.
|
inline |
create a network class
References mLambda, mNeighborsNumber, mPoints, and CORE_Field< T, K, D, S, I >::setElementsNumber().
Referenced by New().
|
inlinevirtual |
destroy
|
inline |
return the particles number
References mNeighborsNumber, and tIndex.
Referenced by SM_XDMF::writeGeometryHeader().
|
inline |
copy the network
[in] | network | : the network to copy |
References CORE_Field< T, K, D, S, I >::copy(), getHeissenbergCoefficients(), getLambda(), getNeighborsIndices(), getNeighborsNumber(), getParticlesCoordinates(), mJs, mLambda, mNeighborsIndices, mNeighborsNumber, and mPoints.
void SM_Network::create3DGrid | ( | const tIndex & | Nx, |
const tIndex | Ny, | ||
const tIndex | Nz, | ||
const tReal & | Hx, | ||
const tReal & | Hy, | ||
const tReal & | Hz, | ||
const tReal & | J, | ||
const tBoolean & | hasSelfInteraction | ||
) |
create a grid 3D of size Nx x Ny x Nz with distance between particles is hx x hy x hz the interaction between particles is modelized by J
[in] | Nx | number of particles in the x-direction |
[in] | Ny | number of particles in the y-direction |
[in] | Nz | number of particles in the z-direction |
[in] | Hx | distance between 2 particles in the x-direction |
[in] | Hy | distance between 2 particles in the y-direction |
[in] | Hz | distance between 2 particles in the z-direction |
[in] | J | interaction factor of 2 particles |
[in] | hasSelfInteraction | : true to make an interaction between each particle and itself |
References CORE_Field< T, K, D, S, I >::getValues(), mPoints, CORE_Field< T, K, D, S, I >::setElementsNumber(), setNeighbors(), tIndex, tReal, tRelativeIndex, tSInt, tUInt, and tUSInt.
Referenced by SM_Test::grid3DParticlesTestCase(), SM_Test::linedParticlesTestCase(), SM_Run::loadNetworkFromOptions(), SM_Test::testEnergyOperatorsDerivatives(), and SM_Test::testVirtualMethods().
|
inlinestaticinherited |
disable the memory stack
Referenced by CORE_Object::EnableMemoryStack().
|
inlinestaticinherited |
enable the memory stack
Referenced by CORE_Object::EnableMemoryStack(), and CORE_Run::SetDebugOptions().
|
inlinestaticinherited |
enable the memory stack
[in] | isMemoryChecked | : true to verify memory allocation of CORE_Object classes |
References CORE_Object::DisableMemoryStack(), CORE_Object::EnableMemoryStack(), and CORE_Object::IsMemoryStackEnabled().
|
inlineinherited |
return the name of the class
Referenced by CORE_Object::getIdentityString(), and CORE_Test::testTypes().
|
inline |
get the number of connections
References mNeighborsIndices.
Referenced by SM_XDMF::writeGeometryHeader().
|
inlineinherited |
return a const shared pointer for this
References CORE_Object::mThis.
|
inlinevirtual |
return the memory size of the included associations
Reimplemented from CORE_Object.
References CORE_Object::getContentsMemorySize(), CORE_Field< T, K, D, S, I >::getContentsMemorySize(), mJs, mNeighborsIndices, mNeighborsNumber, mPoints, tIndex, tMemSize, tReal, and tUInt.
Referenced by SM_System::getContentsMemorySize(), and getMemorySize().
|
inline |
return the dimension
References CORE_Field< T, K, D, S, I >::getDimension(), and mPoints.
Referenced by SM_Operator::computeEnergy(), SM_ZeemanOperator::computeEnergy(), SM_Beam::computeL2Convergence(), SM_System::computeMagneticField(), SM_System::computeMagneticFieldAndEnergies(), SM_DemagnetizedOperator::computeTemplatedEnergy(), SM_HeissenbergOperator::computeTemplatedEnergy(), SM_ZeemanOperator::computeTemplatedEnergy(), SM_TemplatedSystem< SystemImpl >::computeTemplatedMagneticField(), SM_TemplatedSystem< SystemImpl >::computeTemplatedMagneticFieldAndEnergies(), SM_DemagnetizedOperator::computeTemplatedMagneticFieldAndEnergy(), SM_ZeemanOperator::computeTemplatedMagneticFieldAndEnergy(), SM_HeissenbergOperator::computeTemplatedMagneticFieldAndEnergy(), SM_Beam::discretize(), SM_Output::generateOutput(), SM_Test::grid3DParticlesTestCase(), SM_Run::loadMagneticMomentFromOptions(), SM_System::makeRelaxation(), SM_TemplatedSystem< SystemImpl >::makeTemplatedRelaxation(), SM_VTK::save(), SM_Test::testEnergyOperatorsDerivatives(), toString(), SM_System::toString(), SM_Test::validate(), and SM_XDMF::writeContentData().
|
inline |
get the Heissenberg coefficients
References mJs.
|
inline |
get the Heissenberg coefficients
References mJs.
Referenced by SM_HeissenbergOperator::computeTemplatedEnergy(), SM_HeissenbergOperator::computeTemplatedMagneticFieldAndEnergy(), and copy().
|
inlineinherited |
retrun the string identification of the class
References CORE_Object::getClassName(), and core_functions::pointerToString().
Referenced by CORE_Test::testArray(), CORE_Test::testField(), CORE_Test::testTypes(), CORE_Object::toString(), CORE_ClassFactory::toString(), and CORE_Field< T, K, D, S, I >::toString().
|
inline |
get the lambda value
References mLambda.
Referenced by SM_DemagnetizedOperator::computeTemplatedEnergy(), SM_HeissenbergOperator::computeTemplatedEnergy(), SM_DemagnetizedOperator::computeTemplatedMagneticFieldAndEnergy(), SM_HeissenbergOperator::computeTemplatedMagneticFieldAndEnergy(), and copy().
|
inlinevirtual |
return the memory size of the class and the memory size of all its attributes/associations
Reimplemented from SM_Object.
References getContentsMemorySize().
|
inline |
References mNeighborsIndices.
|
inline |
References mNeighborsIndices.
Referenced by SM_HeissenbergOperator::computeTemplatedEnergy(), SM_HeissenbergOperator::computeTemplatedMagneticFieldAndEnergy(), copy(), and SM_XDMF::writeGeometryHeader().
|
inline |
get the neighbors number
References mNeighborsNumber.
|
inline |
get the neighbors number
References mNeighborsNumber.
Referenced by SM_HeissenbergOperator::computeTemplatedEnergy(), SM_HeissenbergOperator::computeTemplatedMagneticFieldAndEnergy(), copy(), and SM_XDMF::writeGeometryHeader().
|
inline |
|
inline |
void get particles coordinates
References mPoints.
Referenced by SM_DemagnetizedOperator::computeTemplatedEnergy(), SM_DemagnetizedOperator::computeTemplatedMagneticFieldAndEnergy(), copy(), and SM_XDMF::writeVertices().
|
inline |
return the particles number
References CORE_Field< T, K, D, S, I >::getElementsNumber(), and mPoints.
Referenced by SM_Operator::computeEnergy(), SM_ZeemanOperator::computeEnergy(), SM_Beam::computeL2Convergence(), SM_System::computeMagneticField(), SM_System::computeMagneticFieldAndEnergies(), SM_DemagnetizedOperator::computeTemplatedEnergy(), SM_HeissenbergOperator::computeTemplatedEnergy(), SM_ZeemanOperator::computeTemplatedEnergy(), SM_TemplatedSystem< SystemImpl >::computeTemplatedMagneticField(), SM_TemplatedSystem< SystemImpl >::computeTemplatedMagneticFieldAndEnergies(), SM_DemagnetizedOperator::computeTemplatedMagneticFieldAndEnergy(), SM_ZeemanOperator::computeTemplatedMagneticFieldAndEnergy(), SM_HeissenbergOperator::computeTemplatedMagneticFieldAndEnergy(), SM_Beam::discretize(), SM_System::discretize(), SM_PermanentZeemanOperator::discretize(), SM_ZeemanOperator::discretize(), SM_Output::generateOutput(), SM_Test::grid3DParticlesTestCase(), SM_Run::loadMagneticMomentFromOptions(), SM_System::makeRelaxation(), SM_TemplatedSystem< SystemImpl >::makeTemplatedRelaxation(), SM_VTK::save(), SM_Test::testEnergyOperatorsDerivatives(), toString(), SM_Test::validate(), and SM_XDMF::writeContentData().
|
inlineinherited |
retrun the pointer of the class as a string
References core_functions::pointerToString().
|
inlinestaticinherited |
get the memory stack in string
|
inlineinherited |
return the shared pointer for this
References CORE_Object::mThis.
|
inlineinherited |
test if the clas T is an instance of this class
Referenced by SM_Beam::templatedSimulate().
|
inlinestaticinherited |
return trur if the memory stack is enabled
Referenced by CORE_Object::EnableMemoryStack(), and main().
|
inlinestaticinherited |
get the memory stack in string
Referenced by main().
|
inlinestatic |
build a new instance of a Network
References SM_Network().
Referenced by SM_Run::createMagneticDipolarMap(), and SM_ClassFactory::NewInstance().
|
inline |
|
inline |
set the neighbors by copy
[in] | neighborsNumber | number of neighbors for each particle of size mParticlesNumber |
[in] | neighborsIndices | indices of neighbors for each particle of size mParticlesNumber x sum of neighborsNumber[i] |
[in] | Js | heissenberg coefficient for each link between 2 particles |
References mJs, mNeighborsIndices, mNeighborsNumber, tIndex, and tReal.
|
inline |
set the neighbors by moving
[in] | neighborsNumber | number of neighbors for each particle of size mParticlesNumber |
[in] | neighborsIndices | indices of neighbors for each particle of size mParticlesNumber x sum of neighborsNumber[i] |
[in] | Js | heissenberg coefficient for each link between 2 particles |
References mJs, mNeighborsIndices, and mNeighborsNumber.
Referenced by create3DGrid().
|
inline |
void set particles coordinates
[in] | coords | : coordinates of the particles |
References mPoints.
|
inline |
|
inline |
|
inline |
set the particles number
[in] | nParticles | : number of particles |
References mPoints, and CORE_Field< T, K, D, S, I >::setElementsNumber().
|
inlineprivateinherited |
set the shared pointer from an unique pointer
[in,out] | up | unique pointer of the class at input, points to null pointer at output |
Method only calledby the friend class CORE_ClassFactory::NewSharedInstance()
References CORE_Object::mThis.
|
overridevirtual |
turn the class into a string representation
Reimplemented from CORE_Object.
References CORE_Field< T, K, D, S, I >::getDimension(), getDimension(), CORE_Field< T, K, D, S, I >::getElementsNumber(), getParticlesNumber(), mJs, mLambda, mNeighborsIndices, mNeighborsNumber, mPoints, tIndex, CORE_Object::toString(), tReal, and tUInt.
Referenced by SM_System::toString().
|
private |
Referenced by copy(), getContentsMemorySize(), getHeissenbergCoefficients(), setNeighbors(), and toString().
|
private |
Referenced by copy(), getLambda(), setLambda(), SM_Network(), and toString().
|
private |
Referenced by copy(), getConnectionsNumber(), getContentsMemorySize(), getNeighborsIndices(), setNeighbors(), and toString().
|
private |
Referenced by computeAloneParticlesNumber(), copy(), getContentsMemorySize(), getNeighborsNumber(), setNeighbors(), SM_Network(), and toString().
|
private |
|
privateinherited |
Referenced by CORE_Object::getConstSharedPointer(), CORE_Object::getSharedPointer(), and CORE_Object::setThis().