Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux-course
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dumux-repositories
dumux-course
Commits
dc8d940b
Commit
dc8d940b
authored
2 years ago
by
Martin Schneider
Browse files
Options
Downloads
Patches
Plain Diff
[ex][model] Make solution consistent with exercise
parent
4f1829c9
No related branches found
No related tags found
1 merge request
!192
[ex][model] Make solution consistent with exercise
Pipeline
#30550
waiting for manual action
Stage: trigger pipelines
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
exercises/solution/exercise-model/main.cc
+7
-8
7 additions, 8 deletions
exercises/solution/exercise-model/main.cc
with
7 additions
and
8 deletions
exercises/solution/exercise-model/main.cc
+
7
−
8
View file @
dc8d940b
...
...
@@ -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 normalize
d
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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment