vcfvdiscretization.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) 2008-2013 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_VCFV_DISCRETIZATION_HH
27 #define EWOMS_VCFV_DISCRETIZATION_HH
28 
29 #include <opm/material/localad/Math.hpp>
30 
31 #include "vcfvproperties.hh"
32 #include "vcfvstencil.hh"
35 #include "vcfvbaseoutputmodule.hh"
36 
39 
40 namespace Ewoms {
41 template <class TypeTag>
43 
44 namespace Properties {
47 {
48 private:
49  typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
50  typedef typename GridView::ctype CoordScalar;
51 
52 public:
54 };
55 
57 SET_TYPE_PROP(VcfvDiscretization, DofMapper, typename GET_PROP_TYPE(TypeTag, VertexMapper));
58 
61 
64 SET_TYPE_PROP(VcfvDiscretization, DiscBaseOutputModule,
66 
68 SET_TYPE_PROP(VcfvDiscretization, GradientCalculator,
70 
72 SET_TYPE_PROP(VcfvDiscretization, GridCommHandleFactory,
74 
77 SET_BOOL_PROP(VcfvDiscretization, UseTwoPointGradients, false);
78 
80 SET_PROP(VcfvDiscretization, BorderListCreator)
81 { private:
82  typedef typename GET_PROP_TYPE(TypeTag, VertexMapper) VertexMapper;
83  typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
84 public:
86 };
87 
91 SET_BOOL_PROP(VcfvDiscretization, LinearizeNonLocalElements, false);
92 
93 } // namespace Properties
94 
100 template<class TypeTag>
101 class VcfvDiscretization : public FvBaseDiscretization<TypeTag>
102 {
103  typedef FvBaseDiscretization<TypeTag> ParentType;
104  typedef typename GET_PROP_TYPE(TypeTag, Model) Implementation;
105  typedef typename GET_PROP_TYPE(TypeTag, DofMapper) DofMapper;
106  typedef typename GET_PROP_TYPE(TypeTag, GridView) GridView;
107  typedef typename GET_PROP_TYPE(TypeTag, Simulator) Simulator;
108 
109  enum { dim = GridView::dimension };
110 
111 
112 public:
114  : ParentType(simulator)
115  { }
116 
120  static std::string discretizationName()
121  { return "vcfv"; }
122 
126  size_t numGridDof() const
127  { return this->gridView_.size(/*codim=*/dim); }
128 
133  const DofMapper &dofMapper() const
134  { return this->simulator_.problem().vertexMapper(); }
135 
143  template <class Restarter>
144  void serialize(Restarter &res)
145  { res.template serializeEntities</*codim=*/dim>(asImp_(), this->gridView_); }
146 
154  template <class Restarter>
155  void deserialize(Restarter &res)
156  {
157  res.template deserializeEntities</*codim=*/dim>(asImp_(), this->gridView_);
158  this->solution_[/*timeIdx=*/1] = this->solution_[/*timeIdx=*/0];
159  }
160 
161 private:
162  Implementation &asImp_()
163  { return *static_cast<Implementation*>(this); }
164  const Implementation &asImp_() const
165  { return *static_cast<const Implementation*>(this); }
166 };
167 } // namespace Ewoms
168 
169 #endif
Implements the discretization specific parts of writing files.
Definition: vcfvbaseoutputmodule.hh:43
Uses communication on the grid to find the initial seed list of indices.
SolutionVector solution_[historySize]
Definition: fvbasediscretization.hh:1546
Problem & problem()
Return the object which specifies the pysical setup of the simulation.
Definition: simulator.hh:189
size_t numGridDof() const
Returns the number of global degrees of freedom (DOFs) due to the grid.
Definition: vcfvdiscretization.hh:126
GridView gridView_
Definition: fvbasediscretization.hh:1531
#define GET_PROP_TYPE(TypeTag, PropTagName)
Access the type attribute of a property for a type tag.
Definition: propertysystem.hh:485
Uses communication on the grid to find the initial seed list of indices.
Definition: vertexborderlistfromgrid.hh:52
static std::string discretizationName()
Returns a string of discretization's human-readable name.
Definition: vcfvdiscretization.hh:120
SET_PROP(NumericModel, ParameterTree)
Set the ParameterTree property.
Definition: basicproperties.hh:117
A class which provides types for DUNE grid handles for communication.
Definition: vcfvgridcommhandlefactory.hh:43
The base class for the finite volume discretization schemes.
Represents the finite volume geometry of a single element in the VCFV discretization.
SET_TYPE_PROP(NumericModel, Scalar, double)
Set the default type of scalar values to double.
Represents the finite volume geometry of a single element in the VCFV discretization.
Definition: vcfvstencil.hh:469
Manages the initializing and running of time dependent problems.
Definition: simulator.hh:73
VcfvDiscretization(Simulator &simulator)
Definition: vcfvdiscretization.hh:113
Definition: baseauxiliarymodule.hh:35
This class calculates gradients of arbitrary quantities at flux integration points for the vertex cen...
A class which provides types for DUNE grid handles for communication.
void deserialize(Restarter &res)
Deserializes the state of the model.
Definition: vcfvdiscretization.hh:155
The base class for the vertex centered finite volume discretization scheme.
Definition: vcfvdiscretization.hh:42
Simulator & simulator_
Definition: fvbasediscretization.hh:1528
Implements the discretization specific parts of writing files.
const DofMapper & dofMapper() const
Mapper to convert the Dune entities of the discretization's degrees of freedoms are to indices...
Definition: vcfvdiscretization.hh:133
This class calculates gradients of arbitrary quantities at flux integration points for the vertex cen...
Definition: vcfvgradientcalculator.hh:51
void serialize(Restarter &res)
Serializes the current state of the model.
Definition: vcfvdiscretization.hh:144
SET_BOOL_PROP(FvBaseDiscretization, EnableVtkOutput, true)
Enable the VTK output by default.
Declares the basic properties used by the common infrastructure of the vertex-centered finite volume ...