Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-solvers
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
agnumpde
dune-solvers
Commits
fe853ba7
Commit
fe853ba7
authored
13 years ago
by
graeser
Committed by
graeser
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Allow to test with more refinement by command line argument
[[Imported from SVN: r6047]]
parent
ded337a0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/solvers/test/obstacletnnmgtest.cc
+26
-13
26 additions, 13 deletions
dune/solvers/test/obstacletnnmgtest.cc
with
26 additions
and
13 deletions
dune/solvers/test/obstacletnnmgtest.cc
+
26
−
13
View file @
fe853ba7
#include
<config.h>
#include
<iostream>
#include
<sstream>
// dune-common includes
#include
<dune/common/bitsetvector.hh>
...
...
@@ -19,8 +22,6 @@
#include
"common.hh"
#define DIMENSION 2
template
<
class
DomainType
,
class
RangeType
>
class
ConstantFunction
:
public
Dune
::
VirtualFunction
<
DomainType
,
RangeType
>
...
...
@@ -108,7 +109,7 @@ void solveObstacleProblemByTNNMG(const GridType& grid, const MatrixType& mat, Ve
template
<
class
GridType
>
bool
checkWithGrid
(
const
GridType
&
grid
)
bool
checkWithGrid
(
const
GridType
&
grid
,
const
std
::
string
fileName
=
""
)
{
bool
passed
=
true
;
...
...
@@ -147,9 +148,12 @@ bool checkWithGrid(const GridType& grid)
solveObstacleProblemByTNNMG
(
grid
,
A
,
u
,
rhs
,
ignore
);
typename
Dune
::
VTKWriter
<
GridView
>
vtkWriter
(
gridView
);
vtkWriter
.
addVertexData
(
u
,
"solution"
);
vtkWriter
.
write
(
"obstacletnnmgtest_solution"
);
if
(
fileName
!=
""
)
{
typename
Dune
::
VTKWriter
<
GridView
>
vtkWriter
(
gridView
);
vtkWriter
.
addVertexData
(
u
,
"solution"
);
vtkWriter
.
write
(
fileName
);
}
return
passed
;
...
...
@@ -157,7 +161,7 @@ bool checkWithGrid(const GridType& grid)
template
<
int
dim
>
bool
checkWithYaspGrid
(
int
refine
)
bool
checkWithYaspGrid
(
int
refine
,
const
std
::
string
fileName
=
""
)
{
bool
passed
=
true
;
...
...
@@ -176,7 +180,7 @@ bool checkWithYaspGrid(int refine)
std
::
cout
<<
"Number of levels: "
<<
(
grid
.
maxLevel
()
+
1
)
<<
std
::
endl
;
std
::
cout
<<
"Number of leaf nodes: "
<<
grid
.
leafView
().
size
(
dim
)
<<
std
::
endl
;
passed
=
passed
and
checkWithGrid
(
grid
);
passed
=
passed
and
checkWithGrid
(
grid
,
fileName
);
return
passed
;
...
...
@@ -187,14 +191,23 @@ bool checkWithYaspGrid(int refine)
int
main
(
int
argc
,
char
**
argv
)
try
{
static
const
int
dim
=
DIMENSION
;
bool
passed
(
true
);
passed
=
passed
and
checkWithYaspGrid
<
1
>
(
15
);
passed
=
passed
and
checkWithYaspGrid
<
2
>
(
10
);
passed
=
passed
and
checkWithYaspGrid
<
3
>
(
5
);
int
refine1d
=
16
;
int
refine2d
=
8
;
int
refine3d
=
5
;
if
(
argc
>
1
)
std
::
istringstream
(
argv
[
1
])
>>
refine1d
;
if
(
argc
>
2
)
std
::
istringstream
(
argv
[
2
])
>>
refine2d
;
if
(
argc
>
3
)
std
::
istringstream
(
argv
[
3
])
>>
refine3d
;
passed
=
passed
and
checkWithYaspGrid
<
1
>
(
refine1d
,
"obstacletnnmgtest_yasp_1d_solution"
);
passed
=
passed
and
checkWithYaspGrid
<
2
>
(
refine2d
,
"obstacletnnmgtest_yasp_2d_solution"
);
passed
=
passed
and
checkWithYaspGrid
<
3
>
(
refine3d
,
"obstacletnnmgtest_yasp_3d_solution"
);
return
passed
?
0
:
1
;
}
...
...
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