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
97be0673
Commit
97be0673
authored
Feb 27, 2019
by
Mark OLESEN
Committed by
Andrew Heather
Feb 27, 2019
Browse files
ENH: additional constructors for IjkField
parent
8a459cdb
Changes
3
Hide whitespace changes
Inline
Side-by-side
applications/test/IjkField/Test-IjkField.C
View file @
97be0673
...
...
@@ -36,7 +36,8 @@ template<class T>
Ostream
&
print
(
const
IjkField
<
T
>&
fld
)
{
Info
<<
static_cast
<
const
Field
<
T
>&>
(
fld
).
size
()
<<
" "
<<
fld
.
sizes
()
<<
' '
<<
flatOutput
(
fld
);
<<
" addr:"
<<
long
(
fld
.
cdata
())
<<
' '
<<
fld
.
sizes
()
<<
' '
<<
flatOutput
(
fld
);
return
Info
;
}
...
...
@@ -102,6 +103,11 @@ int main(int argc, char *argv[])
Info
<<
"/= operator: "
;
print
(
field1
)
<<
nl
;
IjkField
<
scalar
>
field3
(
std
::
move
(
field2
));
Info
<<
"Move construct: "
;
print
(
field2
)
<<
nl
;
print
(
field3
)
<<
nl
;
// Field operations are still limited, but we can bypass things too
{
...
...
src/OpenFOAM/meshes/ijkMesh/IjkField.H
View file @
97be0673
...
...
@@ -25,17 +25,11 @@ Class
Foam::IjkField
Description
Generic templated field type.
Generic templated field type
with i-j-k addressing
.
SourceFiles
IjkFieldFunctions.H
IjkFieldFunctionsM.H
IjkFieldMapper.H
IjkFieldI.H
IjkFieldM.H
IjkField.C
IjkFieldFunctions.C
IjkFieldFunctionsM.C
\*---------------------------------------------------------------------------*/
...
...
@@ -64,9 +58,6 @@ class IjkField
//- The i-j-k addressing
ijkAddressing
ijk_
;
//- Copy construct
inline
IjkField
(
const
IjkField
<
Type
>&
fld
);
public:
...
...
@@ -75,6 +66,12 @@ public:
//- Construct zero-sized
inline
IjkField
();
//- Copy construct
inline
IjkField
(
const
IjkField
<
Type
>&
field
);
//- Move construct
inline
IjkField
(
IjkField
<
Type
>&&
field
);
//- Construct with sizing information, leaving values uninitialized
inline
explicit
IjkField
(
const
labelVector
&
ijk
);
...
...
src/OpenFOAM/meshes/ijkMesh/IjkFieldI.H
View file @
97be0673
...
...
@@ -33,6 +33,22 @@ inline Foam::IjkField<Type>::IjkField()
{}
template
<
class
Type
>
inline
Foam
::
IjkField
<
Type
>::
IjkField
(
const
IjkField
<
Type
>&
field
)
:
Field
<
Type
>
(
field
),
ijk_
(
field
.
ijk
())
{}
template
<
class
Type
>
inline
Foam
::
IjkField
<
Type
>::
IjkField
(
IjkField
<
Type
>&&
field
)
:
Field
<
Type
>
(
std
::
move
(
field
)),
ijk_
(
field
.
ijk
())
{}
template
<
class
Type
>
inline
Foam
::
IjkField
<
Type
>::
IjkField
(
const
labelVector
&
ijk
)
:
...
...
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