Commit 3d4c18c1 authored by Martin Schneider's avatar Martin Schneider Committed by Timo Koch
Browse files

[tests][gg] Adapt to new update strategy for grid geometry

Grid geometries constructed with a grid view are already initialized/updated
from now on. The update interface changed to require a grid view.
Remove duplicate updates and use new update interface with gridview.
parent 4d951cc8
......@@ -74,7 +74,6 @@ int main(int argc, char** argv) try
// instantiate the grid geometry
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
auto gridGeometry = std::make_shared<GridGeometry>(leafGridView);
gridGeometry->update();
// [[/codeblock]]
// ### Initialize the problem and grid variables
......@@ -158,7 +157,7 @@ int main(int argc, char** argv) try
// update the grid geometry, the grid variables and
// the solution vectors now that the grid has been refined
gridGeometry->update();
gridGeometry->update(gridManager.grid().leafGridView());
gridVariables->updateAfterGridAdaption(p);
p.resize(gridGeometry->numDofs());
......
......@@ -105,7 +105,6 @@ int main(int argc, char** argv) try
// of the grid partition.
using GridGeometry = GetPropType<OnePTypeTag, Properties::GridGeometry>;
auto gridGeometry = std::make_shared<GridGeometry>(leafGridView);
gridGeometry->update();
// We now instantiate the problem, in which we define the boundary and initial conditions.
using OnePProblem = GetPropType<OnePTypeTag, Properties::Problem>;
......
......@@ -98,7 +98,6 @@ int main(int argc, char** argv) try
// We need the finite volume geometry to build up the subcontrolvolumes (scv) and subcontrolvolume faces (scvf) for each element of the grid partition.
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
auto gridGeometry = std::make_shared<GridGeometry>(leafGridView);
gridGeometry->update();
// In the problem, we define the boundary and initial conditions and compute the point sources. The `computePointSourceMap` method is inherited from the fvproblem and therefore specified in the `dumux/common/fvproblem.hh`. It calls the `addPointSources` method specified in the `problem.hh` file.
// [[codeblock]]
......
......@@ -96,7 +96,6 @@ int main(int argc, char** argv) try
// We need the finite volume geometry to build up the subcontrolvolumes (scv) and subcontrolvolume faces (scvf) for each element of the grid partition.
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
auto gridGeometry = std::make_shared<GridGeometry>(leafGridView);
gridGeometry->update();
// We now instantiate the problem, in which we define the boundary and initial conditions.
using Problem = GetPropType<TypeTag, Properties::Problem>;
......
......@@ -106,7 +106,6 @@ int main(int argc, char** argv) try
// of the grid partition.
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
auto gridGeometry = std::make_shared<GridGeometry>(leafGridView);
gridGeometry->update();
// We now instantiate the problem, in which we define the boundary and initial conditions.
using Problem = GetPropType<TypeTag, Properties::Problem>;
......
......@@ -126,7 +126,6 @@ int main(int argc, char** argv)
// of the grid partition.
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
auto gridGeometry = std::make_shared<GridGeometry>(leafGridView);
gridGeometry->update();
// We now instantiate the problem, in which we define the boundary and initial conditions.
using Problem = GetPropType<TypeTag, Properties::Problem>;
......
......@@ -73,10 +73,9 @@ int main(int argc, char** argv) try
const auto& leafGridView = gridManager.grid().leafGridView();
// instantiate the grid geometry
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
auto gridGeometry = std::make_shared<GridGeometry>(leafGridView);
auto gridData = gridManager.getGridData();
gridGeometry->update(*gridData);
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
auto gridGeometry = std::make_shared<GridGeometry>(leafGridView, *gridData);
// [[/codeblock]]
// ### Initialize the problem and grid variables
......
......@@ -97,7 +97,6 @@ int main(int argc, char** argv) try
// of the grid partition.
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
auto gridGeometry = std::make_shared<GridGeometry>(leafGridView);
gridGeometry->update();
// We now instantiate the problem, in which we define the boundary and initial conditions.
using Problem = GetPropType<TypeTag, Properties::Problem>;
......
......@@ -73,7 +73,6 @@ int main (int argc, char *argv[])
auto leafGridView = grid->leafGridView();
GridGeometry gridGeometry(leafGridView);
gridGeometry.update();
// iterate over elements. For every element get fv geometry and loop over scvs and scvfaces
for (const auto& element : elements(leafGridView))
......
......@@ -74,7 +74,6 @@ int main (int argc, char *argv[])
// obtain leaf and make GridGeometry
auto leafGridView = grid->leafGridView();
GridGeometry gridGeometry(leafGridView);
gridGeometry.update();
// iterate over elements. For every element get fv geometry and loop over scvs and scvfaces
for (const auto& element : elements(leafGridView))
......
......@@ -143,7 +143,6 @@ int main (int argc, char *argv[])
//! instantiate and update gridGeometry
GridGeometry gridGeometry(leafGridView);
gridGeometry.update();
//! We should have constructed 12 scvfs
if (gridGeometry.numScv() != 12)
......
......@@ -114,7 +114,6 @@ int main (int argc, char *argv[])
// obtain leaf and make GridGeometry
auto leafGridView = grid->leafGridView();
GridGeometry gg(leafGridView);
gg.update();
// compute the annulus area and the surface
const double refVolume = M_PI*(outerRadius*outerRadius - innerRadius*innerRadius);
......@@ -144,7 +143,6 @@ int main (int argc, char *argv[])
// obtain leaf and make GridGeometry
auto leafGridView = grid->leafGridView();
GridGeometry gg(leafGridView);
gg.update();
// compute the ball volume and the surface
const double refVolume = 4.0/3.0*M_PI*(outerRadius*outerRadius*outerRadius - innerRadius*innerRadius*innerRadius);
......@@ -177,7 +175,6 @@ int main (int argc, char *argv[])
// make GridGeometry
GridGeometry gg(leafGridView);
gg.update();
// compute the volume and the surface
const auto centroidRadius = 0.5*(innerRadius + outerRadius);
......@@ -195,7 +192,6 @@ int main (int argc, char *argv[])
{ using Extrusion = RotationalExtrusion<1>; };
using GridGeometry = CCTpfaFVGridGeometry<typename Grid::LeafGridView, /*caching=*/false, GGTraits>;
GridGeometry gg(leafGridView);
gg.update();
// compute the volume and the surface
const auto centroidRadius = 0.5*height;
......
......@@ -88,7 +88,6 @@ int main (int argc, char *argv[])
auto leafGridView = grid->leafGridView();
GridGeometry gridGeometry(leafGridView);
gridGeometry.update();
std::cout << "Abbreviatons:\n"
<< "pos - postition of face center\n"
......
......@@ -124,7 +124,6 @@ int main (int argc, char *argv[])
auto leafGridView = grid->leafGridView();
GridGeometry gridGeometry(leafGridView);
gridGeometry.update();
// iterate over elements. For every element get fv geometry and loop over scvs and scvfaces
for (const auto& element : elements(leafGridView))
......
......@@ -132,7 +132,6 @@ int main(int argc, char** argv)
// create the finite volume grid geometry
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
auto gridGeometry = std::make_shared<GridGeometry>(leafGridView);
gridGeometry->update();
// get some time loop parameters
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
......
......@@ -75,7 +75,6 @@ int main(int argc, char** argv)
// create the finite volume grid geometry
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
auto gridGeometry = std::make_shared<GridGeometry>(leafGridView);
gridGeometry->update();
// the problem (boundary conditions)
using Problem = GetPropType<TypeTag, Properties::Problem>;
......
......@@ -76,7 +76,6 @@ int main(int argc, char** argv)
// create the finite volume grid geometry
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
auto gridGeometry = std::make_shared<GridGeometry>(leafGridView);
gridGeometry->update();
// the problem (initial and boundary conditions)
using Problem = GetPropType<TypeTag, Properties::Problem>;
......
......@@ -101,7 +101,6 @@ int main(int argc, char** argv)
// create the finite volume grid geometry
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
auto gridGeometry = std::make_shared<GridGeometry>(leafGridView);
gridGeometry->update();
// the problem (boundary conditions)
using Problem = GetPropType<TypeTag, Properties::Problem>;
......
......@@ -90,7 +90,6 @@ int main(int argc, char** argv)
// create the finite volume grid geometry
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
auto gridGeometry = std::make_shared<GridGeometry>(gridView);
gridGeometry->update();
// the problem (initial and boundary conditions)
using Problem = GetPropType<TypeTag, Properties::Problem>;
......
......@@ -77,7 +77,6 @@ int main(int argc, char** argv)
// create the finite volume grid geometry
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
auto gridGeometry = std::make_shared<GridGeometry>(leafGridView);
gridGeometry->update();
// the problem (boundary conditions)
using Problem = GetPropType<TypeTag, Properties::Problem>;
......
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