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

This class is a beam output interface for VTK / Paraview software. More...

#include <SM_VTK.h>

Inheritance diagram for SM_VTK:
Inheritance graph
[legend]
Collaboration diagram for SM_VTK:
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...
 
template<class T >
tString getVTKType () const
 return the VTK type of the template Type More...
 
tString getVTKType (const tString &typeName) const
 return the VTK type of tthe type name More...
 
void setFileName (const tString &fn)
 set the file name without extension More...
 
const tStringgetFileName () const
 get the file name without extension More...
 
virtual tBoolean save (const SM_Beam &beam, const tIndex &s)
 save the s-th trajectory of the beam More...
 
virtual tBoolean open ()=0
 open the vtkfile More...
 
virtual tBoolean open (const tIndex &t)=0
 open the vtk field for writing or appending at the time step More...
 
virtual tBoolean writeGeometryHeader (const tIndex &t, const SM_Network &network)=0
 write the geometry header corresponding to the network More...
 
virtual tBoolean writeGeometryData (const tIndex &t, const SM_Network &network)=0
 write the geometry data of the network More...
 
virtual tBoolean writeContentHeader (const tIndex &t, const tFlag &support, const std::vector< tString > &scalarNames, const std::vector< tString > &vectorNames)=0
 write a content header More...
 
virtual tBoolean writeContentData (const tIndex &t, const SM_Network &network, const tFlag &support, const tString &name, const tReal *f)=0
 write a content data More...
 
virtual tBoolean writeContentFooter (const tIndex &t, const tFlag &support)=0
 write a content footer More...
 
virtual tBoolean writeGeometryFooter (const tIndex &t)=0
 write the geometry footer More...
 
virtual tBoolean close (const tIndex &t)=0
 close the file for the time step t More...
 
virtual tBoolean close ()=0
 close the file 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...
 
virtual tString toString () const
 return the string representation of the object node More...
 

Static Public Member Functions

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...
 

Static Public Attributes

static const tFlag CELL =0
 
static const tFlag POINT =1
 

Protected Member Functions

 SM_VTK (void)
 create More...
 
virtual ~SM_VTK (void)
 destroy 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

tString mFileName
 
std::weak_ptr< CORE_ObjectmThis
 

Detailed Description

This class is a beam output interface for VTK / Paraview software.

Author
Stephane Desprsaux
Version
1.0

Constructor & Destructor Documentation

◆ SM_VTK()

SM_VTK::SM_VTK ( void  )
protected

create

◆ ~SM_VTK()

SM_VTK::~SM_VTK ( void  )
protectedvirtual

destroy

Member Function Documentation

◆ close() [1/2]

virtual tBoolean SM_VTK::close ( )
pure virtual

close the file

Returns
true if the footer writting has succceeded false otherwise

Implemented in SM_XDMF.

Referenced by save().

Here is the caller graph for this function:

◆ close() [2/2]

virtual tBoolean SM_VTK::close ( const tIndex t)
pure virtual

close the file for the time step t

Parameters
[in]tthe time step number
Returns
true if the header writting has succceeded false otherwise

Implemented in SM_XDMF.

◆ DisableMemoryStack()

static void CORE_Object::DisableMemoryStack ( )
inlinestaticinherited

disable the memory stack

Referenced by CORE_Object::EnableMemoryStack().

Here is the caller 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:

◆ 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 SM_VTK::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 CORE_Object.

Reimplemented in SM_XDMF.

References CORE_Object::getContentsMemorySize(), mFileName, and tMemSize.

Referenced by SM_XDMF::getContentsMemorySize(), and getMemorySize().

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

◆ getFileName()

const tString& SM_VTK::getFileName ( ) const
inline

get the file name without extension

Returns
the absolute file name without extension

References mFileName.

Referenced by SM_XDMF::open().

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 SM_VTK::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_Object.

Reimplemented in SM_XDMF.

References getContentsMemorySize().

Here is the call graph for this function:

◆ 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

◆ 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.

◆ getVTKType() [1/2]

template<class T >
tString SM_VTK::getVTKType ( ) const
inline

return the VTK type of the template Type

Returns
the VTK type of templated type T in
  • Int8,16,32,64
  • UInt8,16,32,64
  • Float32,64

◆ getVTKType() [2/2]

tString SM_VTK::getVTKType ( const tString typeName) const

return the VTK type of tthe type name

return the VTK type of the template Type

Parameters
[in]typeNamethe name of the type:
  • unsigned char
  • unsigned short
  • unsigned int
  • unsigned long
  • unsigned long long
  • float
  • double
  • long double
Returns
the VTK string type in
  • Int8,16,32,64
  • UInt8,16,32,64
  • Float32,64

References CORE_Run::Is64Architecture(), and tString.

Here is the call 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:

◆ 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:

