Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Nektar
Nektar
Commits
7cf9c651
Commit
7cf9c651
authored
Nov 18, 2016
by
Kilian Lackhove
Browse files
dont overwrite chk files
parent
3104922e
Changes
3
Hide whitespace changes
Inline
Side-by-side
library/SolverUtils/EquationSystem.cpp
View file @
7cf9c651
...
...
@@ -109,6 +109,7 @@ namespace Nektar
string
sessionname
=
"SessionName"
;
sessionname
+=
boost
::
lexical_cast
<
std
::
string
>
(
i
);
m_fieldMetaDataMap
[
sessionname
]
=
filenames
[
i
];
m_fieldMetaDataMap
[
"ChkFileNum"
]
=
boost
::
lexical_cast
<
std
::
string
>
(
0
);
}
}
...
...
@@ -661,7 +662,7 @@ namespace Nektar
m_session
->
LoadParameter
(
"NumQuadPointsError"
,
m_NumQuadPointsError
,
0
);
m_nchk
=
1
;
m_nchk
=
0
;
// Zero all physical fields initially
ZeroPhysFields
();
...
...
@@ -1237,11 +1238,11 @@ namespace Nektar
if
(
dumpInitialConditions
&&
m_checksteps
)
{
Checkpoint_Output
(
0
);
Checkpoint_Output
(
m_nchk
);
m_nchk
++
;
}
}
void
EquationSystem
::
v_EvaluateExactSolution
(
unsigned
int
field
,
Array
<
OneD
,
NekDouble
>
&
outfield
,
...
...
@@ -1986,6 +1987,13 @@ namespace Nektar
{
std
::
string
outname
=
m_sessionName
+
"_"
+
boost
::
lexical_cast
<
std
::
string
>
(
n
);
int
cnt
=
0
;
while
(
std
::
ifstream
(
std
::
string
(
outname
+
".chk"
).
c_str
()))
{
outname
=
m_sessionName
+
"_"
+
boost
::
lexical_cast
<
std
::
string
>
(
n
)
+
"_"
+
boost
::
lexical_cast
<
std
::
string
>
(
cnt
);
}
WriteFld
(
outname
+
".chk"
);
}
...
...
@@ -2000,9 +2008,15 @@ namespace Nektar
std
::
vector
<
Array
<
OneD
,
NekDouble
>
>
&
fieldcoeffs
,
std
::
vector
<
std
::
string
>
&
variables
)
{
char
chkout
[
16
]
=
""
;
sprintf
(
chkout
,
"%d"
,
n
);
std
::
string
outname
=
m_sessionName
+
"_"
+
chkout
+
".chk"
;
std
::
string
outname
=
m_sessionName
+
"_"
+
boost
::
lexical_cast
<
std
::
string
>
(
n
);
int
cnt
=
0
;
while
(
std
::
ifstream
(
std
::
string
(
outname
+
".chk"
).
c_str
()))
{
outname
=
m_sessionName
+
"_"
+
boost
::
lexical_cast
<
std
::
string
>
(
n
)
+
"_"
+
boost
::
lexical_cast
<
std
::
string
>
(
cnt
);
}
WriteFld
(
outname
,
field
,
fieldcoeffs
,
variables
);
}
...
...
@@ -2086,6 +2100,12 @@ namespace Nektar
{
m_fieldMetaDataMap
[
"Time"
]
=
boost
::
lexical_cast
<
std
::
string
>
(
m_time
);
}
// Update step in field info if required
if
(
m_fieldMetaDataMap
.
find
(
"ChkFileNum"
)
!=
m_fieldMetaDataMap
.
end
())
{
m_fieldMetaDataMap
[
"ChkFileNum"
]
=
boost
::
lexical_cast
<
std
::
string
>
(
m_nchk
);
}
// If necessary, add mapping information to metadata
// and output mapping coordinates
...
...
library/SolverUtils/UnsteadySystem.cpp
View file @
7cf9c651
...
...
@@ -376,7 +376,8 @@ namespace Nektar
transformed
[
i
]
=
true
;
}
}
Checkpoint_Output
(
m_nchk
++
);
Checkpoint_Output
(
m_nchk
);
m_nchk
++
;
for
(
i
=
0
;
i
<
nfields
;
i
++
)
{
if
(
transformed
[
i
])
...
...
@@ -391,7 +392,8 @@ namespace Nektar
}
else
{
Checkpoint_Output
(
m_nchk
++
);
Checkpoint_Output
(
m_nchk
);
m_nchk
++
;
}
doCheckTime
=
false
;
}
...
...
@@ -456,7 +458,7 @@ namespace Nektar
*/
void
UnsteadySystem
::
v_DoInitialise
()
{
CheckForRestartTime
(
m_time
);
CheckForRestartTime
(
m_time
,
m_nchk
);
SetBoundaryConditions
(
m_time
);
SetInitialConditions
(
m_time
);
}
...
...
@@ -695,7 +697,7 @@ namespace Nektar
}
}
void
UnsteadySystem
::
CheckForRestartTime
(
NekDouble
&
time
)
void
UnsteadySystem
::
CheckForRestartTime
(
NekDouble
&
time
,
int
&
nchk
)
{
if
(
m_session
->
DefinesFunction
(
"InitialConditions"
))
{
...
...
@@ -738,6 +740,13 @@ namespace Nektar
time
=
boost
::
lexical_cast
<
NekDouble
>
(
iter
->
second
);
}
iter
=
m_fieldMetaDataMap
.
find
(
"ChkFileNum"
);
if
(
iter
!=
m_fieldMetaDataMap
.
end
())
{
nchk
=
boost
::
lexical_cast
<
NekDouble
>
(
iter
->
second
);
}
}
break
;
...
...
library/SolverUtils/UnsteadySystem.h
View file @
7cf9c651
...
...
@@ -142,7 +142,7 @@ namespace Nektar
return
true
;
}
SOLVER_UTILS_EXPORT
void
CheckForRestartTime
(
NekDouble
&
time
);
SOLVER_UTILS_EXPORT
void
CheckForRestartTime
(
NekDouble
&
time
,
int
&
nchk
);
/// \brief Evaluate the SVV diffusion coefficient
/// according to Moura's paper where it should
...
...
Write
Preview
Supports
Markdown
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