|
IFEM
90A354
|
Class for output of FE model and results to VTF file. More...
#include <VTF.h>

Public Member Functions | |
| VTF (const char *filename, int type) | |
| The constructor opens a new VTF-file. More... | |
| VTF (const VTF &)=delete | |
| No copying of this class. | |
| ~VTF () | |
| The destructor finalizes and closes the VTF-file. | |
| bool | writeGrid (const ElementBlock *block, const char *gName, int elemID, int nodeID=0) |
| Writes the FE geometry to the VTF-file. More... | |
| bool | writeTransformation (const Vec3 &X, const Tensor &T, int idBlock=1, int gID=1) |
| Writes a transformation matrix to the VTF-file. More... | |
| bool | writeNres (const std::vector< Real > &nodalResult, int idBlock=1, int geomID=1) |
| Writes a block of scalar nodal results to the VTF-file. More... | |
| bool | writeEres (const std::vector< Real > &elementResult, int idBlock=1, int geomID=1) |
| Writes a block of scalar element results to the VTF-file. More... | |
| bool | writeVres (const std::vector< Real > &nodeResult, int idBlock=1, int geomID=1, size_t nvc=0) |
| Writes a block of vector nodal results to the VTF-file. More... | |
| bool | writeNfunc (const RealFunc &f, const Real *u=nullptr, Real time=Real(0), int idBlock=1, int gID=1) |
| Writes a block of scalar nodal function values to the VTF-file. More... | |
| bool | writeVectors (const std::vector< Vec3Pair > &pntResult, int &gID, int idBlock=1, const char *resultName=nullptr, int iStep=0, int iBlock=1) |
| Writes a block of point vector results to the VTF-file. More... | |
| bool | writePoints (const std::vector< Vec3 > &points, int &gID) |
| Writes a block of points (no results) to the VTF-file. More... | |
| bool | writeSblk (int sBlockID, const char *resultName=nullptr, int idBlock=1, int iStep=1, bool elementData=false) |
| Writes a scalar block definition to the VTF-file. More... | |
| bool | writeSblk (const std::vector< int > &sBlockIDs, const char *resultName=nullptr, int idBlock=1, int iStep=1, bool elementData=false) |
| Writes a scalar block definition to the VTF-file. More... | |
| bool | writeVblk (int vBlockID, const char *resultName=nullptr, int idBlock=1, int iStep=1) |
| Writes a vector block definition to the VTF-file. More... | |
| bool | writeVblk (const std::vector< int > &vBlockIDs, const char *resultName=nullptr, int idBlock=1, int iStep=1) |
| Writes a vector block definition to the VTF-file. More... | |
| bool | writeDblk (const std::vector< int > &dBlockIDs, const char *resultName=nullptr, int idBlock=1, int iStep=1) |
| Writes a displacement block definition to the VTF-file. More... | |
| bool | writeTblk (const std::vector< int > &tBlockIDs, const char *resultName=nullptr, int idBlock=1, int iStep=1) |
| Writes a transformation block definition to the VTF-file. More... | |
| bool | writeState (int iStep, const char *fmt, Real refValue, int refType=0) |
| Writes a state info block to the VTF-file. More... | |
| const ElementBlock * | getBlock (int geomID) const |
| Returns the pointer to a geometry block. | |
| int | getNodeBlock (int geomID) const |
| Returns the node block ID associated with a geometry block. | |
| void | writeGeometryBlocks (int iStep) |
| Adds the current FE geometry blocks to the description block. | |
| void | clearGeometryBlocks () |
| Drops the current FE geometry blocks. | |
Static Public Attributes | |
| static Real | vecOffset [3] = { 0.0, 0.0, 0.0 } |
| Optional offset for vector attack points. | |
Private Member Functions | |
| bool | writeNodes (int iBlockID) |
| Writes a node block to the VTF-file. More... | |
| bool | writeElements (const char *partName, int partID, int iBlockID, int iNodeBlockID) |
| Writes an element block to the VTF-file. More... | |
Private Attributes | |
| VTFAFile * | myFile |
| Pointer to the actual VTF-file being written. | |
| VTFAStateInfoBlock * | myState |
| The state info block for this file. | |
| VTFAGeometryBlock * | myGBlock |
| The geometry description block for this file. | |
| std::vector< VTFATransformationBlock * > | myTBlock |
| Transformation blocks. | |
| std::vector< VTFADisplacementBlock * > | myDBlock |
| Displacement blocks. | |
| std::vector< VTFAVectorBlock * > | myVBlock |
| Vector field blocks. | |
| std::vector< VTFAScalarBlock * > | mySBlock |
| Scalar field blocks. | |
| int | myPartID |
| Internal geometry block part ID. | |
| int | pointGeoID |
| ID of point vector geometry block. | |
| int | lastStep |
| ID of the last state written to file. | |
| std::vector< GridBlock > | myBlocks |
| The FE geometry of the whole model. | |
Class for output of FE model and results to VTF file.
| VTF::VTF | ( | const char * | filename, |
| int | type | ||
| ) |
The constructor opens a new VTF-file.
| [in] | filename | Name of the VTF-file |
| [in] | type | File type (0 = ASCII, 1 = BINARY) |
References lastStep, myFile, myGBlock, myPartID, myState, pointGeoID, showError(), and VTFA_FAILURE.
| bool VTF::writeDblk | ( | const std::vector< int > & | dBlockIDs, |
| const char * | resultName = nullptr, |
||
| int | idBlock = 1, |
||
| int | iStep = 1 |
||
| ) |
Writes a displacement block definition to the VTF-file.
| [in] | dBlockIDs | All result blocks that make up the displacement block |
| [in] | resultName | Name of the result quantity |
| [in] | idBlock | Displacement block identifier |
| [in] | iStep | Load/Time step identifier |
References myDBlock, showError(), VTFA_FAILURE, and VTFA_SUCCESS.
Referenced by SIMoutput::writeGlvM(), and SIMoutput::writeGlvS1().
|
private |
Writes an element block to the VTF-file.
The element topology of the last added element block is written.
| [in] | partName | Name used to identify the part in GLview |
| [in] | partID | Part identifier |
| [in] | iBlockID | Element block identifier |
| [in] | iNodeBlockID | Node block which the element block refers to |
References ElementBlock::getElements(), ElementBlock::getNoElmNodes(), ElementBlock::getNoElms(), myBlocks, myFile, VTFA_FAILURE, and VTFA_SUCCESS.
Referenced by writeGrid().
| bool VTF::writeEres | ( | const std::vector< Real > & | elementResult, |
| int | idBlock = 1, |
||
| int | geomID = 1 |
||
| ) |
Writes a block of scalar element results to the VTF-file.
| [in] | elementResult | Vector of element results (one per element) length must equal the number of elements in the geometry block |
| [in] | idBlock | Result block identifier |
| [in] | geomID | Geometry block identifier |
If elementResult is empty, the external element numbers will instead define the scalar field to be written.
References getBlock(), ElementBlock::getElmId(), ElementBlock::getElmIndex(), ElementBlock::getNoElms(), myBlocks, myFile, showError(), and VTFA_FAILURE.
Referenced by SIMoutput::writeGlvE(), and SIMoutput::writeGlvN().
| bool VTF::writeGrid | ( | const ElementBlock * | block, |
| const char * | gName, | ||
| int | elemID, | ||
| int | nodeID = 0 |
||
| ) |
Writes the FE geometry to the VTF-file.
| [in] | block | The FE grid that all results written are referred to |
| [in] | gName | Name of the geometry being written |
| [in] | elemID | Element block identifier |
| [in] | nodeID | Optional node block identifier (equal to elemID if 0) |
References myBlocks, myFile, myPartID, showError(), writeElements(), and writeNodes().
Referenced by SIMoutput::writeGlvG().
| bool VTF::writeNfunc | ( | const RealFunc & | f, |
| const Real * | u = nullptr, |
||
| Real | time = Real(0), |
||
| int | idBlock = 1, |
||
| int | gID = 1 |
||
| ) |
Writes a block of scalar nodal function values to the VTF-file.
| [in] | f | The scalar function to evaluate at the grid points |
| [in] | u | Pointer to array of solution state values |
| [in] | time | Current time |
| [in] | idBlock | Result block identifier |
| [in] | gID | Geometry block identifier |
References getBlock(), ElementBlock::getCoord(), ElementBlock::getNoNodes(), ElementBlock::getParam(), myBlocks, myFile, showError(), and VTFA_FAILURE.
Referenced by SIMoutput::writeGlvF().
|
private |
Writes a node block to the VTF-file.
The coordinates of the last added element block are written.
| [in] | iBlockID | Node block identifier |
References ElementBlock::begin_XYZ(), ElementBlock::end_XYZ(), ElementBlock::getNoNodes(), myBlocks, myFile, and VTFA_FAILURE.
Referenced by writeGrid().
| bool VTF::writeNres | ( | const std::vector< Real > & | nodalResult, |
| int | idBlock = 1, |
||
| int | geomID = 1 |
||
| ) |
Writes a block of scalar nodal results to the VTF-file.
| [in] | nodalResult | Vector of nodal results, length must equal the number of nodes in the geometry block |
| [in] | idBlock | Result block identifier |
| [in] | geomID | Geometry block identifier |
References getBlock(), ElementBlock::getNoNodes(), myBlocks, myFile, showError(), and VTFA_FAILURE.
Referenced by SIMoutput::writeGlvBC(), SIMoutput::writeGlvS(), and SIMoutput::writeScalarFields().
| bool VTF::writePoints | ( | const std::vector< Vec3 > & | points, |
| int & | gID | ||
| ) |
Writes a block of points (no results) to the VTF-file.
| [in] | points | Vector of point coordinates |
| gID | Running geometry block identifier |
References myBlocks, myFile, myPartID, showError(), vecOffset, and VTFA_FAILURE.
Referenced by writeVectors().
| bool VTF::writeSblk | ( | const std::vector< int > & | sBlockIDs, |
| const char * | resultName = nullptr, |
||
| int | idBlock = 1, |
||
| int | iStep = 1, |
||
| bool | elementData = false |
||
| ) |
Writes a scalar block definition to the VTF-file.
| [in] | sBlockIDs | All result blocks that make up this scalar block |
| [in] | resultName | Name of the result quantity |
| [in] | idBlock | Scalar block identifier |
| [in] | iStep | Load/Time step identifier |
| [in] | elementData | false -> data per node, true -> data per element |
References mySBlock, showError(), VTFA_FAILURE, and VTFA_SUCCESS.
| bool VTF::writeSblk | ( | int | sBlockID, |
| const char * | resultName = nullptr, |
||
| int | idBlock = 1, |
||
| int | iStep = 1, |
||
| bool | elementData = false |
||
| ) |
Writes a scalar block definition to the VTF-file.
| [in] | sBlockID | The result block that makes up this scalar block |
| [in] | resultName | Name of the result quantity |
| [in] | idBlock | Scalar block identifier |
| [in] | iStep | Load/Time step identifier |
| [in] | elementData | false -> data per node, true -> data per element |
References mySBlock, showError(), and VTFA_FAILURE.
Referenced by SIMoutput::writeGlvBC(), SIMoutput::writeGlvE(), SIMoutput::writeGlvF(), SIMoutput::writeGlvN(), SIMoutput::writeGlvP(), SIMoutput::writeGlvS(), SIMoutput::writeGlvS1(), and SIMoutput::writeGlvS2().
| bool VTF::writeState | ( | int | iStep, |
| const char * | fmt, | ||
| Real | refValue, | ||
| int | refType = 0 |
||
| ) |
Writes a state info block to the VTF-file.
| [in] | iStep | Load/Time step identifier |
| [in] | fmt | Format string for step name |
| [in] | refValue | Reference value for the step (time, frequency, etc.) |
| [in] | refType | Reference value type (0=Time, 1=Frequency, 2=Load case) |
References lastStep, myState, showError(), and VTFA_FAILURE.
Referenced by SIMoutput::writeGlvM(), and SIMoutput::writeGlvStep().
| bool VTF::writeTblk | ( | const std::vector< int > & | tBlockIDs, |
| const char * | resultName = nullptr, |
||
| int | idBlock = 1, |
||
| int | iStep = 1 |
||
| ) |
Writes a transformation block definition to the VTF-file.
| [in] | tBlockIDs | All result blocks that make the transformation block |
| [in] | resultName | Name of the result quantity |
| [in] | idBlock | Transformation block identifier |
| [in] | iStep | Load/Time step identifier |
References myTBlock, showError(), VTFA_FAILURE, and VTFA_SUCCESS.
Writes a transformation matrix to the VTF-file.
| [in] | X | Position part of the transformation |
| [in] | T | Orientation part of the transformation |
| [in] | idBlock | Result block identifier |
| [in] | gID | Geometry block identifier |
References getBlock(), myBlocks, myFile, showError(), and VTFA_FAILURE.
| bool VTF::writeVblk | ( | const std::vector< int > & | vBlockIDs, |
| const char * | resultName = nullptr, |
||
| int | idBlock = 1, |
||
| int | iStep = 1 |
||
| ) |
Writes a vector block definition to the VTF-file.
| [in] | vBlockIDs | All result blocks that make up this vector block |
| [in] | resultName | Name of the result quantity |
| [in] | idBlock | Vector block identifier |
| [in] | iStep | Load/Time step identifier |
References myVBlock, showError(), VTFA_FAILURE, and VTFA_SUCCESS.
| bool VTF::writeVblk | ( | int | vBlockID, |
| const char * | resultName = nullptr, |
||
| int | idBlock = 1, |
||
| int | iStep = 1 |
||
| ) |
Writes a vector block definition to the VTF-file.
| [in] | vBlockID | The result block that makes up this vector block |
| [in] | resultName | Name of the result quantity |
| [in] | idBlock | Vector block identifier |
| [in] | iStep | Load/Time step identifier |
References myVBlock, showError(), and VTFA_FAILURE.
Referenced by SIMoutput::writeGlvS1(), SIMoutput::writeGlvS2(), SIMoutput::writeGlvV(), and writeVectors().
| bool VTF::writeVectors | ( | const std::vector< Vec3Pair > & | pntResult, |
| int & | gID, | ||
| int | idBlock = 1, |
||
| const char * | resultName = nullptr, |
||
| int | iStep = 0, |
||
| int | iBlock = 1 |
||
| ) |
Writes a block of point vector results to the VTF-file.
| [in] | pntResult | A set of result vectors with associated attack points |
| gID | Running geometry block identifier | |
| [in] | idBlock | Result block identifier |
| [in] | resultName | Name of the result quantity |
| [in] | iStep | Load/Time step identifier |
| [in] | iBlock | Vector block identifier |
This method creates a separate geometry block consisting of the attack points of the result vectors, since they are independent of the FE geometry created by the writeGrid() method.
References myBlocks, myFile, myPartID, pointGeoID, showError(), vecOffset, VTFA_FAILURE, writePoints(), and writeVblk().
| bool VTF::writeVres | ( | const std::vector< Real > & | nodeResult, |
| int | idBlock = 1, |
||
| int | geomID = 1, |
||
| size_t | nvc = 0 |
||
| ) |
Writes a block of vector nodal results to the VTF-file.
| [in] | nodeResult | Vector of nodal results, length must be equal the number of nodes in the geometry block times 1...5 |
| [in] | idBlock | Result block identifier |
| [in] | geomID | Geometry block identifier |
| [in] | nvc | Number of components per node in nodeResult |
References getBlock(), ElementBlock::getNoNodes(), myBlocks, myFile, showError(), and VTFA_FAILURE.
Referenced by SIMoutput::writeGlvM(), SIMoutput::writeGlvS1(), SIMoutput::writeGlvS2(), and SIMoutput::writeGlvV().