OOFEM
2.4
OOFEM.org - Object Oriented Finite Element Solver
|
Represents VTK (Visualization Toolkit) export module. More...
#include <vtkexportmodule.h>
Public Member Functions | |
VTKExportModule (int n, EngngModel *e) | |
Constructor. Creates empty Output Manager with number n. By default all components are selected. More... | |
virtual | ~VTKExportModule () |
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... | |
virtual const char * | giveInputRecordName () const |
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... | |
Protected Types | |
enum | modeType { wdmode, rbrmode } |
Determines how regions should be exported. More... | |
Protected Member Functions | |
NodalRecoveryModel * | giveSmoother () |
Returns the internal smoother. More... | |
FILE * | giveOutputStream (TimeStep *tStep) |
Returns the output stream for given solution step. More... | |
int | giveCellType (Element *tStep) |
Returns corresponding element cell_type. More... | |
int | giveNumberOfElementCells (Element *) |
Returns the number of elements vtk cells. More... | |
int | giveNumberOfNodesPerCell (int cellType) |
Returns number of nodes corresponding to cell type. More... | |
void | giveElementCell (IntArray &answer, Element *elem, int cell) |
Returns the element cell geometry. More... | |
void | exportIntVars (FILE *stream, TimeStep *tStep) |
Export internal variables. More... | |
void | exportPrimaryVars (FILE *stream, TimeStep *tStep) |
Export primary variables. More... | |
void | exportIntVarAs (InternalStateType valID, InternalStateValueType type, FILE *stream, TimeStep *tStep) |
Exports single variable. More... | |
void | exportPrimVarAs (UnknownType valID, FILE *stream, TimeStep *tStep) |
Exports single variable. More... | |
void | exportCellVars (FILE *stream, int elemToProcess, TimeStep *tStep) |
Export variables defined on cells. More... | |
int | initRegionNodeNumbering (IntArray ®ionNodalNumbers, int ®ionDofMans, int offset, Domain *domain, int reg, int mode) |
Assembles the region node map. More... | |
int | giveTotalRBRNumberOfNodes (Domain *d) |
Computes total number of nodes (summed Region by Region, nodes on region boundaries are added multiple times. More... | |
void | getDofManPrimaryVariable (FloatArray &answer, DofManager *dman, IntArray &dofIDMask, ValueModeType mode, TimeStep *tStep, InternalStateType iType) |
Returns the value of Primary variable at given dof manager. More... | |
Protected Member Functions inherited from oofem::ExportModule | |
int | giveNumberOfRegions () |
Returns number of regions (aka regionSets) More... | |
Set * | giveRegionSet (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... | |
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 | cellVarsToExport |
List of cell data to export. More... | |
modeType | outMode |
modeType | mode |
NodalRecoveryModel::NodalRecoveryModelType | stype |
Smoother type. More... | |
NodalRecoveryModel * | smoother |
Smoother. More... | |
IntArray | regionsToSkip |
List of regions to skip. More... | |
Protected Attributes inherited from oofem::ExportModule | |
int | number |
Component number. More... | |
EngngModel * | emodel |
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< Range > | tsteps_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... | |
Represents VTK (Visualization Toolkit) export module.
It uses VTK file format, Unstructured grid dataset. There is built in support for Region By Region output, taking care about possible nonsmooth character of some internal variables at region boundaries. This, however, is rather complication and since application of VTK is naturally in 3D, the corresponding sections are commented out.
Definition at line 64 of file vtkexportmodule.h.
|
protected |
Determines how regions should be exported.
Enumerator | |
---|---|
wdmode |
Whole domain. |
rbrmode |
Region by region. |
Definition at line 75 of file vtkexportmodule.h.
oofem::VTKExportModule::VTKExportModule | ( | int | n, |
EngngModel * | e | ||
) |
Constructor. Creates empty Output Manager with number n. By default all components are selected.
|
virtual |
|
virtual |
Writes the output.
Abstract service.
tStep | Time step. |
forcedOutput | If true, no testTimeStepOutput should be done. |
Implements oofem::ExportModule.
Definition at line 102 of file vtkexportmodule.C.
References oofem::IntArray::at(), oofem::FloatArray::at(), cellVarsToExport, oofem::Element_local, oofem::ExportModule::emodel, exportCellVars(), exportIntVars(), exportPrimaryVars(), giveCellType(), oofem::EngngModel::giveDomain(), giveElementCell(), oofem::Domain::giveElements(), oofem::Domain::giveNode(), oofem::Domain::giveNumberOfDofManagers(), giveNumberOfElementCells(), giveNumberOfNodesPerCell(), giveOutputStream(), oofem::IntArray::giveSize(), oofem::FloatArray::giveSize(), giveSmoother(), oofem::TimeStep::giveTargetTime(), giveTotalRBRNumberOfNodes(), initRegionNodeNumbering(), internalVarsToExport, OOFEM_LOG_DEBUG, primaryVarsToExport, and oofem::ExportModule::testTimeStepOutput().
|
protected |
Export variables defined on cells.
Definition at line 405 of file vtkexportmodule.C.
References oofem::__InternalStateTypeToString(), oofem::FloatArray::add(), oofem::IntArray::at(), oofem::FloatArray::at(), oofem::FloatMatrix::at(), cellVarsToExport, oofem::FloatArray::clear(), oofem::Element_local, oofem::ExportModule::emodel, oofem::EngngModel::giveDomain(), oofem::Domain::giveElement(), oofem::Domain::giveElements(), oofem::giveInternalStateValueType(), oofem::Element::giveIPValue(), oofem::IntArray::giveSize(), oofem::FloatArray::giveSize(), oofem::ISVT_SCALAR, oofem::ISVT_TENSOR_G, oofem::ISVT_TENSOR_S3, oofem::ISVT_TENSOR_S3E, oofem::ISVT_VECTOR, OOFEM_ERROR, OOFEM_WARNING, oofem::FloatMatrix::resize(), oofem::FloatArray::times(), and oofem::FloatMatrix::zero().
Referenced by doOutput().
|
protected |
Exports single variable.
Definition at line 615 of file vtkexportmodule.C.
References oofem::__InternalStateTypeToString(), oofem::Set::addAllElements(), oofem::IntArray::at(), oofem::FloatArray::at(), oofem::FloatMatrix::at(), oofem::ExportModule::emodel, oofem::EngngModel::giveDomain(), oofem::giveInternalStateTypeSize(), oofem::EngngModel::giveMaterialInterface(), oofem::MaterialInterface::giveNodalScalarRepresentation(), oofem::NodalRecoveryModel::giveNodalVector(), oofem::Domain::giveNode(), oofem::Domain::giveNumberOfDofManagers(), oofem::FloatArray::giveSize(), giveSmoother(), initRegionNodeNumbering(), oofem::ISVT_SCALAR, oofem::ISVT_TENSOR_G, oofem::ISVT_TENSOR_S3, oofem::ISVT_TENSOR_S3E, oofem::ISVT_VECTOR, oofem::min(), oofem::NodalRecoveryModel::recoverValues(), oofem::FloatArray::resize(), smoother, oofem::FloatArray::zero(), and oofem::FloatMatrix::zero().
Referenced by exportIntVars().
|
protected |
Export internal variables.
Definition at line 384 of file vtkexportmodule.C.
References oofem::IntArray::at(), exportIntVarAs(), oofem::giveInternalStateValueType(), oofem::IntArray::giveSize(), and internalVarsToExport.
Referenced by doOutput().
|
protected |
Export primary variables.
Definition at line 764 of file vtkexportmodule.C.
References exportPrimVarAs(), and primaryVarsToExport.
Referenced by doOutput().
|
protected |
Exports single variable.
Definition at line 774 of file vtkexportmodule.C.
References oofem::__UnknownTypeToString(), oofem::IntArray::at(), oofem::FloatArray::at(), oofem::FloatArray::beTProductOf(), oofem::ExportModule::emodel, getDofManPrimaryVariable(), oofem::EngngModel::giveDomain(), oofem::Domain::giveNode(), oofem::FEMComponent::giveNumber(), oofem::Domain::giveNumberOfDofManagers(), oofem::FloatArray::giveSize(), giveSmoother(), initRegionNodeNumbering(), oofem::ISVT_SCALAR, oofem::ISVT_UNDEFINED, oofem::ISVT_VECTOR, oofem::min(), OOFEM_ERROR, oofem::FloatArray::resize(), and oofem::FloatArray::zero().
Referenced by exportPrimaryVars().
|
protected |
Returns the value of Primary variable at given dof manager.
If such variable not directly available in dofman dofs, can use smoother to recover this nodal value.
recover values if not done before
Definition at line 895 of file vtkexportmodule.C.
References oofem::Set::addAllElements(), oofem::IntArray::at(), oofem::FloatArray::at(), oofem::DofManager::giveDofWithID(), oofem::FEMComponent::giveDomain(), oofem::NodalRecoveryModel::giveNodalVector(), oofem::FEMComponent::giveNumber(), oofem::IntArray::giveSize(), oofem::FloatArray::giveSize(), giveSmoother(), oofem::DofManager::hasDofID(), OOFEM_WARNING, oofem::NodalRecoveryModel::recoverValues(), oofem::FloatArray::resize(), and oofem::FloatArray::zero().
Referenced by exportPrimVarAs().
|
protected |
Returns corresponding element cell_type.
Some common element types are supported, others can be supported via interface concept.
Definition at line 241 of file vtkexportmodule.C.
References oofem::Element::giveGeometryType(), and OOFEM_ERROR.
Referenced by doOutput().
|
inlinevirtual |
Returns class name of the receiver.
Implements oofem::ExportModule.
Definition at line 101 of file vtkexportmodule.h.
|
protected |
Returns the element cell geometry.
Definition at line 322 of file vtkexportmodule.C.
References oofem::IntArray::at(), oofem::Element::giveGeometryType(), oofem::Element::giveNode(), oofem::FEMComponent::giveNumber(), oofem::Element::giveNumberOfNodes(), OOFEM_ERROR, and oofem::IntArray::resize().
Referenced by doOutput().
|
inlinevirtual |
Definition at line 102 of file vtkexportmodule.h.
References _IFT_VTKExportModule_Name.
|
protected |
Returns the number of elements vtk cells.
Definition at line 363 of file vtkexportmodule.C.
References oofem::Element::giveGeometryType(), and OOFEM_ERROR.
Referenced by doOutput().
|
protected |
Returns number of nodes corresponding to cell type.
Definition at line 279 of file vtkexportmodule.C.
References OOFEM_ERROR.
Referenced by doOutput().
|
protected |
Returns the output stream for given solution step.
Definition at line 229 of file vtkexportmodule.C.
References oofem::ExportModule::giveOutputBaseFileName(), and OOFEM_ERROR.
Referenced by doOutput().
|
protected |
Returns the internal smoother.
Definition at line 750 of file vtkexportmodule.C.
References oofem::classFactory, oofem::ClassFactory::createNodalRecoveryModel(), oofem::ExportModule::emodel, oofem::EngngModel::giveDomain(), smoother, and stype.
Referenced by doOutput(), exportIntVarAs(), exportPrimVarAs(), and getDofManPrimaryVariable().
|
protected |
Computes total number of nodes (summed Region by Region, nodes on region boundaries are added multiple times.
Definition at line 514 of file vtkexportmodule.C.
References oofem::Element_local, oofem::Domain::giveElements(), and oofem::Domain::giveNumberOfDofManagers().
Referenced by doOutput().
|
virtual |
Reimplemented from oofem::ExportModule.
Definition at line 213 of file vtkexportmodule.C.
References oofem::ExportModule::initialize(), and smoother.
|
virtual |
Initializes receiver according to object description stored in input record.
Reimplemented from oofem::ExportModule.
Definition at line 84 of file vtkexportmodule.C.
References _IFT_VTKExportModule_cellvars, _IFT_VTKExportModule_primvars, _IFT_VTKExportModule_stype, _IFT_VTKExportModule_vars, cellVarsToExport, oofem::ExportModule::initializeFrom(), internalVarsToExport, IR_GIVE_OPTIONAL_FIELD, oofem::NodalRecoveryModel::NRM_ZienkiewiczZhu, primaryVarsToExport, and stype.
|
protected |
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 numbar 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.
Definition at line 552 of file vtkexportmodule.C.
References oofem::IntArray::at(), oofem::Element_local, oofem::Domain::giveElements(), oofem::Domain::giveNumberOfDofManagers(), oofem::IntArray::resize(), and oofem::IntArray::zero().
Referenced by doOutput(), exportIntVarAs(), and exportPrimVarAs().
|
virtual |
Terminates the receiver.
The terminating messages should be printed. All the streams should be closed.
Reimplemented from oofem::ExportModule.
Definition at line 224 of file vtkexportmodule.C.
|
protected |
List of cell data to export.
Definition at line 72 of file vtkexportmodule.h.
Referenced by doOutput(), exportCellVars(), and initializeFrom().
|
protected |
List of InternalStateType values, identifying the selected vars for export.
Definition at line 68 of file vtkexportmodule.h.
Referenced by doOutput(), exportIntVars(), and initializeFrom().
|
protected |
Definition at line 81 of file vtkexportmodule.h.
|
protected |
Definition at line 80 of file vtkexportmodule.h.
|
protected |
List of primary unknowns to export.
Definition at line 70 of file vtkexportmodule.h.
Referenced by doOutput(), exportPrimaryVars(), and initializeFrom().
|
protected |
List of regions to skip.
Definition at line 88 of file vtkexportmodule.h.
|
protected |
Smoother.
Definition at line 86 of file vtkexportmodule.h.
Referenced by exportIntVarAs(), giveSmoother(), initialize(), and ~VTKExportModule().
|
protected |
Smoother type.
Definition at line 84 of file vtkexportmodule.h.
Referenced by giveSmoother(), and initializeFrom().