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
97ea0202
Commit
97ea0202
authored
Sep 29, 2020
by
niklas.baumgarten
Browse files
adapted main
parent
85330575
Changes
2
Hide whitespace changes
Inline
Side-by-side
mlmc/src/main/MainProgram.cpp
View file @
97ea0202
...
...
@@ -8,16 +8,14 @@ void MainProgram::Initialize() {
disc
=
createDiscretization
();
problem
=
createStochasticProblem
();
assemble
=
createStochasticAssemble
();
pdeSolver
=
createPDESolver
();
plotter
=
new
MultilevelPlotter
(
*
meshes
);
mlmc
=
new
MultilevelMonteCarlo
(
initSample
C
ount
,
meshes
,
assemble
,
pdeSolver
);
mlmc
=
new
MultilevelMonteCarlo
(
initLevels
,
initSample
Am
ount
,
meshes
,
pdeSolver
);
meshes
->
PrintInfo
();
mlmc
->
PrintInfo
();
problem
->
PrintInfo
();
assemble
->
PrintInfo
();
}
int
MainProgram
::
Run
()
{
...
...
@@ -99,7 +97,7 @@ IStochasticProblem *MainProgram::createStochasticProblem() {
return
new
StochasticLaplace1D
(
*
meshes
);
if
(
problemName
==
"StochasticLaplace2D"
)
return
new
StochasticLaplace2D
(
*
meshes
);
//
if (problemName == "StochasticPollution1D")
if
(
problemName
==
"StochasticPollution1D"
)
// return new StochasticPollution1D(*meshes);
// if (problemName == "StochasticPollutionCosHat1D")
// return new StochasticPollutionCosHat1D(*meshes);
...
...
@@ -114,34 +112,33 @@ IStochasticProblem *MainProgram::createStochasticProblem() {
Exit
(
"
\n
Problem field not found in "
+
problemName
+
"
\n
"
)
}
IStochasticAssemble
*
MainProgram
::
create
StochasticAssemble
()
{
PDESolver
*
MainProgram
::
create
PDESolver
()
{
IStochasticEllipticProblem
*
ellipticProblem
=
dynamic_cast
<
IStochasticEllipticProblem
*
>
(
problem
);
// IStochasticTransportProblem *transportProblem =
// dynamic_cast<IStochasticTransportProblem * >(problem);
IStochasticTransportProblem
*
transportProblem
=
dynamic_cast
<
IStochasticTransportProblem
*
>
(
problem
);
if
(
ellipticProblem
!=
nullptr
)
{
if
(
modelName
==
"LagrangeFEM"
)
return
new
LagrangeEllipticAssemble
(
disc
,
ellipticProblem
);
return
new
EllipticPDESolver
(
new
LagrangeEllipticAssemble
(
disc
,
ellipticProblem
));
if
(
modelName
==
"MixedFEM"
)
return
new
MixedEllipticAssemble
(
disc
,
ellipticProblem
);
return
new
EllipticPDESolver
(
new
MixedEllipticAssemble
(
disc
,
ellipticProblem
));
if
(
modelName
==
"HybridFEM"
)
return
new
HybridEllipticAssemble
(
disc
,
ellipticProblem
);
// if (modelName == "DGFEM")
// return new DGEllipticAssemble(disc, ellipticProblem);
return
new
EllipticPDESolver
(
new
HybridEllipticAssemble
(
disc
,
ellipticProblem
));
if
(
modelName
==
"DGFEM"
)
return
new
EllipticPDESolver
(
new
DGEllipticAssemble
(
disc
,
ellipticProblem
));
}
//// if (transportProblem != nullptr) {
//// if (modelName == "DGTransport")
//// return new DGTransportAssemble(disc, transportProblem, nullptr);
//// if (modelName == "PGTransport")
//// return nullptr; // Todo open research question
// if (transportProblem != nullptr) {
// if (modelName == "DGTransport")
// return new TransportPDESolver(new DGTransportAssemble(disc,
// transportProblem));
// if (modelName == "PGTransport")
// return nullptr; // Todo open research question
// }
Exit
((
"
\n
Assembling for Problem="
+
problemName
+
" with Model="
+
modelName
+
" not implemented
\n
"
))
}
PDESolver
*
MainProgram
::
createPDESolver
()
{
return
new
EllipticPDESolver
(
static_cast
<
IStochasticEllipticAssemble
*>
(
assemble
));
}
mlmc/src/main/MainProgram.hpp
View file @
97ea0202
#ifndef MLMC_MLMCMAIN_H
#define MLMC_MLMCMAIN_H
#include"assemble/LagrangeEllipticAssemble.hpp"
#include"assemble/MixedEllipticAssemble.hpp"
//
#include"assemble/
DG
EllipticAssemble.hpp"
#include"assemble/
Hybrid
EllipticAssemble.hpp"
//#include"assemble/DGTransportAssemble.hpp"
//#include"assemble/DGReactionAssemble.hpp"
//#include"assemble/PGReactionAssemble.hpp"
#include
"assemble/LagrangeEllipticAssemble.hpp"
#include
"assemble/MixedEllipticAssemble.hpp"
#include
"assemble/
Hybrid
EllipticAssemble.hpp"
#include
"assemble/
DG
EllipticAssemble.hpp"
//#include
"assemble/DGTransportAssemble.hpp"
//#include
"assemble/DGReactionAssemble.hpp"
//#include
"assemble/PGReactionAssemble.hpp"
#include "problem/StochasticEllipticProblem.hpp"
#include "montecarlo/MultilevelMonteCarlo.hpp"
...
...
@@ -37,7 +37,6 @@ public:
Meshes
*
meshes
;
IDiscretization
*
disc
;
IStochasticProblem
*
problem
;
IStochasticAssemble
*
assemble
;
MultilevelMonteCarlo
*
mlmc
;
PDESolver
*
pdeSolver
;
...
...
@@ -56,12 +55,11 @@ public:
config
.
get
(
"Experiment"
,
experimentName
);
int
index
=
0
;
for
(
auto
&
level
:
initLevels
)
{
for
(
auto
&
level
:
initLevels
)
{
initSampleCount
[
level
]
=
initSampleAmount
[
index
];
index
++
;
}
checkValues
();
}
...
...
@@ -69,7 +67,6 @@ public:
delete
meshes
;
delete
disc
;
delete
problem
;
delete
assemble
;
delete
plotter
;
// Todo manage in another way
delete
mlmc
;
}
...
...
@@ -92,8 +89,6 @@ private:
IStochasticProblem
*
createStochasticProblem
();
IStochasticAssemble
*
createStochasticAssemble
();
PDESolver
*
createPDESolver
();
};
...
...
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