Skip to content
Snippets Groups Projects
Commit ad589434 authored by Timo Koch's avatar Timo Koch
Browse files

[fcstaggered] Enable parallel gridvolvar update

parent a84dc395
No related branches found
No related tags found
1 merge request!3193[fcstaggered] Enable parallel gridvolvar update
Checking pipeline status
...@@ -27,6 +27,8 @@ ...@@ -27,6 +27,8 @@
#include <vector> #include <vector>
#include <type_traits> #include <type_traits>
#include <dumux/parallel/parallel_for.hh>
// make the local view function available whenever we use this class // make the local view function available whenever we use this class
#include <dumux/discretization/localview.hh> #include <dumux/discretization/localview.hh>
#include <dumux/discretization/facecentered/staggered/elementsolution.hh> #include <dumux/discretization/facecentered/staggered/elementsolution.hh>
...@@ -78,20 +80,16 @@ public: ...@@ -78,20 +80,16 @@ public:
template<class GridGeometry, class SolutionVector> template<class GridGeometry, class SolutionVector>
void update(const GridGeometry& gridGeometry, const SolutionVector& sol) void update(const GridGeometry& gridGeometry, const SolutionVector& sol)
{ {
const auto numScv = gridGeometry.numScv(); volumeVariables_.resize(gridGeometry.numScv());
volumeVariables_.resize(numScv); Dumux::parallelFor(gridGeometry.gridView().size(0), [&, &problem = problem()](const std::size_t eIdx)
for (const auto& element : elements(gridGeometry.gridView()))
{ {
auto fvGeometry = localView(gridGeometry); const auto element = gridGeometry.element(eIdx);
fvGeometry.bindElement(element); const auto fvGeometry = localView(gridGeometry).bindElement(element);
const auto elemSol = elementSolution(element, sol, gridGeometry);
for (auto&& scv : scvs(fvGeometry))
{ for (const auto& scv : scvs(fvGeometry))
const auto elemSol = elementSolution(element, sol, gridGeometry); volumeVariables_[scv.index()].update(elemSol, problem, element, scv);
volumeVariables_[scv.index()].update(elemSol, problem(), element, scv); });
}
}
} }
const VolumeVariables& volVars(const std::size_t scvIdx) const const VolumeVariables& volVars(const std::size_t scvIdx) const
......
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