CEPS
24.01
Cardiac ElectroPhysiology Simulator
|
A class that enables the output of binary parallel VTK format files.
Multiple scalar fields can be ouputted in the same file
Possible outputs are
Definition at line 68 of file VtkWriter.hpp.
#include <VtkWriter.hpp>
Public Member Functions | |
VtkWriter ()=delete | |
Deleted constructor. More... | |
VtkWriter (AbstractDiscretization *discr, const CepsString &name, CepsUInt nOutputs, CepsOutputFormat outputFormat, CepsBool writeGlobalIndices=false) | |
Constructor. More... | |
~VtkWriter () override | |
Destructor. More... | |
void | addScalarData (const DHVecPtr &v, const CepsVector< CepsString > &fieldNames, const CepsVector< Unknown * > &us) |
Set multiple scalar fields to be output by this writer. addScalarData for several unknowns. More... | |
void | addScalarData (const DHVecPtr &v, const CepsString &fieldName, Unknown *u) |
Set a scalar field to be output by this writer. More... | |
void | write (CepsReal time=0., CepsBool writeXmlEntry=true) |
Write all stored data. More... | |
CepsString | getByeByeMessage () |
Get string to be displayed at end of computation. More... | |
void | setOutputType (CepsOutputFormat flag) |
Set the output type. More... | |
CepsOutputFormat | getOutputType () const |
Get the output type. More... | |
CepsString | getOuputExtension () const |
Get the extension, deduced from CepsOutputFormat. More... | |
Public Member Functions inherited from CepsObject | |
CepsObject ()=default | |
default constructor More... | |
CepsObject (const CepsObject &)=default | |
Copy constructor. More... | |
virtual | ~CepsObject ()=default |
Destructor. More... | |
CepsObject & | operator= (const CepsObject &)=default |
Assignment operator. More... | |
CepsObject * | toBaseObject () |
Returns a pointer to CepsObject class. More... | |
const CepsObject * | toBaseObject () const |
Returns a pointer to CepsObject class, const version. More... | |
Profiler * | getProfiler () const |
Access to profiler. More... | |
Protected Member Functions | |
void | writeVTU () |
Write current state (Paraview xml pvtu & vtu file) More... | |
void | writeLegacyVTK () |
Write current state (Paraview legacy vtk) More... | |
void | writeDataArray () |
Write current state (vtk_ceps format) More... | |
void | writeSeriesFile () |
Write time series file for all time steps (Paraview pvtu.series) More... | |
void | writeMetaDataSet () |
Write time pvd file for all time steps (Paraview .pvd) More... | |
void | updateMeshData () |
Global geometrical data regrouping. More... | |
void | insertPointData () |
Add coordinates to VTK structures, add array of global indices if needed. More... | |
void | insertElementData () |
Add cell definition to VTK structures. More... | |
void | insertElementsOfDim (CepsUInt dim) |
Internal method which for looping on all elements on a mesh of given dimension. More... | |
void | insertCell (GeomCell *cell) |
Internal method which inserts one element as a cell in a unstructuredGrid vtk object. More... | |
vtkCell * | allocateCellOfDim (CepsUInt dim) |
Internal method allocating a cell for a finite element (tetra,tri,...) More... | |
void | addTimeFieldToUGrid (CepsReal time) |
Adds a single scalar field to unstructred grid to write, called before writing. More... | |
Protected Attributes | |
AbstractDiscretization * | m_discr |
Discretization (dofs) More... | |
Geometry * | m_geom |
Direct link to geometry. More... | |
CepsVector< CepsReal > | m_writtenTimes |
Previous times already written. More... | |
CepsString | m_baseName |
base name of output files More... | |
CepsUInt | m_outputNb |
number of output file (not iteration) More... | |
CepsUInt | m_outputLgMax |
estimated number of output files (log10)+1 More... | |
CepsString | m_outputDir |
output directory More... | |
CepsUInt | m_internalIndex |
Points counter. More... | |
CepsOutputFormat | m_outputType |
Output type. More... | |
CepsBool | m_updateMesh |
if the mesh data (geometry) must be updated More... | |
CepsBool | m_writeGeomIndices |
option to add array of CEPS point IDs More... | |
vtkSmartPointer< vtkUnstructuredGrid > | m_unstructuredGrid |
the vtk data wrapper More... | |
std::map< CepsUInt, CepsUInt > | m_geomToVtkNodeIndex |
mapping used for nodes More... | |
std::map< CepsUInt, CepsUInt > | m_geomToVtkCellIndex |
mapping used for elements More... | |
vtkSmartPointer< vtkMPICommunicator > | m_vtkMpiComm |
a vtk wrapping object for the communicator More... | |
vtkMPICommunicatorOpaqueComm | m_opaqueCommVTK |
a vtk object to create user defined MPI communicators More... | |
vtkSmartPointer< vtkMPIController > | m_vtkMpiController |
vtk mpi controller More... | |
Additional Inherited Members | |
Static Protected Attributes inherited from CepsObject | |
static Profiler | m_profiler |
The same profiler for each big object. More... | |
|
delete |
Deleted constructor.
VtkWriter::VtkWriter | ( | AbstractDiscretization * | discr, |
const CepsString & | name, | ||
CepsUInt | nOutputs, | ||
CepsOutputFormat | outputFormat, | ||
CepsBool | writeGlobalIndices = false |
||
) |
Constructor.
discr | pointer on spatial discretization |
name | a base name for each outputted file |
nOutputs | expected nb of outputs, to to sell size of nb in file name |
outputFormat | selects output type |
writeGlobalIndices | adds an int array of point data with the CEPS index of each point. Needed for convergence study (mesh interpolations) |
VTK mpi controller
Definition at line 38 of file VtkWriter.cpp.
|
override |
Destructor.
Definition at line 89 of file VtkWriter.cpp.
void VtkWriter::addScalarData | ( | const DHVecPtr & | v, |
const CepsString & | fieldName, | ||
Unknown * | u | ||
) |
Set a scalar field to be output by this writer.
Multiple scalar fields can be added.
[in] | v | distributed halo vector holding the scalars |
[in] | fieldName | a name for this scalar field. If there already exists a field with this name, it is replaced. This is useful when outputting at each time step an updated solution. |
[in] | u | unknown for which data will be extracted from the distributed vector |
Definition at line 94 of file VtkWriter.cpp.
void VtkWriter::addScalarData | ( | const DHVecPtr & | v, |
const CepsVector< CepsString > & | fieldNames, | ||
const CepsVector< Unknown * > & | us | ||
) |
Set multiple scalar fields to be output by this writer. addScalarData for several unknowns.
Definition at line 101 of file VtkWriter.cpp.
|
protected |
Adds a single scalar field to unstructred grid to write, called before writing.
Definition at line 593 of file VtkWriter.cpp.
|
protected |
Internal method allocating a cell for a finite element (tetra,tri,...)
Definition at line 580 of file VtkWriter.cpp.
CepsString VtkWriter::getByeByeMessage | ( | ) |
Get string to be displayed at end of computation.
Definition at line 217 of file VtkWriter.cpp.
CepsString VtkWriter::getOuputExtension | ( | ) | const |
Get the extension, deduced from CepsOutputFormat.
Definition at line 239 of file VtkWriter.cpp.
CepsOutputFormat VtkWriter::getOutputType | ( | ) | const |
Get the output type.
Definition at line 233 of file VtkWriter.cpp.
|
protected |
Internal method which inserts one element as a cell in a unstructuredGrid vtk object.
Definition at line 560 of file VtkWriter.cpp.
|
protected |
Add cell definition to VTK structures.
Definition at line 483 of file VtkWriter.cpp.
|
protected |
Internal method which for looping on all elements on a mesh of given dimension.
Definition at line 550 of file VtkWriter.cpp.
|
protected |
Add coordinates to VTK structures, add array of global indices if needed.
Definition at line 390 of file VtkWriter.cpp.
void VtkWriter::setOutputType | ( | CepsOutputFormat | flag | ) |
Set the output type.
Definition at line 227 of file VtkWriter.cpp.
|
protected |
Global geometrical data regrouping.
Definition at line 375 of file VtkWriter.cpp.
Write all stored data.
[in] | time | current time of simulation |
[in] | writeXmlEntry | if true, writes in the xml collection files the name of the generated vt<X> files. Set it to true once per iteration to avoid duplicates in the xml files. |
Definition at line 176 of file VtkWriter.cpp.
|
protected |
Write current state (vtk_ceps format)
Definition at line 291 of file VtkWriter.cpp.
|
protected |
Write current state (Paraview legacy vtk)
Definition at line 276 of file VtkWriter.cpp.
|
protected |
Write time pvd file for all time steps (Paraview .pvd)
Write time series file for all time steps (Music)
Definition at line 345 of file VtkWriter.cpp.
|
protected |
Write time series file for all time steps (Paraview pvtu.series)
Definition at line 316 of file VtkWriter.cpp.
|
protected |
Write current state (Paraview xml pvtu & vtu file)
The pvtu xml writer
Definition at line 255 of file VtkWriter.cpp.
|
protected |
base name of output files
Definition at line 208 of file VtkWriter.hpp.
|
protected |
Discretization (dofs)
Definition at line 204 of file VtkWriter.hpp.
|
protected |
Direct link to geometry.
Definition at line 205 of file VtkWriter.hpp.
mapping used for elements
Definition at line 221 of file VtkWriter.hpp.
mapping used for nodes
Definition at line 220 of file VtkWriter.hpp.
|
protected |
Points counter.
Definition at line 213 of file VtkWriter.hpp.
|
protected |
a vtk object to create user defined MPI communicators
Definition at line 225 of file VtkWriter.hpp.
|
protected |
output directory
Definition at line 211 of file VtkWriter.hpp.
|
protected |
estimated number of output files (log10)+1
Definition at line 210 of file VtkWriter.hpp.
|
protected |
number of output file (not iteration)
Definition at line 209 of file VtkWriter.hpp.
|
protected |
Output type.
Definition at line 214 of file VtkWriter.hpp.
|
protected |
the vtk data wrapper
Definition at line 218 of file VtkWriter.hpp.
|
protected |
if the mesh data (geometry) must be updated
Definition at line 215 of file VtkWriter.hpp.
|
protected |
a vtk wrapping object for the communicator
Definition at line 224 of file VtkWriter.hpp.
|
protected |
vtk mpi controller
Definition at line 226 of file VtkWriter.hpp.
|
protected |
option to add array of CEPS point IDs
Definition at line 216 of file VtkWriter.hpp.
|
protected |
Previous times already written.
Definition at line 206 of file VtkWriter.hpp.