Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
dorie
dorie
Commits
ce4823ba
Commit
ce4823ba
authored
Sep 24, 2018
by
Lukas Riedel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Let RichardsSimulation hold grid view directly
Grid view does not require memory management
parent
ecf38fea
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
25 deletions
+24
-25
dune/dorie/interface/richards_simulation.cc
dune/dorie/interface/richards_simulation.cc
+18
-19
dune/dorie/interface/richards_simulation.hh
dune/dorie/interface/richards_simulation.hh
+4
-4
test/test-mass-conservation.hh
test/test-mass-conservation.hh
+2
-2
No files found.
dune/dorie/interface/richards_simulation.cc
View file @
ce4823ba
...
...
@@ -11,20 +11,19 @@ RichardsSimulation<Traits>::RichardsSimulation (
)
:
helper
(
_helper
),
inifile
(
_inifile
),
verbose
(
inifile
.
get
<
int
>
(
"output.verbose"
)),
output_type
(
_inifile
.
get
<
bool
>
(
"output.asciiVtk"
)
?
Dune
::
VTK
::
OutputType
::
ascii
:
Dune
::
VTK
::
OutputType
::
base64
),
grid
(
_grid_mapper
->
get_grid
()),
gv
(
grid
->
leafGridView
()),
mbe_slop
(
estimate_mbe_entries
<
typename
MBE
::
size_type
>
(
Traits
::
dim
,
Traits
::
GridGeometryType
)),
mbe_tlop
(
1
),
verbose
(
inifile
.
get
<
int
>
(
"output.verbose"
)),
output_type
(
_inifile
.
get
<
bool
>
(
"output.asciiVtk"
)
?
Dune
::
VTK
::
OutputType
::
ascii
:
Dune
::
VTK
::
OutputType
::
base64
)
mbe_tlop
(
1
)
{
Dune
::
Timer
timer
;
// create the grid
grid
=
_grid_mapper
->
get_grid
();
gv
=
std
::
make_shared
<
GV
>
(
grid
->
leafGridView
());
// --- Grid Function Space ---
gfs
=
std
::
make_unique
<
GFS
>
(
GFSHelper
::
create
(
*
gv
));
gfs
=
std
::
make_unique
<
GFS
>
(
GFSHelper
::
create
(
gv
));
gfs
->
name
(
"matric_head"
);
cc
=
std
::
make_unique
<
CC
>
();
Dune
::
PDELab
::
constraints
(
*
gfs
,
*
cc
,
false
);
...
...
@@ -36,7 +35,7 @@ RichardsSimulation<Traits>::RichardsSimulation (
// --- Operator Helper Classes ---
fboundary
=
std
::
make_unique
<
FlowBoundary
>
(
inifile
);
fsource
=
std
::
make_unique
<
FlowSource
>
(
inifile
);
finitial
=
std
::
make_unique
<
FlowInitial
>
(
inifile
,
*
gv
);
finitial
=
std
::
make_unique
<
FlowInitial
>
(
inifile
,
gv
);
// --- Local Operators ---
#ifdef EXPERIMENTAL_DG_FEATURES
...
...
@@ -47,13 +46,13 @@ RichardsSimulation<Traits>::RichardsSimulation (
const
auto
upwinding
=
std
::
get
<
OP
::
RichardsDGUpwinding
::
Type
>
(
settings
);
const
auto
weights
=
std
::
get
<
OP
::
RichardsDGWeights
::
Type
>
(
settings
);
slop
=
std
::
make_unique
<
SLOP
>
(
inifile
,
*
fparam
,
*
gv
,
*
fboundary
,
*
fsource
,
slop
=
std
::
make_unique
<
SLOP
>
(
inifile
,
*
fparam
,
gv
,
*
fboundary
,
*
fsource
,
method
,
upwinding
,
weights
);
#else
slop
=
std
::
make_unique
<
SLOP
>
(
inifile
,
*
fparam
,
*
gv
,
*
fboundary
,
*
fsource
);
slop
=
std
::
make_unique
<
SLOP
>
(
inifile
,
*
fparam
,
gv
,
*
fboundary
,
*
fsource
);
#endif // EXPERIMENTAL_DG_FEATURES
tlop
=
std
::
make_unique
<
TLOP
>
(
inifile
,
*
fparam
,
*
gv
);
tlop
=
std
::
make_unique
<
TLOP
>
(
inifile
,
*
fparam
,
gv
);
controller
=
std
::
make_unique
<
CalculationController
>
(
inifile
,
*
fboundary
,
helper
);
// --- Solution Vectors and Initial Condition ---
...
...
@@ -70,7 +69,7 @@ RichardsSimulation<Traits>::RichardsSimulation (
_inifile
.
get
<
int
>
(
"output.subsamplingLevel"
,
0
);
const
auto
subsamling_intervals
=
Dune
::
refinementLevels
(
subsamling_lvl
);
auto
subsamling_vtk
=
std
::
make_shared
<
Dune
::
SubsamplingVTKWriter
<
GV
>>
(
*
gv
,
std
::
make_shared
<
Dune
::
SubsamplingVTKWriter
<
GV
>>
(
gv
,
subsamling_intervals
);
vtkwriter
=
std
::
make_unique
<
Writer
>
(
subsamling_vtk
,
...
...
@@ -99,7 +98,7 @@ void RichardsSimulation<Traits>::operator_setup()
igo
=
std
::
make_unique
<
IGO
>
(
*
go0
,
*
go1
);
// --- Solvers ---
lsgfs
=
std
::
make_unique
<
LSGFS
>
(
LSGFSHelper
::
create
(
*
gv
));
lsgfs
=
std
::
make_unique
<
LSGFS
>
(
LSGFSHelper
::
create
(
gv
));
lscc
=
std
::
make_unique
<
LSCC
>
();
ls
=
std
::
make_unique
<
LS
>
(
*
igo
,
*
cc
,
*
lsgfs
,
*
lscc
,
1000
,
0
,
true
,
true
);
...
...
@@ -129,7 +128,7 @@ void RichardsSimulation<Traits>::operator_setup()
auto
DOFnumber
=
gfs
->
globalSize
();
if
(
verbose
>
1
)
std
::
cout
<<
" Process "
<<
helper
.
rank
()
<<
": number of DOF: "
<<
DOFnumber
<<
std
::
endl
;
DOFnumber
=
gv
->
comm
().
sum
(
DOFnumber
);
DOFnumber
=
gv
.
comm
().
sum
(
DOFnumber
);
if
(
helper
.
rank
()
==
0
)
std
::
cout
<<
" Total number of DOF: "
<<
DOFnumber
<<
std
::
endl
;
}
...
...
@@ -187,7 +186,7 @@ void RichardsSimulation<Traits>::step()
template
<
typename
Traits
>
void
RichardsSimulation
<
Traits
>::
mark_grid
()
{
adaptivity
->
mark_grid
(
*
grid
,
*
gv
,
*
gfs
,
*
fparam
,
adaptivity
->
mark_grid
(
*
grid
,
gv
,
*
gfs
,
*
fparam
,
*
fboundary
,
time_before
+
dt_before
,
*
u
);
}
...
...
@@ -211,9 +210,9 @@ void RichardsSimulation<Traits>::update_adapters () const
{
udgf
=
std
::
make_shared
<
GFMatricHead
>
(
gfs
,
u
);
fluxdgf
=
std
::
make_shared
<
GFWaterFlux
>
(
gfs
,
u
,
fparam
);
condgf
=
std
::
make_shared
<
GFConductivity
>
(
*
gv
,
fparam
);
waterdgf
=
std
::
make_shared
<
GFWaterContent
>
(
udgf
,
*
gv
,
fparam
);
satdgf
=
std
::
make_shared
<
GFSaturation
>
(
udgf
,
*
gv
,
fparam
);
condgf
=
std
::
make_shared
<
GFConductivity
>
(
gv
,
fparam
);
waterdgf
=
std
::
make_shared
<
GFWaterContent
>
(
udgf
,
gv
,
fparam
);
satdgf
=
std
::
make_shared
<
GFSaturation
>
(
udgf
,
gv
,
fparam
);
}
template
<
typename
Traits
>
...
...
dune/dorie/interface/richards_simulation.hh
View file @
ce4823ba
...
...
@@ -231,9 +231,12 @@ protected:
Dune
::
MPIHelper
&
helper
;
Dune
::
ParameterTree
&
inifile
;
const
int
verbose
;
const
Dune
::
VTK
::
OutputType
output_type
;
std
::
shared_ptr
<
GFS
>
gfs
;
std
::
shared_ptr
<
Grid
>
grid
;
std
::
shared_ptr
<
GV
>
gv
;
GV
gv
;
std
::
unique_ptr
<
CC
>
cc
;
std
::
unique_ptr
<
LSGFS
>
lsgfs
;
...
...
@@ -269,9 +272,6 @@ protected:
std
::
unique_ptr
<
Writer
>
vtkwriter
;
std
::
unique_ptr
<
AdaptivityHandler
>
adaptivity
;
const
int
verbose
;
const
Dune
::
VTK
::
OutputType
output_type
;
RF
time_before
;
RF
dt_before
;
public:
...
...
test/test-mass-conservation.hh
View file @
ce4823ba
...
...
@@ -236,7 +236,7 @@ public:
using
FluxGO
=
ERRGO
<
FluxLOP
>
;
// create GFS and operators
auto
errgfs
=
ERRGFSHelper
::
create
(
*
this
->
gv
);
auto
errgfs
=
ERRGFSHelper
::
create
(
this
->
gv
);
FluxLOP
fluxlop
(
*
this
->
fparam
,
*
this
->
fboundary
);
fluxlop
.
setTime
(
time
);
MBE
mbe
(
0
);
...
...
@@ -257,7 +257,7 @@ public:
using
WCGO
=
ERRGO
<
WCLOP
>
;
// create GFS and operators
auto
errgfs
=
ERRGFSHelper
::
create
(
*
this
->
gv
);
auto
errgfs
=
ERRGFSHelper
::
create
(
this
->
gv
);
WCLOP
wclop
(
*
this
->
fparam
);
MBE
mbe
(
0
);
WCGO
wcgo
(
*
this
->
gfs
,
errgfs
,
wclop
,
mbe
);
...
...
Write
Preview
Markdown
is supported
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