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
5f53f6b7
Commit
5f53f6b7
authored
Sep 29, 2020
by
niklas.baumgarten
Browse files
refactored DGTransportAssemble
parent
56f39fd5
Changes
2
Hide whitespace changes
Inline
Side-by-side
mlmc/src/assemble/DGTransportAssemble.cpp
View file @
5f53f6b7
#include "DGTransportAssemble.hpp"
const
char
*
DGTransportAssemble
::
Name
()
const
{
return
"DGTransportAssemble"
;
}
double
DGTransportAssemble
::
Residual
(
const
Vector
&
u
,
Vector
&
b
)
const
{
b
=
0
;
...
...
mlmc/src/assemble/DGTransportAssemble.hpp
View file @
5f53f6b7
...
...
@@ -2,27 +2,38 @@
#define TUTORIAL_DGTRANSPORT_HPP
#include "timestepping/DGTAssemble.hpp"
#include "assemble/IStochasticTransportAssemble.hpp"
#include "problem/StochasticTransportProblem.hpp"
#include "TimeSeries.h"
#include "utility/Logging.hpp"
#include "elements/DGFaceElement.h"
class
DGTransportAssemble
:
public
DG
TAssemble
{
p
ublic
:
IStochasticTransportProblem
*
problem
;
class
DGTransportAssemble
:
public
IStochasticTransportAssemble
,
TAssemble
{
p
rotected
:
DGDiscretization
*
disc
;
double
flux_alpha
=
1.0
;
double
diffusion
=
0.0
;
DGTransportAssemble
(
IDiscretization
*
disc
,
IStochasticTransportProblem
*
problem
,
Plot
*
plot
)
:
DGTAssemble
(
dynamic_cast
<
DGDiscretizationT
<>
*>
(
disc
),
plot
),
problem
(
problem
)
{
public:
DGTransportAssemble
(
IDiscretization
*
disc
,
IStochasticTransportProblem
*
problem
)
:
IStochasticTransportAssemble
(
problem
),
disc
(
dynamic_cast
<
DGDiscretization
*>
(
disc
)
)
{
config
.
get
(
"flux_alpha"
,
flux_alpha
);
config
.
get
(
"diffusion"
,
diffusion
);
}
const
char
*
Name
()
const
override
{
return
"DGTransportAssemble"
;
}
IDiscretization
*
GetDisc
()
override
{
return
disc
;
};
void
PrintInfo
()
const
{
mout
.
PrintInfo
(
"Assemble"
,
1
,
PrintInfoEntry
(
"Name"
,
Name
()),
// PrintInfoEntry("Problem", problem->Name()),
PrintInfoEntry
(
"Discretization"
,
disc
->
DiscName
()));
}
void
PrintInfo
(
const
Vector
&
u
)
const
override
{
// std::pair<double, double> rate = InFlowOutFlowRate(u);
...
...
@@ -37,12 +48,7 @@ public:
// mout << endl;
}
void
PrintInfo
()
const
{
mout
.
PrintInfo
(
"Assemble"
,
verbose
,
PrintInfoEntry
(
"Name"
,
Name
()),
// PrintInfoEntry("Problem", problem->Name()),
PrintInfoEntry
(
"Discretization"
,
disc
->
DiscName
()));
}
const
char
*
Name
()
const
override
;
double
Residual
(
const
Vector
&
u
,
Vector
&
b
)
const
override
;
...
...
@@ -62,7 +68,7 @@ public:
std
::
pair
<
double
,
double
>
InFlowOutFlowRate
(
const
Vector
&
u
)
const
;
void
SetInitialValue
(
Vector
&
u
)
const
override
{
void
SetInitialValue
(
Vector
&
u
)
const
{
u
=
0
;
Point
z
[
MaxNodalPoints
];
for
(
cell
c
=
u
.
cells
();
c
!=
u
.
cells_end
();
++
c
)
{
...
...
@@ -76,7 +82,7 @@ public:
Accumulate
(
u
);
}
void
VtkPlotting
(
double
t
,
const
Vector
&
u
)
const
override
{
void
VtkPlotting
(
double
t
,
const
Vector
&
u
)
const
{
// const Mesh &Mp = plot->GetMesh();
// const Mesh &Mu = u.GetMesh();
// if (Mp.CellCount() != Mu.CellCount()) return;
...
...
@@ -85,7 +91,7 @@ public:
// VtkPlotting_cell(t, u, filename);
}
void
PrintMatrixInfo
(
Matrix
&
A
,
int
diagonal
)
const
override
{
void
PrintMatrixInfo
(
Matrix
&
A
,
int
diagonal
)
const
{
for
(
cell
c
=
A
.
cells
();
c
!=
A
.
cells_end
();
++
c
)
{
DGElement
elem
(
*
disc
,
A
,
c
);
DGRowEntries
A_c
(
A
,
c
,
c
);
...
...
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