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

[box] Commuincate residual when computing residual norm

parent 8a7a8f41
No related branches found
No related tags found
2 merge requests!623Feature/richards on next,!617[WIP] Next
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <dumux/common/timeloop.hh> #include <dumux/common/timeloop.hh>
#include <dumux/implicit/localresidual.hh> #include <dumux/implicit/localresidual.hh>
#include <dumux/discretization/methods.hh> #include <dumux/discretization/methods.hh>
#include <dumux/parallel/vertexhandles.hh>
#include "diffmethod.hh" #include "diffmethod.hh"
#include "boxlocalassembler.hh" #include "boxlocalassembler.hh"
...@@ -50,6 +51,7 @@ class FVAssembler ...@@ -50,6 +51,7 @@ class FVAssembler
using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar); using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
using GridView = typename GET_PROP_TYPE(TypeTag, GridView); using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
using LocalResidual = typename GET_PROP_TYPE(TypeTag, LocalResidual); using LocalResidual = typename GET_PROP_TYPE(TypeTag, LocalResidual);
using VertexMapper = typename GET_PROP_TYPE(TypeTag, VertexMapper);
using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry); using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables); using GridVariables = typename GET_PROP_TYPE(TypeTag, GridVariables);
using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix); using JacobianMatrix = typename GET_PROP_TYPE(TypeTag, JacobianMatrix);
...@@ -218,6 +220,16 @@ public: ...@@ -218,6 +220,16 @@ public:
ResidualType residual(numDofs()); ResidualType residual(numDofs());
assembleResidual(residual, curSol); assembleResidual(residual, curSol);
// for box communicate the residual with the neighboring processes
if (isBox && gridView().comm().size() > 1)
{
VertexHandleSum<typename SolutionVector::block_type, SolutionVector, VertexMapper>
sumResidualHandle(residual, fvGridGeometry_->vertexMapper());
gridView().communicate(sumResidualHandle,
Dune::InteriorBorder_InteriorBorder_Interface,
Dune::ForwardCommunication);
}
// calculate the square norm of the residual // calculate the square norm of the residual
Scalar result2 = residual.two_norm2(); Scalar result2 = residual.two_norm2();
if (gridView().comm().size() > 1) if (gridView().comm().size() > 1)
......
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