◆ open() [1/2]

virtual tBoolean SM_VTK::open ( )
pure virtual

open the vtkfile

Returns
true if the header writting has succceeded false otherwise

Implemented in SM_XDMF.

Referenced by save().

Here is the caller graph for this function:

◆ open() [2/2]

virtual tBoolean SM_VTK::open ( const tIndex t)
pure virtual

open the vtk field for writing or appending at the time step

Parameters
[in]tthe time step
Returns
true if the header writting has succceeded false otherwise

Implemented in SM_XDMF.

◆ save()

tBoolean SM_VTK::save ( const SM_Beam beam,
const tIndex s 
)
virtual

save the s-th trajectory of the beam

Parameters
[in]beam: the beam to save in VTK file
[in]sindex of the trajectory
Returns
true of the saving has succeeded

References CELL, close(), SM_Network::getDimension(), SM_Beam::getMagneticMoment(), SM_TimeStepper::getMaximumTimeStepsNumber(), SM_System::getNetwork(), SM_Network::getParticlesNumber(), SM_Beam::getSystem(), SM_System::getTimeStepper(), open(), POINT, tBoolean, tIndex, tReal, writeContentData(), writeContentFooter(), writeContentHeader(), writeGeometryData(), writeGeometryFooter(), and writeGeometryHeader().

Here is the call graph for this function:

◆ setFileName()

void SM_VTK::setFileName ( const tString fn)
inline

set the file name without extension

Parameters
fn: the absolute file name without extension

References mFileName.

◆ 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.

◆ toString()

virtual tString CORE_Object::toString ( ) const
inlinevirtualinherited

◆ writeContentData()

virtual tBoolean SM_VTK::writeContentData ( const tIndex t,
const SM_Network network,
const tFlag support,
const tString name,
const tReal f 
)
pure virtual

write a content data

Parameters
[in]tthe time step for the content data
[in]networkthe mesh of the field at t
[in]supporttype of support of the field in {SM_VTP::CELL,SM_VTP::POINT}
[in]namename of the field
[in]fthe field to write
Returns
true if the writing succeeds false otherwise

Implemented in SM_XDMF.

Referenced by save().

Here is the caller graph for this function:

◆ writeContentFooter()

virtual tBoolean SM_VTK::writeContentFooter ( const tIndex t,
const tFlag support 
)
pure virtual

write a content footer

Parameters
[in]tthe time step for the content header
[in]supporttype of support in {SM_VTP::CELL,SM_VTP::POINT}
Returns
true if the content footer writting has succceeded false otherwise

Implemented in SM_XDMF.

Referenced by save().

Here is the caller graph for this function:

◆ writeContentHeader()

virtual tBoolean SM_VTK::writeContentHeader ( const tIndex t,
const tFlag support,
const std::vector< tString > &  scalarNames,
const std::vector< tString > &  vectorNames 
)
pure virtual

write a content header

Parameters
[in]tthe time step for the content header
[in]supporttype of support in {SM_VTP::CELL,SM_VTP::POINT}
[in]scalarNamesthe names of the scalar field to save on support
[in]vectorNamesthe names of the vector field to save on support
Returns
true if the content header writting has succceeded false otherwise

Implemented in SM_XDMF.

Referenced by save().

Here is the caller graph for this function:

◆ writeGeometryData()

virtual tBoolean SM_VTK::writeGeometryData ( const tIndex t,
const SM_Network network 
)
pure virtual

write the geometry data of the network

Parameters
[in]tthe time step for the geometry data
[in]networkthe geometry data
Returns
true if the geometry data writting has succceeded false otherwise

Implemented in SM_XDMF.

Referenced by save().

Here is the caller graph for this function:

◆ writeGeometryFooter()

virtual tBoolean SM_VTK::writeGeometryFooter ( const tIndex t)
pure virtual

write the geometry footer

Parameters
[in]tthe time step for the geometry footer
Returns
true if the geometry footer writting has succceeded false otherwise

Implemented in SM_XDMF.

Referenced by save().

Here is the caller graph for this function:

◆ writeGeometryHeader()

virtual tBoolean SM_VTK::writeGeometryHeader ( const tIndex t,
const SM_Network network 
)
pure virtual

write the geometry header corresponding to the network

Parameters
[in]tthe time step for the geometry header
[in]networkthe network to take information for building the header
Returns
true if the geometry header writting has succceeded false otherwise

Implemented in SM_XDMF.

Referenced by save().

Here is the caller graph for this function:

Member Data Documentation

◆ CELL

const tFlag SM_VTK::CELL =0
static

Referenced by save(), and SM_XDMF::writeField().

◆ mFileName

tString SM_VTK::mFileName
private

◆ mThis

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

◆ POINT

const tFlag SM_VTK::POINT =1
static

Referenced by save().


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