Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-gfe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Sander, Oliver
dune-gfe
Commits
98408c42
Commit
98408c42
authored
14 years ago
by
Oliver Sander
Committed by
sander@FU-BERLIN.DE
14 years ago
Browse files
Options
Downloads
Patches
Plain Diff
use system method mkdtemp to create a temporary directory without name clashes
[[Imported from SVN: r6909]]
parent
e77275da
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
dirneucoupling.cc
+19
-5
19 additions, 5 deletions
dirneucoupling.cc
with
19 additions
and
5 deletions
dirneucoupling.cc
+
19
−
5
View file @
98408c42
...
...
@@ -381,6 +381,19 @@ int main (int argc, char *argv[]) try
std
::
map
<
std
::
pair
<
std
::
string
,
std
::
string
>
,
RigidBodyMotion
<
3
>
>
lambda
;
lambda
[
interfaceName
]
=
referenceInterface
;
///////////////////////////////////////////////////////////////////////////7
// make temporary directory for the intermediate iterates
///////////////////////////////////////////////////////////////////////////7
char
tmpPathBuffer
[
1000
];
sprintf
(
tmpPathBuffer
,
"tmp.XXXXXX"
);
char
*
tmpPathChar
=
mkdtemp
(
tmpPathBuffer
);
assert
(
tmpPathChar
);
std
::
string
tmpPath
(
tmpPathChar
);
//resultPath + "tmp/";
tmpPath
+=
"/"
;
std
::
cout
<<
"tmp directory is: "
<<
tmpPath
<<
std
::
endl
;
//
double
normOfOldCorrection
=
1
;
int
dnStepsActuallyTaken
=
0
;
...
...
@@ -507,14 +520,15 @@ int main (int argc, char *argv[]) try
// First the 3d body
std
::
stringstream
iAsAscii
;
iAsAscii
<<
i
;
std
::
string
iSolFilename
=
resultPath
+
"tmp/intermediate3dSolution_"
+
iAsAscii
.
str
();
std
::
string
iSolFilename
=
tmpPath
+
"intermediate3dSolution_"
+
iAsAscii
.
str
();
LeafAmiraMeshWriter
<
GridType
>
amiraMeshWriter
;
amiraMeshWriter
.
addVertexData
(
x3d
,
complex
.
continua_
[
"continuum"
].
grid_
->
leafView
());
amiraMeshWriter
.
write
(
iSolFilename
);
// Then the rod
iSolFilename
=
result
Path
+
"
tmp/
intermediateRodSolution_"
+
iAsAscii
.
str
();
iSolFilename
=
tmp
Path
+
"intermediateRodSolution_"
+
iAsAscii
.
str
();
RodWriter
::
writeBinary
(
rodX
,
iSolFilename
);
...
...
@@ -601,12 +615,12 @@ int main (int argc, char *argv[]) try
// Read 3d solution from file
std
::
stringstream
iAsAscii
;
iAsAscii
<<
i
;
std
::
string
iSolFilename
=
result
Path
+
"
tmp/
intermediate3dSolution_"
+
iAsAscii
.
str
();
std
::
string
iSolFilename
=
tmp
Path
+
"intermediate3dSolution_"
+
iAsAscii
.
str
();
AmiraMeshReader
<
int
>::
readFunction
(
intermediateSol3d
,
iSolFilename
);
// Read rod solution from file
iSolFilename
=
result
Path
+
"
tmp/
intermediateRodSolution_"
+
iAsAscii
.
str
();
iSolFilename
=
tmp
Path
+
"intermediateRodSolution_"
+
iAsAscii
.
str
();
FILE
*
fpInt
=
fopen
(
iSolFilename
.
c_str
(),
"rb"
);
if
(
!
fpInt
)
...
...
@@ -685,7 +699,7 @@ int main (int argc, char *argv[]) try
// //////////////////////////////
// Delete temporary memory
// //////////////////////////////
std
::
string
removeTmpCommand
=
"rm -rf "
+
resultPath
+
"tmp/intermediate*"
;
std
::
string
removeTmpCommand
=
"rm -rf "
+
tmpPath
;
system
(
removeTmpCommand
.
c_str
());
// //////////////////////////////
...
...
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