Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
dumux
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
Commits
c2b3bf97
Commit
c2b3bf97
authored
5 years ago
by
Timo Koch
Committed by
Kilian Weishaupt
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
[test][io][subgrid] Remove deprecation warnings
parent
4aef1bc8
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1592
[io][grid] Allow SubgGrid to create grids from binary images
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/io/gridmanager/test_gridmanager_subgrid.cc
+10
-11
10 additions, 11 deletions
test/io/gridmanager/test_gridmanager_subgrid.cc
with
10 additions
and
11 deletions
test/io/gridmanager/test_gridmanager_subgrid.cc
+
10
−
11
View file @
c2b3bf97
...
...
@@ -26,12 +26,9 @@
#include
<dune/common/fvector.hh>
#include
<dune/common/timer.hh>
#include
<dune/grid/io/file/vtk.hh>
#include
<dune/grid/yaspgrid.hh>
#include
<dumux/common/parameters.hh>
#include
<dumux/io/grid/gridmanager.hh>
#include
<dumux/io/grid/subgridmanager.hh>
#include
<dumux/discretization/method.hh>
#include
<dumux/io/grid/gridmanager_sub.hh>
/*!
* \brief A method providing an () operator in order to select elements for a subgrid.
...
...
@@ -70,6 +67,7 @@ int main(int argc, char** argv) try
Dune
::
Timer
timer
;
using
HostGrid
=
Dune
::
YaspGrid
<
dim
,
Dune
::
TensorProductCoordinates
<
double
,
dim
>
>
;
using
SubGridTensor
=
Dune
::
SubGrid
<
dim
,
HostGrid
>
;
using
HostGridManager
=
Dumux
::
GridManager
<
HostGrid
>
;
HostGridManager
externalHostGridManager
;
...
...
@@ -109,9 +107,9 @@ int main(int argc, char** argv) try
return
element
.
geometry
().
center
()[
0
]
>
center
[
0
];
};
Subg
ridManager
<
HostGrid
>
subgridManager
;
Dumux
::
G
ridManager
<
SubGridTensor
>
subgridManager
;
subgridManager
.
init
(
hostGrid
,
elementSelector
);
Dune
::
VTKWriter
<
Sub
g
rid
Manager
<
HostGrid
>::
Grid
::
LeafGridView
>
vtkWriter
(
subgridManager
.
grid
().
leafGridView
());
Dune
::
VTKWriter
<
Sub
G
rid
Tensor
::
LeafGridView
>
vtkWriter
(
subgridManager
.
grid
().
leafGridView
());
vtkWriter
.
write
(
"subgrid_one"
);
}
{
...
...
@@ -122,9 +120,9 @@ int main(int argc, char** argv) try
// Of course, a lambda would be possible here, too.
CircleSelector
<
GlobalPosition
>
elementSelector
(
center
);
Subg
ridManager
<
HostGrid
>
subgridManager
;
Dumux
::
G
ridManager
<
Dune
::
SubGrid
<
2
,
HostGrid
>
>
subgridManager
;
subgridManager
.
init
(
hostGrid
,
elementSelector
);
Dune
::
VTKWriter
<
Sub
g
rid
Manager
<
HostGrid
>::
Grid
::
LeafGridView
>
vtkWriter
(
subgridManager
.
grid
().
leafGridView
());
Dune
::
VTKWriter
<
Sub
G
rid
Tensor
::
LeafGridView
>
vtkWriter
(
subgridManager
.
grid
().
leafGridView
());
vtkWriter
.
write
(
"subgrid_three"
);
}
...
...
@@ -138,16 +136,17 @@ int main(int argc, char** argv) try
return
element
.
geometry
().
center
()[
0
]
<
center
[
0
];
};
Subg
ridManager
<
Host
Grid
,
HostGrid
Manager
>
subgridManager
;
Dumux
::
G
ridManager
<
Dune
::
Sub
Grid
<
2
,
HostGrid
>
>
subgridManager
;
subgridManager
.
init
(
elementSelector
,
"Internal"
);
Dune
::
VTKWriter
<
Sub
g
rid
Manager
<
HostGrid
>::
Grid
::
LeafGridView
>
vtkWriter
(
subgridManager
.
grid
().
leafGridView
());
Dune
::
VTKWriter
<
Sub
G
rid
Tensor
::
LeafGridView
>
vtkWriter
(
subgridManager
.
grid
().
leafGridView
());
vtkWriter
.
write
(
"subgrid_two"
);
}
// create subgrid from image file
{
std
::
cout
<<
"Constructing SubGrid from binary image"
<<
std
::
endl
;
using
GridManager
=
SubgridManager
<
Dune
::
YaspGrid
<
2
,
Dune
::
EquidistantOffsetCoordinates
<
double
,
2
>>>
;
using
HostGrid
=
Dune
::
YaspGrid
<
2
,
Dune
::
EquidistantOffsetCoordinates
<
double
,
2
>>
;
using
GridManager
=
Dumux
::
GridManager
<
Dune
::
SubGrid
<
2
,
HostGrid
>>
;
GridManager
subgridManager
;
subgridManager
.
init
(
"Image"
);
Dune
::
VTKWriter
<
GridManager
::
Grid
::
LeafGridView
>
vtkWriter
(
subgridManager
.
grid
().
leafGridView
());
vtkWriter
.
write
(
"subgrid_binary_image"
);
...
...
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