Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Mpp
MLUQ
Commits
1180a8e9
Commit
1180a8e9
authored
Nov 11, 2020
by
niklas.baumgarten
Browse files
tested plotmap
parent
aa312d01
Changes
1
Hide whitespace changes
Inline
Side-by-side
tests/unit/TestPlotMap.cpp
View file @
1180a8e9
#include "montecarlo/PDESolver.hpp"
#include "TestEnvironment.hpp"
#include <filesystem>
constexpr
double
PDESOLVER_TEST_TOLERANCE
=
1e-5
;
struct
TestParams
{
std
::
string
model
;
std
::
string
problem
;
std
::
string
quantity
;
double
Q
;
};
class
TestPlotMap
:
public
Test
{
protected:
...
...
@@ -17,26 +10,41 @@ protected:
MatrixGraphs
*
mGraphs
;
SampleID
dummyID
;
void
SetUp
(
const
std
::
string
&
meshName
)
{
meshes
=
createTestMeshes
(
meshName
,
dummyID
.
level
.
pLevel
,
dummyID
.
level
.
fine
);
// Plot testen mit SampleSolution
std
::
vector
<
SampleID
>
dummyIDs
;
PlotMap
plotMap
;
TestPlotMap
(
const
std
::
string
&
meshName
)
{
dummyIDs
=
{
SampleID
(
Level
(
0
,
0
),
false
,
-
1
),
SampleID
(
Level
(
1
,
0
),
false
,
-
1
),
SampleID
(
Level
(
2
,
0
),
false
,
-
1
),
SampleID
(
Level
(
3
,
0
),
false
,
-
1
),
SampleID
(
Level
(
4
,
0
),
false
,
-
1
),
SampleID
(
Level
(
5
,
0
),
false
,
-
1
),
SampleID
(
Level
(
6
,
0
),
false
,
-
1
)
};
meshes
=
createTestMeshes
(
meshName
,
dummyIDs
.
back
().
level
.
pLevel
,
dummyIDs
.
back
().
level
.
fine
);
mGraphs
=
new
MatrixGraphs
(
*
meshes
,
*
(
new
LagrangeDiscretization
(
*
meshes
,
1
)));
}
void
TearDown
()
override
{
}
void
TearDown
()
override
{}
};
class
TestPlotMap2D
:
public
TestPlotMap
{
public:
TestPlotMap2D
()
:
TestPlotMap
(
"Square_DirichletBC"
)
{}
};
TEST_F
(
TestPlotMap
,
TestPlot
)
{
PlotMap
_plotMap
=
{
{
Level
(
3
),
new
Plot
((
*
meshes
)[
3
])}
};
SampleSolution
solution
(
mGraphs
,
dummyID
);
solution
.
U
=
0.0
;
_plotMap
.
VtkPlot
(
solution
,
1
,
"VertexData"
);
TEST_F
(
TestPlotMap2D
,
TestPlotMap
)
{
for
(
auto
&
dummyID
:
dummyIDs
)
{
SampleSolution
solution
(
mGraphs
,
dummyIDs
.
back
());
solution
.
U
=
0.0
;
plotMap
.
VtkPlot
(
solution
,
1
,
"VertexData"
);
ASSERT_TRUE
(
std
::
filesystem
::
exists
(
plotMap
.
currentFile
));
std
::
filesystem
::
remove_all
(
plotMap
.
currentDir
);
}
}
int
main
(
int
argc
,
char
**
argv
)
{
...
...
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