Skip to content
Snippets Groups Projects
Commit 28812f9f authored by Martin Utz's avatar Martin Utz
Browse files

[swe][frictionlaws]Modify updateAnalyticalSolution

Remove unnecessesary part from updateAnalyticalSolution.
parent b77f014e
No related branches found
No related tags found
1 merge request!1596[shallow water] Add friction laws (Manning and Nikuradse)
......@@ -108,7 +108,7 @@ int main(int argc, char** argv) try
VtkOutputModule<GridVariables, SolutionVector> vtkWriter(*gridVariables,x, problem->name());
vtkWriter.addField(problem->getExactWaterDepth(), "exactWaterDepth");
vtkWriter.addField(problem->getExactVelocityX(), "exactVelocityX");
problem->updateAnalyticalSolution(x,*gridVariables);
problem->updateAnalyticalSolution();
IOFields::initOutputModule(vtkWriter);
vtkWriter.write(0.0);
......@@ -139,7 +139,7 @@ int main(int argc, char** argv) try
nonLinearSolver.solve(x,*timeLoop);
// update the analytical solution
problem->updateAnalyticalSolution(x,*gridVariables);
problem->updateAnalyticalSolution();
// make the new solution the old solution
xOld = x;
......
......@@ -179,20 +179,14 @@ public:
}
//! Udpate the analytical solution
template<class SolutionVector, class GridVariables>
void updateAnalyticalSolution(const SolutionVector& curSol,
const GridVariables& gridVariables)
void updateAnalyticalSolution()
{
using std::abs;
//compute solution for all elements
for (const auto& element : elements(this->fvGridGeometry().gridView()))
{
auto fvGeometry = localView(this->fvGridGeometry());
fvGeometry.bindElement(element);
auto elemVolVars = localView(gridVariables.curGridVolVars());
elemVolVars.bindElement(element, fvGeometry, curSol);
Scalar h = this->gauklerManningStrickler(discharge_,constManningN_,bedSlope_);
Scalar u = abs(discharge_)/h;
const Scalar h = this->gauklerManningStrickler(discharge_,constManningN_,bedSlope_);
const Scalar u = abs(discharge_)/h;
const auto eIdx = this->fvGridGeometry().elementMapper().index(element);
exactWaterDepth_[eIdx] = h;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment