OOFEM 3.0
Loading...
Searching...
No Matches
oofem::VTKXMLExportModule Class Reference

#include <vtkxmlexportmodule.h>

Inheritance diagram for oofem::VTKXMLExportModule:
Collaboration diagram for oofem::VTKXMLExportModule:

Public Member Functions

 VTKXMLExportModule (int n, EngngModel *e)
 Constructor. Creates empty Output Manager. By default all components are selected.
virtual ~VTKXMLExportModule ()
 Destructor.
void initializeFrom (InputRecord &ir) override
 Initializes receiver according to object description stored in input record.
void doOutput (TimeStep *tStep, bool forcedOutput=false) override
void initialize () override
void terminate () override
const char * giveClassName () const override
 Returns class name of the receiver.
void exportPointDataHeader (std::ofstream fileStream, TimeStep *tStep)
virtual void giveDataHeaders (std::string &pointHeader, std::string &cellHeader)
NodalRecoveryModelgiveSmoother ()
 Returns the internal smoother.
NodalRecoveryModelgivePrimVarSmoother ()
 Returns the smoother for primary variables (nodal averaging).
ExportRegiongetExportRegions ()
Public Member Functions inherited from oofem::VTKBaseExportModule
 VTKBaseExportModule (int n, EngngModel *e)
 Constructor. Creates empty Output Manager. By default all components are selected.
virtual ~VTKBaseExportModule ()
 Destructor.
int giveCellType (Element *element)
int giveCellType (int num)
Public Member Functions inherited from oofem::ExportModule
 ExportModule (int n, EngngModel *e)
 Constructor. Creates empty Output Manager with number n.
virtual ~ExportModule ()
 Destructor.
void doForcedOutput (TimeStep *tStep)
bool testSubStepOutput ()
virtual void initializeElementSet ()

Public Attributes

std::ofstream fileStream
ExportRegion defaultVTKPiece
std::vector< ExportRegiondefaultVTKPieces

Protected Member Functions

std::string giveOutputFileName (TimeStep *tStep)
 Returns the filename for the given time step.
std::ofstream giveOutputStream (TimeStep *tStep)
 Returns the output stream for given solution step.
void writeIntVars (ExportRegion &vtkPiece)
void writeXFEMVars (ExportRegion &vtkPiece)
void writePrimaryVars (ExportRegion &vtkPiece)
void writeCellVars (ExportRegion &vtkPiece)
void writeExternalForces (ExportRegion &vtkPiece)
void writeVertexSetMembership (ExportRegion &vtkPiece)
void writeCellSetMembership (ExportRegion &vtkPiece)
bool writeVTKPieceEpilog (ExportRegion &vtkPiece, TimeStep *tStep)
bool writeVTKPieceVariables (ExportRegion &vtkPiece, TimeStep *tStep)
bool writeVTKPieceProlog (ExportRegion &vtkPiece, TimeStep *tStep)
void exportIntVarsInGpAs (IntArray valIDs, TimeStep *tStep)
void writeVTKCollection ()
void writeGPVTKCollection ()
 Writes a VTK collection file for Gauss points.
void writeVTKPointData (FloatArray &valueArray)
void writeVTKCellData (FloatArray &valueArray)
void exportCompositeElement (ExportRegion &vtkPiece, Element *el, TimeStep *tStep)
void exportCompositeElement (std::vector< ExportRegion > &vtkPieces, Element *el, TimeStep *tStep)
Protected Member Functions inherited from oofem::VTKBaseExportModule
virtual void setupVTKPiece (ExportRegion &vtkPiece, TimeStep *tStep, Set &region)
virtual void exportPrimaryVars (ExportRegion &piece, Set &region, IntArray &primaryVarsToExport, NodalRecoveryModel &smoother, TimeStep *tStep)
virtual void exportIntVars (ExportRegion &piece, Set &region, IntArray &internalVarsToExport, NodalRecoveryModel &smoother, TimeStep *tStep)
void exportExternalForces (ExportRegion &piece, int region, TimeStep *tStep)
void exportCellVars (ExportRegion &piece, Set &region, IntArray &cellVarsToExport, TimeStep *tStep)
 Exports cell variables (typically internal variables).
void exportExternalForces (ExportRegion &piece, Set &region, IntArray &externalForcesToExport, TimeStep *tStep)
void exportSetMembership (ExportRegion &piece, Set &region, TimeStep *tStep)
void getNodalVariableFromPrimaryField (FloatArray &answer, DofManager *dman, TimeStep *tStep, UnknownType type, Set &region, NodalRecoveryModel &smoother)
void getNodalVariableFromIS (FloatArray &answer, Node *node, TimeStep *tStep, InternalStateType type, Set &region, NodalRecoveryModel &smoother)
void getCellVariableFromIS (FloatArray &answer, Element *el, InternalStateType type, TimeStep *tStep)
int giveNumberOfNodesPerCell (int cellType)
void giveElementCell (IntArray &answer, Element *elem)
virtual int initRegionNodeNumbering (ExportRegion &vtkPiece, Domain *domain, TimeStep *tStep, Set &region)
bool isElementComposite (Element *elem)
void exportCompositeElement (ExportRegion &vtkPiece, Element *el, TimeStep *tStep)
 Returns true if element geometry type is composite (not a single cell).
