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
b877553f
Commit
b877553f
authored
Sep 22, 2020
by
niklas.baumgarten
Browse files
moved matrix graph
parent
c93f9825
Changes
1
Hide whitespace changes
Inline
Side-by-side
mlmc/src/stochastics/CirculantEmbedding.cpp
View file @
b877553f
...
...
@@ -5,9 +5,7 @@
void
CirculantEmbedding1D
::
generateFineSample
(
SampleID
id
,
Vector
*&
fineSample
,
Vector
*&
coarseSample
)
{
MatrixGraphs
cellMatrixGraphs
(
this
->
meshes
,
dof
(
new
CellDoF
(
1
)));
fineSample
=
new
Vector
(
cellMatrixGraphs
[
id
.
level
-
this
->
meshes
.
pLevel
()]);
coarseSample
=
nullptr
;
fineSample
=
new
Vector
(
cellMGraphs
[
id
.
level
-
this
->
meshes
.
pLevel
()]);
if
(
internalCounter
==
0
)
fineComplexField
=
generateField
();
...
...
@@ -29,6 +27,8 @@ void CirculantEmbedding1D::generateFineSample(SampleID id,
internalCounter
+=
1
;
internalCounter
%=
2
;
if
(
coarseSample
)
delete
coarseSample
;
if
(
plotting
)
plotter
->
PlotVector
(
"kappa"
,
*
fineSample
,
1
,
l
,
"CellData"
);
...
...
@@ -37,8 +37,7 @@ void CirculantEmbedding1D::generateFineSample(SampleID id,
void
CirculantEmbedding1D
::
generateCoarseSample
(
SampleID
id
,
Vector
*&
fineSample
,
Vector
*&
coarseSample
)
{
MatrixGraphs
cellMatrixGraphs
(
this
->
meshes
,
dof
(
new
CellDoF
(
1
)));
coarseSample
=
new
Vector
(
cellMatrixGraphs
[
l
-
this
->
meshes
.
pLevel
()
-
1
]);
coarseSample
=
new
Vector
(
cellMGraphs
[
l
-
this
->
meshes
.
pLevel
()
-
1
]);
(
*
coarseSample
)
=
0
;
for
(
cell
c
=
coarseSample
->
cells
();
c
!=
coarseSample
->
cells_end
();
c
++
)
{
...
...
@@ -53,6 +52,8 @@ void CirculantEmbedding1D::generateCoarseSample(SampleID id,
coarseSample
->
operator
()(
coarseRow
,
i
)
/=
c
.
Children
();
}
if
(
fineSample
)
delete
fineSample
;
if
(
plotting
)
plotter
->
PlotVector
(
"kappa"
,
*
coarseSample
,
1
,
l
-
1
,
"CellData"
);
...
...
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