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
fdb05845
Commit
fdb05845
authored
5 years ago
by
Timo Koch
Browse files
Options
Downloads
Patches
Plain Diff
[gridmanager][test] Add mmesh test
parent
66d3b715
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1751
[mmesh] Add grid manager for dune-mmesh.
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
test/io/gridmanager/CMakeLists.txt
+6
-0
6 additions, 0 deletions
test/io/gridmanager/CMakeLists.txt
test/io/gridmanager/test_gridmanager_mmesh.cc
+74
-0
74 additions, 0 deletions
test/io/gridmanager/test_gridmanager_mmesh.cc
with
80 additions
and
0 deletions
test/io/gridmanager/CMakeLists.txt
+
6
−
0
View file @
fdb05845
...
...
@@ -249,3 +249,9 @@ dune_add_test(NAME test_gmshboundaryflag_caching
LABELS unit io
CMAKE_GUARD
"( dune-alugrid_FOUND )"
)
dune_add_test
(
NAME test_gridmanager_mmesh
SOURCES test_gridmanager_mmesh.cc
LABELS unit io
CMAKE_GUARD
"( dune-mmesh_FOUND )"
)
This diff is collapsed.
Click to expand it.
test/io/gridmanager/test_gridmanager_mmesh.cc
0 → 100644
+
74
−
0
View file @
fdb05845
/*****************************************************************************
* See the file COPYING for full copying permissions. *
* *
* This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation, either version 3 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program. If not, see <http://www.gnu.org/licenses/>. *
*****************************************************************************/
/*!
* \file
* \brief Test for the mmesh grid manager
*/
#include
<config.h>
#include
<dune/common/parallel/mpihelper.hh>
#include
<dune/grid/io/file/vtk.hh>
#include
<dumux/io/grid/gridmanager_mmesh.hh>
int
main
(
int
argc
,
char
**
argv
)
try
{
using
namespace
Dumux
;
// Initialize MPI, finalize is done automatically on exit.
Dune
::
MPIHelper
::
instance
(
argc
,
argv
);
// First set parameters
Dumux
::
Parameters
::
init
([](
auto
&
params
){
params
[
"Grid.LowerLeft"
]
=
"-1 -1 -1"
;
params
[
"Grid.UpperRight"
]
=
"1 1 1"
;
});
{
using
Grid
=
Dune
::
MovingMesh
<
3
>
;
GridManager
<
Grid
>
gridManager
;
gridManager
.
init
();
Dune
::
VTKWriter
<
Grid
::
LeafGridView
>
vtkWriter
(
gridManager
.
grid
().
leafGridView
());
vtkWriter
.
write
(
"mmesh-3d"
);
}
Dumux
::
Parameters
::
init
([](
auto
&
params
){
params
[
"Grid.File"
]
=
"grids/complex_equi_coarse_tri.msh"
;
});
{
using
Grid
=
Dune
::
MovingMesh
<
2
>
;
GridManager
<
Grid
>
gridManager
;
gridManager
.
init
();
Dune
::
VTKWriter
<
Grid
::
LeafGridView
>
vtkWriter
(
gridManager
.
grid
().
leafGridView
());
vtkWriter
.
write
(
"mmesh-2d"
);
}
return
0
;
}
///////////////////////////////////////
//////// Error handler ////////////////
///////////////////////////////////////
catch
(
const
Dumux
::
ParameterException
&
e
)
{
std
::
cerr
<<
e
<<
". Abort!
\n
"
;
return
1
;
}
catch
(
const
Dune
::
Exception
&
e
)
{
std
::
cerr
<<
"Dune reported error: "
<<
e
<<
std
::
endl
;
return
3
;
}
catch
(...)
{
std
::
cerr
<<
"Unknown exception thrown!
\n
"
;
return
4
;
}
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