Skip to content
GitLab
Menu
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
743311df
Commit
743311df
authored
Jul 30, 2019
by
Mark OLESEN
Committed by
Andrew Heather
Jul 30, 2019
Browse files
STYLE: consistent access for particle sizeofFields, particle iterators
parent
3d0ed07f
Changes
9
Hide whitespace changes
Inline
Side-by-side
applications/solvers/multiphase/icoReactingMultiphaseInterFoam/laserDTRM/DTRMParticle/DTRMParticle.H
View file @
743311df
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd
\\ / A nd | Copyright (C) 2017
-2019
OpenCFD Ltd
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -64,9 +64,6 @@ class DTRMParticle
{
// Private data
//- Size in bytes of the fields
static
const
std
::
size_t
sizeofFields_
;
//- Initial position
point
p0_
;
...
...
@@ -144,7 +141,12 @@ public:
inline
scalar
&
Q
(
label
celli
);
};
// Static data members
// Static Data Members
//- Size in bytes of the fields
static
const
std
::
size_t
sizeofFields_
;
//- String representation of properties
AddToPropertyList
...
...
src/functionObjects/field/wallBoundedStreamLine/wallBoundedParticle.H
View file @
743311df
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2017
-2019
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
...
...
@@ -64,12 +64,6 @@ class wallBoundedParticle
:
public
particle
{
// Private data
//- Size in bytes of the fields
static
const
std
::
size_t
sizeofFields_
;
public:
//- Class used to pass tracking data to the trackToFace function
...
...
@@ -151,6 +145,12 @@ protected:
public:
// Static Data Members
//- Size in bytes of the fields
static
const
std
::
size_t
sizeofFields_
;
// Constructors
//- Construct from components
...
...
src/functionObjects/field/wallBoundedStreamLine/wallBoundedParticleTemplates.C
View file @
743311df
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2017
-2019
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2016 OpenFOAM Foundation
...
...
@@ -443,11 +443,12 @@ void Foam::wallBoundedParticle::readFields(TrackCloudType& c)
c
.
checkFieldIOobject
(
c
,
diagEdge
);
label
i
=
0
;
for
AllIters
(
c
,
iter
)
for
(
wallBoundedParticle
&
p
:
c
)
{
iter
().
localPosition_
=
localPosition
[
i
];
iter
().
meshEdgeStart_
=
meshEdgeStart
[
i
];
iter
().
diagEdge_
=
diagEdge
[
i
];
p
.
localPosition_
=
localPosition
[
i
];
p
.
meshEdgeStart_
=
meshEdgeStart
[
i
];
p
.
diagEdge_
=
diagEdge
[
i
];
++
i
;
}
}
...
...
@@ -458,7 +459,7 @@ void Foam::wallBoundedParticle::writeFields(const TrackCloudType& c)
{
particle
::
writeFields
(
c
);
label
np
=
c
.
size
();
label
np
=
c
.
size
();
IOField
<
point
>
localPosition
(
...
...
@@ -477,11 +478,12 @@ void Foam::wallBoundedParticle::writeFields(const TrackCloudType& c)
);
label
i
=
0
;
for
AllConstIters
(
c
,
iter
)
for
(
const
wallBoundedParticle
&
p
:
c
)
{
localPosition
[
i
]
=
iter
().
localPosition_
;
meshEdgeStart
[
i
]
=
iter
().
meshEdgeStart_
;
diagEdge
[
i
]
=
iter
().
diagEdge_
;
localPosition
[
i
]
=
p
.
localPosition_
;
meshEdgeStart
[
i
]
=
p
.
meshEdgeStart_
;
diagEdge
[
i
]
=
p
.
diagEdge_
;
++
i
;
}
...
...
src/lagrangian/basic/Cloud/Cloud.C
View file @
743311df
...
...
@@ -116,10 +116,8 @@ void Foam::Cloud<ParticleType>::deleteParticle(ParticleType& p)
template
<
class
ParticleType
>
void
Foam
::
Cloud
<
ParticleType
>::
deleteLostParticles
()
{
for
AllIters
(
*
this
,
pIter
)
for
(
ParticleType
&
p
:
*
this
)
{
ParticleType
&
p
=
pIter
();
if
(
p
.
cell
()
==
-
1
)
{
WarningInFunction
...
...
@@ -208,10 +206,8 @@ void Foam::Cloud<ParticleType>::move
}
// Loop over all particles
for
AllIters
(
*
this
,
pIter
)
for
(
ParticleType
&
p
:
*
this
)
{
ParticleType
&
p
=
pIter
();
// Move the particle
bool
keepParticle
=
p
.
move
(
cloud
,
td
,
trackTime
);
...
...
@@ -330,10 +326,8 @@ void Foam::Cloud<ParticleType>::move
label
pI
=
0
;
for
AllIters
(
newParticles
,
newpIter
)
for
(
ParticleType
&
newp
:
newParticles
)
{
ParticleType
&
newp
=
newpIter
();
label
patchi
=
procPatches
[
receivePatchIndex
[
pI
++
]];
newp
.
correctAfterParallelTransfer
(
patchi
,
td
);
...
...
src/lagrangian/basic/injectedParticle/injectedParticle.H
View file @
743311df
...
...
@@ -69,12 +69,6 @@ class injectedParticle
:
public
particle
{
public:
//- Size in bytes of the fields
static
const
std
::
size_t
sizeofFields
;
protected:
// Protected data
...
...
@@ -99,7 +93,10 @@ protected:
public:
// Static data members
// Static Data Members
//- Size in bytes of the fields
static
const
std
::
size_t
sizeofFields
;
//- Runtime type information
TypeName
(
"injectedParticle"
);
...
...
src/lagrangian/basic/injectedParticle/injectedParticleIO.C
View file @
743311df
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016-201
8
OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016-201
9
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -36,8 +36,8 @@ Foam::string Foam::injectedParticle::propertyList_ =
const
std
::
size_t
Foam
::
injectedParticle
::
sizeofFields
(
//
Note: d
oes not include position_
sizeof
(
label
)
+
sizeof
(
scalar
)
+
sizeof
(
scalar
)
+
sizeof
(
vector
)
//
D
oes not include position_
sizeof
(
injectedParticle
)
-
offsetof
(
injectedParticle
,
tag_
)
);
...
...
@@ -106,17 +106,14 @@ void Foam::injectedParticle::readFields(Cloud<injectedParticle>& c)
c
.
checkFieldIOobject
(
c
,
U
);
label
i
=
0
;
forAllIters
(
c
,
iter
)
for
(
injectedParticle
&
p
:
c
)
{
injectedParticle
&
p
=
iter
();
p
.
tag_
=
tag
[
i
];
p
.
soi_
=
soi
[
i
];
p
.
d_
=
d
[
i
];
p
.
U_
=
U
[
i
];
i
++
;
++
i
;
}
}
...
...
@@ -143,10 +140,8 @@ void Foam::injectedParticle::writeFields(const Cloud<injectedParticle>& c)
label
i
=
0
;
for
AllConstIters
(
c
,
iter
)
for
(
const
injectedParticle
&
p
:
c
)
{
const
injectedParticle
&
p
=
iter
();
tag
[
i
]
=
p
.
tag
();
soi
[
i
]
=
p
.
soi
();
d
[
i
]
=
p
.
d
();
...
...
@@ -190,10 +185,8 @@ void Foam::injectedParticle::writeObjects
label
i
=
0
;
for
AllConstIters
(
c
,
iter
)
for
(
const
injectedParticle
&
p
:
c
)
{
const
injectedParticle
&
p
=
iter
();
tag
[
i
]
=
p
.
tag
();
soi
[
i
]
=
p
.
soi
();
d
[
i
]
=
p
.
d
();
...
...
src/lagrangian/basic/particle/particleTemplates.C
View file @
743311df
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2016 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2016
-2019
OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation
...
...
@@ -50,6 +50,7 @@ void Foam::particle::readFields(TrackCloudType& c)
IOField
<
label
>
origProcId
(
procIO
,
valid
&&
haveFile
);
c
.
checkFieldIOobject
(
c
,
origProcId
);
IOField
<
label
>
origId
(
c
.
fieldIOobject
(
"origId"
,
IOobject
::
MUST_READ
),
...
...
@@ -58,13 +59,11 @@ void Foam::particle::readFields(TrackCloudType& c)
c
.
checkFieldIOobject
(
c
,
origId
);
label
i
=
0
;
for
AllIters
(
c
,
iter
)
for
(
particle
&
p
:
c
)
{
particle
&
p
=
iter
();
p
.
origProc_
=
origProcId
[
i
];
p
.
origId_
=
origId
[
i
];
i
++
;
++
i
;
}
}
...
...
@@ -103,10 +102,11 @@ void Foam::particle::writeFields(const TrackCloudType& c)
);
label
i
=
0
;
for
AllConstIters
(
c
,
iter
)
for
(
const
particle
&
p
:
c
)
{
origProc
[
i
]
=
iter
().
origProc_
;
origId
[
i
]
=
iter
().
origId_
;
origProc
[
i
]
=
p
.
origProc_
;
origId
[
i
]
=
p
.
origId_
;
++
i
;
}
...
...
@@ -125,11 +125,12 @@ void Foam::particle::writeObjects(const CloudType& c, objectRegistry& obr)
IOField
<
point
>&
position
(
cloud
::
createIOField
<
point
>
(
"position"
,
np
,
obr
));
label
i
=
0
;
for
AllConstIters
(
c
,
iter
)
for
(
const
particle
&
p
:
c
)
{
origProc
[
i
]
=
iter
().
origProc_
;
origId
[
i
]
=
iter
().
origId_
;
position
[
i
]
=
iter
().
position
();
origProc
[
i
]
=
p
.
origProc_
;
origId
[
i
]
=
p
.
origId_
;
position
[
i
]
=
p
.
position
();
++
i
;
}
}
...
...
src/mesh/snappyHexMesh/trackedParticle/trackedParticle.C
View file @
743311df
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd |
Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation
...
...
@@ -28,6 +28,14 @@ License
#include
"trackedParticle.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
const
std
::
size_t
Foam
::
trackedParticle
::
sizeofFields_
(
sizeof
(
trackedParticle
)
-
offsetof
(
trackedParticle
,
start_
)
);
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam
::
trackedParticle
::
trackedParticle
...
...
@@ -101,8 +109,7 @@ Foam::trackedParticle::trackedParticle
is
.
read
(
reinterpret_cast
<
char
*>
(
&
start_
),
sizeof
(
start_
)
+
sizeof
(
end_
)
+
sizeof
(
level_
)
+
sizeof
(
i_
)
+
sizeof
(
j_
)
+
sizeof
(
k_
)
sizeofFields_
);
}
}
...
...
@@ -288,8 +295,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const trackedParticle& p)
os
.
write
(
reinterpret_cast
<
const
char
*>
(
&
p
.
start_
),
sizeof
(
p
.
start_
)
+
sizeof
(
p
.
end_
)
+
sizeof
(
p
.
level_
)
+
sizeof
(
p
.
i_
)
+
sizeof
(
p
.
j_
)
+
sizeof
(
p
.
k_
)
trackedParticle
::
sizeofFields_
);
}
...
...
src/mesh/snappyHexMesh/trackedParticle/trackedParticle.H
View file @
743311df
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd |
\\ / A nd |
Copyright (C) 2019 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
| Copyright (C) 2011-2017 OpenFOAM Foundation
...
...
@@ -117,6 +117,11 @@ public:
};
// Static Data Members
//- Size in bytes of the fields
static
const
std
::
size_t
sizeofFields_
;
// Constructors
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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