Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Nektar
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
Jennifer Ryan
Nektar
Commits
da4e8601
Commit
da4e8601
authored
9 years ago
by
Chris Cantwell
Browse files
Options
Downloads
Patches
Plain Diff
Fixed DriverSteadyState for change in formatting of .evl files.
parent
da1e99d3
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
library/SolverUtils/DriverSteadyState.cpp
+25
-25
25 additions, 25 deletions
library/SolverUtils/DriverSteadyState.cpp
with
25 additions
and
25 deletions
library/SolverUtils/DriverSteadyState.cpp
+
25
−
25
View file @
da4e8601
...
...
@@ -163,7 +163,7 @@ void DriverSteadyState::v_Execute(ostream &out)
for
(
int
i
=
0
;
i
<
NumVar_SFD
;
++
i
)
{
q0
[
i
]
=
Array
<
OneD
,
NekDouble
>
(
m_equ
[
m_nequ
-
1
]
->
GetTotPoints
(),
q0
[
i
]
=
Array
<
OneD
,
NekDouble
>
(
m_equ
[
m_nequ
-
1
]
->
GetTotPoints
(),
0.0
);
//q0 is initialised
qBar0
[
i
]
=
Array
<
OneD
,
NekDouble
>
(
m_equ
[
m_nequ
-
1
]
->
GetTotPoints
(),
0.0
);
...
...
@@ -248,13 +248,13 @@ void DriverSteadyState::v_Execute(ostream &out)
FlowPartiallyConverged
=
true
;
}
else
if
(
m_NonConvergingStepsCounter
*
m_dt
*
m_infosteps
else
if
(
m_NonConvergingStepsCounter
*
m_dt
*
m_infosteps
>=
AdaptiveTime
)
{
if
(
m_comm
->
GetRank
()
==
0
)
{
cout
<<
"
\n\t
We compute stability analysis using"
<<
" the current flow field as base flow:
\n
"
<<
" the current flow field as base flow:
\n
"
<<
endl
;
}
...
...
@@ -296,7 +296,7 @@ void DriverSteadyState::v_Execute(ostream &out)
}
m_file
.
close
();
///We save the final solution into a .fld file
m_equ
[
m_nequ
-
1
]
->
Output
();
...
...
@@ -512,28 +512,25 @@ void DriverSteadyState::ReadEVfile(
{
// This routine reads the .evl file written by the Arnoldi algorithm
// (written in September 2014)
std
::
string
EVfileName
=
m_session
->
GetSessionName
()
+
".evl"
;
std
::
string
line
;
int
NumLinesInFile
=
0
;
std
::
string
EVfileName
=
m_session
->
GetSessionName
()
+
".evl"
;
std
::
ifstream
EVfile
(
EVfileName
.
c_str
());
int
NumLinesInFile
(
0
);
NekDouble
NonReleventNumber
(
0.0
);
ASSERTL0
(
EVfile
.
good
(),
"Cannot open .evl file."
);
if
(
EVfile
)
{
std
::
string
line
;
// This block counts the total number of lines of the .evl file
// We keep going util we reach the end of the file
while
(
getline
(
EVfile
,
line
))
{
NumLinesInFile
+=
1
;
++
NumLinesInFile
;
}
EVfile
.
close
();
// It may happen that the Stability method that have produced the .elv
// file converges in less than m_kdim iterations. In this case,
// KrylovSubspaceDim has to be changed here
if
(
NumLinesInFile
<
KrylovSubspaceDim
*
2.0
if
(
NumLinesInFile
<
KrylovSubspaceDim
*
2.0
+
KrylovSubspaceDim
*
(
KrylovSubspaceDim
+
1.0
)
/
2.0
)
{
for
(
int
i
=
1
;
i
<=
KrylovSubspaceDim
;
++
i
)
...
...
@@ -546,28 +543,31 @@ void DriverSteadyState::ReadEVfile(
}
// go back to the beginning of the file
std
::
ifstream
EVfile
(
EVfileName
.
c_str
());
EVfile
.
clear
();
EVfile
.
seekg
(
0
,
ios
::
beg
);
// We now want to go to the line where the most unstable eigenlavue was
// written
for
(
int
i
=
0
;
i
<
(
NumLinesInFile
-
KrylovSubspaceDim
);
++
i
)
{
std
::
getline
(
EVfile
,
line
);
cout
<<
"Discard line: "
<<
line
<<
endl
;
}
// Then we read this line by skipping the first three values written
EVfile
>>
NonReleventNumber
;
EVfile
>>
NonReleventNumber
;
EVfile
>>
NonReleventNumber
;
std
::
vector
<
std
::
string
>
tokens
;
std
::
getline
(
EVfile
,
line
)
;
boost
::
algorithm
::
split
(
tokens
,
line
,
boost
::
is_any_of
(
"
\t
"
),
boost
::
token_compress_on
)
;
// The growth rate and the frequency of the EV are at the 4th and 5th
// colums of the .evl file
EVfile
>>
growthEV
;
EVfile
>>
frequencyEV
;
ASSERTL0
(
tokens
.
size
()
>=
5
,
"Unexpected formatting of .evl file while reading line:
\n
"
+
line
);
growthEV
=
boost
::
lexical_cast
<
NekDouble
>
(
tokens
[
4
]);
frequencyEV
=
boost
::
lexical_cast
<
NekDouble
>
(
tokens
[
5
]);
}
else
{
cout
<<
"An error occured when open
n
ing the .evl file"
<<
endl
;
cout
<<
"An error occur
r
ed when opening the .evl file"
<<
endl
;
}
EVfile
.
close
();
}
...
...
@@ -643,9 +643,9 @@ void DriverSteadyState::PrintSummarySFD()
if
(
m_EvolutionOperator
==
eAdaptiveSFD
)
{
cout
<<
"
\n
We use the adaptive SFD method:"
<<
endl
;
cout
<<
" The parameters are updated every "
<<
AdaptiveTime
cout
<<
" The parameters are updated every "
<<
AdaptiveTime
<<
" time units;"
<<
endl
;
cout
<<
" until |q-qBar|inf becomes smaller than "
<<
AdaptiveTOL
cout
<<
" until |q-qBar|inf becomes smaller than "
<<
AdaptiveTOL
<<
endl
;
}
cout
<<
"====================================="
...
...
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