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
ada2860c
Commit
ada2860c
authored
May 12, 2020
by
niklas.baumgarten
Browse files
fixed std
parent
5d0988b6
Changes
11
Hide whitespace changes
Inline
Side-by-side
mlmc/src/assemble/DGEllipticAssemble.h
View file @
ada2860c
...
...
@@ -8,15 +8,15 @@
class
DGEllipticAssemble
:
public
EllipticAssemble
,
public
DGUtils
{
public:
shared_ptr
<
DGDiscretization
>
disc
;
std
::
shared_ptr
<
DGDiscretization
>
disc
;
double
penalty
=
1.0
;
int
sign
=
1
;
DGEllipticAssemble
(
shared_ptr
<
IDiscretizationT
<>>
disc
,
shared_ptr
<
StochasticEllipticProblem
>
problem
)
DGEllipticAssemble
(
std
::
shared_ptr
<
IDiscretizationT
<>>
disc
,
std
::
shared_ptr
<
StochasticEllipticProblem
>
problem
)
:
EllipticAssemble
(
move
(
disc
),
move
(
problem
))
{
this
->
disc
=
dynamic_pointer_cast
<
DGDiscretization
>
(
disc
);
this
->
disc
=
std
::
dynamic_pointer_cast
<
DGDiscretization
>
(
disc
);
config
.
get
(
"penalty"
,
penalty
);
config
.
get
(
"sign"
,
sign
);
}
...
...
mlmc/src/assemble/DGTransportAssemble.h
View file @
ada2860c
...
...
@@ -232,7 +232,7 @@ public:
}
void
PrintStep
(
double
t
,
const
Vector
&
u
)
const
override
{
pair
<
double
,
double
>
rate
=
InFlowOutFlowRate
(
u
);
std
::
pair
<
double
,
double
>
rate
=
InFlowOutFlowRate
(
u
);
string
msg
=
"Step("
;
msg
=
msg
.
append
(
to_string
(
step
)).
append
(
"), t("
);
...
...
@@ -355,7 +355,7 @@ public:
return
sqrt
(
PPM
->
Sum
(
e
));
}
pair
<
double
,
double
>
InFlowOutFlowRate
(
const
Vector
&
u
)
const
{
std
::
pair
<
double
,
double
>
InFlowOutFlowRate
(
const
Vector
&
u
)
const
{
double
inflow
=
0
;
double
outflow
=
0
;
for
(
cell
c
=
u
.
cells
();
c
!=
u
.
cells_end
();
++
c
)
{
...
...
mlmc/src/assemble/EllipticAssemble.C
View file @
ada2860c
...
...
@@ -261,7 +261,7 @@ double EllipticAssemble::FaceError(const Vector &u) const {
return
sqrt
(
PPM
->
Sum
(
face_error
));
}
pair
<
double
,
double
>
EllipticAssemble
::
getInflowOutflow
(
const
Vector
&
u
)
const
{
std
::
pair
<
double
,
double
>
EllipticAssemble
::
getInflowOutflow
(
const
Vector
&
u
)
const
{
double
inflow
=
0
;
double
outflow
=
0
;
for
(
cell
c
=
u
.
cells
();
c
!=
u
.
cells_end
();
++
c
)
{
...
...
@@ -283,7 +283,7 @@ pair<double, double> EllipticAssemble::getInflowOutflow(const Vector &u) const {
return
{
PPM
->
Sum
(
inflow
),
PPM
->
Sum
(
outflow
)};
}
pair
<
double
,
double
>
EllipticAssemble
::
getPrescribedInflowOutflow
(
const
Vector
&
u
)
const
{
std
::
pair
<
double
,
double
>
EllipticAssemble
::
getPrescribedInflowOutflow
(
const
Vector
&
u
)
const
{
double
inflow
=
0
;
double
outflow
=
0
;
for
(
cell
c
=
u
.
cells
();
c
!=
u
.
cells_end
();
++
c
)
{
...
...
@@ -305,7 +305,7 @@ pair<double, double> EllipticAssemble::getPrescribedInflowOutflow(const Vector &
return
{
PPM
->
Sum
(
inflow
),
PPM
->
Sum
(
outflow
)};
}
pair
<
double
,
double
>
EllipticAssemble
::
getOutflowLeftRight
(
const
Vector
&
u
)
const
{
std
::
pair
<
double
,
double
>
EllipticAssemble
::
getOutflowLeftRight
(
const
Vector
&
u
)
const
{
double
outflowLeft
=
0
;
double
outflowRight
=
0
;
for
(
cell
c
=
u
.
cells
();
c
!=
u
.
cells_end
();
++
c
)
{
...
...
@@ -385,14 +385,14 @@ void EllipticAssemble::AssembleTransfer(TransferMatrix &TM) const {
}
void
EllipticAssemble
::
printSolutionInfo
(
const
Vector
&
u
)
{
pair
<
double
,
double
>
prescribedFlows
=
getPrescribedInflowOutflow
(
u
);
pair
<
double
,
double
>
calculatedFlows
=
getInflowOutflow
(
u
);
std
::
pair
<
double
,
double
>
prescribedFlows
=
getPrescribedInflowOutflow
(
u
);
std
::
pair
<
double
,
double
>
calculatedFlows
=
getInflowOutflow
(
u
);
mout
<<
endl
<<
endl
;
mout
<<
"Prescribed Inflow: "
<<
setw
(
3
)
<<
prescribedFlows
.
first
<<
" Calculated Inflow: "
<<
setw
(
3
)
<<
calculatedFlows
.
first
<<
endl
<<
"Prescribed Outflow: "
<<
setw
(
3
)
<<
prescribedFlows
.
second
<<
" Calculated Outflow: "
<<
setw
(
3
)
<<
calculatedFlows
.
second
mout
<<
"Prescribed Inflow: "
<<
prescribedFlows
.
first
<<
" Calculated Inflow: "
<<
calculatedFlows
.
first
<<
endl
<<
"Prescribed Outflow: "
<<
prescribedFlows
.
second
<<
" Calculated Outflow: "
<<
calculatedFlows
.
second
<<
endl
<<
endl
;
mout
<<
"Flux Loss "
...
...
@@ -401,7 +401,7 @@ void EllipticAssemble::printSolutionInfo(const Vector &u) {
<<
endl
<<
endl
;
if
(
problem
->
Name
()
==
"Rock Problem"
)
{
pair
<
double
,
double
>
outflowLeftRight
=
getOutflowLeftRight
(
u
);
std
::
pair
<
double
,
double
>
outflowLeftRight
=
getOutflowLeftRight
(
u
);
mout
<<
"LeftOutflow: "
<<
outflowLeftRight
.
first
<<
endl
<<
"RightOutflow: "
<<
outflowLeftRight
.
second
...
...
mlmc/src/assemble/EllipticAssemble.h
View file @
ada2860c
...
...
@@ -71,11 +71,11 @@ public:
virtual
double
FaceError
(
const
Vector
&
u
)
const
;
virtual
pair
<
double
,
double
>
getInflowOutflow
(
const
Vector
&
u
)
const
;
virtual
std
::
pair
<
double
,
double
>
getInflowOutflow
(
const
Vector
&
u
)
const
;
virtual
pair
<
double
,
double
>
getPrescribedInflowOutflow
(
const
Vector
&
u
)
const
;
virtual
std
::
pair
<
double
,
double
>
getPrescribedInflowOutflow
(
const
Vector
&
u
)
const
;
virtual
pair
<
double
,
double
>
getOutflowLeftRight
(
const
Vector
&
u
)
const
;
virtual
std
::
pair
<
double
,
double
>
getOutflowLeftRight
(
const
Vector
&
u
)
const
;
virtual
double
getGoal
(
const
Vector
&
u
)
const
;
...
...
mlmc/src/assemble/HybridEllipticAssemble.C
View file @
ada2860c
...
...
@@ -187,7 +187,7 @@ void HybridEllipticAssemble::LocalProblem(const cell &c, const Vector &u, SmallM
}
}
pair
<
double
,
double
>
HybridEllipticAssemble
::
getInflowOutflow
(
const
Vector
&
u
)
const
{
std
::
pair
<
double
,
double
>
HybridEllipticAssemble
::
getInflowOutflow
(
const
Vector
&
u
)
const
{
double
inflow
=
0
;
double
outflow
=
0
;
for
(
cell
c
=
u
.
cells
();
c
!=
u
.
cells_end
();
++
c
)
{
...
...
@@ -225,7 +225,7 @@ pair<double, double> HybridEllipticAssemble::getInflowOutflow(const Vector &u) c
return
{
PPM
->
Sum
(
inflow
),
PPM
->
Sum
(
outflow
)};
}
pair
<
double
,
double
>
HybridEllipticAssemble
::
getOutflowLeftRight
(
const
Vector
&
p
)
const
{
std
::
pair
<
double
,
double
>
HybridEllipticAssemble
::
getOutflowLeftRight
(
const
Vector
&
p
)
const
{
double
outflowLeft
=
0
;
double
outflowRight
=
0
;
for
(
cell
c
=
p
.
cells
();
c
!=
p
.
cells_end
();
++
c
)
{
...
...
mlmc/src/assemble/HybridEllipticAssemble.h
View file @
ada2860c
...
...
@@ -6,8 +6,8 @@
class
HybridEllipticAssemble
:
public
MixedEllipticAssemble
{
public:
HybridEllipticAssemble
(
shared_ptr
<
IDiscretizationT
<>>
disc
,
shared_ptr
<
StochasticEllipticProblem
>
problem
)
HybridEllipticAssemble
(
std
::
shared_ptr
<
IDiscretizationT
<>>
disc
,
std
::
shared_ptr
<
StochasticEllipticProblem
>
problem
)
:
MixedEllipticAssemble
(
move
(
disc
),
move
(
problem
))
{}
Scalar
getValue
(
const
cell
&
c
,
const
Vector
&
u
,
Element
*
elem
,
int
q
)
const
override
;
...
...
@@ -32,9 +32,9 @@ public:
void
LocalProblem
(
const
cell
&
c
,
const
Vector
&
u
,
SmallMatrix
&
A
,
SmallVector
&
B
,
SmallVector
&
R
)
const
;
pair
<
double
,
double
>
getInflowOutflow
(
const
Vector
&
u
)
const
override
;
std
::
pair
<
double
,
double
>
getInflowOutflow
(
const
Vector
&
u
)
const
override
;
pair
<
double
,
double
>
getOutflowLeftRight
(
const
Vector
&
p
)
const
override
;
std
::
pair
<
double
,
double
>
getOutflowLeftRight
(
const
Vector
&
p
)
const
override
;
void
setFlux
(
const
Vector
&
u
,
Vector
&
flux
)
const
override
;
...
...
mlmc/src/assemble/MixedEllipticAssemble.h
View file @
ada2860c
...
...
@@ -6,8 +6,8 @@
class
MixedEllipticAssemble
:
public
EllipticAssemble
{
public:
MixedEllipticAssemble
(
shared_ptr
<
IDiscretizationT
<>>
disc
,
shared_ptr
<
StochasticEllipticProblem
>
problem
)
MixedEllipticAssemble
(
std
::
shared_ptr
<
IDiscretizationT
<>>
disc
,
std
::
shared_ptr
<
StochasticEllipticProblem
>
problem
)
:
EllipticAssemble
(
move
(
disc
),
move
(
problem
))
{}
Element
*
getElement
(
const
cell
&
c
,
const
Vector
&
u
)
const
override
;
...
...
mlmc/src/problem/StochasticTransportProblem.hpp
View file @
ada2860c
...
...
@@ -7,8 +7,8 @@
class
StochasticTransportProblem
:
public
StochasticProblem
{
protected:
shared_ptr
<
Discretization
>
disc
;
shared_ptr
<
HybridEllipticAssemble
>
assemble
;
std
::
shared_ptr
<
Discretization
>
disc
;
std
::
shared_ptr
<
HybridEllipticAssemble
>
assemble
;
public:
...
...
@@ -42,8 +42,8 @@ private:
public:
StochasticPollution1D
()
{
disc
=
make_shared
<
Discretization
>
(
"RT0_P0"
,
1
,
1
);
assemble
=
make_shared
<
HybridEllipticAssemble
>
(
disc
,
nullptr
);
disc
=
std
::
make_shared
<
Discretization
>
(
"RT0_P0"
,
1
,
1
);
assemble
=
std
::
make_shared
<
HybridEllipticAssemble
>
(
disc
,
nullptr
);
}
double
ut
(
double
t
,
const
Point
&
x
)
const
override
{
...
...
@@ -72,8 +72,8 @@ private:
public:
StochasticPollutionCosHat1D
()
{
disc
=
make_shared
<
Discretization
>
(
"RT0_P0"
,
1
,
1
);
assemble
=
make_shared
<
HybridEllipticAssemble
>
(
disc
,
nullptr
);
disc
=
std
::
make_shared
<
Discretization
>
(
"RT0_P0"
,
1
,
1
);
assemble
=
std
::
make_shared
<
HybridEllipticAssemble
>
(
disc
,
nullptr
);
}
double
ut
(
double
t
,
const
Point
&
x
)
const
override
{
...
...
@@ -95,8 +95,8 @@ public:
class
StochasticPollution2D
:
public
StochasticTransportProblem
{
public:
StochasticPollution2D
()
{
disc
=
make_shared
<
Discretization
>
(
"RT0_P0"
,
1
,
2
);
assemble
=
make_shared
<
HybridEllipticAssemble
>
(
disc
,
nullptr
);
disc
=
std
::
make_shared
<
Discretization
>
(
"RT0_P0"
,
1
,
2
);
assemble
=
std
::
make_shared
<
HybridEllipticAssemble
>
(
disc
,
nullptr
);
}
double
ut
(
double
t
,
const
Point
&
x
)
const
override
{
...
...
@@ -116,8 +116,8 @@ private:
public:
StochasticPollutionCosHat2D
()
{
disc
=
make_shared
<
Discretization
>
(
"RT0_P0"
,
1
,
2
);
assemble
=
make_shared
<
HybridEllipticAssemble
>
(
disc
,
nullptr
);
disc
=
std
::
make_shared
<
Discretization
>
(
"RT0_P0"
,
1
,
2
);
assemble
=
std
::
make_shared
<
HybridEllipticAssemble
>
(
disc
,
nullptr
);
}
double
ut
(
double
t
,
const
Point
&
x
)
const
override
{
...
...
@@ -152,8 +152,8 @@ private:
public:
StochasticPollutionMollifiedBar2D
()
{
disc
=
make_shared
<
Discretization
>
(
"RT0_P0"
,
1
,
2
);
assemble
=
make_shared
<
HybridEllipticAssemble
>
(
disc
,
nullptr
);
disc
=
std
::
make_shared
<
Discretization
>
(
"RT0_P0"
,
1
,
2
);
assemble
=
std
::
make_shared
<
HybridEllipticAssemble
>
(
disc
,
nullptr
);
}
double
ut
(
double
t
,
const
Point
&
x
)
const
override
{
...
...
mlmc/src/utils/IndentedLogger.hpp
View file @
ada2860c
...
...
@@ -47,7 +47,7 @@ public:
}
void
LogMsgFlush
(
const
string
&
msg
,
int
verbose
)
{
vout
(
1
)
<<
"
\r
"
<<
indent
<<
msg
<<
flush
;
vout
(
1
)
<<
"
\r
"
<<
indent
<<
msg
;
}
};
...
...
mlmc/src/utils/MultilevelPlotter.hpp
View file @
ada2860c
...
...
@@ -36,7 +36,7 @@ public:
}
// map<int, unique_ptr<SerialVtuPlot>> PlotMap;
map
<
int
,
Plot
*>
PlotMap
;
std
::
map
<
int
,
Plot
*>
PlotMap
;
void
PlotVector
(
const
string
&
name
,
const
Vector
&
data
,
int
dataDim
,
int
l
,
const
string
&
dataType
)
{
...
...
tests/TestMultilevelPlotter.cpp
View file @
ada2860c
#include "../mpp/tests/TestEnvironment.hpp"
#include "utils/MultilevelPlotter.hpp"
#include "matrixgraph/MatrixGraph.h"
#include "Algebra.h"
class
TestMultilevelPlotter
:
public
::
Test
{
protected:
shared_ptr
<
Meshes
>
meshes
;
std
::
shared_ptr
<
Meshes
>
meshes
;
int
pLevel
;
void
SetUp
()
override
{
meshes
=
make_shared
<
Meshes
>
(
"UnitSquare"
,
1
,
4
);
plotter
=
make_shared
<
MultilevelPlotter
>
(
*
meshes
);
meshes
=
std
::
make_shared
<
Meshes
>
(
"UnitSquare"
,
1
,
4
);
plotter
=
std
::
make_shared
<
MultilevelPlotter
>
(
*
meshes
);
pLevel
=
meshes
->
pLevel
();
}
...
...
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