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
4902bc6c
Commit
4902bc6c
authored
Jul 10, 2021
by
niklas.baumgarten
Browse files
added TestStochasticCollocation files
parent
4dfe536d
Changes
2
Hide whitespace changes
Inline
Side-by-side
mluq/tests/estimators/TestStochasticCollocation.cpp
0 → 100644
View file @
4902bc6c
#include
"TestStochasticCollocation.hpp"
int
main
(
int
argc
,
char
**
argv
)
{
return
MppTest
(
MppTestBuilder
(
argc
,
argv
).
WithScreenLogging
().
WithPPM
()
).
RUN_ALL_MPP_TESTS
();
}
\ No newline at end of file
mluq/tests/estimators/TestStochasticCollocation.hpp
0 → 100644
View file @
4902bc6c
#ifndef TESTSTOCHASTICCOLLOCATION_HPP
#define TESTSTOCHASTICCOLLOCATION_HPP
#include
"StochasticCollocation.hpp"
#include
"TestEnvironment.hpp"
class
TestStochasticCollocation
:
public
Test
{
protected:
bool
onlyFine
=
true
;
int
level
=
3
;
int
samples
;
double
epsilon
;
MeshesCreator
meshesCreator
;
PDESolverCreator
pdeSolverCreator
;
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
().
WithDistribute
(
"RCB"
).
WithoutOverlap
()),
pdeSolverCreator
(
PDESolverCreator
().
WithProblem
(
GetParam
().
problemName
).
WithQuantity
(
GetParam
().
quantity
).
WithModel
(
GetParam
().
model
)),
scSeriell
(
EstimatorCreator
(
"MonteCarlo"
).
WithPDESolverCreator
(
pdeSolverCreator
).
WithMeshesCreator
(
meshesCreator
).
WithInitSamples
(
samples
).
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
())
{}
};
#endif //TESTSTOCHASTICCOLLOCATION_HPP
Write
Preview
Supports
Markdown
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