OOFEM  2.4
OOFEM.org - Object Oriented Finite Element Solver
oofem::VTKXMLExportModule Class Reference

Represents VTK (Visualization Toolkit) export module. More...

#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. More...
 
virtual ~VTKXMLExportModule ()
 Destructor. More...
 
virtual IRResultType initializeFrom (InputRecord *ir)
 Initializes receiver according to object description stored in input record. More...
 
virtual void doOutput (TimeStep *tStep, bool forcedOutput=false)
 Writes the output. More...
 
virtual void initialize ()
 
virtual void terminate ()
 Terminates the receiver. More...
 
virtual const char * giveClassName () const
 Returns class name of the receiver. More...
 
void exportPointDataHeader (FILE *fileStream, TimeStep *tStep)
 Prints point data header. More...
 
void giveDataHeaders (std::string &pointHeader, std::string &cellHeader)
 
NodalRecoveryModelgiveSmoother ()
 Returns the internal smoother. More...
 
NodalRecoveryModelgivePrimVarSmoother ()
 Returns the smoother for primary variables (nodal averaging). More...
 
- Public Member Functions inherited from oofem::ExportModule
 ExportModule (int n, EngngModel *e)
 Constructor. Creates empty Output Manager with number n. More...
 
virtual ~ExportModule ()
 Destructor. More...
 
void doForcedOutput (TimeStep *tStep)
 Writes the output. More...
 
bool testSubStepOutput ()
 Initializes receiver. More...
 
virtual void initializeElementSet ()
 Fill regionSets with all elements if regionSets is initially empty. More...
 

Static Public Member Functions

static void computeIPAverage (FloatArray &answer, IntegrationRule *iRule, Element *elem, InternalStateType isType, TimeStep *tStep)
 Computes a cell average of an InternalStateType varible based on the weights in the integrationpoints (=> volume/area/length average) More...
 

Public Attributes

FILE * fileStream
 
VTKPiece defaultVTKPiece
 
std::vector< VTKPiecedefaultVTKPieces
 

Protected Member Functions

std::string giveOutputFileName (TimeStep *tStep)
 Returns the filename for the given time step. More...
 
FILE * giveOutputStream (TimeStep *tStep)
 Returns the output stream for given solution step. More...
 
int giveCellType (Element *element)
 Returns corresponding element cell_type. More...
 
int giveNumberOfNodesPerCell (int cellType)
 Returns number of nodes corresponding to cell type. More...
 
void giveElementCell (IntArray &answer, Element *elem)
 Returns the element cell geometry. More...
 
void exportIntVars (VTKPiece &piece, IntArray &mapG2L, IntArray &mapL2G, int ireg, TimeStep *tStep)
 Export internal variables by smoothing. More...
 
void exportPrimaryVars (VTKPiece &piece, IntArray &mapG2L, IntArray &mapL2G, int region, TimeStep *tStep)
 Export primary variables. More...
 
void exportExternalForces (VTKPiece &piece, IntArray &mapG2L, IntArray &mapL2G, int region, TimeStep *tStep)
 Export external forces. More...
 
void getNodalVariableFromPrimaryField (FloatArray &answer, DofManager *dman, TimeStep *tStep, UnknownType type, int ireg)
 
virtual void setupVTKPiece (VTKPiece &vtkPiece, TimeStep *tStep, int region)
 
void writeIntVars (VTKPiece &vtkPiece)
 
void writeXFEMVars (VTKPiece &vtkPiece)
 
void writePrimaryVars (VTKPiece &vtkPiece)
 
void writeCellVars (VTKPiece &vtkPiece)
 
void writeExternalForces (VTKPiece &vtkPiece)
 
bool writeVTKPiece (VTKPiece &vtkPiece, TimeStep *tStep)
 
void exportXFEMVarAs (XFEMStateType xfemstype, IntArray &mapG2L, IntArray &mapL2G, int regionDofMans, int ireg, TimeStep *tStep, EnrichmentItem *ei)
 
void getNodalVariableFromIS (FloatArray &answer, Node *node, TimeStep *tStep, InternalStateType type, int ireg)
 
void getNodalVariableFromXFEMST (FloatArray &answer, Node *node, TimeStep *tStep, XFEMStateType xfemstype, int ireg, EnrichmentItem *ei)
 
void exportCellVars (VTKPiece &piece, const IntArray &elems, TimeStep *tStep)
 
void getCellVariableFromIS (FloatArray &answer, Element *el, InternalStateType type, TimeStep *tStep)
 
void exportIntVarsInGpAs (IntArray valIDs, TimeStep *tStep)
 Exports given internal variables directly in integration points (raw data, no smoothing) More...
 
virtual int initRegionNodeNumbering (IntArray &mapG2L, IntArray &mapL2G, int &regionDofMans, int &totalcells, Domain *domain, TimeStep *tStep, int reg)
 Assembles the region node map. More...
 
void writeVTKCollection ()
 Writes a VTK collection file where time step data is stored. More...
 
void writeGPVTKCollection ()
 Writes a VTK collection file for Gauss points. More...
 
void writeVTKPointData (FloatArray &valueArray)
 
void writeVTKCellData (FloatArray &valueArray)
 
bool isElementComposite (Element *elem)
 
void exportCompositeElement (VTKPiece &vtkPiece, Element *el, TimeStep *tStep)
 Returns true if element geometry type is composite (not a single cell). More...
 
void exportCompositeElement (std::vector< VTKPiece > &vtkPieces, Element *el, TimeStep *tStep)
 
- Protected Member Functions inherited from oofem::ExportModule
int giveNumberOfRegions ()
 Returns number of regions (aka regionSets) More...
 
SetgiveRegionSet (int i)
 Returns element set. More...
 
std::string giveOutputBaseFileName (TimeStep *tStep)
 Gives the appropriate name (minus specific file extension). More...
 
bool testTimeStepOutput (TimeStep *tStep)
 Tests if given time step output is required. More...
 
bool testDomainOutput (int n)
 Test if domain output is required. More...
 
std::string errorInfo (const char *func) const
 Returns string for prepending output (used by error reporting macros). More...
 

Static Protected Member Functions

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

Protected Attributes

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

Static Protected Attributes

static IntArray redToFull
 Map from Voigt to full tensor. More...
 

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 144 of file vtkxmlexportmodule.h.

Constructor & Destructor Documentation

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

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

Definition at line 81 of file vtkxmlexportmodule.C.

References primVarSmoother, and smoother.

oofem::VTKXMLExportModule::~VTKXMLExportModule ( )
virtual

Destructor.

Definition at line 88 of file vtkxmlexportmodule.C.

References primVarSmoother, and smoother.

Member Function Documentation

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

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.

Definition at line 338 of file vtkxmlexportmodule.C.

References oofem::IntArray::at(), oofem::FloatArray::at(), defaultVTKPiece, defaultVTKPieces, oofem::Element_local, oofem::ExportModule::emodel, exportCompositeElement(), exportIntVarsInGpAs(), fileStream, oofem::DofManager::giveCoordinates(), oofem::EngngModel::giveDomain(), oofem::Domain::giveElement(), oofem::Set::giveElementList(), oofem::Domain::giveNode(), oofem::TimeStep::giveNumber(), oofem::Domain::giveNumberOfDofManagers(), oofem::EngngModel::giveNumberOfProcesses(), oofem::ExportModule::giveNumberOfRegions(), oofem::ExportModule::giveOutputBaseFileName(), oofem::EngngModel::giveOutputBaseFileName(), giveOutputFileName(), giveOutputStream(), oofem::Element::giveParallelMode(), oofem::EngngModel::giveRank(), oofem::ExportModule::giveRegionSet(), oofem::IntArray::giveSize(), oofem::FloatArray::giveSize(), giveSmoother(), oofem::TimeStep::giveSubStepNumber(), oofem::TimeStep::giveTargetTime(), gpPvdBuffer, ipInternalVarsToExport, oofem::PFEMParticle::isActive(), isElementComposite(), oofem::IntArray::isEmpty(), oofem::EngngModel::isParallel(), oofem::ExportModule::number, particleExportFlag, pvdBuffer, setupVTKPiece(), oofem::ExportModule::testTimeStepOutput(), oofem::ExportModule::timeScale, oofem::ExportModule::tstep_substeps_out_flag, writeGPVTKCollection(), writeVTKCollection(), and writeVTKPiece().

void oofem::VTKXMLExportModule::exportCompositeElement ( VTKPiece vtkPiece,
Element el,
TimeStep tStep 
)
protected
void oofem::VTKXMLExportModule::exportCompositeElement ( std::vector< VTKPiece > &  vtkPieces,
Element el,
TimeStep tStep 
)
protected
void oofem::VTKXMLExportModule::exportExternalForces ( VTKPiece piece,
IntArray mapG2L,
IntArray mapL2G,
int  region,
TimeStep tStep 
)
protected

Export external forces.

Todo:
Add a more flexible solution here, ask the Engineering model for the equivalent to this (perhaps as part of the primary field?) This should be looked into, just as "getNodalVariableFromPrimaryField" is particularly complicated.
Todo:
Have some mapping for UnknownType -> DofID array
Todo:
Have to make more assumptions here.. we shouldn't assume EModelDefaultEquationNumbering. Do something nicer than extForces and extForcesP instead.

Definition at line 1647 of file vtkxmlexportmodule.C.

References oofem::EngngModel::assembleVector(), oofem::IntArray::at(), oofem::FloatArray::at(), oofem::NodalRecoveryModel::clear(), oofem::ExportModule::emodel, externalForcesToExport, oofem::DofManager::giveDofWithID(), oofem::EngngModel::giveDomain(), oofem::Dof::giveEquationNumber(), oofem::Domain::giveNode(), oofem::EngngModel::giveNumberOfDomainEquations(), givePrimVarSmoother(), oofem::IntArray::giveSize(), OOFEM_WARNING, oofem::VTKPiece::setLoadInNode(), and oofem::VTKPiece::setNumberOfLoadsToExport().

Referenced by oofem::QuasicontinuumVTKXMLExportModule::setupVTKPiece(), and setupVTKPiece().

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

Prints point data header.

void oofem::VTKXMLExportModule::exportXFEMVarAs ( XFEMStateType  xfemstype,
IntArray mapG2L,
IntArray mapL2G,
int  regionDofMans,
int  ireg,
TimeStep tStep,
EnrichmentItem ei 
)
protected
void oofem::VTKXMLExportModule::getCellVariableFromIS ( FloatArray answer,
Element el,
InternalStateType  type,
TimeStep tStep 
)
protected
int oofem::VTKXMLExportModule::giveCellType ( Element element)
protected

Returns corresponding element cell_type.

Some common element types are supported, others can be supported via interface concept.

Definition at line 185 of file vtkxmlexportmodule.C.

References oofem::Element::giveGeometryType(), oofem::FEMComponent::giveNumber(), and OOFEM_ERROR.

Referenced by oofem::QuasicontinuumVTKXMLExportModule::setupVTKPiece(), and setupVTKPiece().

virtual const char* oofem::VTKXMLExportModule::giveClassName ( ) const
inlinevirtual

Returns class name of the receiver.

Implements oofem::ExportModule.

Definition at line 187 of file vtkxmlexportmodule.h.

int oofem::VTKXMLExportModule::giveNumberOfNodesPerCell ( int  cellType)
protected

Returns number of nodes corresponding to cell type.

Definition at line 230 of file vtkxmlexportmodule.C.

References OOFEM_ERROR.

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

Returns the filename for the given time step.

Definition at line 166 of file vtkxmlexportmodule.C.

References oofem::ExportModule::giveOutputBaseFileName().

Referenced by doOutput(), and giveOutputStream().

FILE * oofem::VTKXMLExportModule::giveOutputStream ( TimeStep tStep)
protected

Returns the output stream for given solution step.

Definition at line 173 of file vtkxmlexportmodule.C.

References giveOutputFileName(), and OOFEM_ERROR.

Referenced by doOutput().

void oofem::VTKXMLExportModule::initialize ( )
virtual

Reimplemented from oofem::ExportModule.

Definition at line 124 of file vtkxmlexportmodule.C.

References oofem::ExportModule::initialize(), and smoother.

int oofem::VTKXMLExportModule::initRegionNodeNumbering ( IntArray mapG2L,
IntArray mapL2G,
int &  regionDofMans,
int &  totalcells,
Domain domain,
TimeStep tStep,
int  reg 
)
protectedvirtual

Assembles the region node map.

Also computes the total number of nodes in region. The region are numbered starting from offset+1. If mode == 0 then regionNodalNumbers is array with mapping from global numbering to local region numbering. The i-th value contains the corresponding local region number (or zero, if global number is not in region). If mode == 1 then regionNodalNumbers is array with mapping from local to global numbering. The i-th value contains the corresponding global node number.

Reimplemented in oofem::QuasicontinuumVTKXMLExportModule.

Definition at line 1351 of file vtkxmlexportmodule.C.

References oofem::IntArray::at(), oofem::Element_local, oofem::Domain::giveElement(), oofem::Set::giveElementList(), oofem::Element::giveNode(), oofem::FEMComponent::giveNumber(), oofem::Domain::giveNumberOfDofManagers(), oofem::Element::giveNumberOfNodes(), oofem::Element::giveParallelMode(), oofem::ExportModule::giveRegionSet(), oofem::IntArray::giveSize(), oofem::Element::isActivated(), oofem::Element::isCast(), isElementComposite(), oofem::IntArray::resize(), and oofem::IntArray::zero().

Referenced by setupVTKPiece().

void oofem::VTKXMLExportModule::makeFullTensorForm ( FloatArray answer,
const FloatArray reducedForm,
InternalStateValueType  vtype 
)
staticprotected
void oofem::VTKXMLExportModule::terminate ( )
virtual

Terminates the receiver.

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

Reimplemented from oofem::ExportModule.

Definition at line 136 of file vtkxmlexportmodule.C.

void oofem::VTKXMLExportModule::writeGPVTKCollection ( )
protected
void oofem::VTKXMLExportModule::writeVTKCellData ( FloatArray valueArray)
protected
void oofem::VTKXMLExportModule::writeVTKCollection ( )
protected

Writes a VTK collection file where time step data is stored.

Definition at line 1914 of file vtkxmlexportmodule.C.

References oofem::ExportModule::emodel, oofem::EngngModel::giveOutputBaseFileName(), oofem::ExportModule::number, pvdBuffer, and oofem::ExportModule::tstep_substeps_out_flag.

Referenced by doOutput().

bool oofem::VTKXMLExportModule::writeVTKPiece ( VTKPiece vtkPiece,
TimeStep tStep 
)
protected
void oofem::VTKXMLExportModule::writeVTKPointData ( FloatArray valueArray)
protected

Member Data Documentation

IntArray oofem::VTKXMLExportModule::cellVarsToExport
protected

List of cell data to export.

Definition at line 154 of file vtkxmlexportmodule.h.

Referenced by exportCellVars(), exportCompositeElement(), giveDataHeaders(), initializeFrom(), and writeCellVars().

VTKPiece oofem::VTKXMLExportModule::defaultVTKPiece

Definition at line 210 of file vtkxmlexportmodule.h.

Referenced by doOutput().

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

Definition at line 212 of file vtkxmlexportmodule.h.

Referenced by doOutput().

IntArray oofem::VTKXMLExportModule::externalForcesToExport
protected

List of primary unknowns to export.

Definition at line 152 of file vtkxmlexportmodule.h.

Referenced by exportExternalForces(), giveDataHeaders(), initializeFrom(), and writeExternalForces().

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

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

Definition at line 175 of file vtkxmlexportmodule.h.

Referenced by doOutput(), and writeGPVTKCollection().

IntArray oofem::VTKXMLExportModule::internalVarsToExport
protected

List of InternalStateType values, identifying the selected vars for export.

Definition at line 148 of file vtkxmlexportmodule.h.

Referenced by exportCompositeElement(), exportIntVars(), giveDataHeaders(), initializeFrom(), and writeIntVars().

IntArray oofem::VTKXMLExportModule::ipInternalVarsToExport
protected

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

Definition at line 156 of file vtkxmlexportmodule.h.

Referenced by doOutput(), and initializeFrom().

bool oofem::VTKXMLExportModule::particleExportFlag
protected

particle export flag

Definition at line 169 of file vtkxmlexportmodule.h.

Referenced by doOutput(), and initializeFrom().

IntArray oofem::VTKXMLExportModule::primaryVarsToExport
protected

List of primary unknowns to export.

Definition at line 150 of file vtkxmlexportmodule.h.

Referenced by exportCompositeElement(), exportPrimaryVars(), giveDataHeaders(), initializeFrom(), and writePrimaryVars().

NodalRecoveryModel* oofem::VTKXMLExportModule::primVarSmoother
protected

Smoother for primary variables.

Definition at line 166 of file vtkxmlexportmodule.h.

Referenced by givePrimVarSmoother(), VTKXMLExportModule(), and ~VTKXMLExportModule().

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

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

Definition at line 172 of file vtkxmlexportmodule.h.

Referenced by doOutput(), and writeVTKCollection().

IntArray oofem::VTKXMLExportModule::redToFull
staticprotected

Map from Voigt to full tensor.

Definition at line 159 of file vtkxmlexportmodule.h.

Referenced by makeFullTensorForm().

NodalRecoveryModel* oofem::VTKXMLExportModule::smoother
protected
NodalRecoveryModel :: NodalRecoveryModelType oofem::VTKXMLExportModule::stype
protected

Smoother type.

Definition at line 162 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 documentation. Copyright (c) 2011 Borek Patzak
Project e-mail: info@oofem.org
Generated at Tue Jan 2 2018 20:07:43 for OOFEM by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2011