void exportCompositeElement (std::vector< ExportRegion > &vtkPieces, Element *el, TimeStep *tStep)
Protected Member Functions inherited from oofem::ExportModule
int giveNumberOfRegions ()
 Returns number of regions (aka regionSets).
SetgiveRegionSet (int i)
 Returns element set.
std::string giveOutputBaseFileName (TimeStep *tStep)
bool testTimeStepOutput (TimeStep *tStep)
bool testDomainOutput (int n)
std::string errorInfo (const char *func) const
 Returns string for prepending output (used by error reporting macros).

Protected Attributes

IntArray internalVarsToExport
 List of InternalStateType values, identifying the selected vars for export.
IntArray primaryVarsToExport
 List of primary unknowns to export.
IntArray externalForcesToExport
 List of primary unknowns to export.
IntArray cellVarsToExport
 List of cell data to export.
IntArray ipInternalVarsToExport
 List of internal variables to export directly in Integration Points (no smoothing to nodes).
bool exportSetMembershipFlag =0
 Flag whether to export setMembership (byte encoded array).
NodalRecoveryModel::NodalRecoveryModelType stype
 Smoother type.
std::unique_ptr< NodalRecoveryModelsmoother
 Smoother.
std::unique_ptr< NodalRecoveryModelprimVarSmoother
 Smoother for primary variables.
std::list< std::string > pvdBuffer
 Buffer for earlier time steps exported to *.pvd file.
std::list< std::string > gpPvdBuffer
 Buffer for earlier time steps with gauss points exported to *.gp.pvd file.
Protected Attributes inherited from oofem::ExportModule
int number
 Component number.
EngngModelemodel
 Problem pointer.
bool tstep_all_out_flag
 Indicates all steps selection.
int tstep_step_out
 User timeStep Output step. Indicates every tstep_step_out-th step selected.
std ::list< Rangetsteps_out
 List of user selected step numbers.
bool tstep_substeps_out_flag
bool domain_all_flag
 Indicates all domains.
IntArray domainMask
 Domain selection mask.
IntArray regionSets
 regions represented by sets
double timeScale
 Scaling time in output, e.g. conversion from seconds to hours.
Set defaultElementSet
 Default region set.
bool pythonExport
 Output is carried out as a python list instead of writing files.

Additional Inherited Members

Static Public Member Functions inherited from oofem::VTKBaseExportModule
static void computeIPAverage (FloatArray &answer, IntegrationRule *iRule, Element *elem, InternalStateType isType, TimeStep *tStep)
Static Protected Member Functions inherited from oofem::VTKBaseExportModule
static void makeFullTensorForm (FloatArray &answer, const FloatArray &reducedForm, InternalStateValueType vtype)
 Gives the full form of given symmetrically stored tensors, missing components are filled with zeros.
Static Protected Attributes inherited from oofem::VTKBaseExportModule
static IntArray redToFull
 Map from Voigt to full tensor.

Detailed Description

Represents VTK (Visualization Toolkit) export module. It uses VTK (.vtu) file format, Unstructured grid dataset. The export of data is done on Region By Region basis, possibly taking care about possible nonsmooth character of some internal variables at region boundaries. Each region is usually exported as a single piece. When region contains composite cells, these are assumed to be exported in individual subsequent pieces after the default one for the particular region.

Definition at line 89 of file vtkxmlexportmodule.h.

Constructor & Destructor Documentation

◆ VTKXMLExportModule()

oofem::VTKXMLExportModule::VTKXMLExportModule ( int n,
EngngModel * e )

Constructor. Creates empty Output Manager. By default all components are selected.

References doOutput(), initialize(), initializeFrom(), terminate(), and VTKXMLExportModule().

Referenced by VTKXMLExportModule().

◆ ~VTKXMLExportModule()

oofem::VTKXMLExportModule::~VTKXMLExportModule ( )
virtual

Destructor.

Definition at line 84 of file vtkxmlexportmodule.C.

References ~VTKXMLExportModule().

Referenced by ~VTKXMLExportModule().

Member Function Documentation

◆ doOutput()

void oofem::VTKXMLExportModule::doOutput ( TimeStep * tStep,
bool forcedOutput = false )
overridevirtual

Writes the output. Abstract service.

Parameters
tStepTime step.
forcedOutputIf true, no testTimeStepOutput should be done.
Todo
Should use probably use PVTU-files instead. It is starting to get messy.

Implements oofem::ExportModule.

Reimplemented in oofem::VTKXMLLatticeExportModule, and oofem::VTKXMLXFemExportModule.

Definition at line 151 of file vtkxmlexportmodule.C.

References oofem::IntArray::at(), cellVarsToExport, defaultVTKPiece, defaultVTKPieces, doOutput(), oofem::Element_local, oofem::ExportModule::emodel, oofem::VTKBaseExportModule::exportCellVars(), exportCompositeElement(), oofem::VTKBaseExportModule::exportExternalForces(), oofem::VTKBaseExportModule::exportIntVars(), exportIntVarsInGpAs(), oofem::VTKBaseExportModule::exportPrimaryVars(), oofem::VTKBaseExportModule::exportSetMembership(), exportSetMembershipFlag, externalForcesToExport, fileStream, oofem::Domain::giveElement(), oofem::TimeStep::giveNumber(), oofem::ExportModule::giveNumberOfRegions(), oofem::ExportModule::giveOutputBaseFileName(), giveOutputFileName(), giveOutputStream(), oofem::Element::giveParallelMode(), givePrimVarSmoother(), oofem::ExportModule::giveRegionSet(), oofem::IntArray::giveSize(), giveSmoother(), oofem::TimeStep::giveSubStepNumber(), oofem::TimeStep::giveTargetTime(), gpPvdBuffer, internalVarsToExport, ipInternalVarsToExport, oofem::VTKBaseExportModule::isElementComposite(), oofem::ExportModule::number, primaryVarsToExport, primVarSmoother, pvdBuffer, oofem::VTKBaseExportModule::setupVTKPiece(), smoother, oofem::ExportModule::testTimeStepOutput(), oofem::ExportModule::timeScale, oofem::ExportModule::tstep_substeps_out_flag, writeGPVTKCollection(), writeVTKCollection(), writeVTKPieceEpilog(), writeVTKPieceProlog(), and writeVTKPieceVariables().

Referenced by doOutput(), and VTKXMLExportModule().

◆ exportCompositeElement() [1/2]

◆ exportCompositeElement() [2/2]

void oofem::VTKXMLExportModule::exportCompositeElement ( std::vector< ExportRegion > & vtkPieces,
Element * el,
TimeStep * tStep )
protected

◆ exportIntVarsInGpAs()

◆ exportPointDataHeader()

void oofem::VTKXMLExportModule::exportPointDataHeader ( std::ofstream fileStream,
TimeStep * tStep )

Prints point data header.

References fileStream, giveDataHeaders(), givePrimVarSmoother(), and giveSmoother().

◆ getExportRegions()

ExportRegion & oofem::VTKXMLExportModule::getExportRegions ( )
inline

Definition at line 158 of file vtkxmlexportmodule.h.

◆ giveClassName()

const char * oofem::VTKXMLExportModule::giveClassName ( ) const
inlineoverridevirtual

Returns class name of the receiver.

Reimplemented from oofem::VTKBaseExportModule.

Reimplemented in oofem::VTKXMLLatticeExportModule, oofem::VTKXMLPeriodicExportModule, and oofem::VTKXMLXFemExportModule.

Definition at line 131 of file vtkxmlexportmodule.h.

◆ giveDataHeaders()

◆ giveOutputFileName()

std::string oofem::VTKXMLExportModule::giveOutputFileName ( TimeStep * tStep)
protected

Returns the filename for the given time step.

Definition at line 123 of file vtkxmlexportmodule.C.

References oofem::ExportModule::giveOutputBaseFileName(), and giveOutputFileName().

Referenced by doOutput(), giveOutputFileName(), and giveOutputStream().

◆ giveOutputStream()

std::ofstream oofem::VTKXMLExportModule::giveOutputStream ( TimeStep * tStep)
protected

Returns the output stream for given solution step.

Definition at line 130 of file vtkxmlexportmodule.C.

References giveOutputFileName(), giveOutputStream(), NULL_DEVICE, OOFEM_ERROR, and oofem::ExportModule::pythonExport.

Referenced by doOutput(), oofem::VTKXMLLatticeExportModule::doOutputNormal(), and giveOutputStream().

◆ givePrimVarSmoother()

◆ giveSmoother()

◆ initialize()

void oofem::VTKXMLExportModule::initialize ( )
overridevirtual

◆ initializeFrom()

◆ terminate()

void oofem::VTKXMLExportModule::terminate ( )
overridevirtual

Terminates the receiver. The terminating messages should be printed. All the streams should be closed.

Reimplemented from oofem::VTKBaseExportModule.

Reimplemented in oofem::VTKXMLXFemExportModule.

Definition at line 119 of file vtkxmlexportmodule.C.

References terminate().

Referenced by terminate(), and VTKXMLExportModule().

◆ writeCellSetMembership()

◆ writeCellVars()

◆ writeExternalForces()

◆ writeGPVTKCollection()

void oofem::VTKXMLExportModule::writeGPVTKCollection ( )
protected

◆ writeIntVars()

◆ writePrimaryVars()

◆ writeVertexSetMembership()

◆ writeVTKCellData()

void oofem::VTKXMLExportModule::writeVTKCellData ( FloatArray & valueArray)
protected

◆ writeVTKCollection()

void oofem::VTKXMLExportModule::writeVTKCollection ( )
protected

◆ writeVTKPieceEpilog()

bool oofem::VTKXMLExportModule::writeVTKPieceEpilog ( ExportRegion & vtkPiece,
TimeStep * tStep )
protected

Writes Piece header+geometry

Returns
true if piece is not empty and thus written

Definition at line 442 of file vtkxmlexportmodule.C.

References fileStream, oofem::ExportRegion::giveNumberOfCells(), and writeVTKPieceEpilog().

Referenced by doOutput(), oofem::VTKXMLXFemExportModule::doOutput(), oofem::VTKXMLLatticeExportModule::doOutputNormal(), writeVTKPieceEpilog(), and writeXFEMVars().

◆ writeVTKPieceProlog()

◆ writeVTKPieceVariables()

bool oofem::VTKXMLExportModule::writeVTKPieceVariables ( ExportRegion & vtkPiece,
TimeStep * tStep )
protected

Writes Piece variables

Returns
true if piece is not empty and thus written
Todo
giveDataHeaders is currently not updated wrt the new structure -> no file names in headers /JB

Definition at line 457 of file vtkxmlexportmodule.C.

References exportSetMembershipFlag, fileStream, giveDataHeaders(), oofem::ExportRegion::giveNumberOfCells(), writeCellSetMembership(), writeCellVars(), writeExternalForces(), writeIntVars(), writePrimaryVars(), writeVertexSetMembership(), and writeVTKPieceVariables().

Referenced by doOutput(), oofem::VTKXMLLatticeExportModule::doOutputNormal(), writeVTKPieceVariables(), and writeXFEMVars().

◆ writeVTKPointData()

◆ writeXFEMVars()

Member Data Documentation

◆ cellVarsToExport

◆ defaultVTKPiece

◆ defaultVTKPieces

std::vector< ExportRegion > oofem::VTKXMLExportModule::defaultVTKPieces

◆ exportSetMembershipFlag

bool oofem::VTKXMLExportModule::exportSetMembershipFlag =0
protected

Flag whether to export setMembership (byte encoded array).

Definition at line 103 of file vtkxmlexportmodule.h.

Referenced by doOutput(), giveDataHeaders(), initializeFrom(), and writeVTKPieceVariables().

◆ externalForcesToExport

IntArray oofem::VTKXMLExportModule::externalForcesToExport
protected

List of primary unknowns to export.

Definition at line 97 of file vtkxmlexportmodule.h.

Referenced by doOutput(), giveDataHeaders(), initializeFrom(), oofem::QuasicontinuumVTKXMLExportModule::setupVTKPiece(), and writeExternalForces().

◆ fileStream

◆ gpPvdBuffer

std::list< std::string > oofem::VTKXMLExportModule::gpPvdBuffer
protected

Buffer for earlier time steps with gauss points exported to *.gp.pvd file.

Definition at line 118 of file vtkxmlexportmodule.h.

Referenced by doOutput(), and writeGPVTKCollection().

◆ internalVarsToExport

◆ ipInternalVarsToExport

IntArray oofem::VTKXMLExportModule::ipInternalVarsToExport
protected

List of internal variables to export directly in Integration Points (no smoothing to nodes).

Definition at line 101 of file vtkxmlexportmodule.h.

Referenced by doOutput(), and initializeFrom().

◆ primaryVarsToExport

◆ primVarSmoother

std::unique_ptr< NodalRecoveryModel > oofem::VTKXMLExportModule::primVarSmoother
protected

◆ pvdBuffer

std::list< std::string > oofem::VTKXMLExportModule::pvdBuffer
protected

Buffer for earlier time steps exported to *.pvd file.

Definition at line 115 of file vtkxmlexportmodule.h.

Referenced by doOutput(), and writeVTKCollection().

◆ smoother

◆ stype

NodalRecoveryModel::NodalRecoveryModelType oofem::VTKXMLExportModule::stype
protected

Smoother type.

Definition at line 108 of file vtkxmlexportmodule.h.

Referenced by giveSmoother(), and initializeFrom().


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

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011