Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
db8b5e6b
Commit
db8b5e6b
authored
Jun 02, 2010
by
Mark Olesen
Browse files
ENH: retain a list of solverPerformance in data
- reset when the iteration changes
parent
7b941b79
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/meshes/data/data.C
View file @
db8b5e6b
...
...
@@ -45,7 +45,8 @@ Foam::data::data(const objectRegistry& obr)
IOobject
::
NO_READ
,
IOobject
::
NO_WRITE
)
)
),
prevTimeIndex_
(
0
)
{
set
(
"solverPerformance"
,
dictionary
());
}
...
...
@@ -65,7 +66,25 @@ void Foam::data::setSolverPerformance
const
lduMatrix
::
solverPerformance
&
sp
)
const
{
const_cast
<
dictionary
&>
(
solverPerformanceDict
()).
set
(
name
,
sp
);
dictionary
&
dict
=
const_cast
<
dictionary
&>
(
solverPerformanceDict
());
List
<
lduMatrix
::
solverPerformance
>
perfs
;
if
(
prevTimeIndex_
!=
this
->
time
().
timeIndex
())
{
// reset solver performance between iterations
prevTimeIndex_
=
this
->
time
().
timeIndex
();
dict
.
clear
();
}
else
{
dict
.
readIfPresent
(
name
,
perfs
);
}
// append to list
perfs
.
setSize
(
perfs
.
size
()
+
1
,
sp
);
dict
.
set
(
name
,
perfs
);
}
...
...
src/OpenFOAM/meshes/data/data.H
View file @
db8b5e6b
...
...
@@ -47,13 +47,19 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class data Declaration
Class data Declaration
\*---------------------------------------------------------------------------*/
class
data
:
public
IOdictionary
{
// Private data
//- Previously used time-index, used for reset between iterations
mutable
label
prevTimeIndex_
;
// Private Member Functions
//- Disallow default bitwise copy construct
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment