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
70fbae89
Commit
70fbae89
authored
Jul 10, 2021
by
niklas.baumgarten
Browse files
worked on TestStochasticCollocation
parent
4a540a65
Pipeline
#157938
failed with stages
in 7 minutes and 24 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
mluq/tests/estimators/TestStochasticCollocation.cpp
View file @
70fbae89
#include "TestStochasticCollocation.hpp"
INSTANTIATE_TEST_SUITE_P
(
TestStochasticCollocation
,
TestStochasticCollocationWithoutEpsilon
,
Values
(
TestParams
{
"SparseGrid2DGeneratorProblem"
,
"FunctionEvaluation"
,
"DummyPDESolver"
}
// Todo add more test cases
));
TEST_P
(
TestStochasticCollocationWithoutEpsilon
,
TestSeriellAgainstParallel
)
{
mout
<<
GetParam
()
<<
endl
;
mout
.
StartBlock
(
"Stochastic Collocation seriell"
);
mout
<<
"Start"
<<
endl
;
scSeriell
->
Method
();
mout
.
EndBlock
();
mout
<<
endl
;
scSeriell
->
EstimatorResults
();
}
int
main
(
int
argc
,
char
**
argv
)
{
return
MppTest
(
...
...
mluq/tests/estimators/TestStochasticCollocation.hpp
View file @
70fbae89
...
...
@@ -35,12 +35,6 @@ protected:
std
::
unique_ptr
<
Estimator
>
scSeriell
;
std
::
unique_ptr
<
Estimator
>
scParallel
;
double
MeanTolerance
()
const
{
return
sqrt
(
1.0
/
samples
);
}
double
SVarTolerance
()
const
{
return
sqrt
(
10.0
/
samples
);
}
TestStochasticCollocation
(
double
epsilon
,
int
samples
)
:
samples
(
samples
),
epsilon
(
epsilon
),
meshesCreator
(
MeshesCreator
().
...
...
@@ -52,25 +46,21 @@ protected:
WithQuantity
(
GetParam
().
quantity
).
WithModel
(
GetParam
().
model
)),
scSeriell
(
EstimatorCreator
(
"
MonteCarlo
"
).
scSeriell
(
EstimatorCreator
(
"
StochasticCollocation
"
).
WithPDESolverCreator
(
pdeSolverCreator
).
WithMeshesCreator
(
meshesCreator
).
With
InitSamples
(
samples
).
With
StochLevel
(
6
).
WithOnlyFine
(
onlyFine
).
WithInitLevel
(
level
).
WithEpsilon
(
epsilon
).
WithParallel
(
false
).
CreateUnique
()),
scParallel
(
EstimatorCreator
(
"MonteCarlo"
).
WithPDESolverCreator
(
pdeSolverCreator
).
WithMeshesCreator
(
meshesCreator
).
WithInitSamples
(
samples
).
WithOnlyFine
(
onlyFine
).
WithEpsilon
(
epsilon
).
WithInitLevel
(
level
).
WithParallel
(
true
).
CreateUnique
())
{}
};
class
TestStochasticCollocationWithoutEpsilon
:
public
TestStochasticCollocation
{
public:
TestStochasticCollocationWithoutEpsilon
()
:
TestStochasticCollocation
(
0.0
,
0
)
{}
};
#endif //TESTSTOCHASTICCOLLOCATION_HPP
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