C++ main module for stochmagnet Package  1.0
Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
SM_Test Class Reference

#include <SM_Test.h>

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

Public Member Functions

 SM_Test (void)
 create the class More...
 
virtual ~SM_Test (void)
 destroy the class More...
 
virtual tMemSize getMemorySize () const override
 return the memory size of the class More...
 
virtual tBoolean execute (const CORE_Run &runner, const std::map< tString, tString > &options) const
 execute the tests More...
 
void setName (const tString &name)
 set the test name More...
 
const tStringgetName () const
 get the test name More...
 
template<typename T , class I >
requires core_functions::isArithmeticType< T > tBoolean testArray (CORE_Array< T, I > &A) const
 
template<typename T , typename K , K D, class S , class I >
tBoolean testField (CORE_Field< T, K, D, S, I > &A) const
 
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...
 
virtual tString toString () const
 return the string representation of the object node More...
 

Static Public Member Functions

static CORE_UniquePointer< CORE_TestNew ()
 create a test class @retrun a new instance of the class 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...
 

Protected Member Functions

virtual void getSearchingPaths (std::vector< tString > &vpaths) const override
 get the test path locations More...
 
virtual tBoolean primaryTests (const CORE_Run &runner, const std::map< tString, tString > &options) const override
 execute the primary tests More...
 
virtual tBoolean elementaryTests (const CORE_Run &runner, const std::map< tString, tString > &options) const override
 execute the elementary tests More...
 
virtual tBoolean caseTests (const CORE_Run &runner, const std::map< tString, tString > &options) const override
 execute the case tests More...
 
void getSearchingPaths (const tString &packageName, const tUSInt &nLevels, const std::vector< tString > &localPaths, std::vector< tString > &vpaths) const
 get the test path locations More...
 
tString getSearchingPathsToString () const
 get the test path locations into string More...
 
tString searchPath (const tString &f) const
 retun the path where the file f is withing the searching paths list More...
 
tBoolean testCase (const CORE_Run &runner, const tString &name) const
 execute the test case More...
 
virtual tBoolean compareResults (const std::map< tString, tString > &options, const tString &resultFile, const tString &referenceFile, const tReal &eps) const
 make the difference between the two files More...
 
tBoolean testArray (const CORE_Run &runner, const std::map< tString, tString > &options) const
 test the numeric array More...
 
template<typename Q , class I >
requires core_functions::isArithmeticType< Q > tBoolean testArray (CORE_Array< Q, I > &A) const
 
template<typename T , class I >
tBoolean uniformRandomTest (CORE_Array< T, I > &A, CORE_Array< T, I > &B) const
 randomizer test More...
 
template<typename Q , typename K , K D, class S , class I >
tBoolean testField (CORE_Field< Q, K, D, S, I > &A) const
 

Static Protected Member Functions

template<typename T , typename Q >
requires core_functions::isRealType< T > static core_functions::isRealType< Q > tBoolean Equals (const T &a, const Q &b)
 retrun true if the two values are equals More...
 
template<typename T , typename Q >
requires core_functions::isIntegerType< T > &&static core_functions::isIntegerType< Q > tBoolean Equals (const T &a, const Q &b)
 

Private Member Functions

tBoolean testNormalLaw (const CORE_Run &runner, const std::map< tString, tString > &options) const
 test the normal law More...
 
tBoolean testField (const CORE_Run &runner, const std::map< tString, tString > &options) const
 test the field More...
 
tBoolean testVirtualMethods (const CORE_Run &runner, const std::map< tString, tString > &options) const
 test the efficiency of the templated method vs virtual method More...
 
tBoolean testOperators (const CORE_Run &runner, const std::map< tString, tString > &options) const
 test the oparator by appling the formule dE/dM=-H More...
 
tBoolean testEnergyOperatorsDerivatives (SM_Beam &beam, const tIndex &Nx, const tIndex &Ny, const tIndex &Nz) const
 test the Energy & H relations with the formulat dE/dmu=_H on a grid of size Nx x Ny x Nz More...
 
tBoolean linedParticlesTestCase (const CORE_Run &runner, const std::array< tReal, 3 > &Mu0, const tBoolean &hasZeeman, const tReal &J, const tBoolean &hasSelfInteraction, const tIndex &n, const tReal &h, const tString &system, const tString &noise, const tReal &T, const tReal &dt) const
 test n particles on a 3D- line with system & noise function More...
 
tBoolean grid3DParticlesTestCase (const CORE_Run &runner, const tIndex &Nx, const tIndex &Ny, const tIndex &Nz, const tReal &J, const tBoolean &hasSelfInteraction, const tString &systemName, const tString &noiseName) const
 test Nx x Ny x Nz particles on a 3D-grid with system & noise function More...
 
tBoolean validate (const CORE_Run &runner, const tString &path, const tString &prefix, const SM_Beam &beam, const tIndex &s) const
 validate the s-trajectory of the beam simulations More...
 
tBoolean testDerivative (const tIndex &i, const tDimension &d, const SM_Network &network, SM_RealField &Mu, const SM_Operator &op, SM_RealField &H) const
 test derivative of the operator at particle i in the direction d on the network at Mu More...
 
tBoolean testTypes (const CORE_Run &runner, const std::map< tString, tString > &options) const
 test type More...
 
tBoolean testIO (const CORE_Run &runner, const std::map< tString, tString > &options) const
 test IO class More...
 
tBoolean testChrono (const CORE_Run &runner, const std::map< tString, tString > &options) const
 test Chrono class More...
 
tBoolean testMemorySize (const CORE_Run &runner, const std::map< tString, tString > &options)
 test memory size More...
 
tBoolean testStringsList (const CORE_Run &runner, const std::map< tString, tString > &options) const
 test the string array More...
 
tBoolean testLoops (const CORE_Run &runner, const std::map< tString, tString > &options) const
 test the string array More...
 
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

tString mName
 
std::weak_ptr< CORE_ObjectmThis
 

Static Private Attributes

static const tFlag ALL_TESTS =0
 
static const tFlag PRIMARY_TESTS =1
 
static const tFlag ELEMENTARY_TESTS =2
 
static const tFlag CASE_TESTS =3
 

Constructor & Destructor Documentation

◆ SM_Test()

SM_Test::SM_Test ( void  )

create the class

◆ ~SM_Test()

SM_Test::~SM_Test ( void  )
virtual

destroy the class

Member Function Documentation

◆ caseTests()

tBoolean SM_Test::caseTests ( const CORE_Run runner,
const std::map< tString, tString > &  options 
) const
overrideprotectedvirtual

execute the case tests

Parameters
[in]runnerrunner of the program
[in]optionsoptions of the program
Returns
false if the tests have failed

Reimplemented from CORE_Test.

References tBoolean.

◆ compareResults()

tBoolean CORE_Test::compareResults ( const std::map< tString, tString > &  options,
const tString resultFile,
const tString referenceFile,
const tReal eps 
) const
protectedvirtualinherited

make the difference between the two files

Parameters
[in]optionsoptons of the program
[in]resultFileresult file generated by the program
[in]referenceFilereference file
[in]epstolerated error
Returns
true if the difference between two file are les than eps

Referenced by CORE_Test::testCase().

Here is the caller graph for this function:

◆ DisableMemoryStack()

static void CORE_Object::DisableMemoryStack ( )
inlinestaticinherited

disable the memory stack

Referenced by CORE_Object::EnableMemoryStack().

Here is the caller graph for this function:

◆ elementaryTests()

tBoolean SM_Test::elementaryTests ( const CORE_Run runner,
const std::map< tString, tString > &  options 
) const
overrideprotectedvirtual

execute the elementary tests

Parameters
[in]runnerrunner of the program
[in]optionsoptions of the program
Returns
false if the tests have failed

Reimplemented from CORE_Test.

References grid3DParticlesTestCase(), linedParticlesTestCase(), CORE_Run::Out(), CORE_Out::printError(), tBoolean, testVirtualMethods(), tIndex, and tString.

Here is the call graph for this function:

◆ EnableMemoryStack() [1/2]

static void CORE_Object::EnableMemoryStack ( )
inlinestaticinherited

enable the memory stack

Referenced by CORE_Object::EnableMemoryStack(), and CORE_Run::SetDebugOptions().

Here is the caller graph for this function:

◆ EnableMemoryStack() [2/2]

static tBoolean CORE_Object::EnableMemoryStack ( const tBoolean isMemoryChecked)
inlinestaticinherited

enable the memory stack

Parameters
[in]isMemoryChecked: true to verify memory allocation of CORE_Object classes
Returns
true if the memroy is checked

References CORE_Object::DisableMemoryStack(), CORE_Object::EnableMemoryStack(), and CORE_Object::IsMemoryStackEnabled().

Here is the call graph for this function:

◆ Equals() [1/2]

template<typename T , typename Q >
requires core_functions::isRealType<T> static core_functions::isRealType<Q> tBoolean CORE_Test::Equals ( const T &  a,
const Q &  b 
)
inlinestaticprotectedinherited

retrun true if the two values are equals

Parameters
[in]a: argument to compare
[in]b: argument to compare
Returns
true if a==b

Referenced by CORE_Test::testArray(), and CORE_Test::testField().

Here is the caller graph for this function:

◆ Equals() [2/2]

template<typename T , typename Q >
requires core_functions::isIntegerType<T>&& static core_functions::isIntegerType<Q> tBoolean CORE_Test::Equals ( const T &  a,
const Q &  b 
)
inlinestaticprotectedinherited

◆ execute()

tBoolean CORE_Test::execute ( const CORE_Run runner,
const std::map< tString, tString > &  options 
) const
virtualinherited

execute the tests

Parameters
[in]runnerthe runner of the tests
[in]optionsthe options of the program

References CORE_Test::ALL_TESTS, CORE_Test::CASE_TESTS, CORE_Test::caseTests(), CORE_Test::ELEMENTARY_TESTS, CORE_Test::elementaryTests(), CORE_Run::Out(), CORE_Test::PRIMARY_TESTS, CORE_Test::primaryTests(), tBoolean, CORE_Test::testCase(), tFlag, and tString.

Referenced by CORE_Run::makeTests(), and SM_Run::makeTests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getClassName()

tString CORE_Object::getClassName ( ) const
inlineinherited

return the name of the class

Returns
the string name of the class

Referenced by CORE_Object::getIdentityString(), and CORE_Test::testTypes().

Here is the caller graph for this function:

◆ getConstSharedPointer()

template<class T >
std::shared_ptr<const T> CORE_Object::getConstSharedPointer ( ) const
inlineinherited

return a const shared pointer for this

Returns
the shared pointer as a type T

References CORE_Object::mThis.

◆ getContentsMemorySize()

virtual tMemSize CORE_Object::getContentsMemorySize ( ) const
inlinevirtualinherited

return nthe 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 in CORE_VectorList< T, I >, CORE_VectorList< tString, CORE_StringsList >, CORE_ValArray< T, I >, CORE_ValArray< T, CORE_StdValArray< T > >, CORE_Run, CORE_PtrArray< T, I >, CORE_PtrArray< T, CORE_StdPtrArray< T > >, CORE_Field< T, K, D, S, I >, CORE_Field< T, K, D, CORE_StdPtrArray< T >, CORE_StdPtrField< T, K, D > >, CORE_Field< T, K, D, CORE_StdValArray< T >, CORE_StdValField< T, K, D > >, CORE_ClassFactory, SMS_STDUniformFunction, SMS_STDNormalFunction, SMS_BoostUniformFunction, SMS_BoostNormalFunction, SM_ZeemanOperator, SM_XDMF, SM_VTK, SM_System, SM_Output, SM_Operator, SM_Network, SM_DemagnetizedOperator, SM_Beam, CORE_StringsList, and CORE_Out.

Referenced by CORE_Out::getContentsMemorySize(), SM_Beam::getContentsMemorySize(), SM_Network::getContentsMemorySize(), SM_Operator::getContentsMemorySize(), SM_Output::getContentsMemorySize(), SM_System::getContentsMemorySize(), SM_VTK::getContentsMemorySize(), SMS_BoostNormalFunction::getContentsMemorySize(), SMS_BoostUniformFunction::getContentsMemorySize(), SMS_STDNormalFunction::getContentsMemorySize(), SMS_STDUniformFunction::getContentsMemorySize(), CORE_ClassFactory::getContentsMemorySize(), CORE_PtrArray< T, I >::getContentsMemorySize(), CORE_ValArray< T, I >::getContentsMemorySize(), CORE_VectorList< T, I >::getContentsMemorySize(), CORE_Object::getMemorySize(), SM_ConstantNoiseRateFunction::getMemorySize(), SM_InverseNoiseRateFunction::getMemorySize(), SM_LandauLifschitzFunction::getMemorySize(), SM_NoiseRateFunction::getMemorySize(), SM_Object::getMemorySize(), SM_StochasticFunction::getMemorySize(), SM_TemplatedNoiseRateFunction< DerivedClass >::getMemorySize(), SM_TimeStepper::getMemorySize(), SMS_BoostRandomFunction::getMemorySize(), CORE_Array< T, I >::getMemorySize(), CORE_Chrono::getMemorySize(), CORE_Collection< T, I >::getMemorySize(), CORE_IO::getMemorySize(), CORE_List< T, K, I >::getMemorySize(), CORE_OptionsReader::getMemorySize(), CORE_OutputFile::getMemorySize(), and CORE_Test::getMemorySize().

