3.1-git
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
2p2c/sequential/fluxdata.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 * See the file COPYING for full copying permissions. *
5 * *
6 * This program is free software: you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation, either version 3 of the License, or *
9 * (at your option) any later version. *
10 * *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
15 * *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
18 *****************************************************************************/
24#ifndef DUMUX_FLUXDATA2P2C_HH
25#define DUMUX_FLUXDATA2P2C_HH
26
28
29namespace Dumux {
41template<class TypeTag>
43{
44private:
45 using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
46 using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
47 using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
48
49 enum
50 {
51 dim = GridView::dimension
52 };
53
54 enum
55 {
56 numEquations = GET_PROP_VALUE(TypeTag, NumEq)
57 };
58
59 enum
60 {
61 wPhaseIdx = Indices::wPhaseIdx,
62 nPhaseIdx = Indices::nPhaseIdx
63 };
64
65 enum
66 {
67 numPhases = GET_PROP_VALUE(TypeTag, NumPhases)
68 };
69
70 typename Dune::BlockVector<typename Dune::FieldVector<bool, numEquations>> isUpwindCell_;
71 using DimVector = Dune::FieldVector<Scalar, dim>;
72 using VelocityVector = Dune::FieldVector<DimVector, 2*dim>;
73 VelocityVector velocity_[numPhases];
74
75public:
76
79 {
80 isUpwindCell_.resize(2*dim);
81 for (int phaseIdx = 0; phaseIdx < numPhases; ++phaseIdx)
82 for (int fIdx = 0; fIdx < 2*dim; ++fIdx)
83 velocity_[phaseIdx][fIdx] = 0.0;
84 }
85
92 const DimVector& velocity(int phaseIdx, int indexInInside)
93 {
94 return velocity_[phaseIdx][indexInInside];
95 }
96
103 const DimVector& velocity(int phaseIdx, int indexInInside) const
104 {
105 return velocity_[phaseIdx][indexInInside];
106 }
107
115 void setVelocity(int phaseIdx, int indexInInside, const DimVector& velocity)
116 {
117 velocity_[phaseIdx][indexInInside] = velocity;
118 }
119
125 DimVector velocityTotal(int indexInInside)
126 {
127 return velocity_[wPhaseIdx][indexInInside]
128 + velocity_[nPhaseIdx][indexInInside];
129 }
130
136 DimVector velocityTotal(int indexInInside) const
137 {
138 return velocity_[wPhaseIdx][indexInInside]
139 + velocity_[nPhaseIdx][indexInInside];
140 }
141
143 void resize(int size)
144 {
145 isUpwindCell_.resize(size);
146 }
148 int size()
149 {
150 return isUpwindCell_.size();
151 }
152
159 const bool& isUpwindCell(int indexInInside, int equationIdx) const
160 {
161 return isUpwindCell_[indexInInside][equationIdx];
162 }
170 void setUpwindCell(int indexInInside, int equationIdx, bool value)
171 {
172 isUpwindCell_[indexInInside][equationIdx] = value;
173 }
174
177 {
178 for(int banana=0; banana<isUpwindCell_.size(); banana++)
179 printvector(std::cout, isUpwindCell_, "upwindInformation", "row", 3);
180 }
181
182
183};
184} // end namespace Dumux
185#endif
#define GET_PROP_VALUE(TypeTag, PropTagName)
Definition: propertysystemmacros.hh:282
#define GET_PROP_TYPE(TypeTag, PropTagName)
Definition: propertysystemmacros.hh:283
make the local view function available whenever we use the grid geometry
Definition: adapt.hh:29
Property tag NumEq
Number of equations in the system of PDEs.
Definition: porousmediumflow/sequential/properties.hh:68
Property tag NumPhases
Number of phases in the system.
Definition: porousmediumflow/sequential/properties.hh:69
Class including the variables and data of discretized data of the constitutive relations.
Definition: 2p2c/sequential/fluxdata.hh:43
void resize(int size)
resizes the upwind vector for the case of hanging nodes
Definition: 2p2c/sequential/fluxdata.hh:143
DimVector velocityTotal(int indexInInside) const
Returns the total velocity vector at a cell-cell interface.
Definition: 2p2c/sequential/fluxdata.hh:136
void setUpwindCell(int indexInInside, int equationIdx, bool value)
Sets the upwind information.
Definition: 2p2c/sequential/fluxdata.hh:170
FluxData2P2C()
Constructor.
Definition: 2p2c/sequential/fluxdata.hh:78
const DimVector & velocity(int phaseIdx, int indexInInside) const
Returns the phase velocity vector at a cell-cell interface.
Definition: 2p2c/sequential/fluxdata.hh:103
void setVelocity(int phaseIdx, int indexInInside, const DimVector &velocity)
Sets the phase velocity vector at a cell-cell interface.
Definition: 2p2c/sequential/fluxdata.hh:115
void outputFluxData()
Console output for the FluxData.
Definition: 2p2c/sequential/fluxdata.hh:176
const DimVector & velocity(int phaseIdx, int indexInInside)
Returns the phase velocity vector at a cell-cell interface.
Definition: 2p2c/sequential/fluxdata.hh:92
const bool & isUpwindCell(int indexInInside, int equationIdx) const
Functions returning upwind information.
Definition: 2p2c/sequential/fluxdata.hh:159
int size()
returns the size of the upwind vector which equals number of faces
Definition: 2p2c/sequential/fluxdata.hh:148
DimVector velocityTotal(int indexInInside)
Returns the total velocity vector at a cell-cell interface.
Definition: 2p2c/sequential/fluxdata.hh:125
Base file for properties related to sequential models.