Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-tectonic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
podlesny
dune-tectonic
Commits
7b746081
Commit
7b746081
authored
9 years ago
by
Elias Pipping
Browse files
Options
Downloads
Patches
Plain Diff
[Cleanup] Abbreviate the namespace boost::fs
parent
9804a59e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sand-wedge.cc
+11
-12
11 additions, 12 deletions
src/sand-wedge.cc
with
11 additions
and
12 deletions
src/sand-wedge.cc
+
11
−
12
View file @
7b746081
...
...
@@ -75,25 +75,25 @@
#include
"vtk.hh"
size_t
const
dims
=
MY_DIM
;
namespace
fs
=
boost
::
filesystem
;
void
initPython
(
std
::
string
dataDirectory
)
{
void
initPython
(
fs
::
path
const
&
dataDirectory
)
{
Python
::
start
();
Python
::
run
(
"import sys"
);
Python
::
run
(
str
(
boost
::
format
(
"sys.path.append('%s')"
)
%
dataDirectory
));
Python
::
run
(
str
(
boost
::
format
(
"sys.path.append('%s')"
)
%
dataDirectory
.
string
()));
}
int
main
(
int
argc
,
char
*
argv
[])
{
try
{
auto
const
dataDirectory
=
boost
::
filesystem
::
system_complete
(
boost
::
filesystem
::
path
(
argv
[
0
]))
.
parent_path
()
/
boost
::
filesystem
::
path
(
"sand-wedge-data"
);
fs
::
system_complete
(
fs
::
path
(
argv
[
0
])).
parent_path
()
/
fs
::
path
(
"sand-wedge-data"
);
Dune
::
ParameterTree
parset
;
Dune
::
ParameterTreeParser
::
readINITree
(
(
dataDirectory
/
boost
::
filesystem
::
path
(
"parset.cfg"
)).
string
(),
parset
);
(
dataDirectory
/
fs
::
path
(
"parset.cfg"
)).
string
(),
parset
);
Dune
::
ParameterTreeParser
::
readOptions
(
argc
,
argv
,
parset
);
MyGeometry
::
render
();
...
...
@@ -169,7 +169,7 @@ int main(int argc, char *argv[]) {
using
FunctionMap
=
SharedPointerMap
<
std
::
string
,
Function
>
;
FunctionMap
functions
;
{
initPython
(
dataDirectory
.
string
()
);
initPython
(
dataDirectory
);
Python
::
import
(
"boundaryconditions"
)
.
get
(
"Functions"
)
.
toC
<
typename
FunctionMap
::
Base
>
(
functions
);
...
...
@@ -213,8 +213,7 @@ int main(int argc, char *argv[]) {
auto
const
firstRestart
=
parset
.
get
<
size_t
>
(
"restarts.first"
);
auto
const
restartSpacing
=
parset
.
get
<
size_t
>
(
"restarts.spacing"
);
auto
const
restartTemplate
=
parset
.
get
<
std
::
string
>
(
"restarts.template"
);
auto
const
restartDirectory
=
boost
::
filesystem
::
path
(
restartTemplate
).
parent_path
();
auto
const
restartDirectory
=
fs
::
path
(
restartTemplate
).
parent_path
();
if
(
firstRestart
!=
0
)
DataIO
::
loadData
(
programState
,
...
...
@@ -286,8 +285,8 @@ int main(int argc, char *argv[]) {
specialDisplacementWriter
.
write
(
displacement
);
if
(
programState
.
timeStep
%
restartSpacing
==
0
)
{
if
(
!
boost
::
filesystem
::
is_directory
(
restartDirectory
))
boost
::
filesystem
::
create_directories
(
restartDirectory
);
if
(
!
fs
::
is_directory
(
restartDirectory
))
fs
::
create_directories
(
restartDirectory
);
DataIO
::
writeData
(
programState
,
str
(
boost
::
format
(
restartTemplate
)
%
programState
.
timeStep
));
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment