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
336e8bcd
Commit
336e8bcd
authored
Jul 12, 2021
by
chinsp
Browse files
added test case for polynomial of total degree 2
parent
c7353352
Pipeline
#158232
passed with stages
in 11 minutes and 22 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
mluq/src/problems/IStochasticProblem.cpp
View file @
336e8bcd
...
...
@@ -23,7 +23,7 @@ CreateStochasticDummyProblem(const std::string &problemName, const Meshes &meshe
return
new
SparseGrid1DGeneratorProblem
(
meshes
);
if
(
problemName
==
"SparseGrid2DGeneratorProblem"
)
return
new
SparseGrid2DGeneratorProblem
(
meshes
);
if
(
problemName
==
"SparseGrid2DPoly
nomialDegree
2Problem"
)
return
new
SparseGrid2DPoly
nomialDegree
2Problem
(
meshes
);
if
(
problemName
==
"SparseGrid2DPoly
Deg
2Problem"
)
return
new
SparseGrid2DPoly
Deg
2Problem
(
meshes
);
Exit
(
problemName
+
" not found"
)
}
\ No newline at end of file
mluq/src/problems/IStochasticProblem.hpp
View file @
336e8bcd
...
...
@@ -249,22 +249,22 @@ public:
}
};
class
SparseGrid2DPoly
nomialDegree
2Problem
:
public
SparseGridGeneratorProblem
{
class
SparseGrid2DPoly
Deg
2Problem
:
public
SparseGridGeneratorProblem
{
public:
explicit
SparseGrid2DPoly
nomialDegree
2Problem
(
const
Meshes
&
meshes
)
:
SparseGridGeneratorProblem
(
meshes
,
SparseGridGenerator
(
meshes
,
2
,
0
,
1
))
{}
explicit
SparseGrid2DPoly
Deg
2Problem
(
const
Meshes
&
meshes
)
:
SparseGridGeneratorProblem
(
meshes
,
SparseGridGenerator
(
meshes
,
2
,
0
,
4
))
{}
double
FunctionEvaluation
()
override
{
RVector
sample
=
this
->
generator
.
EvalSample
();
return
sample
[
0
]
*
sample
[
1
];
return
1
+
sample
[
0
]
+
pow
(
sample
[
0
],
2
)
+
sample
[
1
]
+
pow
(
sample
[
1
],
2
)
+
sample
[
0
]
*
sample
[
1
];
}
string
Name
()
const
override
{
return
"SparseGrid2DPoly
nomialDegree
2Problem"
;
return
"SparseGrid2DPoly
Deg
2Problem"
;
}
};
// Todo find more test cases in tasmani
n
a examples and write sparse grid problems
// Todo find more test cases in tasmania
n
examples and write sparse grid problems
StochasticDummyProblem
*
CreateStochasticDummyProblem
(
const
std
::
string
&
problemName
,
const
Meshes
&
meshes
);
...
...
mluq/tests/estimators/TestStochasticCollocation.cpp
View file @
336e8bcd
...
...
@@ -9,8 +9,8 @@ INSTANTIATE_TEST_SUITE_P(
TestStochasticCollocation
,
TestStochasticCollocationWithoutEpsilon
,
Values
(
TestParams
{
"SparseGrid2DGeneratorProblem"
,
"FunctionEvaluation"
,
"DummyPDESolver"
,
2.513723354063905
},
TestParams
{
"SparseGrid2DPoly
nomialDegree
2Problem"
,
"FunctionEvaluation"
,
"DummyPDESolver"
,
0.0
}
TestParams
{
"SparseGrid2DPoly
Deg
2Problem"
,
"FunctionEvaluation"
,
"DummyPDESolver"
,
6.666666666666667
}
// Todo add more test cases
));
...
...
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