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
534920b6
Commit
534920b6
authored
Jan 07, 2019
by
Mark OLESEN
Committed by
Andrew Heather
Jan 07, 2019
Browse files
ENH: for-range, forAllIters() ... in lagrangian/molecularDynamics/
- reduced clutter when iterating over containers
parent
f487333b
Changes
10
Hide whitespace changes
Inline
Side-by-side
src/lagrangian/DSMC/clouds/Templates/DSMCCloud/DSMCCloud.C
View file @
534920b6
...
...
@@ -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
...
...
@@ -50,7 +50,7 @@ void Foam::DSMCCloud<ParcelType>::buildConstProps()
forAll
(
typeIdList_
,
i
)
{
const
word
&
id
(
typeIdList_
[
i
]
)
;
const
word
&
id
=
typeIdList_
[
i
];
Info
<<
" "
<<
id
<<
endl
;
...
...
@@ -64,14 +64,14 @@ void Foam::DSMCCloud<ParcelType>::buildConstProps()
template
<
class
ParcelType
>
void
Foam
::
DSMCCloud
<
ParcelType
>::
buildCellOccupancy
()
{
for
All
(
cellOccupancy_
,
cO
)
for
(
auto
&
list
:
cellOccupancy_
)
{
cellOccupancy_
[
cO
]
.
clear
();
list
.
clear
();
}
for
AllIter
(
typename
DSMCCloud
<
ParcelType
>
,
*
this
,
iter
)
for
(
ParcelType
&
p
:
*
this
)
{
cellOccupancy_
[
iter
()
.
cell
()].
append
(
&
iter
()
);
cellOccupancy_
[
p
.
cell
()].
append
(
&
p
);
}
}
...
...
@@ -400,9 +400,8 @@ void Foam::DSMCCloud<ParcelType>::calculateFields()
scalarField
&
iDof
=
iDof_
.
primitiveFieldRef
();
vectorField
&
momentum
=
momentum_
.
primitiveFieldRef
();
for
AllConstIter
(
typename
DSMCCloud
<
ParcelType
>
,
*
this
,
iter
)
for
(
const
ParcelType
&
p
:
*
this
)
{
const
ParcelType
&
p
=
iter
();
const
label
celli
=
p
.
cell
();
rhoN
[
celli
]
++
;
...
...
@@ -692,7 +691,7 @@ Foam::DSMCCloud<ParcelType>::DSMCCloud
const
fvMesh
&
mesh
,
const
IOdictionary
&
dsmcInitialiseDict
)
:
:
Cloud
<
ParcelType
>
(
mesh
,
cloudName
,
false
),
DSMCBaseCloud
(),
cloudName_
(
cloudName
),
...
...
@@ -1038,13 +1037,11 @@ void Foam::DSMCCloud<ParcelType>::dumpParticlePositions() const
+
this
->
db
().
time
().
timeName
()
+
".obj"
);
for
AllConstIter
(
typename
DSMCCloud
<
ParcelType
>
,
*
this
,
iter
)
for
(
const
ParcelType
&
p
:
*
this
)
{
const
ParcelType
&
p
=
iter
();
pObj
<<
"v "
<<
p
.
position
().
x
()
<<
" "
<<
p
.
position
().
y
()
<<
" "
<<
p
.
position
().
z
()
<<
' '
<<
p
.
position
().
y
()
<<
' '
<<
p
.
position
().
z
()
<<
nl
;
}
...
...
src/lagrangian/DSMC/clouds/Templates/DSMCCloud/DSMCCloudI.H
View file @
534920b6
...
...
@@ -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-2016 OpenFOAM Foundation
...
...
@@ -259,10 +259,8 @@ inline Foam::scalar Foam::DSMCCloud<ParcelType>::massInSystem() const
{
scalar
sysMass
=
0.0
;
for
AllConstIter
(
typename
DSMCCloud
<
ParcelType
>
,
*
this
,
iter
)
for
(
const
ParcelType
&
p
:
*
this
)
{
const
ParcelType
&
p
=
iter
();
const
typename
ParcelType
::
constantProperties
&
cP
=
constProps
(
p
.
typeId
()
...
...
@@ -280,10 +278,8 @@ inline Foam::vector Foam::DSMCCloud<ParcelType>::linearMomentumOfSystem() const
{
vector
linearMomentum
(
Zero
);
for
AllConstIter
(
typename
DSMCCloud
<
ParcelType
>
,
*
this
,
iter
)
for
(
const
ParcelType
&
p
:
*
this
)
{
const
ParcelType
&
p
=
iter
();
const
typename
ParcelType
::
constantProperties
&
cP
=
constProps
(
p
.
typeId
()
...
...
@@ -302,10 +298,8 @@ Foam::DSMCCloud<ParcelType>::linearKineticEnergyOfSystem() const
{
scalar
linearKineticEnergy
=
0.0
;
for
AllConstIter
(
typename
DSMCCloud
<
ParcelType
>
,
*
this
,
iter
)
for
(
const
ParcelType
&
p
:
*
this
)
{
const
ParcelType
&
p
=
iter
();
const
typename
ParcelType
::
constantProperties
&
cP
=
constProps
(
p
.
typeId
()
...
...
@@ -324,10 +318,8 @@ Foam::DSMCCloud<ParcelType>::internalEnergyOfSystem() const
{
scalar
internalEnergy
=
0.0
;
for
AllConstIter
(
typename
DSMCCloud
<
ParcelType
>
,
*
this
,
iter
)
for
(
const
ParcelType
&
p
:
*
this
)
{
const
ParcelType
&
p
=
iter
();
internalEnergy
+=
p
.
Ei
();
}
...
...
src/lagrangian/DSMC/parcels/Templates/DSMCParcel/DSMCParcelIO.C
View file @
534920b6
...
...
@@ -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
...
...
@@ -94,14 +94,12 @@ void Foam::DSMCParcel<ParcelType>::readFields(Cloud<DSMCParcel<ParcelType>>& c)
c
.
checkFieldIOobject
(
c
,
typeId
);
label
i
=
0
;
for
AllIter
(
typename
Cloud
<
DSMCParcel
<
ParcelType
>
>
,
c
,
iter
)
for
(
DSMCParcel
<
ParcelType
>
&
p
:
c
)
{
DSMCParcel
<
ParcelType
>&
p
=
iter
();
p
.
U_
=
U
[
i
];
p
.
Ei_
=
Ei
[
i
];
p
.
typeId_
=
typeId
[
i
];
i
++
;
++
i
;
}
}
...
...
@@ -121,14 +119,12 @@ void Foam::DSMCParcel<ParcelType>::writeFields
IOField
<
label
>
typeId
(
c
.
fieldIOobject
(
"typeId"
,
IOobject
::
NO_READ
),
np
);
label
i
=
0
;
for
AllConstIter
(
typename
Cloud
<
DSMCParcel
<
ParcelType
>
>
,
c
,
iter
)
for
(
const
DSMCParcel
<
ParcelType
>
&
p
:
c
)
{
const
DSMCParcel
<
ParcelType
>&
p
=
iter
();
U
[
i
]
=
p
.
U
();
Ei
[
i
]
=
p
.
Ei
();
typeId
[
i
]
=
p
.
typeId
();
i
++
;
++
i
;
}
U
.
write
(
np
>
0
);
...
...
src/lagrangian/molecularDynamics/molecularMeasurements/distribution/distribution.C
View file @
534920b6
...
...
@@ -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-2016 OpenFOAM Foundation
...
...
@@ -87,9 +87,9 @@ Foam::label Foam::distribution::totalEntries() const
{
label
sumOfEntries
=
0
;
forAllConstIter
(
Map
<
label
>
,
*
this
,
iter
)
forAllConstIter
s
(
*
this
,
iter
)
{
sumOfEntries
+=
iter
();
sumOfEntries
+=
iter
.
val
();
if
(
sumOfEntries
<
0
)
{
...
...
@@ -115,9 +115,9 @@ Foam::scalar Foam::distribution::approxTotalEntries() const
{
scalar
sumOfEntries
=
0
;
forAllConstIter
(
Map
<
label
>
,
*
this
,
iter
)
forAllConstIter
s
(
*
this
,
iter
)
{
sumOfEntries
+=
scalar
(
iter
());
sumOfEntries
+=
scalar
(
iter
.
val
());
}
return
sumOfEntries
;
...
...
src/lagrangian/molecularDynamics/molecularMeasurements/distribution/distribution.H
View file @
534920b6
...
...
@@ -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-2016 OpenFOAM Foundation
...
...
src/lagrangian/molecularDynamics/molecule/mdTools/calculateAutoCorrelationFunctions.H
View file @
534920b6
...
...
@@ -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-2016 OpenFOAM Foundation
...
...
@@ -31,9 +31,11 @@ if (mesh.time().timeIndex() % vacf.sampleSteps() == 0)
label
uV
=
0
;
for
AllConstIter
(
IDLList
<
molecule
>
,
molecules
,
mol
)
for
(
const
molecule
&
mol
:
molecules
)
{
uVals
[
uV
++
]
=
mol
().
U
();
uVals
[
uV
]
=
mol
.
U
();
++
uV
;
}
vacf
.
calculateCorrelationFunction
(
uVals
);
...
...
@@ -43,19 +45,19 @@ if (mesh.time().timeIndex() % pacf.sampleSteps() == 0)
{
vector
p
=
Zero
;
for
AllConstIter
(
IDLList
<
molecule
>
,
molecules
,
mol
)
for
(
const
molecule
&
mol
:
molecules
)
{
p
.
x
()
+=
mol
()
.
mass
()
*
mol
()
.
U
().
y
()
*
mol
()
.
U
().
z
()
+
0
.
5
*
mol
()
.
rf
().
yz
();
mol
.
mass
()
*
mol
.
U
().
y
()
*
mol
.
U
().
z
()
+
0
.
5
*
mol
.
rf
().
yz
();
p
.
y
()
+=
mol
()
.
mass
()
*
mol
()
.
U
().
z
()
*
mol
()
.
U
().
x
()
+
0
.
5
*
mol
()
.
rf
().
zx
();
mol
.
mass
()
*
mol
.
U
().
z
()
*
mol
.
U
().
x
()
+
0
.
5
*
mol
.
rf
().
zx
();
p
.
z
()
+=
mol
()
.
mass
()
*
mol
()
.
U
().
x
()
*
mol
()
.
U
().
y
()
+
0
.
5
*
mol
()
.
rf
().
xy
();
mol
.
mass
()
*
mol
.
U
().
x
()
*
mol
.
U
().
y
()
+
0
.
5
*
mol
.
rf
().
xy
();
}
pacf
.
calculateCorrelationFunction
(
p
);
...
...
@@ -65,14 +67,14 @@ if (mesh.time().timeIndex() % hfacf.sampleSteps() == 0)
{
vector
s
=
Zero
;
for
AllConstIter
(
IDLList
<
molecule
>
,
molecules
,
mol
)
for
(
const
molecule
&
mol
:
molecules
)
{
s
+=
(
0
.
5
*
mol
()
.
mass
()
*
magSqr
(
mol
()
.
U
())
+
mol
()
.
potentialEnergy
()
)
*
mol
()
.
U
()
+
0
.
5
*
(
mol
()
.
rf
()
&
mol
()
.
U
());
0
.
5
*
mol
.
mass
()
*
magSqr
(
mol
.
U
())
+
mol
.
potentialEnergy
()
)
*
mol
.
U
()
+
0
.
5
*
(
mol
.
rf
()
&
mol
.
U
());
}
hfacf
.
calculateCorrelationFunction
(
s
);
...
...
src/lagrangian/molecularDynamics/molecule/mdTools/meanMomentumEnergyAndNMols.H
View file @
534920b6
...
...
@@ -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-2016 OpenFOAM Foundation
...
...
@@ -56,15 +56,15 @@ label singleStepNMols = molecules.size();
label
singleStepDOFs
=
0
;
{
for
AllConstIter
(
IDLList
<
molecule
>
,
molecules
,
mol
)
for
(
const
molecule
&
mol
:
molecules
)
{
const
label
molId
=
mol
()
.
id
();
const
label
molId
=
mol
.
id
();
scalar
molMass
(
molecules
.
constProps
(
molId
).
mass
());
singleStepTotalMass
+=
molMass
;
//singleStepCentreOfMass += mol
()
.position()*molMass;
//singleStepCentreOfMass += mol.position()*molMass;
}
// if (singleStepNMols)
...
...
@@ -72,9 +72,9 @@ label singleStepDOFs = 0;
// singleStepCentreOfMass /= singleStepTotalMass;
// }
for
AllConstIter
(
IDLList
<
molecule
>
,
molecules
,
mol
)
for
(
const
molecule
&
mol
:
molecules
)
{
const
label
molId
=
mol
()
.
id
();
const
label
molId
=
mol
.
id
();
const
molecule
::
constantProperties
cP
(
molecules
.
constProps
(
molId
));
...
...
@@ -82,16 +82,16 @@ label singleStepDOFs = 0;
const
diagTensor
&
molMoI
(
cP
.
momentOfInertia
());
const
vector
&
molV
(
mol
()
.
v
());
const
vector
&
molV
(
mol
.
v
());
const
vector
molOmega
(
inv
(
molMoI
)
&
mol
()
.
pi
());
const
vector
molOmega
(
inv
(
molMoI
)
&
mol
.
pi
());
vector
molPiGlobal
=
mol
()
.
Q
()
&
mol
()
.
pi
();
vector
molPiGlobal
=
mol
.
Q
()
&
mol
.
pi
();
singleStepTotalLinearMomentum
+=
molV
*
molMass
;
singleStepTotalAngularMomentum
+=
molPiGlobal
;
//+((mol
()
.position() - singleStepCentreOfMass) ^ (molV * molMass));
//+((mol.position() - singleStepCentreOfMass) ^ (molV * molMass));
if
(
mag
(
molV
)
>
singleStepMaxVelocityMag
)
{
...
...
@@ -102,9 +102,9 @@ label singleStepDOFs = 0;
singleStepTotalAngularKE
+=
0
.
5
*
(
molOmega
&
molMoI
&
molOmega
);
singleStepTotalPE
+=
mol
()
.
potentialEnergy
();
singleStepTotalPE
+=
mol
.
potentialEnergy
();
singleStepTotalrDotf
+=
tr
(
mol
()
.
rf
());
singleStepTotalrDotf
+=
tr
(
mol
.
rf
());
singleStepDOFs
+=
cP
.
degreesOfFreedom
();
}
...
...
src/lagrangian/molecularDynamics/molecule/molecule/moleculeIO.C
View file @
534920b6
...
...
@@ -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
...
...
@@ -128,10 +128,8 @@ void Foam::molecule::readFields(Cloud<molecule>& mC)
mC
.
checkFieldIOobject
(
mC
,
id
);
label
i
=
0
;
for
AllIter
(
molecule
Cloud
,
mC
,
iter
)
for
(
molecule
&
mol
:
mC
)
{
molecule
&
mol
=
iter
();
mol
.
Q_
=
Q
[
i
];
mol
.
v_
=
v
[
i
];
mol
.
a_
=
a
[
i
];
...
...
@@ -140,7 +138,8 @@ void Foam::molecule::readFields(Cloud<molecule>& mC)
mol
.
specialPosition_
=
specialPosition
[
i
];
mol
.
special_
=
special
[
i
];
mol
.
id_
=
id
[
i
];
i
++
;
++
i
;
}
}
...
...
@@ -197,10 +196,8 @@ void Foam::molecule::writeFields(const Cloud<molecule>& mC)
);
label
i
=
0
;
for
AllConstIter
(
moleculeCloud
,
mC
,
iter
)
for
(
const
molecule
&
mol
:
mC
)
{
const
molecule
&
mol
=
iter
();
Q
[
i
]
=
mol
.
Q_
;
v
[
i
]
=
mol
.
v_
;
a
[
i
]
=
mol
.
a_
;
...
...
@@ -217,7 +214,7 @@ void Foam::molecule::writeFields(const Cloud<molecule>& mC)
orientation2
[
i
]
=
mol
.
Q_
&
vector
(
0
,
1
,
0
);
orientation3
[
i
]
=
mol
.
Q_
&
vector
(
0
,
0
,
1
);
i
++
;
++
i
;
}
const
bool
valid
=
np
>
0
;
...
...
src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C
View file @
534920b6
...
...
@@ -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
...
...
@@ -97,32 +97,32 @@ void Foam::moleculeCloud::buildConstProps()
void
Foam
::
moleculeCloud
::
setSiteSizesAndPositions
()
{
for
AllIter
(
molecule
Cloud
,
*
this
,
mol
)
for
(
molecule
&
mol
:
*
this
)
{
const
molecule
::
constantProperties
&
cP
=
constProps
(
mol
()
.
id
());
const
molecule
::
constantProperties
&
cP
=
constProps
(
mol
.
id
());
mol
()
.
setSiteSizes
(
cP
.
nSites
());
mol
.
setSiteSizes
(
cP
.
nSites
());
mol
()
.
setSitePositions
(
cP
);
mol
.
setSitePositions
(
cP
);
}
}
void
Foam
::
moleculeCloud
::
buildCellOccupancy
()
{
for
All
(
cellOccupancy_
,
cO
)
for
(
auto
&
list
:
cellOccupancy_
)
{
cellOccupancy_
[
cO
]
.
clear
();
list
.
clear
();
}
for
AllIter
(
molecule
Cloud
,
*
this
,
mol
)
for
(
molecule
&
mol
:
*
this
)
{
cellOccupancy_
[
mol
()
.
cell
()].
append
(
&
mol
()
);
cellOccupancy_
[
mol
.
cell
()].
append
(
&
mol
);
}
for
All
(
cellOccupancy_
,
cO
)
for
(
auto
&
list
:
cellOccupancy_
)
{
cellOccupancy_
[
cO
]
.
shrink
();
list
.
shrink
();
}
}
...
...
@@ -191,12 +191,7 @@ void Foam::moleculeCloud::calculatePairForce()
IDLList
<
molecule
>&
refMols
=
referredMols
[
r
];
forAllIter
(
IDLList
<
molecule
>
,
refMols
,
refMol
)
for
(
molecule
&
refMol
:
refMols
)
{
forAll
(
realCells
,
rC
)
{
...
...
@@ -206,7 +201,7 @@ void Foam::moleculeCloud::calculatePairForce()
{
molI
=
celli
[
cellIMols
];
evaluatePair
(
*
molI
,
refMol
()
);
evaluatePair
(
*
molI
,
refMol
);
}
}
}
...
...
@@ -219,24 +214,24 @@ void Foam::moleculeCloud::calculateTetherForce()
{
const
tetherPotentialList
&
tetherPot
(
pot_
.
tetherPotentials
());
for
AllIter
(
molecule
Cloud
,
*
this
,
mol
)
for
(
molecule
&
mol
:
*
this
)
{
if
(
mol
()
.
tethered
())
if
(
mol
.
tethered
())
{
vector
rIT
=
mol
()
.
position
()
-
mol
()
.
specialPosition
();
vector
rIT
=
mol
.
position
()
-
mol
.
specialPosition
();
label
idI
=
mol
()
.
id
();
label
idI
=
mol
.
id
();
scalar
massI
=
constProps
(
idI
).
mass
();
vector
fIT
=
tetherPot
.
force
(
idI
,
rIT
);
mol
()
.
a
()
+=
fIT
/
massI
;
mol
.
a
()
+=
fIT
/
massI
;
mol
()
.
potentialEnergy
()
+=
tetherPot
.
energy
(
idI
,
rIT
);
mol
.
potentialEnergy
()
+=
tetherPot
.
energy
(
idI
,
rIT
);
// What to do here?
// mol
()
.rf() += rIT*fIT;
// mol.rf() += rIT*fIT;
}
}
}
...
...
@@ -244,9 +239,9 @@ void Foam::moleculeCloud::calculateTetherForce()
void
Foam
::
moleculeCloud
::
calculateExternalForce
()
{
for
AllIter
(
molecule
Cloud
,
*
this
,
mol
)
for
(
molecule
&
mol
:
*
this
)
{
mol
()
.
a
()
+=
pot_
.
gravity
();
mol
.
a
()
+=
pot_
.
gravity
();
}
}
...
...
@@ -382,14 +377,9 @@ void Foam::moleculeCloud::removeHighEnergyOverlaps()
{
IDLList
<
molecule
>&
refMols
=
referredMols
[
r
];
forAllIter
(
IDLList
<
molecule
>
,
refMols
,
refMol
)
for
(
molecule
&
refMol
:
refMols
)
{
molJ
=
&
refMol
()
;
molJ
=
&
refMol
;
const
List
<
label
>&
realCells
=
ril
[
r
];
...
...
@@ -489,10 +479,8 @@ void Foam::moleculeCloud::initialiseMolecules
<<
abort
(
FatalError
);
}
for
All
(
cellZones
,
z
)
for
(
const
cellZone
&
zone
:
cellZones
)
{
const
cellZone
&
zone
(
cellZones
[
z
]);
if
(
zone
.
size
())
{
if
(
!
mdInitialiseDict
.
found
(
zone
.
name
()))
...
...
@@ -1041,9 +1029,9 @@ Foam::label Foam::moleculeCloud::nSites() const
{
label
n
=
0
;
for
AllConstIter
(
molecule
Cloud
,
*
this
,
mol
)
for
(
const
molecule
&
mol
:
*
this
)
{
n
+=
constProps
(
mol
()
.
id
()).
nSites
();
n
+=
constProps
(
mol
.
id
()).
nSites
();
}
return
n
;
...
...
@@ -1135,13 +1123,13 @@ void Foam::moleculeCloud::calculateForce()
buildCellOccupancy
();
// Set accumulated quantities to zero
for
AllIter
(
molecule
Cloud
,
*
this
,
mol
)
for
(
molecule
&
mol
:
*
this
)
{
mol
()
.
siteForces
()
=
Zero
;
mol
.
siteForces
()
=
Zero
;
mol
()
.
potentialEnergy
()
=
0
.
0
;
mol
.
potentialEnergy
()
=
0
.
0
;
mol
()
.
rf
()
=
Zero
;
mol
.
rf
()
=
Zero
;
}
calculatePairForce
();
...
...
@@ -1172,11 +1160,11 @@ void Foam::moleculeCloud::applyConstraintsAndThermostats
<<
"----------------------------------------"
<<
endl
;
for
AllIter
(
molecule
Cloud
,
*
this
,
mol
)
for
(
molecule
&
mol
:
*
this
)
{