baseoutputwriter.hh
Go to the documentation of this file.
1 // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 // vi: set et ts=4 sw=4 sts=4:
3 /*
4  Copyright (C) 2014 by Andreas Lauser
5 
6  This file is part of the Open Porous Media project (OPM).
7 
8  OPM is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 2 of the License, or
11  (at your option) any later version.
12 
13  OPM is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with OPM. If not, see <http://www.gnu.org/licenses/>.
20 */
26 #ifndef EWOMS_BASE_OUTPUT_WRITER_HH
27 #define EWOMS_BASE_OUTPUT_WRITER_HH
28 
29 #include <dune/common/dynvector.hh>
30 #include <dune/common/dynmatrix.hh>
31 
32 #include <vector>
33 
34 namespace Ewoms {
42 {
43 public:
44  typedef double Scalar;
45  typedef Dune::DynamicVector<double> Vector;
46  typedef Dune::DynamicMatrix<double> Tensor;
47  typedef std::vector<Scalar> ScalarBuffer;
48  typedef std::vector<Vector> VectorBuffer;
49  typedef std::vector<Tensor> TensorBuffer;
50 
52  {}
53 
55  {}
56 
61  virtual void beginWrite(double t) = 0;
62 
66  virtual void attachScalarVertexData(ScalarBuffer &buf, std::string name) = 0;
67 
71  virtual void attachScalarElementData(ScalarBuffer &buf, std::string name) = 0;
72 
76  virtual void attachVectorVertexData(VectorBuffer &buf, std::string name) = 0;
77 
81  virtual void attachVectorElementData(VectorBuffer &buf, std::string name) = 0;
82 
86  virtual void attachTensorVertexData(TensorBuffer &buf, std::string name) = 0;
87 
91  virtual void attachTensorElementData(TensorBuffer &buf, std::string name) = 0;
92 
100  virtual void endWrite(bool onlyDiscard = false) = 0;
101 };
102 } // namespace Ewoms
103 
104 #endif
virtual void attachVectorElementData(VectorBuffer &buf, std::string name)=0
Add a vectorial element centered quantity to the output.
virtual void endWrite(bool onlyDiscard=false)=0
Finalizes the current writer.
std::vector< Vector > VectorBuffer
Definition: baseoutputwriter.hh:48
std::vector< Scalar > ScalarBuffer
Definition: baseoutputwriter.hh:47
virtual void attachVectorVertexData(VectorBuffer &buf, std::string name)=0
Add a vectorial vertex centered vector field to the output.
std::vector< Tensor > TensorBuffer
Definition: baseoutputwriter.hh:49
virtual void attachTensorVertexData(TensorBuffer &buf, std::string name)=0
Add a tensorial vertex centered tensor field to the output.
double Scalar
Definition: baseoutputwriter.hh:44
The base class for all output writers.
Definition: baseoutputwriter.hh:41
Definition: baseauxiliarymodule.hh:35
virtual void beginWrite(double t)=0
Called when ever a new time step or a new grid must be written.
virtual ~BaseOutputWriter()
Definition: baseoutputwriter.hh:54
virtual void attachTensorElementData(TensorBuffer &buf, std::string name)=0
Add a tensorial element centered quantity to the output.
virtual void attachScalarVertexData(ScalarBuffer &buf, std::string name)=0
Add a scalar vertex centered vector field to the output.
virtual void attachScalarElementData(ScalarBuffer &buf, std::string name)=0
Add a scalar element centered quantity to the output.
Dune::DynamicVector< double > Vector
Definition: baseoutputwriter.hh:45
BaseOutputWriter()
Definition: baseoutputwriter.hh:51
Dune::DynamicMatrix< double > Tensor
Definition: baseoutputwriter.hh:46