Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
dumux-repositories
dumux
Commits
28812f9f
Commit
28812f9f
authored
Jun 06, 2019
by
Martin Utz
Browse files
[swe][frictionlaws]Modify updateAnalyticalSolution
Remove unnecessesary part from updateAnalyticalSolution.
parent
b77f014e
Changes
2
Hide whitespace changes
Inline
Side-by-side
test/freeflow/shallowwater/roughchannel/main.cc
View file @
28812f9f
...
...
@@ -108,7 +108,7 @@ int main(int argc, char** argv) try
VtkOutputModule
<
GridVariables
,
SolutionVector
>
vtkWriter
(
*
gridVariables
,
x
,
problem
->
name
());
vtkWriter
.
addField
(
problem
->
getExactWaterDepth
(),
"exactWaterDepth"
);
vtkWriter
.
addField
(
problem
->
getExactVelocityX
(),
"exactVelocityX"
);
problem
->
updateAnalyticalSolution
(
x
,
*
gridVariables
);
problem
->
updateAnalyticalSolution
();
IOFields
::
initOutputModule
(
vtkWriter
);
vtkWriter
.
write
(
0.0
);
...
...
@@ -139,7 +139,7 @@ int main(int argc, char** argv) try
nonLinearSolver
.
solve
(
x
,
*
timeLoop
);
// update the analytical solution
problem
->
updateAnalyticalSolution
(
x
,
*
gridVariables
);
problem
->
updateAnalyticalSolution
();
// make the new solution the old solution
xOld
=
x
;
...
...
test/freeflow/shallowwater/roughchannel/problem.hh
View file @
28812f9f
...
...
@@ -179,20 +179,14 @@ public:
}
//! Udpate the analytical solution
template
<
class
SolutionVector
,
class
GridVariables
>
void
updateAnalyticalSolution
(
const
SolutionVector
&
curSol
,
const
GridVariables
&
gridVariables
)
void
updateAnalyticalSolution
()
{
using
std
::
abs
;
//compute solution for all elements
for
(
const
auto
&
element
:
elements
(
this
->
fvGridGeometry
().
gridView
()))
{
auto
fvGeometry
=
localView
(
this
->
fvGridGeometry
());
fvGeometry
.
bindElement
(
element
);
auto
elemVolVars
=
localView
(
gridVariables
.
curGridVolVars
());
elemVolVars
.
bindElement
(
element
,
fvGeometry
,
curSol
);
Scalar
h
=
this
->
gauklerManningStrickler
(
discharge_
,
constManningN_
,
bedSlope_
);
Scalar
u
=
abs
(
discharge_
)
/
h
;
const
Scalar
h
=
this
->
gauklerManningStrickler
(
discharge_
,
constManningN_
,
bedSlope_
);
const
Scalar
u
=
abs
(
discharge_
)
/
h
;
const
auto
eIdx
=
this
->
fvGridGeometry
().
elementMapper
().
index
(
element
);
exactWaterDepth_
[
eIdx
]
=
h
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment