Skip to content
GitLab
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
324743c9
Commit
324743c9
authored
Jan 30, 2019
by
Dennis Gläser
Browse files
[test][unstructured] print fluxes
parent
312b899e
Changes
1
Hide whitespace changes
Inline
Side-by-side
test/multidomain/boundary/stokesdarcy/1p_1p/beaversjoseph/main_unstructured.cc
View file @
324743c9
...
...
@@ -201,6 +201,39 @@ int main(int argc, char** argv) try
couplingManager
);
#endif
auto
printAllFluxes
=
[
&
]()
{
using
Indices
=
typename
GetPropType
<
StokesTypeTag
,
Properties
::
ModelTraits
>::
Indices
;
Scalar
flux
=
0.0
;
auto
fvGeometry
=
localView
(
*
stokesFvGridGeometry
);
auto
elemVolVars
=
localView
(
stokesGridVariables
->
curGridVolVars
());
auto
elemFaceVars
=
localView
(
stokesGridVariables
->
curGridFaceVars
());
for
(
auto
&&
element
:
elements
(
stokesFvGridGeometry
->
gridView
()))
{
couplingManager
->
bindCouplingContext
(
stokesCellCenterIdx
,
element
,
*
assembler
);
fvGeometry
.
bind
(
element
);
elemVolVars
.
bind
(
element
,
fvGeometry
,
stokesSol
);
elemFaceVars
.
bind
(
element
,
fvGeometry
,
stokesSol
);
for
(
const
auto
scvf
:
scvfs
(
fvGeometry
))
{
if
(
!
couplingManager
->
isCoupledEntity
(
CouplingManager
::
stokesIdx
,
scvf
))
continue
;
Scalar
faceFlux
=
stokesProblem
->
neumann
(
element
,
fvGeometry
,
elemVolVars
,
elemFaceVars
,
scvf
)[
Indices
::
conti0EqIdx
]
*
scvf
.
area
();
if
(
faceFlux
<
0.0
)
flux
+=
faceFlux
;
}
}
std
::
cout
<<
"Transfer flux = "
<<
flux
<<
std
::
endl
;
};
VtkOutputModule
<
DarcyGridVariables
,
GetPropType
<
DarcyTypeTag
,
Properties
::
SolutionVector
>>
darcyVtkWriter
(
*
darcyGridVariables
,
sol
[
darcyIdx
],
darcyName
);
using
DarcyVelocityOutput
=
GetPropType
<
DarcyTypeTag
,
Properties
::
VelocityOutput
>
;
darcyVtkWriter
.
addVelocityOutput
(
std
::
make_shared
<
DarcyVelocityOutput
>
(
*
darcyGridVariables
));
...
...
@@ -256,8 +289,10 @@ int main(int argc, char** argv) try
// solve the non-linear system
nonLinearSolver
.
solve
(
sol
);
printAllFluxes
();
// write vtk output
stokesVtkWriter
.
write
(
1.0
);
//
stokesVtkWriter.write(1.0);
darcyVtkWriter
.
write
(
1.0
);
#endif
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment