mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Tidying up InteractionLists - needed to use pointField for the points,
so move everything to a vectorField or a pointField. Changed accessor for a ReferredCells points to points(). Renamed PairFunction to PairModel, so will fit in with WallModel, rather than WallFunction, a confusion waiting to happen.
This commit is contained in:
@ -444,7 +444,7 @@ Foam::DirectInteractionList<ParticleType>::~DirectInteractionList()
|
||||
template<class ParticleType>
|
||||
void Foam::DirectInteractionList<ParticleType>::buildInverseAddressing()
|
||||
{
|
||||
const ReferredCellList<ParticleType>& ril(il_.ril());
|
||||
const ReferredCellList<ParticleType>& ril = il_.ril();
|
||||
|
||||
// Temporary Dynamic lists for accumulation
|
||||
List<DynamicList<label> > referredCellsForInteraction
|
||||
@ -484,7 +484,7 @@ template<class ParticleType>
|
||||
void Foam::DirectInteractionList<ParticleType>::
|
||||
writeReferredCellsForInteraction() const
|
||||
{
|
||||
const ReferredCellList<ParticleType>& ril(il_.ril());
|
||||
const ReferredCellList<ParticleType>& ril = il_.ril();
|
||||
|
||||
forAll(*this, cellI)
|
||||
{
|
||||
@ -510,14 +510,14 @@ writeReferredCellsForInteraction() const
|
||||
const ReferredCell<ParticleType>& refCell =
|
||||
ril[refCells[refCellForInteractionI]];
|
||||
|
||||
const vectorList& refCellPts = refCell.vertexPositions();
|
||||
const pointField& refCellPts = refCell.points();
|
||||
|
||||
const faceList& refCellFaces = refCell.faces();
|
||||
|
||||
forAll(refCellPts, ptI)
|
||||
{
|
||||
referredCellsFile
|
||||
<< "v "
|
||||
<< "v "
|
||||
<< refCellPts[ptI].x() << " "
|
||||
<< refCellPts[ptI].y() << " "
|
||||
<< refCellPts[ptI].z()
|
||||
@ -526,16 +526,15 @@ writeReferredCellsForInteraction() const
|
||||
|
||||
forAll(refCellFaces, faceI)
|
||||
{
|
||||
referredCellsFile<< "f";
|
||||
referredCellsFile << "f";
|
||||
|
||||
forAll(refCellFaces[faceI], fPtI)
|
||||
{
|
||||
referredCellsFile
|
||||
<< " "
|
||||
<< refCellFaces[faceI][fPtI] + vertexOffset;
|
||||
<< " " << refCellFaces[faceI][fPtI] + vertexOffset;
|
||||
}
|
||||
|
||||
referredCellsFile<< nl;
|
||||
referredCellsFile << nl;
|
||||
}
|
||||
|
||||
vertexOffset += refCellPts.size();
|
||||
|
||||
@ -124,7 +124,7 @@ bool Foam::InteractionLists<ParticleType>::testPointFaceDistance
|
||||
(
|
||||
pointPosition,
|
||||
refCell.faces()[rCF],
|
||||
refCell.vertexPositions(),
|
||||
refCell.points(),
|
||||
refCell.faceCentres()[rCF],
|
||||
refCell.faceAreas()[rCF]
|
||||
)
|
||||
@ -141,7 +141,7 @@ bool Foam::InteractionLists<ParticleType>::testPointFaceDistance
|
||||
template<class ParticleType>
|
||||
bool Foam::InteractionLists<ParticleType>::testPointFaceDistance
|
||||
(
|
||||
const vectorList& pointsToTest,
|
||||
const pointField& pointsToTest,
|
||||
const label faceNo
|
||||
) const
|
||||
{
|
||||
@ -176,7 +176,7 @@ bool Foam::InteractionLists<ParticleType>::testPointFaceDistance
|
||||
|
||||
const vector& faceA(mesh_.faceAreas()[faceNo]);
|
||||
|
||||
const vectorList& points(mesh_.points());
|
||||
const pointField& points(mesh_.points());
|
||||
|
||||
return testPointFaceDistance
|
||||
(
|
||||
@ -194,7 +194,7 @@ bool Foam::InteractionLists<ParticleType>::testPointFaceDistance
|
||||
(
|
||||
const vector& p,
|
||||
const labelList& faceToTest,
|
||||
const vectorList& points,
|
||||
const pointField& points,
|
||||
const vector& faceC,
|
||||
const vector& faceA
|
||||
) const
|
||||
@ -462,8 +462,8 @@ Foam::InteractionLists<ParticleType>::ReferredCellsInRangeOfSegment
|
||||
|
||||
forAll(referredInteractionList, rIL)
|
||||
{
|
||||
const vectorList& refCellPoints
|
||||
= referredInteractionList[rIL].vertexPositions();
|
||||
const pointField& refCellPoints
|
||||
= referredInteractionList[rIL].points();
|
||||
|
||||
if (testPointFaceDistance(refCellPoints, f))
|
||||
{
|
||||
@ -500,8 +500,8 @@ Foam::InteractionLists<ParticleType>::ReferredCellsInRangeOfSegment
|
||||
|
||||
forAll(referredInteractionList, rIL)
|
||||
{
|
||||
const vectorList& refCellPoints
|
||||
= referredInteractionList[rIL].vertexPositions();
|
||||
const pointField& refCellPoints
|
||||
= referredInteractionList[rIL].points();
|
||||
|
||||
const edgeList& refCellEdges
|
||||
= referredInteractionList[rIL].edges();
|
||||
|
||||
@ -123,7 +123,7 @@ public:
|
||||
|
||||
bool testPointFaceDistance
|
||||
(
|
||||
const vectorList& pointsToTest,
|
||||
const pointField& pointsToTest,
|
||||
const label faceNo
|
||||
) const;
|
||||
|
||||
@ -137,7 +137,7 @@ public:
|
||||
(
|
||||
const vector& p,
|
||||
const labelList& faceToTest,
|
||||
const vectorList& points,
|
||||
const pointField& points,
|
||||
const vector& faceC,
|
||||
const vector& faceA
|
||||
) const;
|
||||
|
||||
@ -40,7 +40,7 @@ void Foam::ReferredCell<ParticleType>::setConstructionData
|
||||
|
||||
const labelList& points = mesh.cellPoints()[sourceCell];
|
||||
|
||||
vectorList sourceCellVertices(points.size());
|
||||
pointField sourceCellVertices(points.size());
|
||||
|
||||
forAll(sourceCellVertices, sCV)
|
||||
{
|
||||
@ -68,9 +68,9 @@ void Foam::ReferredCell<ParticleType>::setConstructionData
|
||||
|
||||
labelList faces(mesh.cells()[sourceCell]);
|
||||
|
||||
vectorList sourceCellFaceCentres(faces.size());
|
||||
pointField sourceCellFaceCentres(faces.size());
|
||||
|
||||
vectorList sourceCellFaceAreas(faces.size());
|
||||
vectorField sourceCellFaceAreas(faces.size());
|
||||
|
||||
labelListList sourceCellFaces(faces.size());
|
||||
|
||||
@ -189,10 +189,10 @@ Foam::vector Foam::ReferredCell<ParticleType>::referPosition
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::vectorList
|
||||
Foam::pointField
|
||||
Foam::ReferredCell<ParticleType>::referPositions
|
||||
(
|
||||
const vectorList& positionsToRefer
|
||||
const pointField& positionsToRefer
|
||||
)
|
||||
{
|
||||
return offset_ + (rotation_ & positionsToRefer);
|
||||
@ -208,10 +208,10 @@ Foam::ReferredCell<ParticleType>::rotateVector(const vector& vectorToRotate)
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::vectorList
|
||||
Foam::vectorField
|
||||
Foam::ReferredCell<ParticleType>::rotateVectors
|
||||
(
|
||||
const vectorList& vectorsToRotate
|
||||
const vectorField& vectorsToRotate
|
||||
)
|
||||
{
|
||||
return rotation_ & vectorsToRotate;
|
||||
@ -270,12 +270,12 @@ Foam::ReferredCell<ParticleType>::ReferredCell
|
||||
(
|
||||
const label sourceProc,
|
||||
const label sourceCell,
|
||||
const vectorList& vertexPositions,
|
||||
const pointField& vertexPositions,
|
||||
const edgeList& localEdges,
|
||||
const faceList& localFaces,
|
||||
const labelList& wallFaces,
|
||||
const vectorList& faceCentres,
|
||||
const vectorList& faceAreas,
|
||||
const pointField& faceCentres,
|
||||
const vectorField& faceAreas,
|
||||
const vector& offset,
|
||||
const tensor& rotation
|
||||
)
|
||||
@ -396,9 +396,9 @@ Foam::vector Foam::ReferredCell<ParticleType>::referPosition
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::vectorList Foam::ReferredCell<ParticleType>::referPosition
|
||||
Foam::pointField Foam::ReferredCell<ParticleType>::referPosition
|
||||
(
|
||||
const vectorList& positionsToRefer
|
||||
const pointField& positionsToRefer
|
||||
) const
|
||||
{
|
||||
return offset_ + (rotation_ & positionsToRefer);
|
||||
@ -416,9 +416,9 @@ Foam::vector Foam::ReferredCell<ParticleType>::rotateVector
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
Foam::vectorList Foam::ReferredCell<ParticleType>::rotateVectors
|
||||
Foam::vectorField Foam::ReferredCell<ParticleType>::rotateVectors
|
||||
(
|
||||
const vectorList& vectorsToRotate
|
||||
const vectorField& vectorsToRotate
|
||||
) const
|
||||
{
|
||||
return rotation_ & vectorsToRotate;
|
||||
@ -535,7 +535,7 @@ Foam::Ostream& Foam::operator<<
|
||||
|
||||
os << rC.sourceProc()
|
||||
<< token::SPACE << rC.sourceCell()
|
||||
<< token::SPACE << rC.vertexPositions()
|
||||
<< token::SPACE << rC.points()
|
||||
<< token::SPACE << rC.edges()
|
||||
<< token::SPACE << rC.faces()
|
||||
<< token::SPACE << rC.wallFaces()
|
||||
|
||||
@ -37,7 +37,6 @@ SourceFiles
|
||||
#define ReferredCell_H
|
||||
|
||||
#include "vector.H"
|
||||
#include "vectorList.H"
|
||||
#include "tensor.H"
|
||||
#include "transform.H"
|
||||
#include "IDLList.H"
|
||||
@ -104,7 +103,7 @@ class ReferredCell
|
||||
label sourceCell_;
|
||||
|
||||
//- Referred cell vertex positions
|
||||
vectorList vertexPositions_;
|
||||
pointField vertexPositions_;
|
||||
|
||||
//- The edge structure of this referred cell, indices of the
|
||||
// vertexPositions_ list
|
||||
@ -118,10 +117,10 @@ class ReferredCell
|
||||
labelList wallFaces_;
|
||||
|
||||
//- The face centre data for the cell in the referred position
|
||||
vectorList faceCentres_;
|
||||
pointField faceCentres_;
|
||||
|
||||
//- The face area data for the cell in the referred position
|
||||
vectorList faceAreas_;
|
||||
vectorField faceAreas_;
|
||||
|
||||
//- Which cells on the processor hosting this referred cell
|
||||
// require interactions from it
|
||||
@ -156,11 +155,11 @@ class ReferredCell
|
||||
|
||||
vector referPosition(const vector& positionToRefer);
|
||||
|
||||
vectorList referPositions(const vectorList& positionsToRefer);
|
||||
pointField referPositions(const pointField& positionsToRefer);
|
||||
|
||||
vector rotateVector(const vector& vectorToRotate);
|
||||
|
||||
vectorList rotateVectors(const vectorList& vectorsToRotate);
|
||||
vectorField rotateVectors(const vectorField& vectorsToRotate);
|
||||
|
||||
|
||||
public:
|
||||
@ -186,12 +185,12 @@ public:
|
||||
(
|
||||
const label sourceProc,
|
||||
const label sourceCell,
|
||||
const vectorList& vertexPositions,
|
||||
const pointField& vertexPositions,
|
||||
const edgeList& localEdges,
|
||||
const faceList& localFaces,
|
||||
const labelList& wallFaces,
|
||||
const vectorList& faceCentres,
|
||||
const vectorList& faceAreas,
|
||||
const pointField& faceCentres,
|
||||
const vectorField& faceAreas,
|
||||
const vector& offset,
|
||||
const tensor& rotation
|
||||
);
|
||||
@ -236,14 +235,14 @@ public:
|
||||
|
||||
//- Use internal transformatation values to transform the given
|
||||
// list of postions to their new locations.
|
||||
vectorList referPosition(const vectorList& positionsToRefer) const;
|
||||
pointField referPosition(const pointField& positionsToRefer) const;
|
||||
|
||||
//- Use internal transformatation values to rotate the given vector
|
||||
vector rotateVector(const vector& vectorToRotate) const;
|
||||
|
||||
//- Use internal transformatation values to rotate the given
|
||||
// list of vectors
|
||||
vectorList rotateVectors(const vectorList& vectorsToRotate) const;
|
||||
vectorField rotateVectors(const vectorField& vectorsToRotate) const;
|
||||
|
||||
//- referInParticle takes a referred particle from a source
|
||||
// processor, transforming its position and properties
|
||||
@ -274,7 +273,7 @@ public:
|
||||
|
||||
inline const tensor& rotation() const;
|
||||
|
||||
inline const vectorList& vertexPositions() const;
|
||||
inline const pointField& points() const;
|
||||
|
||||
inline const edgeList& edges() const;
|
||||
|
||||
@ -282,9 +281,9 @@ public:
|
||||
|
||||
inline const labelList& wallFaces() const;
|
||||
|
||||
inline const vectorList& faceCentres() const;
|
||||
inline const pointField& faceCentres() const;
|
||||
|
||||
inline const vectorList& faceAreas() const;
|
||||
inline const vectorField& faceAreas() const;
|
||||
|
||||
inline labelList& realCells();
|
||||
|
||||
|
||||
@ -55,8 +55,8 @@ inline const Foam::tensor& Foam::ReferredCell<ParticleType>::rotation() const
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
inline const Foam::vectorList&
|
||||
Foam::ReferredCell<ParticleType>::vertexPositions() const
|
||||
inline const Foam::pointField&
|
||||
Foam::ReferredCell<ParticleType>::points() const
|
||||
{
|
||||
return vertexPositions_;
|
||||
}
|
||||
@ -86,7 +86,7 @@ Foam::ReferredCell<ParticleType>::wallFaces() const
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
inline const Foam::vectorList&
|
||||
inline const Foam::pointField&
|
||||
Foam::ReferredCell<ParticleType>::faceCentres() const
|
||||
{
|
||||
return faceCentres_;
|
||||
@ -94,7 +94,7 @@ Foam::ReferredCell<ParticleType>::faceCentres() const
|
||||
|
||||
|
||||
template<class ParticleType>
|
||||
inline const Foam::vectorList&
|
||||
inline const Foam::vectorField&
|
||||
Foam::ReferredCell<ParticleType>::faceAreas() const
|
||||
{
|
||||
return faceAreas_;
|
||||
|
||||
@ -64,12 +64,12 @@ void Foam::ReferredCellList<ParticleType>::buildReferredCellList
|
||||
mesh.globalData().processorPatches().size()
|
||||
);
|
||||
|
||||
List<vectorList> allNeighbourFaceCentres
|
||||
List<pointField> allNeighbourFaceCentres
|
||||
(
|
||||
mesh.globalData().processorPatches().size()
|
||||
);
|
||||
|
||||
List<vectorList> allNeighbourFaceAreas
|
||||
List<vectorField> allNeighbourFaceAreas
|
||||
(
|
||||
mesh.globalData().processorPatches().size()
|
||||
);
|
||||
@ -249,11 +249,11 @@ void Foam::ReferredCellList<ParticleType>::buildReferredCellList
|
||||
mesh.boundaryMesh()[procPatches[pP]]
|
||||
);
|
||||
|
||||
vectorList& neighbFaceCentres = allNeighbourFaceCentres[pP];
|
||||
pointField& neighbFaceCentres = allNeighbourFaceCentres[pP];
|
||||
|
||||
neighbFaceCentres.setSize(patch.size());
|
||||
|
||||
vectorList& neighbFaceAreas = allNeighbourFaceAreas[pP];
|
||||
vectorField& neighbFaceAreas = allNeighbourFaceAreas[pP];
|
||||
|
||||
neighbFaceAreas.setSize(patch.size());
|
||||
|
||||
@ -281,9 +281,9 @@ void Foam::ReferredCellList<ParticleType>::buildReferredCellList
|
||||
mesh.boundaryMesh()[procPatches[pP]]
|
||||
);
|
||||
|
||||
const vectorList& neighbFaceCentres = allNeighbourFaceCentres[pP];
|
||||
const pointField& neighbFaceCentres = allNeighbourFaceCentres[pP];
|
||||
|
||||
const vectorList& neighbFaceAreas = allNeighbourFaceAreas[pP];
|
||||
const vectorField& neighbFaceAreas = allNeighbourFaceAreas[pP];
|
||||
|
||||
label nUP;
|
||||
|
||||
@ -389,7 +389,7 @@ void Foam::ReferredCellList<ParticleType>::buildReferredCellList
|
||||
// Face corresponding to faceL in the 2nd half of the
|
||||
// patch. Assumes correct face ordering.
|
||||
|
||||
vectorList refOff(patch.size()/2);
|
||||
vectorField refOff(patch.size()/2);
|
||||
|
||||
List<tensor> refTrans(patch.size()/2);
|
||||
|
||||
@ -922,10 +922,10 @@ void Foam::ReferredCellList<ParticleType>::buildReferredCellList
|
||||
DynamicList<ReferredCell<ParticleType> >
|
||||
ReferredCellsToTransfer;
|
||||
|
||||
const vectorList& neighbFaceCentres =
|
||||
const pointField& neighbFaceCentres =
|
||||
allNeighbourFaceCentres[pP];
|
||||
|
||||
const vectorList& neighbFaceAreas = allNeighbourFaceAreas[pP];
|
||||
const vectorField& neighbFaceAreas = allNeighbourFaceAreas[pP];
|
||||
|
||||
label nUP;
|
||||
|
||||
@ -1299,7 +1299,7 @@ void Foam::ReferredCellList<ParticleType>::buildReferredCellList
|
||||
|
||||
DynamicList<label> realCellsFoundInRange;
|
||||
|
||||
const vectorList& refCellPoints = refCell.vertexPositions();
|
||||
const pointField& refCellPoints = refCell.points();
|
||||
|
||||
forAll(rFacesWRRP, rCF)
|
||||
{
|
||||
@ -1774,7 +1774,7 @@ void Foam::ReferredCellList<ParticleType>::writeReferredCells() const
|
||||
{
|
||||
const ReferredCell<ParticleType>& refCell = (*this)[refCellI];
|
||||
|
||||
const vectorList& refCellPts = refCell.vertexPositions();
|
||||
const pointField& refCellPts = refCell.points();
|
||||
|
||||
const faceList& refCellFaces = refCell.faces();
|
||||
|
||||
@ -1819,7 +1819,7 @@ void Foam::ReferredCellList<ParticleType>::writeReferredCells() const
|
||||
{
|
||||
const ReferredCell<ParticleType>& refCell = (*this)[refCellI];
|
||||
|
||||
const vectorList& refCellPts = refCell.vertexPositions();
|
||||
const pointField& refCellPts = refCell.points();
|
||||
|
||||
const faceList& refCellFaces = refCell.faces();
|
||||
|
||||
|
||||
@ -56,9 +56,9 @@ License
|
||||
ParcelType \
|
||||
); \
|
||||
\
|
||||
makePairFunction(InteractingKinematicCloud<ParcelType>); \
|
||||
makePairModel(InteractingKinematicCloud<ParcelType>); \
|
||||
\
|
||||
makePairFunctionType \
|
||||
makePairModelType \
|
||||
( \
|
||||
SpringSliderDashpot, \
|
||||
InteractingKinematicCloud, \
|
||||
|
||||
@ -80,9 +80,9 @@ License
|
||||
ThermoType \
|
||||
); \
|
||||
\
|
||||
makePairFunction(InteractingKinematicCloud<ParcelType<ThermoType> >); \
|
||||
makePairModel(InteractingKinematicCloud<ParcelType<ThermoType> >); \
|
||||
\
|
||||
makePairFunctionThermoType \
|
||||
makePairModelThermoType \
|
||||
( \
|
||||
SpringSliderDashpot, \
|
||||
InteractingKinematicCloud, \
|
||||
|
||||
@ -25,7 +25,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "PairCollision.H"
|
||||
#include "PairFunction.H"
|
||||
#include "PairModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
@ -55,7 +55,7 @@ void Foam::PairCollision<CloudType>::evaluatePair
|
||||
typename CloudType::parcelType& pB
|
||||
) const
|
||||
{
|
||||
pairFunction_->evaluatePair(pA, pB);
|
||||
pairModel_->evaluatePair(pA, pB);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
@ -69,9 +69,9 @@ Foam::PairCollision<CloudType>::PairCollision
|
||||
:
|
||||
CollisionModel<CloudType>(dict, owner, typeName),
|
||||
cellOccupancy_(owner.mesh().nCells()),
|
||||
pairFunction_
|
||||
pairModel_
|
||||
(
|
||||
PairFunction<CloudType>::New
|
||||
PairModel<CloudType>::New
|
||||
(
|
||||
this->coeffDict(),
|
||||
this->owner()
|
||||
@ -98,11 +98,11 @@ Foam::PairCollision<CloudType>::~PairCollision()
|
||||
template<class CloudType>
|
||||
Foam::label Foam::PairCollision<CloudType>::nSubCycles() const
|
||||
{
|
||||
if (pairFunction_->controlsTimestep())
|
||||
if (pairModel_->controlsTimestep())
|
||||
{
|
||||
label nSubCycles = returnReduce
|
||||
(
|
||||
pairFunction_->nSubCycles(), maxOp<label>()
|
||||
pairModel_->nSubCycles(), maxOp<label>()
|
||||
);
|
||||
|
||||
if(nSubCycles > 1)
|
||||
@ -143,24 +143,27 @@ void Foam::PairCollision<CloudType>::collide()
|
||||
|
||||
buildCellOccupancy();
|
||||
|
||||
const DirectInteractionList<typename CloudType::parcelType>& dil(il_.dil());
|
||||
const DirectInteractionList<typename CloudType::parcelType>& dil =
|
||||
il_.dil();
|
||||
|
||||
const polyMesh& mesh = this->owner().mesh();
|
||||
|
||||
typename CloudType::parcelType* pA_ptr = NULL;
|
||||
typename CloudType::parcelType* pB_ptr = NULL;
|
||||
|
||||
// real-real interactions
|
||||
|
||||
forAll(dil, d)
|
||||
forAll(dil, realCellI)
|
||||
{
|
||||
// Loop over all Parcels in cell A (a)
|
||||
forAll(cellOccupancy_[d], a)
|
||||
forAll(cellOccupancy_[realCellI], a)
|
||||
{
|
||||
pA_ptr = cellOccupancy_[d][a];
|
||||
pA_ptr = cellOccupancy_[realCellI][a];
|
||||
|
||||
forAll(dil[d], interactingCells)
|
||||
forAll(dil[realCellI], interactingCells)
|
||||
{
|
||||
List<typename CloudType::parcelType*> cellBParcels =
|
||||
cellOccupancy_[dil[d][interactingCells]];
|
||||
cellOccupancy_[dil[realCellI][interactingCells]];
|
||||
|
||||
// Loop over all Parcels in cell B (b)
|
||||
forAll(cellBParcels, b)
|
||||
@ -172,9 +175,9 @@ void Foam::PairCollision<CloudType>::collide()
|
||||
}
|
||||
|
||||
// Loop over the other Parcels in cell A (aO)
|
||||
forAll(cellOccupancy_[d], aO)
|
||||
forAll(cellOccupancy_[realCellI], aO)
|
||||
{
|
||||
pB_ptr = cellOccupancy_[d][aO];
|
||||
pB_ptr = cellOccupancy_[realCellI][aO];
|
||||
|
||||
// Do not double-evaluate, compare pointers, arbitrary
|
||||
// order
|
||||
@ -188,7 +191,7 @@ void Foam::PairCollision<CloudType>::collide()
|
||||
|
||||
// real-referred interactions
|
||||
|
||||
ReferredCellList<typename CloudType::parcelType>& ril(il_.ril());
|
||||
ReferredCellList<typename CloudType::parcelType>& ril = il_.ril();
|
||||
|
||||
// Loop over all referred cells
|
||||
forAll(ril, refCellI)
|
||||
|
||||
@ -46,7 +46,7 @@ namespace Foam
|
||||
// Forward declaration of classes
|
||||
|
||||
template<class CloudType>
|
||||
class PairFunction;
|
||||
class PairModel;
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
@ -63,8 +63,8 @@ class PairCollision
|
||||
//- Cell occupancy information for each parcel
|
||||
List<DynamicList<typename CloudType::parcelType*> > cellOccupancy_;
|
||||
|
||||
// //- PairFunction to calculate the interaction between two parcels
|
||||
autoPtr<PairFunction<CloudType> > pairFunction_;
|
||||
//- PairModel to calculate the interaction between two parcels
|
||||
autoPtr<PairModel<CloudType> > pairModel_;
|
||||
|
||||
//- Interactions lists determining which cells are in
|
||||
// interaction range of each other
|
||||
|
||||
@ -24,43 +24,43 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "PairFunction.H"
|
||||
#include "PairModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::autoPtr<Foam::PairFunction<CloudType> >
|
||||
Foam::PairFunction<CloudType>::New
|
||||
Foam::autoPtr<Foam::PairModel<CloudType> >
|
||||
Foam::PairModel<CloudType>::New
|
||||
(
|
||||
const dictionary& dict,
|
||||
CloudType& owner
|
||||
)
|
||||
{
|
||||
word PairFunctionType(dict.lookup("PairFunction"));
|
||||
word PairModelType(dict.lookup("PairModel"));
|
||||
|
||||
Info<< "Selecting PairFunction " << PairFunctionType
|
||||
Info<< "Selecting PairModel " << PairModelType
|
||||
<< endl;
|
||||
|
||||
typename dictionaryConstructorTable::iterator cstrIter =
|
||||
dictionaryConstructorTablePtr_->find(PairFunctionType);
|
||||
dictionaryConstructorTablePtr_->find(PairModelType);
|
||||
|
||||
if (cstrIter == dictionaryConstructorTablePtr_->end())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"PairFunction<CloudType>::New"
|
||||
"PairModel<CloudType>::New"
|
||||
"("
|
||||
"const dictionary&, "
|
||||
"CloudType&"
|
||||
")"
|
||||
) << "Unknown PairFunctionType type "
|
||||
<< PairFunctionType
|
||||
) << "Unknown PairModelType type "
|
||||
<< PairModelType
|
||||
<< ", constructor not in hash table" << nl << nl
|
||||
<< " Valid PairFunction types are:" << nl
|
||||
<< " Valid PairModel types are:" << nl
|
||||
<< dictionaryConstructorTablePtr_->sortedToc() << exit(FatalError);
|
||||
}
|
||||
|
||||
return autoPtr<PairFunction<CloudType> >(cstrIter()(dict, owner));
|
||||
return autoPtr<PairModel<CloudType> >(cstrIter()(dict, owner));
|
||||
}
|
||||
|
||||
|
||||
@ -24,12 +24,12 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "PairFunction.H"
|
||||
#include "PairModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::PairFunction<CloudType>::PairFunction
|
||||
Foam::PairModel<CloudType>::PairModel
|
||||
(
|
||||
const dictionary& dict,
|
||||
CloudType& owner,
|
||||
@ -45,7 +45,7 @@ Foam::PairFunction<CloudType>::PairFunction
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::PairFunction<CloudType>::~PairFunction()
|
||||
Foam::PairModel<CloudType>::~PairModel()
|
||||
{}
|
||||
|
||||
|
||||
@ -53,14 +53,14 @@ Foam::PairFunction<CloudType>::~PairFunction()
|
||||
|
||||
template<class CloudType>
|
||||
const CloudType&
|
||||
Foam::PairFunction<CloudType>::owner() const
|
||||
Foam::PairModel<CloudType>::owner() const
|
||||
{
|
||||
return owner_;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
const Foam::dictionary& Foam::PairFunction<CloudType>::dict() const
|
||||
const Foam::dictionary& Foam::PairModel<CloudType>::dict() const
|
||||
{
|
||||
return dict_;
|
||||
}
|
||||
@ -68,7 +68,7 @@ const Foam::dictionary& Foam::PairFunction<CloudType>::dict() const
|
||||
|
||||
template<class CloudType>
|
||||
const Foam::dictionary&
|
||||
Foam::PairFunction<CloudType>::coeffDict() const
|
||||
Foam::PairModel<CloudType>::coeffDict() const
|
||||
{
|
||||
return coeffDict_;
|
||||
}
|
||||
@ -76,6 +76,6 @@ Foam::PairFunction<CloudType>::coeffDict() const
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "NewPairFunction.C"
|
||||
#include "NewPairModel.C"
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -23,19 +23,19 @@ License
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Class
|
||||
Foam::PairFunction
|
||||
Foam::PairModel
|
||||
|
||||
Description
|
||||
Templated pair interaction class
|
||||
|
||||
SourceFiles
|
||||
PairFunction.C
|
||||
NewPairFunction.C
|
||||
PairModel.C
|
||||
NewPairModel.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef PairFunction_H
|
||||
#define PairFunction_H
|
||||
#ifndef PairModel_H
|
||||
#define PairModel_H
|
||||
|
||||
#include "IOdictionary.H"
|
||||
#include "autoPtr.H"
|
||||
@ -47,11 +47,11 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class PairFunction Declaration
|
||||
Class PairModel Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class CloudType>
|
||||
class PairFunction
|
||||
class PairModel
|
||||
{
|
||||
// Private data
|
||||
|
||||
@ -68,13 +68,13 @@ class PairFunction
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("PairFunction");
|
||||
TypeName("PairModel");
|
||||
|
||||
//- Declare runtime constructor selection table
|
||||
declareRunTimeSelectionTable
|
||||
(
|
||||
autoPtr,
|
||||
PairFunction,
|
||||
PairModel,
|
||||
dictionary,
|
||||
(
|
||||
const dictionary& dict,
|
||||
@ -87,7 +87,7 @@ public:
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
PairFunction
|
||||
PairModel
|
||||
(
|
||||
const dictionary& dict,
|
||||
CloudType& owner,
|
||||
@ -96,11 +96,11 @@ public:
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~PairFunction();
|
||||
virtual ~PairModel();
|
||||
|
||||
|
||||
//- Selector
|
||||
static autoPtr<PairFunction<CloudType> > New
|
||||
static autoPtr<PairModel<CloudType> > New
|
||||
(
|
||||
const dictionary& dict,
|
||||
CloudType& owner
|
||||
@ -121,11 +121,11 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Whether the PairFunction has a timestep limit that will
|
||||
//- Whether the PairModel has a timestep limit that will
|
||||
// require subCycling
|
||||
virtual bool controlsTimestep() const = 0;
|
||||
|
||||
//- For PairFunctions that control the timestep, calculate the
|
||||
//- For PairModels that control the timestep, calculate the
|
||||
// number of subCycles needed to satisfy the minimum
|
||||
// allowable timestep
|
||||
virtual label nSubCycles() const = 0;
|
||||
@ -145,27 +145,27 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#define makePairFunction(CloudType) \
|
||||
#define makePairModel(CloudType) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(PairFunction<CloudType>, 0); \
|
||||
defineNamedTemplateTypeNameAndDebug(PairModel<CloudType>, 0); \
|
||||
\
|
||||
defineTemplateRunTimeSelectionTable \
|
||||
( \
|
||||
PairFunction<CloudType>, \
|
||||
PairModel<CloudType>, \
|
||||
dictionary \
|
||||
);
|
||||
|
||||
|
||||
#define makePairFunctionType(SS, CloudType, ParcelType) \
|
||||
#define makePairModelType(SS, CloudType, ParcelType) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug(SS<CloudType<ParcelType> >, 0); \
|
||||
\
|
||||
PairFunction<CloudType<ParcelType> >:: \
|
||||
PairModel<CloudType<ParcelType> >:: \
|
||||
adddictionaryConstructorToTable<SS<CloudType<ParcelType> > > \
|
||||
add##SS##CloudType##ParcelType##ConstructorToTable_;
|
||||
|
||||
|
||||
#define makePairFunctionThermoType(SS, CloudType, ParcelType, ThermoType) \
|
||||
#define makePairModelThermoType(SS, CloudType, ParcelType, ThermoType) \
|
||||
\
|
||||
defineNamedTemplateTypeNameAndDebug \
|
||||
( \
|
||||
@ -173,7 +173,7 @@ public:
|
||||
0 \
|
||||
); \
|
||||
\
|
||||
PairFunction<CloudType<ParcelType<ThermoType> > >:: \
|
||||
PairModel<CloudType<ParcelType<ThermoType> > >:: \
|
||||
adddictionaryConstructorToTable \
|
||||
<SS<CloudType<ParcelType<ThermoType> > > > \
|
||||
add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_;
|
||||
@ -182,7 +182,7 @@ public:
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "PairFunction.C"
|
||||
# include "PairModel.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -77,7 +77,7 @@ Foam::SpringSliderDashpot<CloudType>::SpringSliderDashpot
|
||||
CloudType& cloud
|
||||
)
|
||||
:
|
||||
PairFunction<CloudType>(dict, cloud, typeName),
|
||||
PairModel<CloudType>(dict, cloud, typeName),
|
||||
Estar_(),
|
||||
Gstar_(),
|
||||
alpha_(dimensionedScalar(this->coeffDict().lookup("alpha")).value()),
|
||||
@ -33,7 +33,7 @@ Description
|
||||
#ifndef SpringSliderDashpot_H
|
||||
#define SpringSliderDashpot_H
|
||||
|
||||
#include "PairFunction.H"
|
||||
#include "PairModel.H"
|
||||
#include "CollisionRecord.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -47,7 +47,7 @@ namespace Foam
|
||||
template<class CloudType>
|
||||
class SpringSliderDashpot
|
||||
:
|
||||
public PairFunction<CloudType>
|
||||
public PairModel<CloudType>
|
||||
{
|
||||
// Private data
|
||||
|
||||
@ -105,11 +105,11 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Whether the PairFunction has a timestep limit that will
|
||||
//- Whether the PairModel has a timestep limit that will
|
||||
// require subCycling
|
||||
virtual bool controlsTimestep() const;
|
||||
|
||||
//- For PairFunctions that control the timestep, calculate the
|
||||
//- For PairModels that control the timestep, calculate the
|
||||
// number of subCycles needed to satisfy the minimum
|
||||
// allowable timestep
|
||||
virtual label nSubCycles() const;
|
||||
Reference in New Issue
Block a user