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
51f769a1
Commit
51f769a1
authored
Oct 28, 2020
by
niklas.baumgarten
Browse files
temp new strucutre
parent
2dd48084
Changes
2
Hide whitespace changes
Inline
Side-by-side
mlmc/src/montecarlo/MonteCarlo.cpp
View file @
51f769a1
...
...
@@ -12,7 +12,28 @@ void MonteCarlo::Method() {
mout
.
EndBlock
(
verbose
==
0
);
}
void
MonteCarlo
::
init
()
{
// SampleID coarseId;
// SampleID fineId;
// SampleSolution coarseSolution(*solMGraphs, level.mGcoarse);
// SampleSolution fineSolution(*solMGraphs, level.mGfine);
// fineId.level = level;
// fineId.coarse = false;
// coarseId.level = level;
// coarseId.coarse = true;
}
void
MonteCarlo
::
method
()
{
SampleID
coarseId
;
SampleID
fineId
;
SampleSolution
coarseSolution
(
*
solMGraphs
,
level
.
mGcoarse
);
SampleSolution
fineSolution
(
*
solMGraphs
,
level
.
mGfine
);
fineId
.
level
=
level
;
fineId
.
coarse
=
false
;
coarseId
.
level
=
level
;
coarseId
.
coarse
=
true
;
for
(
int
m
=
ctr
.
M
;
m
<
ctr
.
M
+
ctr
.
dM
;
m
++
)
{
computeSampleSolution
(
m
,
fineId
,
fineSolution
);
if
(
onlyFine
)
coarseSolution
.
Init
();
...
...
mlmc/src/montecarlo/MonteCarlo.hpp
View file @
51f769a1
...
...
@@ -12,6 +12,8 @@ protected:
int
plotting
=
0
;
int
verbose
=
1
;
void
init
();
void
method
();
void
computeSampleSolution
(
int
m
,
SampleID
&
id
,
SampleSolution
&
solution
);
...
...
@@ -29,26 +31,23 @@ public:
PDESolver
*
pdeSolver
;
MatrixGraphs
*
solMGraphs
;
SampleID
coarseId
;
SampleID
fineId
;
SampleSolution
coarseSolution
;
SampleSolution
fineSolution
;
MonteCarlo
(
Level
level
,
int
dM
,
bool
onlyFine
,
MatrixGraphs
*
solMGraphs
,
PDESolver
*
pdeSolver
)
:
level
(
level
),
onlyFine
(
onlyFine
),
solMGraphs
(
solMGraphs
),
pdeSolver
(
pdeSolver
)
,
coarseSolution
(
SampleSolution
(
*
solMGraphs
,
level
.
mGcoarse
)),
fineSolution
(
SampleSolution
(
*
solMGraphs
,
level
.
mGfine
))
{
solMGraphs
(
solMGraphs
),
pdeSolver
(
pdeSolver
)
{
//
coarseSolution(SampleSolution(*solMGraphs, level.mGcoarse)),
//
fineSolution(SampleSolution(*solMGraphs, level.mGfine)) {
config
.
get
(
"MCPlotting"
,
plotting
);
config
.
get
(
"MCVerbose"
,
verbose
);
ctr
.
dM
=
dM
;
fineId
.
level
=
level
;
fineId
.
coarse
=
false
;
coarseId
.
level
=
level
;
coarseId
.
coarse
=
true
;
//
fineId.level = level;
//
fineId.coarse = false;
//
coarseId.level = level;
//
coarseId.coarse = true;
}
void
Method
();
...
...
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