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

Merge branch 'feature/ex-model-update-sol' into 'master'

[ex][model] Make solution consistent with exercise

See merge request !192
parents 4f1829c9 dc8d940b
No related branches found
No related tags found
1 merge request!192[ex][model] Make solution consistent with exercise
Pipeline #30551 passed
......@@ -45,7 +45,6 @@
/*!
* \ingroup NonlinearDiffusion
*
* \brief Test problem for image denoising using a nonlinear diffusion model
*/
namespace Dumux {
......@@ -56,8 +55,6 @@ class NonlinearDiffusionTestProblem : public FVProblem<TypeTag>
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
using GridView = typename GridGeometry::GridView;
using Element = typename GridView::template Codim<0>::Entity;
using FVElementGeometry = typename GridGeometry::LocalView;
using SubControlVolume = typename FVElementGeometry::SubControlVolume;
using GlobalPosition = typename GridGeometry::LocalView::Element::Geometry::GlobalCoordinate;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using PrimaryVariables = GetPropType<TypeTag, Properties::PrimaryVariables>;
......@@ -113,7 +110,7 @@ struct NonlinearDiffusionTest
// Create the initial solution
// Given by normalize image pixel data
// Given by normalized image pixel data to the range [0,1]
template<class SolutionVector, class GridGeometry, class ImageData>
SolutionVector createInitialSolution(const GridGeometry& gg, const ImageData& data)
{
......@@ -137,12 +134,8 @@ int main(int argc, char** argv)
// define the type tag for this problem.
using TypeTag = Properties::TTag::NonlinearDiffusionTest;
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using Grid = GetPropType<TypeTag, Properties::Grid>;
using GridGeometry = GetPropType<TypeTag, Properties::GridGeometry>;
using Problem = GetPropType<TypeTag, Properties::Problem>;
using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>;
using GridVariables = GetPropType<TypeTag, Properties::GridVariables>;
// Read the image
const auto imageFileName = getParam<std::string>("ImageFile");
......@@ -156,6 +149,12 @@ int main(int argc, char** argv)
// We, create the finite volume grid geometry from the (leaf) grid view,
// the problem for the boundary conditions, a solution vector and a grid variables instance.
auto gridGeometry = std::make_shared<GridGeometry>(gridManager.grid().leafGridView());
using Scalar = GetPropType<TypeTag, Properties::Scalar>;
using Problem = GetPropType<TypeTag, Properties::Problem>;
using SolutionVector = GetPropType<TypeTag, Properties::SolutionVector>;
using GridVariables = GetPropType<TypeTag, Properties::GridVariables>;
auto problem = std::make_shared<Problem>(gridGeometry);
auto sol = createInitialSolution<SolutionVector>(*gridGeometry, imageData);
auto gridVariables = std::make_shared<GridVariables>(problem, gridGeometry);
......
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