Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
1cec12ba
Commit
1cec12ba
authored
May 16, 2018
by
Timo Koch
Browse files
[cleanup] Remove extract dof privars in volumevariables. Extract directly from elemsol.
parent
839a1e54
Changes
16
Hide whitespace changes
Inline
Side-by-side
dumux/freeflow/volumevariables.hh
View file @
1cec12ba
...
...
@@ -78,18 +78,10 @@ public:
const
Element
&
element
,
const
SubControlVolume
&
scv
)
{
priVars_
=
extractDofPriVars
(
elemSol
,
scv
)
;
priVars_
=
elemSol
[
scv
.
localDofIndex
()]
;
extrusionFactor_
=
problem
.
extrusionFactor
(
element
,
scv
,
elemSol
);
}
/*!
* \brief Returns the primary variables at the dof associated with a given scv.
*/
template
<
class
ElementSolution
,
class
SubControlVolume
>
static
const
auto
&
extractDofPriVars
(
const
ElementSolution
&
elemSol
,
const
SubControlVolume
&
scv
)
{
return
elemSol
[
0
];
}
/*!
* \brief Return how much the sub-control volume is extruded.
*
...
...
@@ -226,7 +218,7 @@ public:
const
Element
&
element
,
const
Scv
&
scv
)
{
return
ParentType
::
extractDofPriVars
(
elemSol
,
scv
)
[
Indices
::
temperatureIdx
];
return
elemSol
[
scv
.
localDofIndex
()]
[
Indices
::
temperatureIdx
];
}
//! The phase enthalpy is zero for isothermal models
...
...
dumux/porousmediumflow/1p/volumevariables.hh
View file @
1cec12ba
...
...
@@ -108,7 +108,7 @@ public:
EnergyVolVars
::
updateTemperature
(
elemSol
,
problem
,
element
,
scv
,
fluidState
,
solidState
);
fluidState
.
setSaturation
(
/*phaseIdx=*/
0
,
1.
);
const
auto
&
priVars
=
ParentType
::
extractDofPriVars
(
elemSol
,
scv
)
;
const
auto
&
priVars
=
elemSol
[
scv
.
localDofIndex
()]
;
fluidState
.
setPressure
(
/*phaseIdx=*/
0
,
priVars
[
Indices
::
pressureIdx
]);
// saturation in a single phase is always 1 and thus redundant
...
...
dumux/porousmediumflow/1pnc/volumevariables.hh
View file @
1cec12ba
...
...
@@ -142,7 +142,7 @@ public:
EnergyVolVars
::
updateTemperature
(
elemSol
,
problem
,
element
,
scv
,
fluidState
,
solidState
);
fluidState
.
setSaturation
(
fluidSystemPhaseIdx
,
1.
);
const
auto
&
priVars
=
ParentType
::
extractDofPriVars
(
elemSol
,
scv
)
;
const
auto
&
priVars
=
elemSol
[
scv
.
localDofIndex
()]
;
fluidState
.
setPressure
(
fluidSystemPhaseIdx
,
priVars
[
pressureIdx
]);
// calculate the phase composition
...
...
dumux/porousmediumflow/2p/volumevariables.hh
View file @
1cec12ba
...
...
@@ -133,7 +133,7 @@ public:
using
MaterialLaw
=
typename
Problem
::
SpatialParams
::
MaterialLaw
;
const
auto
&
materialParams
=
problem
.
spatialParams
().
materialLawParams
(
element
,
scv
,
elemSol
);
const
auto
&
priVars
=
ParentType
::
extractDofPriVars
(
elemSol
,
scv
)
;
const
auto
&
priVars
=
elemSol
[
scv
.
localDofIndex
()]
;
const
int
wPhaseIdx
=
problem
.
spatialParams
().
template
wettingPhase
<
FluidSystem
>(
element
,
scv
,
elemSol
);
if
(
formulation
==
TwoPFormulation
::
p0s1
)
...
...
dumux/porousmediumflow/2p1c/volumevariables.hh
View file @
1cec12ba
...
...
@@ -143,7 +143,7 @@ public:
// capillary pressure parameters
const
auto
&
materialParams
=
problem
.
spatialParams
().
materialLawParams
(
element
,
scv
,
elemSol
);
const
auto
&
priVars
=
ParentType
::
extractDofPriVars
(
elemSol
,
scv
)
;
const
auto
&
priVars
=
elemSol
[
scv
.
localDofIndex
()]
;
const
auto
phasePresence
=
priVars
.
state
();
// get saturations
...
...
dumux/porousmediumflow/2p2c/volumevariables.hh
View file @
1cec12ba
...
...
@@ -174,7 +174,7 @@ public:
{
EnergyVolVars
::
updateTemperature
(
elemSol
,
problem
,
element
,
scv
,
fluidState
,
solidState
);
const
auto
&
priVars
=
ParentType
::
extractDofPriVars
(
elemSol
,
scv
)
;
const
auto
&
priVars
=
elemSol
[
scv
.
localDofIndex
()]
;
const
auto
phasePresence
=
priVars
.
state
();
using
MaterialLaw
=
typename
Problem
::
SpatialParams
::
MaterialLaw
;
...
...
dumux/porousmediumflow/2pnc/volumevariables.hh
View file @
1cec12ba
...
...
@@ -193,7 +193,7 @@ public:
{
EnergyVolVars
::
updateTemperature
(
elemSol
,
problem
,
element
,
scv
,
fluidState
,
solidState
);
const
auto
&
priVars
=
ParentType
::
extractDofPriVars
(
elemSol
,
scv
)
;
const
auto
&
priVars
=
elemSol
[
scv
.
localDofIndex
()]
;
const
auto
phasePresence
=
priVars
.
state
();
using
MaterialLaw
=
typename
Problem
::
SpatialParams
::
MaterialLaw
;
...
...
dumux/porousmediumflow/3p/volumevariables.hh
View file @
1cec12ba
...
...
@@ -136,7 +136,7 @@ public:
EnergyVolVars
::
updateTemperature
(
elemSol
,
problem
,
element
,
scv
,
fluidState
,
solidState
);
const
auto
&
materialParams
=
problem
.
spatialParams
().
materialLawParams
(
element
,
scv
,
elemSol
);
const
auto
&
priVars
=
ParentType
::
extractDofPriVars
(
elemSol
,
scv
)
;
const
auto
&
priVars
=
elemSol
[
scv
.
localDofIndex
()]
;
const
Scalar
sw
=
priVars
[
swIdx
];
const
Scalar
sn
=
priVars
[
snIdx
];
...
...
dumux/porousmediumflow/3p3c/volumevariables.hh
View file @
1cec12ba
...
...
@@ -110,7 +110,7 @@ public:
const
Scv
&
scv
)
{
ParentType
::
update
(
elemSol
,
problem
,
element
,
scv
);
const
auto
&
priVars
=
ParentType
::
extractDofPriVars
(
elemSol
,
scv
)
;
const
auto
&
priVars
=
elemSol
[
scv
.
localDofIndex
()]
;
const
auto
phasePresence
=
priVars
.
state
();
constexpr
bool
useConstraintSolver
=
ModelTraits
::
useConstraintSolver
();
...
...
dumux/porousmediumflow/3pwateroil/volumevariables.hh
View file @
1cec12ba
...
...
@@ -103,7 +103,7 @@ public:
const
Scv
&
scv
)
{
ParentType
::
update
(
elemSol
,
problem
,
element
,
scv
);
const
auto
&
priVars
=
ParentType
::
extractDofPriVars
(
elemSol
,
scv
)
;
const
auto
&
priVars
=
elemSol
[
scv
.
localDofIndex
()]
;
const
auto
phasePresence
=
priVars
.
state
();
bool
onlyGasPhaseCanDisappear
=
Traits
::
ModelTraits
::
onlyGasPhaseCanDisappear
();
...
...
dumux/porousmediumflow/co2/volumevariables.hh
View file @
1cec12ba
...
...
@@ -162,7 +162,7 @@ public:
{
EnergyVolVars
::
updateTemperature
(
elemSol
,
problem
,
element
,
scv
,
fluidState
,
solidState
);
const
auto
&
priVars
=
ParentType
::
extractDofPriVars
(
elemSol
,
scv
)
;
const
auto
&
priVars
=
elemSol
[
scv
.
localDofIndex
()]
;
const
auto
phasePresence
=
priVars
.
state
();
using
MaterialLaw
=
typename
Problem
::
SpatialParams
::
MaterialLaw
;
...
...
dumux/porousmediumflow/mpnc/volumevariables.hh
View file @
1cec12ba
...
...
@@ -167,7 +167,7 @@ public:
/////////////
// set the phase saturations
/////////////
auto
&&
priVars
=
ParentType
::
extractDofPriVars
(
elemSol
,
scv
)
;
auto
&&
priVars
=
elemSol
[
scv
.
localDofIndex
()]
;
Scalar
sumSat
=
0
;
for
(
int
phaseIdx
=
0
;
phaseIdx
<
numPhases
()
-
1
;
++
phaseIdx
)
{
sumSat
+=
priVars
[
Indices
::
s0Idx
+
phaseIdx
];
...
...
@@ -620,7 +620,7 @@ public:
/////////////
// set the phase saturations
/////////////
auto
&&
priVars
=
ParentType
::
extractDofPriVars
(
elemSol
,
scv
)
;
auto
&&
priVars
=
elemSol
[
scv
.
localDofIndex
()]
;
Scalar
sumSat
=
0
;
for
(
int
phaseIdx
=
0
;
phaseIdx
<
numPhases
()
-
1
;
++
phaseIdx
)
{
sumSat
+=
priVars
[
Indices
::
s0Idx
+
phaseIdx
];
...
...
dumux/porousmediumflow/nonisothermal/volumevariables.hh
View file @
1cec12ba
...
...
@@ -125,7 +125,7 @@ public:
if
(
numEnergyEq
==
1
)
{
// retrieve temperature from solution vector, all phases have the same temperature
const
Scalar
T
=
ParentType
::
extractDofPriVars
(
elemSol
,
scv
)
[
temperatureIdx
];
const
Scalar
T
=
elemSol
[
scv
.
localDofIndex
()]
[
temperatureIdx
];
for
(
int
phaseIdx
=
0
;
phaseIdx
<
FluidSystem
::
numPhases
;
++
phaseIdx
)
{
fluidState
.
setTemperature
(
phaseIdx
,
T
);
...
...
@@ -138,11 +138,11 @@ public:
for
(
int
phaseIdx
=
0
;
phaseIdx
<
numEnergyEq
-
1
;
++
phaseIdx
)
{
// retrieve temperatures from solution vector, phases might have different temperature
const
Scalar
T
=
ParentType
::
extractDofPriVars
(
elemSol
,
scv
)
[
temperatureIdx
+
phaseIdx
];
const
Scalar
T
=
elemSol
[
scv
.
localDofIndex
()]
[
temperatureIdx
+
phaseIdx
];
fluidState
.
setTemperature
(
phaseIdx
,
T
);
}
const
Scalar
solidTemperature
=
ParentType
::
extractDofPriVars
(
elemSol
,
scv
)
[
temperatureIdx
+
numEnergyEq
-
1
];
const
Scalar
solidTemperature
=
elemSol
[
scv
.
localDofIndex
()]
[
temperatureIdx
+
numEnergyEq
-
1
];
solidState
.
setTemperature
(
solidTemperature
);
}
}
...
...
dumux/porousmediumflow/richards/volumevariables.hh
View file @
1cec12ba
...
...
@@ -85,7 +85,7 @@ public:
{
ParentType
::
update
(
elemSol
,
problem
,
element
,
scv
);
const
auto
&
materialParams
=
problem
.
spatialParams
().
materialLawParams
(
element
,
scv
,
elemSol
);
const
auto
&
priVars
=
ParentType
::
extractDofPriVars
(
elemSol
,
scv
)
;
const
auto
&
priVars
=
elemSol
[
scv
.
localDofIndex
()]
;
const
auto
phasePresence
=
priVars
.
state
();
// precompute the minimum capillary pressure (entry pressure)
...
...
@@ -183,7 +183,7 @@ public:
EnergyVolVars
::
updateTemperature
(
elemSol
,
problem
,
element
,
scv
,
fluidState
,
solidState
);
const
auto
&
materialParams
=
problem
.
spatialParams
().
materialLawParams
(
element
,
scv
,
elemSol
);
const
auto
&
priVars
=
ParentType
::
extractDofPriVars
(
elemSol
,
scv
)
;
const
auto
&
priVars
=
elemSol
[
scv
.
localDofIndex
()]
;
// set the wetting pressure
using
std
::
max
;
...
...
dumux/porousmediumflow/richardsnc/volumevariables.hh
View file @
1cec12ba
...
...
@@ -140,7 +140,7 @@ public:
EnergyVolVars
::
updateTemperature
(
elemSol
,
problem
,
element
,
scv
,
fluidState
,
solidState
);
const
auto
&
materialParams
=
problem
.
spatialParams
().
materialLawParams
(
element
,
scv
,
elemSol
);
const
auto
&
priVars
=
ParentType
::
extractDofPriVars
(
elemSol
,
scv
)
;
const
auto
&
priVars
=
elemSol
[
scv
.
localDofIndex
()]
;
// set the wetting pressure
fluidState
.
setPressure
(
fluidSystemPhaseIdx
,
priVars
[
Indices
::
pressureIdx
]);
...
...
dumux/porousmediumflow/volumevariables.hh
View file @
1cec12ba
...
...
@@ -65,21 +65,10 @@ public:
const
Element
&
element
,
const
Scv
&
scv
)
{
priVars_
=
extractDofPriVars
(
elemSol
,
scv
)
;
priVars_
=
elemSol
[
scv
.
localDofIndex
()]
;
extrusionFactor_
=
problem
.
extrusionFactor
(
element
,
scv
,
elemSol
);
}
/*!
* \brief Returns the primary variables at the dof associated with a given scv.
*
* \param elemSol A vector containing all primary variables connected to the element
* \param scv The sub-control volume
*/
template
<
class
ElemSol
,
class
Scv
>
static
const
PrimaryVariables
&
extractDofPriVars
(
const
ElemSol
&
elemSol
,
const
Scv
&
scv
)
{
return
elemSol
[
scv
.
localDofIndex
()];
}
/*!
* \brief Return the vector of primary variables
*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment