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
bd34db10
Commit
bd34db10
authored
Oct 16, 2020
by
niklas.baumgarten
Browse files
adapted imports
parent
e844ec7a
Pipeline
#114635
failed with stages
in 6 minutes and 5 seconds
Changes
18
Pipelines
17
Hide whitespace changes
Inline
Side-by-side
mlmc/src/assemble/DGEllipticAssemble.hpp
View file @
bd34db10
...
...
@@ -2,7 +2,7 @@
#define _DGLAPLACE_H_
#include
"discretization/DGDiscretization.hpp"
#include
"elements/Elements.h"
#include
"elements/Elements.h
pp
"
#include
"IStochasticEllipticAssemble.hpp"
class
DGEllipticAssemble
:
public
IStochasticEllipticAssemble
{
...
...
mlmc/src/assemble/DGTransportAssemble.hpp
View file @
bd34db10
...
...
@@ -4,9 +4,9 @@
#include
"timestepping/DGTAssemble.hpp"
#include
"assemble/IStochasticTransportAssemble.hpp"
#include
"problem/StochasticTransportProblem.hpp"
#include
"TimeSeries.h"
#include
"TimeSeries.h
pp
"
#include
"utility/Logging.hpp"
#include
"elements/DGFaceElement.h"
#include
"elements/DGFaceElement.h
pp
"
class
DGTransportAssemble
:
public
IStochasticTransportAssemble
{
...
...
mlmc/src/assemble/HybridEllipticAssemble.cpp
View file @
bd34db10
...
...
@@ -36,7 +36,7 @@ void HybridEllipticAssemble::Residual(const cell &c, const Vector &u, Vector &r)
SmallVector
RU
(
R
);
SmallVector
UU
(
R
);
RT
0_
LagrangeElement
T
<>
elem
(
*
disc
,
u
,
c
);
RTLagrangeElement
elem
(
*
disc
,
u
,
c
);
for
(
int
face
=
0
;
face
<
Faces
;
++
face
)
UU
[
face
]
=
u
(
elem
[
face
],
0
);
for
(
int
face
=
0
;
face
<
Faces
;
++
face
)
...
...
@@ -73,7 +73,7 @@ void HybridEllipticAssemble::Jacobi(const cell &c, const Vector &u, Matrix &J) c
SmallVector
IAB
(
IA
,
B
);
Scalar
BIAB
=
B
*
IAB
;
RT
0_
LagrangeElement
T
<>
elem
(
*
disc
,
u
,
c
);
RTLagrangeElement
elem
(
*
disc
,
u
,
c
);
RowEntries
J_c
(
J
,
elem
);
for
(
int
face_i
=
0
;
face_i
<
Faces
;
++
face_i
)
for
(
int
face_j
=
0
;
face_j
<
Faces
;
++
face_j
)
...
...
@@ -85,7 +85,7 @@ void HybridEllipticAssemble::LocalProblem(const cell &c, const Vector &u,
SmallMatrix
&
A
,
SmallVector
&
B
,
SmallVector
&
R
)
const
{
A
=
0
,
B
=
0
,
R
=
0
;
RT
0_
LagrangeElement
T
<>
elem
(
*
disc
,
u
,
c
);
RTLagrangeElement
elem
(
*
disc
,
u
,
c
);
for
(
int
q
=
0
;
q
<
elem
.
nQ
();
++
q
)
{
double
w
=
elem
.
QWeight
(
q
);
Tensor
IK
=
Invert
(
problem
->
Permeability
(
c
));
...
...
@@ -167,7 +167,7 @@ void HybridEllipticAssemble::SetFlux(const Vector &u, Vector &flux) {
Scalar
BIAB
=
B
*
IAB
;
SmallVector
RU
(
R
);
SmallVector
UU
(
R
);
RT
0_
LagrangeElement
T
<>
elem
(
*
disc
,
u
,
c
);
RTLagrangeElement
elem
(
*
disc
,
u
,
c
);
for
(
int
i
=
0
;
i
<
c
.
Faces
();
++
i
)
UU
[
i
]
=
u
(
elem
[
i
],
0
);
for
(
int
i
=
0
;
i
<
c
.
Faces
();
++
i
)
...
...
@@ -213,7 +213,7 @@ void HybridEllipticAssemble::SetNormalFlux(const Vector &u, Vector &flux) {
Scalar
BIAB
=
B
*
IAB
;
SmallVector
RU
(
R
);
SmallVector
UU
(
R
);
RT
0_
LagrangeElement
T
<>
elem
(
*
disc
,
u
,
c
);
RTLagrangeElement
elem
(
*
disc
,
u
,
c
);
for
(
int
face
=
0
;
face
<
c
.
Faces
();
++
face
)
UU
[
face
]
=
u
(
elem
[
face
],
0
);
for
(
int
face
=
0
;
face
<
c
.
Faces
();
++
face
)
...
...
@@ -233,7 +233,7 @@ VectorField HybridEllipticAssemble::EvaluateCellFlux(const Vector &flux,
const
cell
&
c
)
const
{
const
Mesh
&
M
=
flux
.
GetMesh
();
if
(
M
.
find_cell
(
c
())
==
M
.
cells_end
())
return
zero
;
RT
0_
LagrangeElement
T
<>
elem
(
*
disc
,
flux
,
c
);
RTLagrangeElement
elem
(
*
disc
,
flux
,
c
);
VectorField
F
=
zero
;
double
area
=
0
;
for
(
int
q
=
0
;
q
<
elem
.
nQ
();
++
q
)
{
...
...
@@ -249,19 +249,19 @@ double HybridEllipticAssemble::EvaluateNormalFlux(const Vector &flux, const cell
int
i
)
const
{
const
Mesh
&
M
=
flux
.
GetMesh
();
if
(
M
.
find_cell
(
c
())
==
M
.
cells_end
())
return
0
;
RT
0_
LagrangeElement
T
<>
elem
(
*
disc
,
flux
,
c
);
RTLagrangeElement
elem
(
*
disc
,
flux
,
c
);
RTFaceElementT
<>
faceElem
(
*
disc
,
flux
,
c
,
i
);
return
flux
(
elem
[
i
],
0
)
*
elem
.
Sign
(
i
)
/
faceElem
.
Area
();
}
VectorField
HybridEllipticAssemble
::
EvaluateNormal
(
const
Vector
&
flux
,
const
cell
&
c
,
int
i
)
const
{
RT
0_
LagrangeElement
T
<>
elem
(
*
disc
,
flux
,
c
);
RTLagrangeElement
elem
(
*
disc
,
flux
,
c
);
return
elem
.
Normal
(
i
);
}
Scalar
HybridEllipticAssemble
::
Value
(
const
cell
&
c
,
const
Vector
&
u
,
RT
0_
LagrangeElement
T
<>
&
elem
)
const
{
RTLagrangeElement
&
elem
)
const
{
int
Faces
=
c
.
Faces
();
SmallMatrix
A
(
Faces
);
SmallVector
B
(
Faces
),
R
(
Faces
);
...
...
@@ -271,7 +271,7 @@ Scalar HybridEllipticAssemble::Value(const cell &c, const Vector &u,
Scalar
BIAB
=
B
*
IAB
;
SmallVector
RU
(
R
);
SmallVector
UU
(
R
);
RT
0_
LagrangeElement
T
<>
E
(
*
disc
,
u
,
c
);
RTLagrangeElement
E
(
*
disc
,
u
,
c
);
for
(
int
face
=
0
;
face
<
c
.
Faces
();
++
face
)
UU
[
face
]
=
u
(
E
[
face
],
0
);
for
(
int
face
=
0
;
face
<
c
.
Faces
();
++
face
)
...
...
@@ -292,7 +292,7 @@ Scalar HybridEllipticAssemble::FaceValue(const cell &c, const Vector &u,
Scalar
BIAB
=
B
*
IAB
;
SmallVector
RU
(
R
);
SmallVector
UU
(
R
);
RT
0_
LagrangeElement
T
<>
elem
(
*
disc
,
u
,
c
);
RTLagrangeElement
elem
(
*
disc
,
u
,
c
);
for
(
int
face
=
0
;
face
<
c
.
Faces
();
++
face
)
UU
[
face
]
=
u
(
elem
[
face
],
0
);
for
(
int
face
=
0
;
face
<
Faces
;
++
face
)
...
...
@@ -303,7 +303,7 @@ Scalar HybridEllipticAssemble::FaceValue(const cell &c, const Vector &u,
}
VectorField
HybridEllipticAssemble
::
Flux
(
const
cell
&
c
,
const
Vector
&
u
,
RT
0_
LagrangeElement
T
<>
&
elem
,
int
q
)
const
{
RTLagrangeElement
&
elem
,
int
q
)
const
{
int
Faces
=
c
.
Faces
();
SmallMatrix
A
(
Faces
);
SmallVector
B
(
Faces
),
R
(
Faces
);
...
...
@@ -334,7 +334,7 @@ VectorField HybridEllipticAssemble::Flux(const cell &c, const Vector &u,
VectorField
HybridEllipticAssemble
::
FaceFlux
(
const
cell
&
c
,
const
Vector
&
u
,
RTFaceElementT
<>
&
faceElem
,
int
q
,
int
face
)
const
{
RT
0_
LagrangeElement
T
<>
elem
(
*
disc
,
u
,
c
);
RTLagrangeElement
elem
(
*
disc
,
u
,
c
);
int
Faces
=
c
.
Faces
();
SmallMatrix
A
(
Faces
);
SmallVector
B
(
Faces
),
R
(
Faces
);
...
...
@@ -360,7 +360,7 @@ VectorField HybridEllipticAssemble::FaceFlux(const cell &c, const Vector &u,
double
HybridEllipticAssemble
::
EnergyError
(
const
Vector
&
u
)
const
{
double
err
=
0.0
;
for
(
cell
c
=
u
.
cells
();
c
!=
u
.
cells_end
();
++
c
)
{
RT
0_
LagrangeElement
T
<>
elem
(
*
disc
,
u
,
c
);
RTLagrangeElement
elem
(
*
disc
,
u
,
c
);
for
(
int
q
=
0
;
q
<
elem
.
nQ
();
++
q
)
{
double
w
=
elem
.
QWeight
(
q
);
Tensor
IK
=
Invert
(
problem
->
Permeability
(
c
));
...
...
@@ -375,7 +375,7 @@ double HybridEllipticAssemble::EnergyError(const Vector &u) const {
double
HybridEllipticAssemble
::
L2
(
const
Vector
&
u
)
const
{
double
l2
=
0.0
;
for
(
cell
c
=
u
.
cells
();
c
!=
u
.
cells_end
();
++
c
)
{
RT
0_
LagrangeElement
T
<>
elem
(
*
disc
,
u
,
c
);
RTLagrangeElement
elem
(
*
disc
,
u
,
c
);
for
(
int
q
=
0
;
q
<
elem
.
nQ
();
++
q
)
{
double
w
=
elem
.
QWeight
(
q
);
Scalar
U
=
Value
(
c
,
u
,
elem
);
...
...
@@ -388,7 +388,7 @@ double HybridEllipticAssemble::L2(const Vector &u) const {
double
HybridEllipticAssemble
::
H1
(
const
Vector
&
u
)
const
{
double
err
=
0.0
;
for
(
cell
c
=
u
.
cells
();
c
!=
u
.
cells_end
();
++
c
)
{
RT
0_
LagrangeElement
T
<>
elem
(
*
disc
,
u
,
c
);
RTLagrangeElement
elem
(
*
disc
,
u
,
c
);
for
(
int
q
=
0
;
q
<
elem
.
nQ
();
++
q
)
{
double
w
=
elem
.
QWeight
(
q
);
Scalar
U
=
Value
(
c
,
u
,
elem
);
...
...
@@ -403,7 +403,7 @@ double HybridEllipticAssemble::H1(const Vector &u) const {
double
HybridEllipticAssemble
::
L2Error
(
const
Vector
&
u
)
const
{
double
err
=
0.0
;
for
(
cell
c
=
u
.
cells
();
c
!=
u
.
cells_end
();
++
c
)
{
RT
0_
LagrangeElement
T
<>
elem
(
*
disc
,
u
,
c
);
RTLagrangeElement
elem
(
*
disc
,
u
,
c
);
for
(
int
q
=
0
;
q
<
elem
.
nQ
();
++
q
)
{
double
w
=
elem
.
QWeight
(
q
);
Scalar
U
=
Value
(
c
,
u
,
elem
);
...
...
@@ -417,7 +417,7 @@ double HybridEllipticAssemble::L2Error(const Vector &u) const {
double
HybridEllipticAssemble
::
L2CellAverageError
(
const
Vector
&
u
)
const
{
double
err
=
0
;
for
(
cell
c
=
u
.
cells
();
c
!=
u
.
cells_end
();
++
c
)
{
RT
0_
LagrangeElement
T
<>
elem
(
*
disc
,
u
,
c
);
RTLagrangeElement
elem
(
*
disc
,
u
,
c
);
double
w
=
0
;
Scalar
U
=
0
;
Scalar
Sol
=
0
;
...
...
@@ -434,7 +434,7 @@ double HybridEllipticAssemble::L2CellAverageError(const Vector &u) const {
double
HybridEllipticAssemble
::
MaxError
(
const
Vector
&
u
)
const
{
double
err
=
0
;
for
(
cell
c
=
u
.
cells
();
c
!=
u
.
cells_end
();
++
c
)
{
RT
0_
LagrangeElement
T
<>
elem
(
*
disc
,
u
,
c
);
RTLagrangeElement
elem
(
*
disc
,
u
,
c
);
for
(
int
q
=
0
;
q
<
elem
.
nQ
();
++
q
)
{
Scalar
U
=
Value
(
c
,
u
,
elem
);
err
=
max
(
err
,
abs
(
U
-
problem
->
Solution
(
elem
.
QPoint
(
q
))));
...
...
mlmc/src/assemble/HybridEllipticAssemble.hpp
View file @
bd34db10
#ifndef _HYBRID_H_
#define _HYBRID_H_
#include
"Small.h"
#include
"Small.h
pp
"
#include
"MixedEllipticAssemble.hpp"
...
...
@@ -67,13 +67,13 @@ public:
VectorField
EvaluateNormal
(
const
Vector
&
flux
,
const
cell
&
c
,
int
i
)
const
;
Scalar
Value
(
const
cell
&
c
,
const
Vector
&
u
,
RT
0_
LagrangeElement
T
<>
&
elem
)
const
;
RTLagrangeElement
&
elem
)
const
;
Scalar
FaceValue
(
const
cell
&
c
,
const
Vector
&
u
,
RTFaceElementT
<>
&
faceElem
)
const
;
VectorField
Flux
(
const
cell
&
c
,
const
Vector
&
u
,
RT
0_
LagrangeElement
T
<>
&
elem
,
int
q
)
const
;
RTLagrangeElement
&
elem
,
int
q
)
const
;
VectorField
FaceFlux
(
const
cell
&
c
,
const
Vector
&
u
,
RTFaceElementT
<>
&
faceElem
,
...
...
mlmc/src/assemble/IReactionAssemble.hpp
View file @
bd34db10
#ifndef IREACTIONASSEMBLE_HPP
#define IREACTIONASSEMBLE_HPP
#include
"Assemble.h"
#include
"Assemble.h
pp
"
class
IReactionAssemble
:
public
TAssemble
{
...
...
mlmc/src/assemble/IStochasticEllipticAssemble.hpp
View file @
bd34db10
#ifndef ISTOCHASTICELLIPTICASSEMBLE_HPP
#define ISTOCHASTICELLIPTICASSEMBLE_HPP
#include
"Assemble.h"
#include
"Assemble.h
pp
"
#include
"problem/StochasticEllipticProblem.hpp"
...
...
mlmc/src/assemble/IStochasticTransportAssemble.hpp
View file @
bd34db10
#ifndef ISTOCHASTICTRANSPORTASSEMBLE_HPP
#define ISTOCHASTICTRANSPORTASSEMBLE_HPP
#include
"Assemble.h"
#include
"Assemble.h
pp
"
#include
"problem/StochasticTransportProblem.hpp"
...
...
mlmc/src/assemble/LagrangeEllipticAssemble.hpp
View file @
bd34db10
...
...
@@ -2,7 +2,7 @@
#define _LAPLACE_H_
#include
"discretization/LagrangeDiscretization.hpp"
#include
"elements/Elements.h"
#include
"elements/Elements.h
pp
"
#include
"IStochasticEllipticAssemble.hpp"
...
...
mlmc/src/assemble/MixedEllipticAssemble.hpp
View file @
bd34db10
...
...
@@ -3,7 +3,7 @@
#include
"discretization/RTLagrangeDiscretization.hpp"
#include
"discretization/LagrangeDiscretization.hpp"
#include
"elements/Elements.h"
#include
"elements/Elements.h
pp
"
#include
"IStochasticEllipticAssemble.hpp"
...
...
mlmc/src/assemble/PGReactionAssemble.hpp
View file @
bd34db10
...
...
@@ -2,9 +2,9 @@
#define _REACTION_H_
#include
"discretization/LagrangeDiscretization.hpp"
#include
"elements/Elements.h"
#include
"Plot.h"
#include
"utility/ctools.h"
#include
"elements/Elements.h
pp
"
#include
"Plot.h
pp
"
#include
"utility/ctools.h
pp
"
#include
"problem/StochasticReactionProblem.hpp"
#include
"IReactionAssemble.hpp"
...
...
mlmc/src/main/MultilevelPlotter.hpp
View file @
bd34db10
#ifndef MULTILEVELPLOTTER_HPP
#define MULTILEVELPLOTTER_HPP
#include
"Plot.h"
#include
"Plot.h
pp
"
#include
"mesh/Meshes.hpp"
#include
"montecarlo/Sample.hpp"
#include
<memory>
...
...
mlmc/src/montecarlo/EmpiricMeasures.cpp
View file @
bd34db10
#include
"EmpiricMeasures.hpp"
#include
"utility/Assertion.h"
#include
"utility/Assertion.h
pp
"
#include
<math.h>
...
...
mlmc/src/montecarlo/PDESolver.hpp
View file @
bd34db10
...
...
@@ -2,8 +2,8 @@
#define PDESOLVER_HPP
#include
"Sample.hpp"
#include
"solver/Solver.h"
#include
"solver/Newton.h"
#include
"solver/Solver.h
pp
"
#include
"solver/Newton.h
pp
"
#include
"timestepping/TimeIntegrator.hpp"
#include
"assemble/IStochasticEllipticAssemble.hpp"
#include
"assemble/IStochasticTransportAssemble.hpp"
...
...
mlmc/src/montecarlo/Sample.hpp
View file @
bd34db10
#ifndef SAMPLE_HPP
#define SAMPLE_HPP
#include
"Algebra.h"
#include
"Algebra.h
pp
"
#include
<string>
...
...
mlmc/src/problem/StochasticProblem.hpp
View file @
bd34db10
#ifndef STOCHASTICPROBLEM_HPP
#define STOCHASTICPROBLEM_HPP
#include
"Algebra.h"
#include
"Algebra.h
pp
"
#include
"montecarlo/Sample.hpp"
#include
"stochastics/SampleGenerator.hpp"
#include
"main/Utils.hpp"
...
...
mlmc/src/stochastics/CirculantEmbedding.hpp
View file @
bd34db10
...
...
@@ -4,7 +4,7 @@
#include
"RandomNumberManager.hpp"
#include
"CovarianceFunction.hpp"
#include
"main/Utils.hpp"
#include
"Algebra.h"
#include
"Algebra.h
pp
"
#include
"SampleGenerator.hpp"
#include
"dof/BasicDoFs.hpp"
#include
"main/MultilevelPlotter.hpp"
...
...
mlmc/src/stochastics/CovarianceFunction.hpp
View file @
bd34db10
...
...
@@ -2,7 +2,7 @@
#define M_COVARIANCEFUNCTION_H
#include
"utility/Config.hpp"
#include
"utility/Assertion.h"
#include
"utility/Assertion.h
pp
"
typedef
std
::
vector
<
double
>
ToeplitzRow
;
...
...
mlmc/src/stochastics/HybridFluxGenerator.hpp
View file @
bd34db10
...
...
@@ -7,7 +7,7 @@
#include
"assemble/HybridEllipticAssemble.hpp"
#include
"problem/StochasticHybridFlux.hpp"
#include
"discretization/RTLagrangeDiscretization.hpp"
#include
"solver/Newton.h"
#include
"solver/Newton.h
pp
"
#include
<memory>
...
...
@@ -96,7 +96,7 @@ public:
};
VectorField
EvalVectorFieldSample
(
const
cell
&
c
)
override
{
RT
0_
LagrangeElement
T
<>
elem
(
*
disc
,
*
faceFlux
,
c
);
RTLagrangeElement
elem
(
*
disc
,
*
faceFlux
,
c
);
VectorField
F
=
zero
;
double
area
=
0
;
for
(
int
q
=
0
;
q
<
elem
.
nQ
();
++
q
)
{
...
...
@@ -109,7 +109,7 @@ public:
}
Scalar
EvalScalarSample
(
int
face
,
const
cell
&
c
)
override
{
RT
0_
LagrangeElement
T
<>
elem
(
*
disc
,
*
faceFlux
,
c
);
RTLagrangeElement
elem
(
*
disc
,
*
faceFlux
,
c
);
RTFaceElementT
<>
faceElem
(
*
disc
,
*
faceFlux
,
c
,
face
);
return
(
*
faceFlux
)(
elem
[
face
],
0
)
*
elem
.
Sign
(
face
)
/
faceElem
.
Area
();
}
...
...
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