Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Mpp
MLUQ
Commits
421e49d7
Commit
421e49d7
authored
Nov 11, 2020
by
niklas.baumgarten
Browse files
further work on plotting
parent
75d5966b
Pipeline
#117643
passed with stages
in 6 minutes and 19 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
mlmc/src/montecarlo/PDESolver.cpp
View file @
421e49d7
...
...
@@ -27,7 +27,15 @@ void EllipticPDESolver::computeCost(SampleSolution &solution) {
}
void
EllipticPDESolver
::
plotSolution
(
SampleSolution
&
solution
)
{
plotMap
.
VtkPlot
(
solution
,
1
,
"VertexData"
);
if
(
!
plotting
)
return
;
auto
disc
=
this
->
GetDisc
();
auto
typeName
=
typeid
(
*
disc
).
name
();
if
(
typeName
==
typeid
(
LagrangeDiscretization
).
name
())
plotMap
.
VtkPlot
(
solution
,
1
,
"VertexData"
);
if
(
typeName
==
typeid
(
RTLagrangeDiscretization
).
name
())
plotMap
.
VtkPlot
(
solution
,
1
,
"CellData"
);
// if (typeName == typeid(DGDiscretization).name())
// Todo plot flux
// const auto d = dof(new CellDoF(3));
// MatrixGraph *fluxMGraph = new MatrixGraph(d, solution.U.GetMesh());
...
...
mlmc/src/montecarlo/PDESolver.hpp
View file @
421e49d7
...
...
@@ -33,6 +33,8 @@ protected:
int
verbose
=
1
;
int
plotting
=
1
;
InfoEntries
entries
;
string
quantity
=
"L2"
;
...
...
@@ -48,12 +50,14 @@ protected:
virtual
void
plotSolution
(
SampleSolution
&
solution
)
=
0
;
virtual
void
setUpPlot
(
SampleSolution
&
solution
)
{
if
(
!
plotting
)
return
;
plotMap
.
UpdateMap
(
solution
);
}
public:
PDESolver
()
{
config
.
get
(
"PDESolverVerbose"
,
verbose
);
config
.
get
(
"PDESolverPlotting"
,
plotting
);
config
.
get
(
"Quantity"
,
quantity
);
config
.
get
(
"CostMeasure"
,
costMeasure
);
entries
.
push_back
(
InfoEntry
(
"Quantity"
,
quantity
));
...
...
@@ -99,18 +103,6 @@ public:
virtual
IStochasticProblem
*
GetProblem
()
const
=
0
;
virtual
void
DrawSample
(
const
SampleID
&
id
)
=
0
;
InfoEntries
GetInfoEntries
()
const
{
// auto assembleEntries = GetAssemble()->GetInfoEntries();
// auto discEntries = GetDisc()->GetInfoEntries();
auto
problemEntries
=
GetProblem
()
->
GetInfoEntries
();
// entries.insert(entries.end(), problemEntries.begin(), problemEntries.end());
return
entries
;
}
void
PrintInfo
()
const
{
mout
.
PrintInfo
(
"Model"
,
verbose
,
entries
);
}
};
class
EllipticPDESolver
:
public
PDESolver
{
...
...
@@ -135,10 +127,7 @@ public:
PDESolver
(),
assemble
(
assemble
),
solver
(
Solver
(
GetPC
(
"SuperLU"
),
"GMRES"
)),
newton
(
Newton
(
solver
))
{
auto
assembleEntries
=
assemble
->
GetInfoEntries
();
// entries.insert(entries.end(), assembleEntries.begin(), assembleEntries.end());
}
newton
(
Newton
(
solver
))
{}
IAssemble
*
GetAssemble
()
const
override
{
return
assemble
;
...
...
@@ -191,14 +180,9 @@ public:
// T(assemble) Todo make T and t0 Problem Properties
solver
(
Solver
(
GetPC
(
"PointBlockGaussSeidel"
),
"GMRES"
)),
timeInt
(
TimeIntegrator
(
solver
,
-
102
))
{
config
.
get
(
"CFL"
,
CFL
);
config
.
get
(
"t0"
,
t0
);
config
.
get
(
"T"
,
T
);
entries
.
push_back
(
InfoEntry
(
"CFL"
,
to_string
(
CFL
)));
entries
.
push_back
(
InfoEntry
(
"t0"
,
to_string
(
t0
)));
entries
.
push_back
(
InfoEntry
(
"T"
,
to_string
(
T
)));
}
IAssemble
*
GetAssemble
()
const
override
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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