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 Total, S.A
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 
85  virtual void reinit() override;
86 
88  struct viewKeysStruct : OutputBase::viewKeysStruct
89  {
90  static constexpr auto plotFileRoot = "plotFileRoot";
91  static constexpr auto writeFEMFaces = "writeFEMFaces";
92  static constexpr auto writeGhostCells = "writeGhostCells";
93  static constexpr auto writeFaceElementsAs3D = "writeFaceElementsAs3D";
94  static constexpr auto plotLevel = "plotLevel";
95  static constexpr auto binaryString = "format";
96  static constexpr auto outputRegionTypeString = "outputRegionType";
97  static constexpr auto onlyPlotSpecifiedFieldNames = "onlyPlotSpecifiedFieldNames";
98  static constexpr auto fieldNames = "fieldNames";
99  static constexpr auto levelNames = "levelNames";
100  } vtkOutputViewKeys;
102 
107 #if defined(GEOS_USE_PYGEOSX)
108  virtual PyTypeObject * getPythonType() const override;
109 #endif
110 
111 private:
112 
113  string m_plotFileRoot;
114  integer m_writeFaceMesh;
115  integer m_plotLevel;
116 
118  integer m_writeGhostCells;
119 
121  integer m_writeFaceElementsAs3D;
122 
124  integer m_onlyPlotSpecifiedFieldNames;
125 
127  array1d< string > m_fieldNames;
128 
130  array1d< string > m_levelNames;
131 
133  vtk::VTKOutputMode m_writeBinaryData = vtk::VTKOutputMode::BINARY;
134 
136  vtk::VTKRegionTypes m_outputRegionType = vtk::VTKRegionTypes::ALL;
137 
139 
140 };
141 
142 
143 } /* namespace geos */
144 
145 #endif /* GEOS_FILEIO_OUTPUTS_VTKOUTPUT_HPP_ */
Partition of the decomposed physical domain. It also manages the connexion information to its neighbo...
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.
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
struct containing the view access keys to be bound with class data member