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

This class is a beam interface output for XMF format for paraview visualization software. More...

#include <SM_XDMF.h>

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

Public Member Functions

 SM_XDMF (void)
 create
 
virtual ~SM_XDMF (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...
 
void setExternalFileName (const tString &f)
 set the external file to find the vector data More...
 
void setFormat (const tFlag &f)
 set the format of the data More...
 
const tFlag & getFormat () const
 get the format of the data More...
 
const tString & getExternalFileName () const
 get the external file name to find data 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 &it, 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_VTK< SM_XDMF >
 SM_VTK (void)
 create
 
virtual ~SM_VTK (void)
 destroy
 
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 Member Functions

static CORE_UniquePointer< SM_XDMFNew ()
 create an XDMF class More...
 
static CORE_UniquePointer< SM_XDMFNew (const tFlag &format)
 create an XDMF class 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...
 

Static Public Attributes

static const tFlag XML =0
 XML file type.
 
static const tFlag HDF =1
 HDF file type.
 
- Static Public Attributes inherited from SM_VTK< SM_XDMF >
static const tFlag CELL
 cell tag
 
static const tFlag POINT
 point tag
 

Static Protected Member Functions

static tBoolean WriteVertices (CORE_OutputFile &file, const tFlag &fileType, const tString &linkHDFFile, const SM_Network &mesh, const tString &tag)
 write the vertices coordinates More...
 
static tBoolean WriteConnectivity (CORE_OutputFile &file, const tFlag &fileType, const tString &linkHDFFile, const tIndex &nAloneParticles, const tIndex &nHaloParticles, const std::valarray< tIndex > &neighboringParticlesListOffset, const std::valarray< tIndex > &neighboringParticlesList, const tString &tagN)
 write the connectivity between vertices More...
 
static tBoolean WriteField (CORE_OutputFile &file, const tFlag &fileType, const tString &linkHDFFile, const tIndex &t, const tFlag &contentType, const tString &name, const tString &tagName, const tReal &alpha, const tIndex &n, const tDimension &dim, const tReal *f)
 write a field with name More...
 

Additional Inherited Members

- Protected Member Functions inherited from SM_VTK< SM_XDMF >
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

 

Detailed Description

This class is a beam interface output for XMF format for paraview visualization software.

Author
Stephane Despreaux
Version
1.0

Member Function Documentation

◆ close() [1/2]

tBoolean SM_XDMF::close ( )
inline

close the file

Returns
true if the footer writting has succceeded false otherwise

◆ close() [2/2]

tBoolean SM_XDMF::close ( const tIndex &  t)
inline

close the file for the time step t

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

◆ getContentsMemorySize()

virtual tMemSize SM_XDMF::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_VTK< SM_XDMF >.

◆ getExternalFileName()

const tString& SM_XDMF::getExternalFileName ( ) const
inline

get the external file name to find data

Returns
the complete external file name

◆ getFormat()

const tFlag& SM_XDMF::getFormat ( ) const
inline

get the format of the data

Returns
the format of the data in XML HDF

◆ getMemorySize()

virtual tMemSize SM_XDMF::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_VTK< SM_XDMF >.

◆ New() [1/2]

static CORE_UniquePointer<SM_XDMF> SM_XDMF::New ( )
inlinestatic

create an XDMF class

Returns
a shared pointer of the XDMF class

◆ New() [2/2]

static CORE_UniquePointer<SM_XDMF> SM_XDMF::New ( const tFlag &  format)
inlinestatic

create an XDMF class

Parameters
[in]formatthe format of the data in the XML file in {XML,HDF}
Returns
a shared pointer of the XDMF class

◆ open() [1/2]

tBoolean SM_XDMF::open ( )
inline

open the vtkfile

Returns
true if the header writting has succceeded false otherwise

◆ open() [2/2]

tBoolean SM_XDMF::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

◆ setExternalFileName()

void SM_XDMF::setExternalFileName ( const tString &  f)
inline

set the external file to find the vector data

Parameters
[in]fthe aboslute file name with extension

◆ setFormat()

void SM_XDMF::setFormat ( const tFlag &  f)
inline

set the format of the data

Parameters
[in]fthe format of the data in XML,HDF

◆ WriteConnectivity()

tBoolean SM_XDMF::WriteConnectivity ( CORE_OutputFile file,
const tFlag &  fileType,
const tString &  linkHDFFile,
const tIndex &  nAloneParticles,
const tIndex &  nHaloParticles,
const std::valarray< tIndex > &  neighboringParticlesListOffset,
const std::valarray< tIndex > &  neighboringParticlesList,
const tString &  tagN 
)
staticprotected

write the connectivity between vertices

Parameters
[in]filethe output stream
[in]fileTypetype of file in {XML,HDF}
[in]linkHDFFile: link file for HDF type
[in]nAloneParticles: number of points where neighboringParticlesListOffset[i+1]- neighboringParticlesListOffset[i] is null
[in]nHaloParticles: number of halo points (without connection)
[in]neighboringParticlesListOffset: index within neighboringParticlesList of the first neighbor of particle p
[in]neighboringParticlesList: the index of the first neighbor of point i in [0,neighborIndices.getSize()-1[
[in]tagN: the tag for finding the vector neighbors in external file if any
Returns
true if vertices writting has succceeded

◆ writeContentData()

tBoolean SM_XDMF::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 step for the content data
[in]networkthe mesh of the field
[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()

tBoolean SM_XDMF::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()

tBoolean SM_XDMF::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

◆ WriteField()

tBoolean SM_XDMF::WriteField ( CORE_OutputFile file,
const tFlag &  fileType,
const tString &  linkHDFFile,
const tIndex &  t,
const tFlag &  contentType,
const tString &  name,
const tString &  tagName,
const tReal &  alpha,
const tIndex &  n,
const tDimension &  dim,
const tReal *  f 
)
staticprotected

write a field with name

Parameters
[in]filethe output stream
[in]fileTypetype of file in {XML,HDF}
[in]linkHDFFile: link file for HDF type
[in]tthe time step index
[in]contentType;the type of content in {CELL,POINT}
[in]namethe name of the field
[in]tagNamethe tag to get the field
[in]alphafactor f
[in]nsize of the field
[in]dimdimension of the field
[in]fthe field to save
Returns
true if content footer writting has succceeded

◆ writeGeometryData()

tBoolean SM_XDMF::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()

tBoolean SM_XDMF::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()

tBoolean SM_XDMF::writeGeometryHeader ( const tIndex &  it,
const SM_Network network 
)
inline

write the geometry header corresponding to the network

Parameters
[in]itthe 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

◆ WriteVertices()

tBoolean SM_XDMF::WriteVertices ( CORE_OutputFile file,
const tFlag &  fileType,
const tString &  linkHDFFile,
const SM_Network mesh,
const tString &  tag 
)
staticprotected

write the vertices coordinates

Parameters
[in]filethe output stream
[in]fileTypetype of file in {XML,HDF}
[in]linkHDFFile: link file for HDF type
[in]meshthe mesh
[in]tagthe tag for finding the vector in external file if any
Returns
true if vertices writting has succceeded

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