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
ede1e913
Commit
ede1e913
authored
Jan 28, 2021
by
niklas.baumgarten
Browse files
adding destructor and bug fix
parent
fde26f75
Changes
2
Hide whitespace changes
Inline
Side-by-side
mlmc/src/pdesolver/PDESolver.cpp
View file @
ede1e913
...
...
@@ -3,7 +3,6 @@
MatrixGraphs
*
PDESolver
::
CreateSolutionMatrixGraphs
()
{
createOtherMatrixGraphs
();
auto
disc
=
this
->
GetDisc
();
auto
discType
=
typeid
(
*
disc
).
name
();
if
(
discType
==
typeid
(
LagrangeDiscretization
).
name
())
...
...
mlmc/src/pdesolver/PDESolver.hpp
View file @
ede1e913
...
...
@@ -29,7 +29,7 @@ class PDESolver {
protected:
Meshes
&
meshes
;
MatrixGraphs
*
solMGraph
;
MatrixGraphs
*
solMGraph
s
;
PlotMap
plotMap
;
...
...
@@ -60,16 +60,14 @@ public:
PDESolver
(
Meshes
&
meshes
,
const
std
::
string
&
quantity
,
const
std
::
string
&
costMeasure
,
int
verbose
,
int
plotting
)
:
meshes
(
meshes
),
quantity
(
quantity
),
costMeasure
(
costMeasure
),
verbose
(
verbose
),
plotting
(
plotting
)
{
createOtherMatrixGraphs
();
}
verbose
(
verbose
),
plotting
(
plotting
)
{}
virtual
~
PDESolver
()
{
delete
solMGraph
;
if
(
!
solMGraphs
)
delete
solMGraph
s
;
};
MatrixGraphs
*
MGraphs
()
{
return
solMGraph
;
MatrixGraphs
*
MGraphs
()
{
return
solMGraph
s
;
}
void
Run
(
SampleSolution
&
solution
)
{
...
...
@@ -117,7 +115,13 @@ public:
const
std
::
string
&
costMeasure
=
"size"
,
int
verbose
=
1
,
int
plotting
=
1
)
:
PDESolver
(
meshes
,
quantity
,
costMeasure
,
verbose
,
plotting
),
assemble
(
assemble
)
{}
assemble
(
assemble
)
{
solMGraphs
=
CreateSolutionMatrixGraphs
();
}
~
DummyPDESolver
()
{
if
(
!
solMGraphs
)
delete
solMGraphs
;
}
IAssemble
*
GetAssemble
()
const
override
{
return
assemble
;
...
...
@@ -144,9 +148,6 @@ private:
IStochasticEllipticAssemble
*
assemble
;
// To plot pressure and flux
// Might be a problem since PDESolver is storing
// meshes related information
MatrixGraphs
*
fluxMGraphs
;
MatrixGraphs
*
pressureMGraphs
;
...
...
@@ -176,9 +177,16 @@ public:
assemble
(
assemble
),
solver
(
Solver
(
GetPC
(
pc
),
linearSolver
)),
newton
(
Newton
(
solver
))
{
solMGraphs
=
CreateSolutionMatrixGraphs
();
PrintInfo
();
}
~
EllipticPDESolver
()
{
if
(
!
solMGraphs
)
delete
solMGraphs
;
if
(
!
fluxMGraphs
)
delete
fluxMGraphs
;
if
(
!
pressureMGraphs
)
delete
pressureMGraphs
;
}
IAssemble
*
GetAssemble
()
const
override
{
return
assemble
;
}
...
...
@@ -234,11 +242,16 @@ public:
// T(assemble) Todo make T and t0 Problem Properties
solver
(
Solver
(
GetPC
(
"PointBlockGaussSeidel"
),
"GMRES"
)),
timeInt
(
TimeIntegrator
(
solver
,
-
102
))
{
solMGraphs
=
CreateSolutionMatrixGraphs
();
config
.
get
(
"CFL"
,
CFL
);
config
.
get
(
"t0"
,
t0
);
config
.
get
(
"T"
,
T
);
}
~
TransportPDESolver
()
{
if
(
!
solMGraphs
)
delete
solMGraphs
;
}
IAssemble
*
GetAssemble
()
const
override
{
return
assemble
;
}
...
...
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