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
e7a5be0e
Commit
e7a5be0e
authored
Jan 17, 2020
by
niklas.baumgarten
Browse files
moved plotting to dgtransport and added sample directory
parent
126969fa
Changes
3
Hide whitespace changes
Inline
Side-by-side
mlmc/src/assemble/DGTAssemble.h
View file @
e7a5be0e
...
...
@@ -62,27 +62,6 @@ public:
void
SetGamma
(
Scalar
gamma
)
{
this
->
gamma
=
gamma
;
}
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
);
NumberName
(
"U"
,
filename
,
step
);
plot
->
vtk_celldata
(
filename
,
0
);
plot
->
gnu_celldata
(
filename
,
0
);
}
};
#endif
mlmc/src/assemble/DGTransportAssemble.h
View file @
e7a5be0e
...
...
@@ -10,6 +10,8 @@ public:
StochasticTransportProblem
*
problem
;
PDELogger
*
logger
;
string
sampleDir
=
""
;
double
flux_alpha
=
1.0
;
double
diffusion
=
0.0
;
...
...
@@ -251,6 +253,29 @@ public:
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
);
}
void
PrintMatrixInfo
(
Matrix
&
A
,
int
diagonal
)
const
override
{
for
(
cell
c
=
A
.
cells
();
c
!=
A
.
cells_end
();
++
c
)
{
DGElement
elem
(
*
disc
,
A
,
c
);
...
...
mlmc/src/mc/MonteCarlo.h
View file @
e7a5be0e
...
...
@@ -88,8 +88,7 @@ protected:
void
mkSampleDir
(
int
m
)
{
string
pathToData
=
"data/vtk/"
;
string
sampleDirName
=
mkSampleDirName
(
m
);
int
status
=
mkdir
(
const_cast
<
char
*>
((
pathToData
+
sampleDirName
).
c_str
()),
0777
);
int
status
=
mkdir
(
const_cast
<
char
*>
((
pathToData
.
append
(
sampleDirName
)).
c_str
()),
0777
);
}
string
buildName
(
int
m
,
string
name
,
const
string
&
suffix
=
""
)
{
...
...
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