3.3.0
DUNE for Multi-{Phase, Component, Scale, Physics, ...} flow and transport in porous media
1p/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 *****************************************************************************/
25#ifndef DUMUX_FLUXDATA1P_HH
26#define DUMUX_FLUXDATA1P_HH
27
28#include "properties.hh"
29
30namespace Dumux {
40template<class TypeTag>
42{
43private:
46
47 enum
48 {
49 dim = GridView::dimension
50 };
51
52 using DimVector = Dune::FieldVector<Scalar, dim>;
53 using VelocityVector = Dune::FieldVector<DimVector, 2*dim>;
54
55 VelocityVector velocity_;
56 Scalar potential_[2 * dim];
57 bool velocityMarker_[2 * dim];
58
59public:
60
63 {
64 for (int fIdx = 0; fIdx < 2*dim; fIdx++)
65 {
66 velocity_[fIdx] = DimVector(0.0);
67 potential_[fIdx] = 0.0;
68 velocityMarker_[fIdx] = false;
69 }
70 }
71
73 // functions returning the vectors of the primary variables
75
81 const DimVector& velocity(int indexInInside)
82 {
83 return velocity_[indexInInside];
84 }
85
91 const DimVector& velocity(int indexInInside) const
92 {
93 return velocity_[indexInInside];
94 }
95
102 void setVelocity(int indexInInside, DimVector& velocity)
103 {
104 velocity_[indexInInside] = velocity;
105 }
106
109 {
110 for (int i = 0; i < 2 * dim; i++)
111 {
112 velocity_[i] = 0.;
113 potential_[i] = 0.;
114 velocityMarker_[i] = false;
115 }
116 }
117
125 void setVelocityMarker(int indexInInside)
126 {
127 velocityMarker_[indexInInside] = true;
128 }
129
137 bool haveVelocity(int indexInInside)
138 {
139 return velocityMarker_[indexInInside];
140 }
141
144 {
145 for (int i = 0; i < 2*dim; i++)
146 velocityMarker_[i] = false;
147 }
148
157 bool isUpwindCell(int indexInInside)
158 {
159 return (potential_[indexInInside] >= 0.);
160 }
161
167 bool isUpwindCell(int indexInInside) const
168 {
169 return (potential_[indexInInside] >= 0.);
170 }
171
177 Scalar potential(int indexInInside)
178 {
179 return potential_[indexInInside];
180 }
181
187 Scalar potential(int indexInInside) const
188 {
189 return potential_[indexInInside];
190 }
191
198 void setPotential(int indexInInside, Scalar pot)
199 {
200 potential_[indexInInside] = pot;
201 }
202
203};
204} // end namespace Dumux
205#endif
Definition: adapt.hh:29
typename Properties::Detail::GetPropImpl< TypeTag, Property >::type::type GetPropType
get the type alias defined in the property (equivalent to old macro GET_PROP_TYPE(....
Definition: propertysystem.hh:149
Class storing data assigned to a cell-cell interfaces, so-called flux-data.
Definition: 1p/sequential/fluxdata.hh:42
Scalar potential(int indexInInside)
Returns the potential at a cell-cell interface.
Definition: 1p/sequential/fluxdata.hh:177
const DimVector & velocity(int indexInInside) const
Returns the velocity vector at a cell-cell interface.
Definition: 1p/sequential/fluxdata.hh:91
bool isUpwindCell(int indexInInside) const
Checks for upwind direction Returns true if the cell is the upwind cell, otherwise false
Definition: 1p/sequential/fluxdata.hh:167
void setVelocity(int indexInInside, DimVector &velocity)
Sets the velocity vector at a cell-cell interface.
Definition: 1p/sequential/fluxdata.hh:102
void resetVelocityMarker()
Resets the velocity marker.
Definition: 1p/sequential/fluxdata.hh:143
Scalar potential(int indexInInside) const
Returns the potential at a cell-cell interface.
Definition: 1p/sequential/fluxdata.hh:187
bool haveVelocity(int indexInInside)
Check the velocity marker.
Definition: 1p/sequential/fluxdata.hh:137
void setVelocityMarker(int indexInInside)
Sets the velocity marker at a cell-cell interface.
Definition: 1p/sequential/fluxdata.hh:125
const DimVector & velocity(int indexInInside)
Returns the velocity vector at a cell-cell interface.
Definition: 1p/sequential/fluxdata.hh:81
void resetVelocity()
Resets velocities and potentials.
Definition: 1p/sequential/fluxdata.hh:108
FluxData1P()
Constructs a FluxData1P object.
Definition: 1p/sequential/fluxdata.hh:62
void setPotential(int indexInInside, Scalar pot)
Sets the potential at a cell-cell interface.
Definition: 1p/sequential/fluxdata.hh:198
bool isUpwindCell(int indexInInside)
Checks for upwind direction.
Definition: 1p/sequential/fluxdata.hh:157
Base file for properties related to sequential models.