C++ mpi module for stochmagnet_main Package
Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
SM_VTK< VTK_Impl > Class Template Reference

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

#include <SM_VTK.h>

Inheritance diagram for SM_VTK< VTK_Impl >:
Inheritance graph
[legend]
Collaboration diagram for SM_VTK< VTK_Impl >:
Collaboration graph
[legend]

Public Member Functions

 SM_VTK (void)
 create
 
virtual ~SM_VTK (void)
 destroy
 
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 tString & getFileName () const
 get the file name without extension More...
 
void setFields (const tUCInt &dim, const tFlag &support, const std::vector< tString > &names)
 initialize fields More...
 
const tBoolean & isFileOpened () const
 return true if the file is open
 
tBoolean save (const SM_Network &network, const tIndex &it, const tReal &time)
 save the system at time More...
 
tBoolean save (const SM_System &system, const tIndex &it, const tReal &time)
 save the system at time More...
 
tBoolean save (const tString &vtkFileName, const SM_Network &network, const tString &Sname, const tReal &alpha, SM_RealField &S)
 save the system at time More...
 
tBoolean save (const SM_Network &network, const tString &Sname, const tReal &alpha, const SM_RealField &S, const tIndex &it, const tReal &time)
 save the system at time More...
 
tBoolean open ()
 open the vtkfile More...
 
tBoolean open (const tIndex &t)
 open the vtk field for writing or appending at the time step More...
 
tBoolean writeGeometryHeader (const tIndex &t, const SM_Network &network)
 write the geometry header corresponding to the network More...
 
tBoolean writeGeometryData (const tIndex &t, const SM_Network &network)
 write the geometry data of the network More...
 
tBoolean writeContentHeader (const tIndex &t, const tFlag &support, const std::vector< tString > &scalarNames, const std::vector< tString > &vectorNames)
 write a content header More...
 
tBoolean writeContentData (const tReal &t, const SM_Network &network, const tFlag &support, const tString &name, const tReal &alpha, const tReal *f)
 write a content data More...
 
tBoolean writeContentFooter (const tIndex &t, const tFlag &support)
 write a content footer More...
 
tBoolean writeGeometryFooter (const tIndex &t)
 write the geometry footer More...
 
tBoolean close (const tIndex &t)
 close the file for the time step t More...
 
tBoolean close ()
 close the file 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 Attributes

static const tFlag CELL =0
 cell tag
 
static const tFlag POINT =1
 point tag
 

Protected Member Functions

void setIsFileOpened (const tBoolean &v)
 set true is the file is opened
 
- 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 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...
 

Detailed Description

template<class VTK_Impl>
class SM_VTK< VTK_Impl >

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

Author
Stephane Despreaux
Version
1.0

Member Function Documentation

◆ close() [1/2]

template<class VTK_Impl >
tBoolean SM_VTK< VTK_Impl >::close ( )
inline

close the file

Returns
true if the footer writting has succceeded false otherwise

◆ close() [2/2]

template<class VTK_Impl >
tBoolean SM_VTK< VTK_Impl >::close ( const tIndex &  t)
inline

close the file for the time step t

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

◆ getContentsMemorySize()

template<class VTK_Impl >
virtual tMemSize SM_VTK< VTK_Impl >::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.

◆ getFileName()

template<class VTK_Impl >
const tString& SM_VTK< VTK_Impl >::getFileName ( ) const
inline

get the file name without extension

Returns
the absolute file name without extension

◆ getMemorySize()

template<class VTK_Impl >
virtual tMemSize SM_VTK< VTK_Impl >::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.

◆ getVTKType() [1/2]

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

return the VTK type of the template Type

Template Parameters
T: C++ type to get the corresponding VTK type
Returns
the VTK type of templated type T in
  • Int8,16,32,64
  • UInt8,16,32,64
  • Float32,64

◆ getVTKType() [2/2]

template<class VTK_Impl >
tString SM_VTK< VTK_Impl >::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

◆ open() [1/2]

template<class VTK_Impl >
tBoolean SM_VTK< VTK_Impl >::open ( )
inline

open the vtkfile

Returns
true if the header writting has succceeded false otherwise

◆ open() [2/2]

template<class VTK_Impl >
tBoolean SM_VTK< VTK_Impl >::open ( const tIndex &  t)
inline

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

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

◆ save() [1/4]

template<class VTK_Impl >
tBoolean SM_VTK< VTK_Impl >::save ( const SM_Network network,
const tIndex &  it,
const tReal &  time 
)
inline

save the system at time

Parameters
[in]network: network to save
[in]it: index of time
[in]time: time

◆ save() [2/4]

template<class VTK_Impl >
tBoolean SM_VTK< VTK_Impl >::save ( const SM_Network network,
const tString &  Sname,
const tReal &  alpha,
const SM_RealField S,
const tIndex &  it,
const tReal &  time 
)
inline

save the system at time

Parameters
[in]network: network on with the S field is applied
[in]Snamename of the field
[in]alpha: multiplicator os S
[in]S: value of the S field
[in]it: index of time
[in]time: time value

◆ save() [3/4]

template<class VTK_Impl >
tBoolean SM_VTK< VTK_Impl >::save ( const SM_System system,
const tIndex &  it,
const tReal &  time 
)
inline

save the system at time

Parameters
[in]system: system to save
[in]it: index of time
[in]time: time

◆ save() [4/4]

template<class VTK_Impl >
tBoolean SM_VTK< VTK_Impl >::save ( const tString &  vtkFileName,
const SM_Network network,
const tString &  Sname,
const tReal &  alpha,
SM_RealField S 
)
inline

save the system at time

Parameters
[in]vtkFileNamename of the ctk
[in]networknetwork whe eS is computed
[in]Sname: name of field S
[in]alphafactro of S
[in]S: direction of magnetic moments

◆ setFields()

template<class VTK_Impl >
void SM_VTK< VTK_Impl >::setFields ( const tUCInt &  dim,
const tFlag &  support,
const std::vector< tString > &  names 
)
inline

initialize fields

Parameters
[in]dim: dimension of the field
[in]support: support of field in {CELL,POINT}
[in]namesnames of files

◆ setFileName()

template<class VTK_Impl >
void SM_VTK< VTK_Impl >::setFileName ( const tString &  fn)
inline

set the file name without extension

Parameters
fn: the absolute file name without extension

◆ writeContentData()

template<class VTK_Impl >
tBoolean SM_VTK< VTK_Impl >::writeContentData ( const tReal &  t,
const SM_Network network,
const tFlag &  support,
const tString &  name,
const tReal &  alpha,
const tReal *  f 
)
inline

write a content data

Parameters
[in]tthe time 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]alphafactor of f
[in]fthe field to write
Returns
true if the writing succeeds false otherwise

◆ writeContentFooter()

template<class VTK_Impl >
tBoolean SM_VTK< VTK_Impl >::writeContentFooter ( const tIndex &  t,
const tFlag &  support 
)
inline

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

◆ writeContentHeader()

template<class VTK_Impl >
tBoolean SM_VTK< VTK_Impl >::writeContentHeader ( const tIndex &  t,
const tFlag &  support,
const std::vector< tString > &  scalarNames,
const std::vector< tString > &  vectorNames 
)
inline

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

◆ writeGeometryData()

template<class VTK_Impl >
tBoolean SM_VTK< VTK_Impl >::writeGeometryData ( const tIndex &  t,
const SM_Network network 
)
inline

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

◆ writeGeometryFooter()

template<class VTK_Impl >
tBoolean SM_VTK< VTK_Impl >::writeGeometryFooter ( const tIndex &  t)
inline

write the geometry footer

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

◆ writeGeometryHeader()

template<class VTK_Impl >
tBoolean SM_VTK< VTK_Impl >::writeGeometryHeader ( const tIndex &  t,
const SM_Network network 
)
inline

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

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