Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
OPAL
src
Commits
6d0ba0fe
Commit
6d0ba0fe
authored
Jun 03, 2020
by
frey_m
Browse files
FieldWriter: do not hardcode output directory
parent
6ecb9e68
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
2 deletions
+10
-2
src/AbstractObjects/OpalData.cpp
src/AbstractObjects/OpalData.cpp
+4
-0
src/AbstractObjects/OpalData.h
src/AbstractObjects/OpalData.h
+3
-0
src/Structure/FieldWriter.hpp
src/Structure/FieldWriter.hpp
+3
-2
No files found.
src/AbstractObjects/OpalData.cpp
View file @
6d0ba0fe
...
...
@@ -674,6 +674,10 @@ std::string OpalData::getTitle() {
return
p
->
itsTitle_m
;
}
std
::
string
OpalData
::
getOutputDirectory
()
const
{
return
"data"
;
}
std
::
string
OpalData
::
getInputFn
()
{
return
p
->
inputFn_m
;
}
...
...
src/AbstractObjects/OpalData.h
View file @
6d0ba0fe
...
...
@@ -182,6 +182,9 @@ public:
/// get the step where to restart
int
getRestartStep
();
/// get the name of the data directory
std
::
string
getOutputDirectory
()
const
;
/// get opals input filename
std
::
string
getInputFn
();
...
...
src/Structure/FieldWriter.hpp
View file @
6d0ba0fe
...
...
@@ -40,7 +40,7 @@ void FieldWriter::dumpField(FieldType& field, std::string name,
INFOMSG
(
"*** START DUMPING "
+
Util
::
toUpper
(
name
)
+
" FIELD ***"
<<
endl
);
/* Save the files in the
data/
directory of the simulation. The file
/* Save the files in the
output
directory of the simulation. The file
* name of vector fields is
*
* 'basename'-'name'_field-'******'.dat
...
...
@@ -54,7 +54,8 @@ void FieldWriter::dumpField(FieldType& field, std::string name,
* 'name': field name (input argument of function)
* '******': step padded with zeros to 6 digits
*/
boost
::
filesystem
::
path
file
(
"data"
);
std
::
string
dirname
=
OpalData
::
getInstance
()
->
getOutputDirectory
();
boost
::
filesystem
::
path
file
(
dirname
);
boost
::
format
filename
(
"%1%-%2%-%|3$06|.dat"
);
std
::
string
basename
=
OpalData
::
getInstance
()
->
getInputBasename
();
filename
%
basename
%
(
name
+
std
::
string
(
"_"
)
+
type
)
%
step
;
...
...
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