OOFEM 3.0
Loading...
Searching...
No Matches
vtkhdf5exportmodule.h
Go to the documentation of this file.
1/*
2 *
3 * ##### ##### ###### ###### ### ###
4 * ## ## ## ## ## ## ## ### ##
5 * ## ## ## ## #### #### ## # ##
6 * ## ## ## ## ## ## ## ##
7 * ## ## ## ## ## ## ## ##
8 * ##### ##### ## ###### ## ##
9 *
10 *
11 * OOFEM : Object Oriented Finite Element Code
12 *
13 * Copyright (C) 1993 - 2025 Borek Patzak
14 *
15 *
16 *
17 * Czech Technical University, Faculty of Civil Engineering,
18 * Department of Structural Mechanics, 166 29 Prague, Czech Republic
19 *
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License as published by the Free Software Foundation; either
23 * version 2.1 of the License, or (at your option) any later version.
24 *
25 * This program is distributed in the hope that it will be useful,
26 * but WITHOUT ANY WARRANTY; without even the implied warranty of
27 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
28 * Lesser General Public License for more details.
29 *
30 * You should have received a copy of the GNU Lesser General Public
31 * License along with this library; if not, write to the Free Software
32 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
33 */
34
35#ifndef vtkhdf5exportmodule_h
36#define vtkhdf5exportmodule_h
37
38#include "vtkbaseexportmodule.h"
39#include "intarray.h"
40#include "nodalrecoverymodel.h"
41#include "interface.h"
43#include "integrationrule.h"
44#include "xfem/xfemmanager.h"
45#include <iostream>
46#include <fstream>
47#include <iomanip>
48
49
50#ifdef _WIN32
51 #define NULL_DEVICE "NUL:"
52#else
53 #define NULL_DEVICE "/dev/null"
54#endif
55
56
57#include <string>
58#include <list>
59
60#ifdef __HDF_MODULE
61#include "H5Cpp.h"
62#endif
63
64#ifndef H5_NO_NAMESPACE
65// using namespace H5;
66#endif
67
69
70#define _IFT_VTKHDF5ExportModule_Name "vtkhdf5"
71#define _IFT_VTKHDF5ExportModule_cellvars "cellvars"
72#define _IFT_VTKHDF5ExportModule_vars "vars"
73#define _IFT_VTKHDF5ExportModule_primvars "primvars"
74#define _IFT_VTKHDF5ExportModule_externalForces "externalforces"
75#define _IFT_VTKHDF5ExportModule_ipvars "ipvars"
76#define _IFT_VTKHDF5ExportModule_stype "stype"
78
79using namespace std;
80namespace oofem {
81class Node;
82
96{
97protected:
108
109
110
114 std::unique_ptr< NodalRecoveryModel >smoother;
116 std::unique_ptr< NodalRecoveryModel >primVarSmoother;
117
118
119public:
123 virtual ~VTKHDF5ExportModule();
124
125 void initializeFrom(InputRecord &ir) override;
126 void doOutput(TimeStep *tStep, bool forcedOutput = false) override;
127 void initialize() override;
128 void terminate() override;
129 const char *giveClassName() const override { return "VTKHDF5ExportModule"; }
133 //void exportPointDataHeader(std::ofstream fileStream, TimeStep *tStep);
134 //virtual void giveDataHeaders(std::string &pointHeader, std::string &cellHeader); // returns the headers
136 NodalRecoveryModel *giveSmoother();
138 NodalRecoveryModel *givePrimVarSmoother();
139
140
141#ifdef __VTK_MODULE
142 vtkSmartPointer< vtkUnstructuredGrid >fileStream;
143 vtkSmartPointer< vtkPoints >nodes;
144 vtkSmartPointer< vtkIdList >elemNodeArray;
145
146 vtkSmartPointer< vtkDoubleArray >intVarArray;
147 vtkSmartPointer< vtkDoubleArray >primVarArray;
148#endif
149#ifdef __HDF_MODULE
150 std::string fileName;
151 H5::H5File *file;
152 H5::Group *topGroup, *pointDataGroup, *cellDataGroup, *stepsGroup;
153 unsigned int pointCounter, cellCounter, connCounter, offsetCounter;
154#endif
155
157
158 std::vector< ExportRegion >defaultVTKPieces;
159
160 ExportRegion& getExportRegions() {return this->defaultVTKPiece;}
161protected:
162
163#ifdef __HDF_MODULE
164 void writeIntVars(ExportRegion &vtkPiece);
165 void writeXFEMVars(ExportRegion &vtkPiece);
166 void writePrimaryVars(ExportRegion &vtkPiece);
167 void writeCellVars(ExportRegion &vtkPiece);
168 void writeExternalForces(ExportRegion &vtkPiece);
173 bool writeVTKPieceEpilog(ExportRegion &vtkPiece, TimeStep *tStep);
178 bool writeVTKPieceVariables(ExportRegion &vtkPiece, TimeStep *tStep);
183 bool writeVTKPieceProlog(ExportRegion &vtkPiece, TimeStep *tStep, unsigned int& pointCount, unsigned int &cellCounter, unsigned int &connCounter, unsigned int& offsetCounter,
184 unsigned int& stepPointCounter, unsigned int& stepCellCounter, unsigned int& stepConnCounter,
185 H5::DataSet& points, H5::DataSet& conn, H5::DataSet &typeDSet, H5::DataSet& types);
191 void exportIntVarsInGpAs(IntArray valIDs, TimeStep *tStep);
192
193
194 void updateDataSet (H5::DataSet&, int rank, hsize_t* dim, hsize_t* offset, H5::DataType, const void* data);
195#endif
196
197#ifdef __VTK_MODULE
198 void writeVTKPointData(const char *name, vtkSmartPointer< vtkDoubleArray >varArray);
199#else
200 void writeVTKPointData(FloatArray &valueArray);
201#endif
202
203#ifdef __VTK_MODULE
204 void writeVTKCellData(const char *name, vtkSmartPointer< vtkDoubleArray >varArray);
205#else
206 void writeVTKCellData(FloatArray &valueArray);
207#endif
208
209 // Export of composite elements (built up from several subcells)
211 void exportCompositeElement(std::vector< ExportRegion > &vtkPieces, Element *el, TimeStep *tStep);
212};
213
214} // end namespace oofem
215#endif // vtkhdf5exportmodule_h
Stores all neccessary data (of a region) in a VTKPiece so it can be exported later.
VTKBaseExportModule(int n, EngngModel *e)
Constructor. Creates empty Output Manager. By default all components are selected.
const char * giveClassName() const override
Returns class name of the receiver.
VTKHDF5ExportModule(int n, EngngModel *e)
Constructor. Creates empty Output Manager. By default all components are selected.
std::unique_ptr< NodalRecoveryModel > primVarSmoother
Smoother for primary variables.
std::unique_ptr< NodalRecoveryModel > smoother
Smoother.
void exportCompositeElement(ExportRegion &vtkPiece, Element *el, TimeStep *tStep)
void writeVTKCellData(FloatArray &valueArray)
IntArray primaryVarsToExport
List of primary unknowns to export.
NodalRecoveryModel::NodalRecoveryModelType stype
Smoother type.
IntArray cellVarsToExport
List of cell data to export.
void doOutput(TimeStep *tStep, bool forcedOutput=false) override
std::vector< ExportRegion > defaultVTKPieces
IntArray ipInternalVarsToExport
List of internal variables to export directly in Integration Points (no smoothing to nodes).
void writeVTKPointData(FloatArray &valueArray)
IntArray externalForcesToExport
List of primary unknowns to export.
IntArray internalVarsToExport
List of InternalStateType values, identifying the selected vars for export.
void exportCompositeElement(std::vector< ExportRegion > &vtkPieces, Element *el, TimeStep *tStep)
void initializeFrom(InputRecord &ir) override
Initializes receiver according to object description stored in input record.
#define OOFEM_EXPORT
Definition oofemcfg.h:7

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