Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
openfoam
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor 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
Development
openfoam
Commits
75bfb292
Commit
75bfb292
authored
15 years ago
by
henry
Browse files
Options
Downloads
Patches
Plain Diff
Added a switch to control the caching system.
parent
e684a875
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/OpenFOAM/matrices/solution/solution.C
+13
-4
13 additions, 4 deletions
src/OpenFOAM/matrices/solution/solution.C
src/OpenFOAM/matrices/solution/solution.H
+4
-0
4 additions, 0 deletions
src/OpenFOAM/matrices/solution/solution.H
with
17 additions
and
4 deletions
src/OpenFOAM/matrices/solution/solution.C
+
13
−
4
View file @
75bfb292
...
@@ -60,6 +60,7 @@ Foam::solution::solution(const objectRegistry& obr, const fileName& dictName)
...
@@ -60,6 +60,7 @@ Foam::solution::solution(const objectRegistry& obr, const fileName& dictName)
)
)
),
),
cache_
(
ITstream
(
"cache"
,
tokenList
())()),
cache_
(
ITstream
(
"cache"
,
tokenList
())()),
caching_
(
false
),
relaxationFactors_
(
ITstream
(
"relaxationFactors"
,
tokenList
())()),
relaxationFactors_
(
ITstream
(
"relaxationFactors"
,
tokenList
())()),
defaultRelaxationFactor_
(
0
),
defaultRelaxationFactor_
(
0
),
solvers_
(
ITstream
(
"solvers"
,
tokenList
())())
solvers_
(
ITstream
(
"solvers"
,
tokenList
())())
...
@@ -150,12 +151,19 @@ Foam::label Foam::solution::upgradeSolverDict
...
@@ -150,12 +151,19 @@ Foam::label Foam::solution::upgradeSolverDict
bool
Foam
::
solution
::
cache
(
const
word
&
name
)
const
bool
Foam
::
solution
::
cache
(
const
word
&
name
)
const
{
{
if
(
debug
)
if
(
caching_
)
{
{
Info
<<
"Cache: find entry for "
<<
name
<<
endl
;
if
(
debug
)
}
{
Info
<<
"Cache: find entry for "
<<
name
<<
endl
;
}
return
cache_
.
found
(
name
);
return
cache_
.
found
(
name
);
}
else
{
return
false
;
}
}
}
...
@@ -248,6 +256,7 @@ bool Foam::solution::read()
...
@@ -248,6 +256,7 @@ bool Foam::solution::read()
if
(
dict
.
found
(
"cache"
))
if
(
dict
.
found
(
"cache"
))
{
{
cache_
=
dict
.
subDict
(
"cache"
);
cache_
=
dict
.
subDict
(
"cache"
);
caching_
=
cache_
.
lookupOrDefault
<
Switch
>
(
"active"
,
true
);
}
}
if
(
dict
.
found
(
"relaxationFactors"
))
if
(
dict
.
found
(
"relaxationFactors"
))
...
...
This diff is collapsed.
Click to expand it.
src/OpenFOAM/matrices/solution/solution.H
+
4
−
0
View file @
75bfb292
...
@@ -37,6 +37,7 @@ SourceFiles
...
@@ -37,6 +37,7 @@ SourceFiles
#define solution_H
#define solution_H
#include
"IOdictionary.H"
#include
"IOdictionary.H"
#include
"Switch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
...
@@ -56,6 +57,9 @@ class solution
...
@@ -56,6 +57,9 @@ class solution
//- Dictionary of temporary fields to cache
//- Dictionary of temporary fields to cache
dictionary
cache_
;
dictionary
cache_
;
//- Switch for the caching mechanism
Switch
caching_
;
//- Dictionary of relaxation factors for all the fields
//- Dictionary of relaxation factors for all the fields
dictionary
relaxationFactors_
;
dictionary
relaxationFactors_
;
...
...
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