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
339844e1
Commit
339844e1
authored
12 years ago
by
mattijs
Browse files
Options
Downloads
Patches
Plain Diff
BUG: DimensionSets: stored reference instead of dictionary
parent
57a0dd6f
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/OpenFOAM/dimensionSet/dimensionSets.C
+22
-9
22 additions, 9 deletions
src/OpenFOAM/dimensionSet/dimensionSets.C
src/OpenFOAM/global/debug/debug.C
+12
-21
12 additions, 21 deletions
src/OpenFOAM/global/debug/debug.C
with
34 additions
and
30 deletions
src/OpenFOAM/dimensionSet/dimensionSets.C
+
22
−
9
View file @
339844e1
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-201
2
OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-201
3
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -35,16 +35,30 @@ namespace Foam
/* * * * * * * * * * * * * * * Static Member Data * * * * * * * * * * * * * */
dictionary
*
dimensionSystemsPtr_
(
NULL
);
//- Since dimensionSystems() can be reread we actually store a copy of
// the controlDict subDict (v.s. a reference to the subDict for e.g.
// dimensionedConstants)
autoPtr
<
dictionary
>
dimensionSystemsPtr_
(
NULL
);
dictionary
&
dimensionSystems
()
{
return
debug
::
switchSet
if
(
!
dimensionSystemsPtr_
.
valid
())
{
dictionary
*
cachedPtr
=
NULL
;
dimensionSystemsPtr_
.
reset
(
new
dictionary
(
debug
::
switchSet
(
"DimensionSets"
,
dimensionSystemsPtr_
cachedPtr
)
)
);
}
return
dimensionSystemsPtr_
();
}
autoPtr
<
HashTable
<
dimensionedScalar
>
>
unitSetPtr_
;
...
...
@@ -63,10 +77,9 @@ public:
{}
virtual
void
readData
(
Foam
::
Istream
&
is
)
{
deleteDemandDrivenData
(
dimensionSystemsPtr_
);
unitSetPtr_
.
clear
();
writeUnitSetPtr_
.
clear
();
dimensionSystemsPtr_
=
new
dictionary
(
is
);
dimensionSystemsPtr_
.
reset
(
new
dictionary
(
is
)
)
;
}
virtual
void
writeData
(
Foam
::
Ostream
&
os
)
const
{
...
...
This diff is collapsed.
Click to expand it.
src/OpenFOAM/global/debug/debug.C
+
12
−
21
View file @
339844e1
...
...
@@ -47,47 +47,38 @@ dictionary* debugSwitchesPtr_(NULL);
dictionary
*
infoSwitchesPtr_
(
NULL
);
dictionary
*
optimisationSwitchesPtr_
(
NULL
);
// to ensure controlDictPtr_ is deleted at the end of the run
class
deleteControlDictPtr
{
public:
deleteControlDictPtr
()
{}
~
deleteControlDictPtr
()
{
deleteDemandDrivenData
(
controlDictPtr_
);
}
};
deleteControlDictPtr
deleteControlDictPtr_
;
// Debug switch read and write callback tables.
simpleObjectRegistry
*
debugObjectsPtr_
(
NULL
);
simpleObjectRegistry
*
infoObjectsPtr_
(
NULL
);
simpleObjectRegistry
*
optimisationObjectsPtr_
(
NULL
);
simpleObjectRegistry
*
dimensionSetObjectsPtr_
(
NULL
);
simpleObjectRegistry
*
dimensionedConstantObjectsPtr_
(
NULL
);
class
deleteDebugSwitchPtr
// to ensure controlDictPtr_ is deleted at the end of the run
class
deleteControlDictPtr
{
public:
delete
DebugSwitch
Ptr
()
delete
ControlDict
Ptr
()
{}
~
delete
DebugSwitch
Ptr
()
~
delete
ControlDict
Ptr
()
{
deleteDemandDrivenData
(
debugObjectsPtr_
);
deleteDemandDrivenData
(
infoObjectsPtr_
);
deleteDemandDrivenData
(
optimisationObjectsPtr_
);
deleteDemandDrivenData
(
dimensionSetObjectsPtr_
);
deleteDemandDrivenData
(
dimensionedConstantObjectsPtr_
);
debugSwitchesPtr_
=
NULL
;
infoSwitchesPtr_
=
NULL
;
optimisationSwitchesPtr_
=
NULL
;
deleteDemandDrivenData
(
controlDictPtr_
);
}
};
delete
DebugSwitchPtr
deleteDebugSwitch
Ptr_
;
delete
ControlDictPtr
deleteControlDict
Ptr_
;
//! \endcond
...
...
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