GEOSX
VTKOutput.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2020 TotalEnergies
8  * Copyright (c) 2019- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
19 #ifndef GEOS_FILEIO_OUTPUTS_VTKOUTPUT_HPP_
20 #define GEOS_FILEIO_OUTPUTS_VTKOUTPUT_HPP_
21 
22 #include "OutputBase.hpp"
23 #include "fileIO/vtk/VTKPolyDataWriterInterface.hpp"
24 
25 
26 namespace geos
27 {
28 
32 class VTKOutput : public OutputBase
33 {
34 public:
35 
37  VTKOutput( string const & name, Group * const parent );
38 
40  virtual ~VTKOutput() override;
41 
46  static string catalogName() { return "VTK"; }
47 
48  virtual void postProcessInput() override;
49 
55  void setPlotFileRoot( string const & root );
56 
61  virtual bool execute( real64 const time_n,
62  real64 const dt,
63  integer const cycleNumber,
64  integer const eventCounter,
65  real64 const eventProgress,
66  DomainPartition & domain ) override;
67 
72  virtual void cleanup( real64 const time_n,
73  integer const cycleNumber,
74  integer const eventCounter,
75  real64 const eventProgress,
76  DomainPartition & domain ) override
77  {
78  execute( time_n, 0, cycleNumber, eventCounter, eventProgress, domain );
79  }
80 
84  virtual void reinit() override;
85 
87  struct viewKeysStruct : OutputBase::viewKeysStruct
88  {
89  static constexpr auto plotFileRoot = "plotFileRoot";
90  static constexpr auto writeFEMFaces = "writeFEMFaces";
91  static constexpr auto writeGhostCells = "writeGhostCells";
92  static constexpr auto plotLevel = "plotLevel";
93  static constexpr auto binaryString = "format";
94  static constexpr auto outputRegionTypeString = "outputRegionType";
95  static constexpr auto onlyPlotSpecifiedFieldNames = "onlyPlotSpecifiedFieldNames";
96  static constexpr auto fieldNames = "fieldNames";
97  static constexpr auto levelNames = "levelNames";
98  } vtkOutputViewKeys;
100 
105 #if defined(GEOSX_USE_PYGEOSX)
106  virtual PyTypeObject * getPythonType() const override;
107 #endif
108 
109 private:
110 
111  string m_plotFileRoot;
112  integer m_writeFaceMesh;
113  integer m_plotLevel;
114 
116  integer m_writeGhostCells;
117 
119  integer m_onlyPlotSpecifiedFieldNames;
120 
122  array1d< string > m_fieldNames;
123 
125  array1d< string > m_levelNames;
126 
128  vtk::VTKOutputMode m_writeBinaryData = vtk::VTKOutputMode::BINARY;
129 
131  vtk::VTKRegionTypes m_outputRegionType = vtk::VTKRegionTypes::ALL;
132 
134 
135 };
136 
137 
138 } /* namespace geos */
139 
140 #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:33
virtual void reinit() override
Performs re-initialization of the datasets accumulated in the PVD writer.
virtual void postProcessInput() override
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:46
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:72
Encapsulate output methods for vtk.
double real64
64-bit floating point type.
Definition: DataTypes.hpp:139
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:122
Array< T, 1 > array1d
Alias for 1D array.
Definition: DataTypes.hpp:216
struct containing the view access keys to be bound with class data member