Commit e015388e authored by Dennis Gläser's avatar Dennis Gläser
Browse files

[volvars] introduce convenience function to extract privars from element solution

parent 1ddb21c2
...@@ -82,10 +82,17 @@ public: ...@@ -82,10 +82,17 @@ public:
const Element &element, const Element &element,
const SubControlVolume &scv) const SubControlVolume &scv)
{ {
priVars_ = isBox ? elemSol[scv.index()] : elemSol[0]; priVars_ = extractDofPriVars(elemSol, scv);
extrusionFactor_ = problem.extrusionFactor(element, scv, elemSol); extrusionFactor_ = problem.extrusionFactor(element, scv, elemSol);
} }
/*!
* \brief Returns the primary variables at the dof associated with a given scv.
*/
static const PrimaryVariables& extractDofPriVars(const ElementSolutionVector& elemSol,
const SubControlVolume& scv)
{ return isBox ? elemSol[scv.index()] : elemSol[0]; }
/*! /*!
* \brief Return the vector of primary variables * \brief Return the vector of primary variables
*/ */
......
...@@ -91,7 +91,7 @@ public: ...@@ -91,7 +91,7 @@ public:
fluidState.setTemperature(t); fluidState.setTemperature(t);
fluidState.setSaturation(/*phaseIdx=*/0, 1.); fluidState.setSaturation(/*phaseIdx=*/0, 1.);
const auto& priVars = isBox ? elemSol[scv.index()] : elemSol[0]; const auto& priVars = ParentType::extractDofPriVars(elemSol, scv);
fluidState.setPressure(/*phaseIdx=*/0, priVars[Indices::pressureIdx]); fluidState.setPressure(/*phaseIdx=*/0, priVars[Indices::pressureIdx]);
// saturation in a single phase is always 1 and thus redundant // saturation in a single phase is always 1 and thus redundant
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment