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
1f6ccdf0
Commit
1f6ccdf0
authored
Apr 23, 2020
by
niklas.baumgarten
Browse files
started to re- implement transport
parent
c9b17e5f
Pipeline
#83913
failed with stages
in 5 minutes and 57 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
mlmc/src/assemble/DGTAssemble.h
View file @
1f6ccdf0
...
...
@@ -9,13 +9,12 @@
class
DGTAssemble
:
public
TAssemble
,
public
DGUtils
{
public:
DGDiscretization
*
disc
;
Plot
*
plot
;
int
plot_tStep
=
1
;
Scalar
gamma
=
1.0
;
explicit
DGTAssemble
(
DGDiscretization
*
disc
,
Plot
*
plot
)
:
disc
(
disc
)
,
plot
(
plot
)
{};
explicit
DGTAssemble
(
DGDiscretization
*
disc
)
:
disc
(
disc
)
{};
const
char
*
Name
()
const
override
{
return
"DGTAssemble"
;
}
...
...
mlmc/src/assemble/DGTransportAssemble.h
View file @
1f6ccdf0
...
...
@@ -5,19 +5,22 @@
#include
"utils/IndentedLogger.hpp"
#include
<memory>
class
DGTransportAssemble
:
public
DGTAssemble
{
public:
StochasticTransportProblem
*
problem
;
IndentedLogger
*
logger
;
//
std::shared_ptr<IDiscretizationT<>> disc
;
std
::
shared_ptr
<
StochasticTransportProblem
>
problem
;
string
sampleDir
=
""
;
IndentedLogger
*
logger
;
double
flux_alpha
=
1.0
;
double
diffusion
=
0.0
;
DGTransportAssemble
(
Discretization
*
disc
,
StochasticTransportProblem
*
problem
,
Plot
*
plot
)
:
DGTAssemble
(
dynamic_cast
<
DGDiscretization
*>
(
disc
),
plot
),
problem
(
problem
)
{
// Todo Super Hacky!
DGTransportAssemble
(
std
::
shared_ptr
<
IDiscretizationT
<>>
disc
,
std
::
shared_ptr
<
StochasticTransportProblem
>
problem
)
:
DGTAssemble
(
dynamic_cast
<
DGDiscretization
*>
(
disc
.
get
())),
problem
(
move
(
problem
))
{
ReadConfig
(
Settings
,
"flux_alpha"
,
flux_alpha
);
logger
=
IndentedLogger
::
GetInstance
();
}
...
...
@@ -245,35 +248,37 @@ public:
}
void
VtkPlotting
(
double
t
,
const
Vector
&
u
)
const
override
{
const
Mesh
&
Mp
=
plot
->
GetMesh
();
const
Mesh
&
Mu
=
u
.
GetMesh
();
if
(
Mp
.
Cells
::
size
()
!=
Mu
.
Cells
::
size
())
return
;
vout
(
2
)
<<
" => VtkPlotting result of step "
<<
step
<<
".
\n
"
;
char
filename
[
128
];
VtkPlotting_cell
(
t
,
u
,
filename
);
// Todo
// const Mesh &Mp = plot->GetMesh();
// const Mesh &Mu = u.GetMesh();
// if (Mp.Cells::size() != Mu.Cells::size()) return;
// vout (2) << " => VtkPlotting result of step " << step << ".\n";
// char filename[128];
// VtkPlotting_cell(t, u, filename);
}
void
VtkPlotting_cell
(
double
t
,
const
Vector
&
u
,
char
*
filename
)
const
{
Vector
u_tmp
(
u
);
for
(
cell
c
=
u_tmp
.
cells
();
c
!=
u_tmp
.
cells_end
();
++
c
)
{
DGElement
elem
(
*
disc
,
u_tmp
,
c
);
Scalar
U
=
0.0
;
double
a
=
0
;
for
(
int
q
=
0
;
q
<
elem
.
nQ
();
++
q
)
{
double
w
=
elem
.
QWeight
(
q
);
U
+=
w
*
elem
.
Value
(
q
,
u
);
a
+=
w
;
}
U
*=
(
1
/
a
);
row
r
=
u
.
find_row
(
c
());
u_tmp
(
r
)[
0
]
=
U
;
}
plot
->
celldata
(
u_tmp
,
1
);
string
name
=
""
;
name
=
name
.
append
(
sampleDir
).
append
(
"/U"
);
NumberName
(
const_cast
<
char
*>
(
name
.
c_str
()),
filename
,
step
);
plot
->
vtk_celldata
(
filename
,
0
);
plot
->
gnu_celldata
(
filename
,
0
);
// Todo
// Vector u_tmp(u);
// for (cell c = u_tmp.cells(); c != u_tmp.cells_end(); ++c) {
// DGElement elem(*disc, u_tmp, c);
// Scalar U = 0.0;
// double a = 0;
// for (int q = 0; q < elem.nQ(); ++q) {
// double w = elem.QWeight(q);
// U += w * elem.Value(q, u);
// a += w;
// }
// U *= (1 / a);
// row r = u.find_row(c());
// u_tmp(r)[0] = U;
// }
// plot->celldata(u_tmp, 1);
// string name = "";
// name = name.append(sampleDir).append("/U");
// NumberName(const_cast<char *>(name.c_str()), filename, step);
// plot->vtk_celldata(filename, 0);
// plot->gnu_celldata(filename, 0);
}
void
PrintMatrixInfo
(
Matrix
&
A
,
int
diagonal
)
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