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
1c597bd3
Commit
1c597bd3
authored
Jan 17, 2020
by
niklas.baumgarten
Browse files
added sample folders
parent
e97bbffb
Changes
1
Hide whitespace changes
Inline
Side-by-side
mlmc/src/mc/MonteCarlo.h
View file @
1c597bd3
...
...
@@ -4,11 +4,14 @@
#include "m++.h"
#include "stochastics/StochasticField.h"
#include "MonteCarloLogger.h"
#include <sys/stat.h>
#include <utility>
class
MonteCarlo
{
public:
int
verbose
=
0
,
plotting
=
0
;
int
plotting
=
0
;
MonteCarloLogger
*
logger
;
int
l
=
0
,
pLevel
=
0
;
...
...
@@ -78,14 +81,26 @@ protected:
3.0
*
avgY
*
avgY
*
avgY
*
avgY
)
/
varY
/
varY
;
}
const
char
*
buildString
(
int
m
,
string
name
,
const
string
&
suffix
=
""
)
{
string
mkSampleDirName
(
int
m
)
{
return
buildName
(
m
,
"sample"
);
}
void
mkSampleDir
(
int
m
)
{
string
pathToData
=
"data/vtk/"
;
string
sampleDirName
=
mkSampleDirName
(
m
);
int
status
=
mkdir
(
const_cast
<
char
*>
((
pathToData
+
sampleDirName
).
c_str
()),
0777
);
}
string
buildName
(
int
m
,
string
name
,
const
string
&
suffix
=
""
)
{
string
returnName
=
std
::
move
(
name
);
if
(
!
suffix
.
empty
())
n
ame
+
=
"_"
+
suffix
;
returnN
ame
=
returnName
.
append
(
"_"
).
append
(
suffix
)
;
if
(
l
!=
-
1
)
n
ame
+
=
"_"
+
to_string
(
l
);
returnN
ame
=
returnName
.
append
(
"_"
).
append
(
to_string
(
l
)
)
;
if
(
m
!=
-
1
)
n
ame
+
=
"_"
+
to_string
(
m
);
return
const_cast
<
char
*>
(
name
.
c_str
())
;
returnN
ame
=
returnName
.
append
(
"_"
).
append
(
to_string
(
m
)
)
;
return
returnName
;
}
};
...
...
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