GEOS
VTKOutput.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2024 TotalEnergies
7  * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
8  * Copyright (c) 2023-2024 Chevron
9  * Copyright (c) 2019- GEOS/GEOSX Contributors
10  * All rights reserved
11  *
12  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
13  * ------------------------------------------------------------------------------------------------------------
14  */
15 
20 #ifndef GEOS_FILEIO_OUTPUTS_VTKOUTPUT_HPP_
21 #define GEOS_FILEIO_OUTPUTS_VTKOUTPUT_HPP_
22 
23 #include "OutputBase.hpp"
24 #include "fileIO/vtk/VTKPolyDataWriterInterface.hpp"
25 
26 
27 namespace geos
28 {
29 
33 class VTKOutput : public OutputBase
34 {
35 public:
36 
38  VTKOutput( string const & name, Group * const parent );
39 
41  virtual ~VTKOutput() override;
42 
47  static string catalogName() { return "VTK"; }
48 
49  virtual void postInputInitialization() override;
50 
56  void setPlotFileRoot( string const & root );
57 
62  virtual bool execute( real64 const time_n,
63  real64 const dt,
64  integer const cycleNumber,
65  integer const eventCounter,
66  real64 const eventProgress,
67  DomainPartition & domain ) override;
68 
73  virtual void cleanup( real64 const time_n,
74  integer const cycleNumber,
75  integer const eventCounter,
76  real64 const eventProgress,
77  DomainPartition & domain ) override
78  {
79  execute( time_n, 0, cycleNumber, eventCounter, eventProgress, domain );
80 
81  // Call parent class cleanup to get the timing statistics
82  OutputBase::cleanup( time_n, cycleNumber, eventCounter, eventProgress, domain );
83  }
84 
88  virtual void reinit() override;
89 
91  struct viewKeysStruct : OutputBase::viewKeysStruct
92  {
93  static constexpr auto plotFileRoot = "plotFileRoot";
94  static constexpr auto writeFEMFaces = "writeFEMFaces";
95  static constexpr auto writeGhostCells = "writeGhostCells";
96  static constexpr auto writeFaceElementsAs3D = "writeFaceElementsAs3D";
97  static constexpr auto plotLevel = "plotLevel";
98  static constexpr auto binaryString = "format";
99  static constexpr auto outputRegionTypeString = "outputRegionType";
100  static constexpr auto onlyPlotSpecifiedFieldNames = "onlyPlotSpecifiedFieldNames";
101  static constexpr auto fieldNames = "fieldNames";
102  static constexpr auto levelNames = "levelNames";
103  static constexpr auto numberOfTargetProcesses = "numberOfTargetProcesses";
104  } vtkOutputViewKeys;
106 
111 #if defined(GEOS_USE_PYGEOSX)
112  virtual PyTypeObject * getPythonType() const override;
113 #endif
114 
115 protected:
119  logInfo::OutputTimerBase const & getTimerCategory() const override;
120 
121 private:
122 
123  string m_plotFileRoot;
124  integer m_writeFaceMesh;
125  integer m_plotLevel;
126 
128  integer m_numberOfTargetProcesses;
129 
131  integer m_writeGhostCells;
132 
134  integer m_writeFaceElementsAs3D;
135 
137  integer m_onlyPlotSpecifiedFieldNames;
138 
140  array1d< string > m_fieldNames;
141 
143  array1d< string > m_levelNames;
144 
146  vtk::VTKOutputMode m_writeBinaryData = vtk::VTKOutputMode::BINARY;
147 
149  vtk::VTKRegionTypes m_outputRegionType = vtk::VTKRegionTypes::ALL;
150 
152 
153 };
154 
155 
156 } /* namespace geos */
157 
158 #endif /* GEOS_FILEIO_OUTPUTS_VTKOUTPUT_HPP_ */
Partition of the decomposed physical domain. It also manages the connexion information to its neighbo...
virtual void cleanup(real64 const time_n, integer const cycleNumber, integer const eventCounter, real64 const eventProgress, DomainPartition &domain) override
Called as the code exits the main run loop.
A class for creating vtk outputs.
Definition: VTKOutput.hpp:34
virtual void postInputInitialization() override
virtual void reinit() override
Performs re-initialization of the datasets accumulated in the PVD writer.
void setPlotFileRoot(string const &root)
Set the plotFileRoot name for the output.
logInfo::OutputTimerBase const & getTimerCategory() const override
Return PyVTKOutput type.
VTKOutput(string const &name, Group *const parent)
Constructor.
static string catalogName()
Catalog name interface.
Definition: VTKOutput.hpp:47
virtual bool execute(real64 const time_n, real64 const dt, integer const cycleNumber, integer const eventCounter, real64 const eventProgress, DomainPartition &domain) override
Writes out a set of vtk files.
virtual ~VTKOutput() override
Destructor.
virtual void cleanup(real64 const time_n, integer const cycleNumber, integer const eventCounter, real64 const eventProgress, DomainPartition &domain) override
Write one final set of vtk files as the code exits.
Definition: VTKOutput.hpp:73
Encapsulate output methods for vtk.
double real64
64-bit floating point type.
Definition: DataTypes.hpp:99
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:82
Array< T, 1 > array1d
Alias for 1D array.
Definition: DataTypes.hpp:176
Base interface for specific output type timers.
Definition: OutputBase.hpp:59
struct containing the view access keys to be bound with class data member