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
12b30732
Commit
12b30732
authored
Feb 12, 2016
by
Henry Weller
Browse files
GeometricField: Added another constructor from tmp<GeometricField>
which supports re-using the internalField storage
parent
6fde55cb
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.C
View file @
12b30732
...
...
@@ -422,7 +422,7 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
if
(
debug
)
{
InfoInFunction
<<
"Constructing
as copy
"
<<
endl
<<
this
->
info
()
<<
endl
;
<<
"Constructing
from tmp
"
<<
endl
<<
this
->
info
()
<<
endl
;
}
this
->
writeOpt
()
=
IOobject
::
NO_WRITE
;
...
...
@@ -634,6 +634,47 @@ Foam::GeometricField<Type, PatchField, GeoMesh>::GeometricField
}
#ifndef NoConstructFromTmp
template
<
class
Type
,
template
<
class
>
class
PatchField
,
class
GeoMesh
>
Foam
::
GeometricField
<
Type
,
PatchField
,
GeoMesh
>::
GeometricField
(
const
IOobject
&
io
,
const
tmp
<
GeometricField
<
Type
,
PatchField
,
GeoMesh
>>&
tgf
,
const
wordList
&
patchFieldTypes
,
const
wordList
&
actualPatchTypes
)
:
DimensionedField
<
Type
,
GeoMesh
>
(
io
,
const_cast
<
GeometricField
<
Type
,
PatchField
,
GeoMesh
>&>
(
tgf
()),
tgf
.
isTmp
()
),
timeIndex_
(
tgf
().
timeIndex
()),
field0Ptr_
(
NULL
),
fieldPrevIterPtr_
(
NULL
),
boundaryField_
(
this
->
mesh
().
boundary
(),
*
this
,
patchFieldTypes
,
actualPatchTypes
)
{
if
(
debug
)
{
InfoInFunction
<<
"Constructing from tmp resetting IO params and patch types"
<<
endl
<<
this
->
info
()
<<
endl
;
}
boundaryField_
==
tgf
().
boundaryField_
;
tgf
.
clear
();
}
#endif
// * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * * * //
template
<
class
Type
,
template
<
class
>
class
PatchField
,
class
GeoMesh
>
...
...
src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricField.H
View file @
12b30732
...
...
@@ -411,6 +411,17 @@ public:
const
wordList
&
actualPatchTypes
=
wordList
()
);
//- Construct as copy resetting IO parameters and boundary types
#ifndef NoConstructFromTmp
GeometricField
(
const
IOobject
&
,
const
tmp
<
GeometricField
<
Type
,
PatchField
,
GeoMesh
>>&
,
const
wordList
&
patchFieldTypes
,
const
wordList
&
actualPatchTypes
=
wordList
()
);
#endif
//- Destructor
virtual
~
GeometricField
();
...
...
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