Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Mpp
MLMC
Commits
763d84e7
Commit
763d84e7
authored
Apr 24, 2020
by
niklas.baumgarten
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed multilevel plotter test and included it into yml
parent
3da42994
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
9 deletions
+16
-9
.gitlab-ci.yml
.gitlab-ci.yml
+3
-0
tests/TestMultilevelPlotter.cpp
tests/TestMultilevelPlotter.cpp
+13
-9
No files found.
.gitlab-ci.yml
View file @
763d84e7
...
...
@@ -50,6 +50,8 @@ program-test:
script
:
-
cd tests
-
mpirun -n 4 TestMainProgram
-
mpirun -n 4 TestMultilevelPlotter
downstream-test
:
stage
:
test
...
...
@@ -79,5 +81,6 @@ downstream-test:
script
:
-
cd tests
-
mpirun -n 4 TestMainProgram
-
mpirun -n 4 TestMultilevelPlotter
tests/TestMultilevelPlotter.cpp
View file @
763d84e7
...
...
@@ -5,25 +5,29 @@
class
TestMultilevelPlotter
:
public
::
Test
{
protected:
shared_ptr
<
Meshes
>
meshes
;
int
pLevel
;
void
SetUp
()
override
{
meshes
=
make_shared
<
Meshes
>
(
"UnitSquare"
,
1
,
4
);
plotter
=
make_shared
<
MultilevelPlotter
>
(
*
meshes
);
pLevel
=
meshes
->
pLevel
();
// Refactor
logging
=
new
Logging
;
logging
->
initialize
();
//
// Refactor
//
logging = new Logging;
//
logging->initialize();
}
void
TearDown
()
override
{
system
(
"rm -rf data/vtk/*"
);
// Only master checks if files are there, thus only master deletes
if
(
PPM
->
master
())
system
(
"rm -rf data/vtk/*"
);
}
};
TEST_F
(
TestMultilevelPlotter
,
TestVertexData1D
)
{
MatrixGraphs
vertexMG
(
*
meshes
,
dof
(
"vertex"
,
1
));
for
(
int
l
=
meshes
->
pLevel
()
;
l
<=
meshes
->
Level
();
l
++
)
{
Vector
vertexData
(
vertexMG
[
l
]);
for
(
int
l
=
pLevel
;
l
<=
meshes
->
Level
();
l
++
)
{
Vector
vertexData
(
vertexMG
[
l
-
pLevel
]);
vertexData
=
1.0
;
string
name
=
"VertexData1D_"
+
to_string
(
l
);
plotter
->
PlotVector
(
name
,
vertexData
,
1
,
l
,
"VertexData"
);
...
...
@@ -35,7 +39,7 @@ TEST_F(TestMultilevelPlotter, TestVertexData1D) {
TEST_F
(
TestMultilevelPlotter
,
TestVertexData2D
)
{
MatrixGraphs
vertexMG
(
*
meshes
,
dof
(
"vertex"
,
2
));
for
(
int
l
=
meshes
->
pLevel
();
l
<=
meshes
->
Level
();
l
++
)
{
Vector
vertexData
(
vertexMG
[
l
]);
Vector
vertexData
(
vertexMG
[
l
-
pLevel
]);
vertexData
=
1.0
;
string
name
=
"VertexData2D_"
+
to_string
(
l
);
plotter
->
PlotVector
(
name
,
vertexData
,
2
,
l
,
"VertexData"
);
...
...
@@ -47,7 +51,7 @@ TEST_F(TestMultilevelPlotter, TestVertexData2D) {
TEST_F
(
TestMultilevelPlotter
,
TestCellData1D
)
{
MatrixGraphs
cellMG
(
*
meshes
,
dof
(
"cell"
,
1
));
for
(
int
l
=
meshes
->
pLevel
();
l
<=
meshes
->
Level
();
l
++
)
{
Vector
cellData
(
cellMG
[
l
]);
Vector
cellData
(
cellMG
[
l
-
pLevel
]);
cellData
=
1.0
;
string
name
=
"CellData1D_"
+
to_string
(
l
);
plotter
->
PlotVector
(
name
,
cellData
,
1
,
l
,
"CellData"
);
...
...
@@ -59,7 +63,7 @@ TEST_F(TestMultilevelPlotter, TestCellData1D) {
TEST_F
(
TestMultilevelPlotter
,
TestCellData2D
)
{
MatrixGraphs
cellMG
(
*
meshes
,
dof
(
"cell"
,
2
));
for
(
int
l
=
meshes
->
pLevel
();
l
<=
meshes
->
Level
();
l
++
)
{
Vector
cellData
(
cellMG
[
l
]);
Vector
cellData
(
cellMG
[
l
-
pLevel
]);
cellData
=
1.0
;
string
name
=
"CellData2D_"
+
to_string
(
l
);
plotter
->
PlotVector
(
name
,
cellData
,
2
,
l
,
"CellData"
);
...
...
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