Here is the caller graph for this function:

◆ getIdentityString()

tString CORE_Object::getIdentityString ( ) const
inlineinherited

retrun the string identification of the class

Returns
the string identity 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().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMemorySize()

virtual tMemSize CORE_Test::getMemorySize ( ) const
inlineoverridevirtualinherited

return the memory size of the class

Returns
the memory size of the class in bytes 1 octet = 1 byte 1 Ko = 1024 bytes 1 Mo = 1024 Ko 1 Go = 1024 Mo

Reimplemented from CORE_Object.

References CORE_Object::getContentsMemorySize().

Here is the call graph for this function:

◆ getName()

const tString& CORE_Test::getName ( ) const
inlineinherited

get the test name

Returns
name of the test

References CORE_Test::mName.

◆ getPointerString()

tString CORE_Object::getPointerString ( ) const
inlineinherited

retrun the pointer of the class as a string

Returns
the pointer of the calss as a string

References core_functions::pointerToString().

Here is the call graph for this function:

◆ GetRegisteredClassesNumber()

static tIndex CORE_Object::GetRegisteredClassesNumber ( )
inlinestaticinherited

get the memory stack in string

Returns
the string representation of the memory stack

◆ getSearchingPaths() [1/2]

void CORE_Test::getSearchingPaths ( const tString packageName,
const tUSInt nLevels,
const std::vector< tString > &  localPaths,
std::vector< tString > &  vpaths 
) const
protectedinherited

get the test path locations

Parameters
[in]packageName: package name
[in]nLevels: the levels number
[in]localPaths: the local paths for test
[out]vpaths: the return path location

References tString, and tUSInt.

◆ getSearchingPaths() [2/2]

virtual void SM_Test::getSearchingPaths ( std::vector< tString > &  vpaths) const
inlineoverrideprotectedvirtual

get the test path locations

Parameters
[out]vpaths: the return path location s

Reimplemented from CORE_Test.

References CORE_Test::getSearchingPaths().

Referenced by grid3DParticlesTestCase(), and linedParticlesTestCase().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSearchingPathsToString()

tString CORE_Test::getSearchingPathsToString ( ) const
protectedinherited

get the test path locations into string

Returns
all the sarching path in string

References CORE_Test::getSearchingPaths().

Referenced by CORE_Test::testCase(), and CORE_Test::testIO().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSharedPointer()

template<class T >
std::shared_ptr<T> CORE_Object::getSharedPointer ( )
inlineinherited

return the shared pointer for this

Returns
the shared pointer as a type T

References CORE_Object::mThis.

◆ grid3DParticlesTestCase()

tBoolean SM_Test::grid3DParticlesTestCase ( const CORE_Run runner,
const tIndex Nx,
const tIndex Ny,
const tIndex Nz,
const tReal J,
const tBoolean hasSelfInteraction,
const tString systemName,
const tString noiseName 
) const
private

test Nx x Ny x Nz particles on a 3D-grid with system & noise function

Parameters
[in]runnerrunner of the program
[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]J: constant heissengerg coefficient
[in]hasSelfInteraction: true to interact a particle with itself
[in]systemName: name of the system
[in]noiseName: name of the noise

References SM_System::addOperator(), CORE_Chrono::ConvertDuration(), SM_Network::create3DGrid(), SM_Beam::discretize(), SM_Output::generateOutput(), CORE_Run::GetClassFactory(), SM_Network::getDimension(), SM_System::getLandauLifschitzFunction(), SM_System::getNetwork(), SM_Network::getParticlesNumber(), getSearchingPaths(), SM_Beam::getSystem(), SM_System::getTimeStepper(), CORE_ClassFactory::NewUniqueInstance(), CORE_Run::Out(), SM_Beam::runSimulations(), CORE_Test::searchPath(), SM_LandauLifschitzFunction::setAlpha(), SM_Beam::setBeamSize(), SM_LandauLifschitzFunction::setBeta(), SM_System::setInitialMagneticMoment(), SM_Beam::setIsTemplatedSimulateVersion(), SM_System::setNoiseRateFunction(), SM_Output::setOutputPath(), SM_Output::setPrefix(), SM_Output::setSimulations(), SM_Beam::setStochasticFunction(), SM_Beam::setSystem(), SM_TimeStepper::setTargetTime(), SM_TimeStepper::setTimeStep(), CORE_Chrono::start(), CORE_Chrono::stop(), tBoolean, tIndex, tReal, tString, tUInt, and validate().

Referenced by elementaryTests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isInstanceOf()

template<class T >
tBoolean CORE_Object::isInstanceOf ( ) const
inlineinherited

test if the clas T is an instance of this class

Returns
true if the object is an instance of T

Referenced by SM_Beam::templatedSimulate().

Here is the caller graph for this function:

◆ IsMemoryStackEnabled()

static tBoolean CORE_Object::IsMemoryStackEnabled ( )
inlinestaticinherited

return trur if the memory stack is enabled

Referenced by CORE_Object::EnableMemoryStack(), and main().

Here is the caller graph for this function:

◆ linedParticlesTestCase()

tBoolean SM_Test::linedParticlesTestCase ( const CORE_Run runner,
const std::array< tReal, 3 > &  Mu0,
const tBoolean hasZeeman,
const tReal J,
const tBoolean hasSelfInteraction,
const tIndex n,
const tReal h,
const tString system,
const tString noise,
const tReal T,
const tReal dt 
) const
private

test n particles on a 3D- line with system & noise function

Parameters
[in]runnerrunner of the program
[in]Mu0: initial magnetic moment
[in]hasZeeman: true if there is an external magnetic field
[in]J: exchange factor
[in]hasSelfInteraction: true to interact a particle with itself
[in]n: number of particles
[in]h: distance between 2 particles
[in]system: name of the system
[in]noise: name of the noise
[in]T: target time
[in]dt: time step

References SM_System::addOperator(), CORE_Chrono::ConvertDuration(), SM_Network::create3DGrid(), SM_Beam::discretize(), SM_Output::generateOutput(), CORE_Run::GetClassFactory(), SM_System::getLandauLifschitzFunction(), SM_System::getNetwork(), getSearchingPaths(), SM_Beam::getSystem(), SM_System::getTimeStepper(), SMS_BoostUniformFunction::initializeSeed(), CORE_ClassFactory::NewUniqueInstance(), CORE_Run::Out(), SM_Beam::runSimulations(), CORE_Test::searchPath(), SM_LandauLifschitzFunction::setAlpha(), SM_Beam::setBeamSize(), SM_LandauLifschitzFunction::setBeta(), SM_ConstantZeemanOperator::setBext(), SM_System::setInitialMagneticMoment(), SM_Beam::setIsTemplatedSimulateVersion(), SM_System::setNoiseRateFunction(), SM_Output::setOutputPath(), SM_Output::setPrefix(), SM_Output::setSimulations(), SM_Beam::setStochasticFunction(), SMS_BoostUniformFunction::setSupport(), SM_Beam::setSystem(), SM_TimeStepper::setTargetTime(), SM_TimeStepper::setTimeStep(), CORE_Chrono::start(), CORE_Chrono::stop(), tBoolean, SMS_BoostUniformFunction::templatedRandom(), tIndex, tReal, tString, tUInt, and validate().

Referenced by elementaryTests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MemoryStackToString()

static tString CORE_Object::MemoryStackToString ( )
inlinestaticinherited

get the memory stack in string

Returns
the string representation of the memory stack

Referenced by main().

Here is the caller graph for this function:

◆ New()

static CORE_UniquePointer<CORE_Test> CORE_Test::New ( )
inlinestaticinherited

create a test class @retrun a new instance of the class

References CORE_Test::CORE_Test().

Here is the call graph for this function:

◆ primaryTests()

tBoolean SM_Test::primaryTests ( const CORE_Run runner,
const std::map< tString, tString > &  options 
) const
overrideprotectedvirtual

execute the primary tests

Parameters
[in]runnerrunner of the program
[in]optionsoptions of the program
Returns
false if the tests have failed

Reimplemented from CORE_Test.

References CORE_Run::Out(), CORE_Out::printError(), tBoolean, testField(), testNormalLaw(), testOperators(), and tString.

Here is the call graph for this function:

◆ searchPath()

tString CORE_Test::searchPath ( const tString f) const
protectedinherited

retun the path where the file f is withing the searching paths list

Parameters
[in]f: file to search
Returns
the path form the current exceutable file where the file f is

References CORE_Test::getSearchingPaths().

Referenced by grid3DParticlesTestCase(), linedParticlesTestCase(), CORE_Test::testCase(), and CORE_Test::testIO().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setName()

void CORE_Test::setName ( const tString name)
inlineinherited

set the test name

Parameters
[in]namename of the test

References CORE_Test::mName.

◆ setThis()

template<class T >
std::shared_ptr<T> CORE_Object::setThis ( std::unique_ptr< T, CORE_Object::Delete > &  up)
inlineprivateinherited

set the shared pointer from an unique pointer

Parameters
[in,out]upunique pointer of the class at input, points to null pointer at output
Returns
the shared pointer of the class

Method only calledby the friend class CORE_ClassFactory::NewSharedInstance()

References CORE_Object::mThis.

◆ testArray() [1/3]

tBoolean CORE_Test::testArray ( const CORE_Run runner,
const std::map< tString, tString > &  options 
) const
protectedinherited

test the numeric array

Parameters
[in]runnerthe runner of the tests
[in]optionsthe options of the program

References tBoolean.

Referenced by CORE_Test::primaryTests().

Here is the caller graph for this function:

◆ testArray() [2/3]

template<typename Q , class I >
requires core_functions::isArithmeticType<Q> tBoolean CORE_Test::testArray ( CORE_Array< Q, I > &  A) const
protectedinherited

◆ testArray() [3/3]

template<typename T , class I >
requires core_functions::isArithmeticType<T> tBoolean CORE_Test::testArray ( CORE_Array< T, I > &  A) const
inherited

◆ testCase()

tBoolean CORE_Test::testCase ( const CORE_Run runner,
const tString name 
) const
protectedinherited

execute the test case

Parameters
[in]runner: runner of the test
[in]namename of the case which must correspond the same local path
Returns
true if the tests have succeeded
  • reads the options file 'options.txt' within the local test case path with name 'name'
  • the current path becomes the path where the options file is
  • executes the program. If it fails return false
  • reads the tolerance error in 'eps' key value within options
  • reads the output path from 'output-path' key value within options
  • reads the reference path from 'reference-path' key value within options
  • reads the output file 'output-file' key value within options
  • reads the prefix from 'prefix' key value within options
  • make the difference betwen the result file and the refence file

References CORE_Test::compareResults(), CORE_Test::getSearchingPathsToString(), CORE_Run::makeRun(), CORE_Run::Out(), CORE_OptionsReader::ReadOptions(), CORE_OptionsReader::ReadPath(), CORE_Test::searchPath(), CORE_Run::SetDebugOptions(), CORE_Run::SetOutputOptions(), tBoolean, tReal, and tString.

Referenced by CORE_Test::execute().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ testChrono()

tBoolean CORE_Test::testChrono ( const CORE_Run runner,
const std::map< tString, tString > &  options 
) const
privateinherited

test Chrono class

Parameters
[in]runnerthe runner of the tests
[in]optionsthe options of the program
Returns
true if the tests have succeeded

References CORE_Chrono::ConvertDuration(), CORE_Chrono::start(), CORE_Chrono::stop(), tIndex, tReal, tUInt, tUSInt, and CORE_StdValArray< T >::UniformRandomize().

Referenced by CORE_Test::primaryTests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ testDerivative()

tBoolean SM_Test::testDerivative ( const tIndex i,
const tDimension d,
const SM_Network network,
SM_RealField Mu,
const SM_Operator op,
SM_RealField H 
) const
private

test derivative of the operator at particle i in the direction d on the network at Mu

Parameters
[in]i: index of the point
[in]d: direction of derivation
[in]network: network of particles
[in,out]Mu: magnetic moment
[in]op: operator to test
[out]H: magnetic field
Returns
true if the derivative is ok by comparison with the taylor expansion of order 2.

References SM_Operator::computeEnergy(), SM_Operator::computeMagneticFieldAndEnergy(), core_functions::isNAN(), CORE_Run::Out(), tBoolean, and tReal.

Referenced by testEnergyOperatorsDerivatives().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ testEnergyOperatorsDerivatives()

tBoolean SM_Test::testEnergyOperatorsDerivatives ( SM_Beam beam,
const tIndex Nx,
const tIndex Ny,
const tIndex Nz 
) const
private

test the Energy & H relations with the formulat dE/dmu=_H on a grid of size Nx x Ny x Nz

Parameters
[in,out]beam: the beam to test
[in]Nx: the number of particle along x
[in]Ny: the number of particle along y
[in]Nz: the number of particle along z

References SM_Network::create3DGrid(), SM_Beam::discretize(), SM_Network::getDimension(), SM_System::getNetwork(), SM_System::getOperator(), SM_Network::getParticlesNumber(), SM_Beam::getSystem(), CORE_Run::Out(), CORE_Field< T, K, D, S, I >::setElementsNumber(), SM_System::setInitialMagneticMoment(), tBoolean, testDerivative(), tIndex, and tReal.

Referenced by testOperators().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ testField() [1/3]

tBoolean SM_Test::testField ( const CORE_Run runner,
const std::map< tString, tString > &  options 
) const
private

test the field

Parameters
[in]runnerrunner of the program
[in]optionsoptions of the program
Returns
false if the test has failed

References CORE_Field< T, K, D, S, I >::setElementsNumber(), tBoolean, tIndex, and tUSInt.

Referenced by primaryTests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ testField() [2/3]

template<typename Q , typename K , K D, class S , class I >
tBoolean CORE_Test::testField ( CORE_Field< Q, K, D, S, I > &  A) const
protectedinherited

◆ testField() [3/3]

template<typename T , typename K , K D, class S , class I >
tBoolean CORE_Test::testField ( CORE_Field< T, K, D, S, I > &  A) const
inherited

◆ testIO()

tBoolean CORE_Test::testIO ( const CORE_Run runner,
const std::map< tString, tString > &  options 
) const
privateinherited

test IO class

Parameters
[in]runnerthe runner of the tests
[in]optionsthe options of the program
Returns
true if the tests have succeeded

References CORE_IO::CreatePath(), CORE_IO::GetBaseName(), CORE_IO::GetExtension(), CORE_IO::GetFiles(), CORE_IO::GetPath(), CORE_IO::GetPaths(), CORE_Test::getSearchingPathsToString(), CORE_Run::Out(), CORE_IO::RemovePath(), CORE_Test::searchPath(), tBoolean, and tString.

Referenced by CORE_Test::primaryTests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ testLoops()

tBoolean CORE_Test::testLoops ( const CORE_Run runner,
const std::map< tString, tString > &  options 
) const
privateinherited

test the string array

Parameters
[in]runnerthe runner of the tests
[in]optionsthe options of the program

References CORE_Chrono::ConvertDuration(), CORE_Chrono::start(), CORE_Chrono::stop(), tIndex, tReal, tULLInt, and CORE_StdValArray< T >::UniformRandomize().

Referenced by CORE_Test::primaryTests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ testMemorySize()

tBoolean CORE_Test::testMemorySize ( const CORE_Run runner,
const std::map< tString, tString > &  options 
)
privateinherited

test memory size

Parameters
[in]runnerthe runner of the tests
[in]optionsthe options of the program

References CORE_Object::CORE_Object(), CORE_Run::Out(), tFlag, tString, and tUCInt.

Here is the call graph for this function:

◆ testNormalLaw()

tBoolean SM_Test::testNormalLaw ( const CORE_Run runner,
const std::map< tString, tString > &  options 
) const
private

test the normal law

Parameters
[in]runnerrunner of the program
[in]optionsoptions of the program
Returns
false if the test has failed

References CORE_Chrono::ConvertDuration(), SMS_STDNormalFunction::initializeSeed(), CORE_Run::Out(), SMS_STDNormalFunction::random(), CORE_Chrono::start(), CORE_Chrono::stop(), tBoolean, SMS_STDNormalFunction::templatedRandom(), tIndex, tReal, and tUInt.

Referenced by primaryTests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ testOperators()

tBoolean SM_Test::testOperators ( const CORE_Run runner,
const std::map< tString, tString > &  options 
) const
private

◆ testStringsList()

tBoolean CORE_Test::testStringsList ( const CORE_Run runner,
const std::map< tString, tString > &  options 
) const
privateinherited

test the string array

Parameters
[in]runnerthe runner of the tests
[in]optionsthe options of the program

References CORE_VectorList< T, I >::getSize(), CORE_List< T, K, I >::sort(), tBoolean, and tIndex.

Referenced by CORE_Test::primaryTests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ testTypes()

tBoolean CORE_Test::testTypes ( const CORE_Run runner,
const std::map< tString, tString > &  options 
) const
privateinherited

test type

Parameters
[in]runnerthe runner of the tests
[in]optionsthe options of the program
Returns
true if the tests have succeeded

References CORE_Object::getClassName(), CORE_Object::getIdentityString(), CORE_Run::Is32Architecture(), CORE_Run::Is64Architecture(), core_functions::max(), core_functions::min(), CORE_Run::Out(), tBoolean, tChar, tComplex, tDouble, tFlag, tFloat, tIndex, tInt, tInteger, tLDouble, tLInt, tLLInt, tMemSize, tReal, tRelativeIndex, tRelativeInteger, tSInt, tString, tUChar, tUInt, tULInt, tULLInt, and tUSInt.

Referenced by CORE_Test::primaryTests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ testVirtualMethods()

tBoolean SM_Test::testVirtualMethods ( const CORE_Run runner,
const std::map< tString, tString > &  options 
) const
private

test the efficiency of the templated method vs virtual method

Parameters
[in]runner: the main caller of the program
[in]optionsoptions of the program
Returns
false if the test has failed

References SM_InverseNoiseRateFunction::computeFunction(), SM_InverseNoiseRateFunction::computeTemplatedFunction(), CORE_Chrono::ConvertDuration(), SM_Network::create3DGrid(), CORE_Run::Out(), CORE_Field< T, K, D, S, I >::setElementsNumber(), CORE_Chrono::start(), CORE_Chrono::stop(), tBoolean, tIndex, tReal, and tUInt.

Referenced by elementaryTests().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ toString()

virtual tString CORE_Object::toString ( ) const
inlinevirtualinherited

◆ uniformRandomTest()

template<typename T , class I >
tBoolean CORE_Test::uniformRandomTest ( CORE_Array< T, I > &  A,
CORE_Array< T, I > &  B 
) const
protectedinherited

randomizer test

Parameters
[out]A: first array for testing
[out]B: second array for testing

References CORE_Chrono::ConvertDuration(), CORE_Collection< T, I >::setSize(), CORE_Chrono::start(), CORE_Chrono::stop(), CORE_Array< T, I >::sum(), tBoolean, tIndex, CORE_Array< T, I >::transform(), tReal, tULLInt, and CORE_Array< T, I >::uniformRandomize().

Here is the call graph for this function:

◆ validate()

tBoolean SM_Test::validate ( const CORE_Run runner,
const tString path,
const tString prefix,
const SM_Beam beam,
const tIndex s 
) const
private

validate the s-trajectory of the beam simulations

Parameters
[in]runnerrunner of the program
[in]pathpath of the generated files
[in]prefixprefix of the generated files
[in]beam: data of the simulations
[in]s: simulation index to validate
Returns
true if the validation succeeded

References core_functions::booleanToString(), SM_Network::getDimension(), CORE_Field< T, K, D, S, I >::getElementsNumber(), SM_Beam::getMagneticMoment(), SM_TimeStepper::getMaximumTimeStepsNumber(), SM_System::getNetwork(), SM_Network::getParticlesNumber(), SM_Beam::getSystem(), SM_TimeStepper::getTimeStep(), SM_System::getTimeStepper(), core_functions::isNAN(), SM_Output::LoadMagneticMomentField(), CORE_Run::Out(), SM_Output::SaveMagneticMomentField(), tBoolean, tIndex, tInteger, tReal, and tString.

Referenced by grid3DParticlesTestCase(), and linedParticlesTestCase().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ ALL_TESTS

const tFlag CORE_Test::ALL_TESTS =0
staticprivateinherited

Referenced by CORE_Test::execute().

◆ CASE_TESTS

const tFlag CORE_Test::CASE_TESTS =3
staticprivateinherited

Referenced by CORE_Test::execute().

◆ ELEMENTARY_TESTS

const tFlag CORE_Test::ELEMENTARY_TESTS =2
staticprivateinherited

Referenced by CORE_Test::execute().

◆ mName

tString CORE_Test::mName
privateinherited

◆ mThis

std::weak_ptr<CORE_Object> CORE_Object::mThis
privateinherited

◆ PRIMARY_TESTS

const tFlag CORE_Test::PRIMARY_TESTS =1
staticprivateinherited

Referenced by CORE_Test::execute().


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