mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Re-worked lagrangian/basic
This commit is contained in:
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -32,12 +32,6 @@ License
|
|||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
#include "wallPolyPatch.H"
|
#include "wallPolyPatch.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class ParticleType>
|
|
||||||
const Foam::scalar Foam::Cloud<ParticleType>::trackingCorrectionTol = 1e-5;
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class ParticleType>
|
template<class ParticleType>
|
||||||
@ -47,7 +41,7 @@ void Foam::Cloud<ParticleType>::calcCellWallFaces() const
|
|||||||
|
|
||||||
PackedBoolList& cellWallFaces = cellWallFacesPtr_();
|
PackedBoolList& cellWallFaces = cellWallFacesPtr_();
|
||||||
|
|
||||||
const polyBoundaryMesh& patches = pMesh().boundaryMesh();
|
const polyBoundaryMesh& patches = polyMesh_.boundaryMesh();
|
||||||
|
|
||||||
forAll(patches, patchI)
|
forAll(patches, patchI)
|
||||||
{
|
{
|
||||||
@ -78,9 +72,7 @@ Foam::Cloud<ParticleType>::Cloud
|
|||||||
cloud(pMesh),
|
cloud(pMesh),
|
||||||
IDLList<ParticleType>(),
|
IDLList<ParticleType>(),
|
||||||
polyMesh_(pMesh),
|
polyMesh_(pMesh),
|
||||||
particleCount_(0),
|
|
||||||
labels_(),
|
labels_(),
|
||||||
cellTree_(),
|
|
||||||
nTrackingRescues_(),
|
nTrackingRescues_(),
|
||||||
cellWallFacesPtr_()
|
cellWallFacesPtr_()
|
||||||
{
|
{
|
||||||
@ -104,9 +96,7 @@ Foam::Cloud<ParticleType>::Cloud
|
|||||||
cloud(pMesh, cloudName),
|
cloud(pMesh, cloudName),
|
||||||
IDLList<ParticleType>(),
|
IDLList<ParticleType>(),
|
||||||
polyMesh_(pMesh),
|
polyMesh_(pMesh),
|
||||||
particleCount_(0),
|
|
||||||
labels_(),
|
labels_(),
|
||||||
cellTree_(),
|
|
||||||
nTrackingRescues_(),
|
nTrackingRescues_(),
|
||||||
cellWallFacesPtr_()
|
cellWallFacesPtr_()
|
||||||
{
|
{
|
||||||
@ -121,236 +111,6 @@ Foam::Cloud<ParticleType>::Cloud
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class ParticleType>
|
|
||||||
void Foam::Cloud<ParticleType>::findCellFacePt
|
|
||||||
(
|
|
||||||
const point& pt,
|
|
||||||
label& cellI,
|
|
||||||
label& tetFaceI,
|
|
||||||
label& tetPtI
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
cellI = -1;
|
|
||||||
tetFaceI = -1;
|
|
||||||
tetPtI = -1;
|
|
||||||
|
|
||||||
const indexedOctree<treeDataCell>& tree = cellTree();
|
|
||||||
|
|
||||||
// Find nearest cell to the point
|
|
||||||
|
|
||||||
pointIndexHit info = tree.findNearest(pt, sqr(GREAT));
|
|
||||||
|
|
||||||
if (info.hit())
|
|
||||||
{
|
|
||||||
label nearestCellI = tree.shapes().cellLabels()[info.index()];
|
|
||||||
|
|
||||||
// Check the nearest cell to see if the point is inside.
|
|
||||||
findFacePt(nearestCellI, pt, tetFaceI, tetPtI);
|
|
||||||
|
|
||||||
if (tetFaceI != -1)
|
|
||||||
{
|
|
||||||
// Point was in the nearest cell
|
|
||||||
|
|
||||||
cellI = nearestCellI;
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
// Check the other possible cells that the point may be in
|
|
||||||
|
|
||||||
labelList testCells = tree.findIndices(pt);
|
|
||||||
|
|
||||||
forAll(testCells, pCI)
|
|
||||||
{
|
|
||||||
label testCellI = tree.shapes().cellLabels()[testCells[pCI]];
|
|
||||||
|
|
||||||
if (testCellI == nearestCellI)
|
|
||||||
{
|
|
||||||
// Don't retest the nearest cell
|
|
||||||
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check the test cell to see if the point is inside.
|
|
||||||
findFacePt(testCellI, pt, tetFaceI, tetPtI);
|
|
||||||
|
|
||||||
if (tetFaceI != -1)
|
|
||||||
{
|
|
||||||
// Point was in the test cell
|
|
||||||
|
|
||||||
cellI = testCellI;
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
FatalErrorIn
|
|
||||||
(
|
|
||||||
"void Foam::Cloud<ParticleType>::findCellFacePt"
|
|
||||||
"("
|
|
||||||
"const point& pt, "
|
|
||||||
"label& cellI, "
|
|
||||||
"label& tetFaceI, "
|
|
||||||
"label& tetPtI"
|
|
||||||
") const"
|
|
||||||
) << "Did not find nearest cell in search tree."
|
|
||||||
<< abort(FatalError);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class ParticleType>
|
|
||||||
void Foam::Cloud<ParticleType>::findFacePt
|
|
||||||
(
|
|
||||||
label cellI,
|
|
||||||
const point& pt,
|
|
||||||
label& tetFaceI,
|
|
||||||
label& tetPtI
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
tetFaceI = -1;
|
|
||||||
tetPtI = -1;
|
|
||||||
|
|
||||||
List<tetIndices> cellTets = polyMeshTetDecomposition::cellTetIndices
|
|
||||||
(
|
|
||||||
polyMesh_,
|
|
||||||
cellI
|
|
||||||
);
|
|
||||||
|
|
||||||
forAll(cellTets, tetI)
|
|
||||||
{
|
|
||||||
const tetIndices& cellTetIs = cellTets[tetI];
|
|
||||||
|
|
||||||
if (inTet(pt, cellTetIs.tet(polyMesh_)))
|
|
||||||
{
|
|
||||||
tetFaceI = cellTetIs.face();
|
|
||||||
tetPtI = cellTetIs.tetPt();
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class ParticleType>
|
|
||||||
bool Foam::Cloud<ParticleType>::inTet
|
|
||||||
(
|
|
||||||
const point& pt,
|
|
||||||
const tetPointRef& tet
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
// For robustness, assuming that the point is in the tet unless
|
|
||||||
// "definitively" shown otherwise by obtaining a positive dot
|
|
||||||
// product greater than a tolerance of SMALL.
|
|
||||||
|
|
||||||
// The tet is defined: tet(Cc, tetBasePt, pA, pB) where the normal
|
|
||||||
// vectors and base points for the half-space planes are:
|
|
||||||
// area[0] = tet.Sa();
|
|
||||||
// area[1] = tet.Sb();
|
|
||||||
// area[2] = tet.Sc();
|
|
||||||
// area[3] = tet.Sd();
|
|
||||||
// planeBase[0] = tetBasePt = tet.b()
|
|
||||||
// planeBase[1] = ptA = tet.c()
|
|
||||||
// planeBase[2] = tetBasePt = tet.b()
|
|
||||||
// planeBase[3] = tetBasePt = tet.b()
|
|
||||||
|
|
||||||
vector n = vector::zero;
|
|
||||||
|
|
||||||
{
|
|
||||||
// 0, a
|
|
||||||
const point& basePt = tet.b();
|
|
||||||
|
|
||||||
n = tet.Sa();
|
|
||||||
n /= (mag(n) + VSMALL);
|
|
||||||
|
|
||||||
if (((pt - basePt) & n) > SMALL)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
// 1, b
|
|
||||||
const point& basePt = tet.c();
|
|
||||||
|
|
||||||
n = tet.Sb();
|
|
||||||
n /= (mag(n) + VSMALL);
|
|
||||||
|
|
||||||
if (((pt - basePt) & n) > SMALL)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
// 2, c
|
|
||||||
const point& basePt = tet.b();
|
|
||||||
|
|
||||||
n = tet.Sc();
|
|
||||||
n /= (mag(n) + VSMALL);
|
|
||||||
|
|
||||||
if (((pt - basePt) & n) > SMALL)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
// 3, d
|
|
||||||
const point& basePt = tet.b();
|
|
||||||
|
|
||||||
n = tet.Sd();
|
|
||||||
n /= (mag(n) + VSMALL);
|
|
||||||
|
|
||||||
if (((pt - basePt) & n) > SMALL)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class ParticleType>
|
|
||||||
const Foam::indexedOctree<Foam::treeDataCell>&
|
|
||||||
Foam::Cloud<ParticleType>::cellTree() const
|
|
||||||
{
|
|
||||||
if (cellTree_.empty())
|
|
||||||
{
|
|
||||||
treeBoundBox overallBb(polyMesh_.points());
|
|
||||||
|
|
||||||
Random rndGen(261782);
|
|
||||||
|
|
||||||
overallBb = overallBb.extend(rndGen, 1E-4);
|
|
||||||
overallBb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
|
||||||
overallBb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
|
|
||||||
|
|
||||||
cellTree_.reset
|
|
||||||
(
|
|
||||||
new indexedOctree<treeDataCell>
|
|
||||||
(
|
|
||||||
treeDataCell
|
|
||||||
(
|
|
||||||
false, // not cache bb
|
|
||||||
polyMesh_
|
|
||||||
),
|
|
||||||
overallBb,
|
|
||||||
8, // maxLevel
|
|
||||||
10, // leafsize
|
|
||||||
3.0 // duplicity
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
return cellTree_();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class ParticleType>
|
template<class ParticleType>
|
||||||
const Foam::PackedBoolList& Foam::Cloud<ParticleType>::cellHasWallFaces()
|
const Foam::PackedBoolList& Foam::Cloud<ParticleType>::cellHasWallFaces()
|
||||||
const
|
const
|
||||||
@ -364,22 +124,6 @@ const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
template<class ParticleType>
|
|
||||||
Foam::label Foam::Cloud<ParticleType>::getNewParticleID() const
|
|
||||||
{
|
|
||||||
label id = particleCount_++;
|
|
||||||
|
|
||||||
if (id == labelMax)
|
|
||||||
{
|
|
||||||
WarningIn("Cloud<ParticleType>::getNewParticleID() const")
|
|
||||||
<< "Particle counter has overflowed. This might cause problems"
|
|
||||||
<< " when reconstructing particle tracks." << endl;
|
|
||||||
}
|
|
||||||
return id;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class ParticleType>
|
template<class ParticleType>
|
||||||
void Foam::Cloud<ParticleType>::addParticle(ParticleType* pPtr)
|
void Foam::Cloud<ParticleType>::addParticle(ParticleType* pPtr)
|
||||||
{
|
{
|
||||||
@ -399,14 +143,14 @@ void Foam::Cloud<ParticleType>::cloudReset(const Cloud<ParticleType>& c)
|
|||||||
{
|
{
|
||||||
// Reset particle cound and particles only
|
// Reset particle cound and particles only
|
||||||
// - not changing the cloud object registry or reference to the polyMesh
|
// - not changing the cloud object registry or reference to the polyMesh
|
||||||
particleCount_ = 0;
|
ParticleType::particleCount_ = 0;
|
||||||
IDLList<ParticleType>::operator=(c);
|
IDLList<ParticleType>::operator=(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class ParticleType>
|
template<class ParticleType>
|
||||||
template<class TrackingData>
|
template<class TrackData>
|
||||||
void Foam::Cloud<ParticleType>::move(TrackingData& td, const scalar trackTime)
|
void Foam::Cloud<ParticleType>::move(TrackData& td, const scalar trackTime)
|
||||||
{
|
{
|
||||||
const polyBoundaryMesh& pbm = pMesh().boundaryMesh();
|
const polyBoundaryMesh& pbm = pMesh().boundaryMesh();
|
||||||
const globalMeshData& pData = polyMesh_.globalData();
|
const globalMeshData& pData = polyMesh_.globalData();
|
||||||
@ -472,9 +216,9 @@ void Foam::Cloud<ParticleType>::move(TrackingData& td, const scalar trackTime)
|
|||||||
{
|
{
|
||||||
// If we are running in parallel and the particle is on a
|
// If we are running in parallel and the particle is on a
|
||||||
// boundary face
|
// boundary face
|
||||||
if (Pstream::parRun() && p.faceI_ >= pMesh().nInternalFaces())
|
if (Pstream::parRun() && p.face() >= pMesh().nInternalFaces())
|
||||||
{
|
{
|
||||||
label patchI = pbm.whichPatch(p.faceI_);
|
label patchI = pbm.whichPatch(p.face());
|
||||||
|
|
||||||
// ... and the face is on a processor patch
|
// ... and the face is on a processor patch
|
||||||
// prepare it for transfer
|
// prepare it for transfer
|
||||||
@ -571,7 +315,7 @@ void Foam::Cloud<ParticleType>::move(TrackingData& td, const scalar trackTime)
|
|||||||
IDLList<ParticleType> newParticles
|
IDLList<ParticleType> newParticles
|
||||||
(
|
(
|
||||||
particleStream,
|
particleStream,
|
||||||
typename ParticleType::iNew(*this)
|
typename ParticleType::iNew(polyMesh_)
|
||||||
);
|
);
|
||||||
|
|
||||||
label pI = 0;
|
label pI = 0;
|
||||||
@ -600,57 +344,64 @@ void Foam::Cloud<ParticleType>::move(TrackingData& td, const scalar trackTime)
|
|||||||
|
|
||||||
|
|
||||||
template<class ParticleType>
|
template<class ParticleType>
|
||||||
void Foam::Cloud<ParticleType>::autoMap(const mapPolyMesh& mapper)
|
template<class TrackData>
|
||||||
|
void Foam::Cloud<ParticleType>::autoMap
|
||||||
|
(
|
||||||
|
TrackData& td,
|
||||||
|
const mapPolyMesh& mapper
|
||||||
|
)
|
||||||
{
|
{
|
||||||
if (cloud::debug)
|
if (cloud::debug)
|
||||||
{
|
{
|
||||||
Info<< "Cloud<ParticleType>::autoMap(const morphFieldMapper& map) "
|
Info<< "Cloud<ParticleType>::autoMap(TrackData&, const mapPolyMesh&) "
|
||||||
"for lagrangian cloud " << cloud::name() << endl;
|
<< "for lagrangian cloud " << cloud::name() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const labelList& reverseCellMap = mapper.reverseCellMap();
|
const labelList& reverseCellMap = mapper.reverseCellMap();
|
||||||
const labelList& reverseFaceMap = mapper.reverseFaceMap();
|
const labelList& reverseFaceMap = mapper.reverseFaceMap();
|
||||||
|
|
||||||
// Reset stored data that relies on the mesh
|
// Reset stored data that relies on the mesh
|
||||||
cellTree_.clear();
|
// polyMesh_.clearCellTree();
|
||||||
cellWallFacesPtr_.clear();
|
cellWallFacesPtr_.clear();
|
||||||
|
|
||||||
forAllIter(typename Cloud<ParticleType>, *this, pIter)
|
forAllIter(typename Cloud<ParticleType>, *this, pIter)
|
||||||
{
|
{
|
||||||
if (reverseCellMap[pIter().cellI_] >= 0)
|
ParticleType& p = pIter();
|
||||||
{
|
|
||||||
pIter().cellI_ = reverseCellMap[pIter().cellI_];
|
|
||||||
|
|
||||||
if (pIter().faceI_ >= 0 && reverseFaceMap[pIter().faceI_] >= 0)
|
if (reverseCellMap[p.cell()] >= 0)
|
||||||
{
|
{
|
||||||
pIter().faceI_ = reverseFaceMap[pIter().faceI_];
|
p.cell() = reverseCellMap[p.cell()];
|
||||||
|
|
||||||
|
if (p.face() >= 0 && reverseFaceMap[p.face()] >= 0)
|
||||||
|
{
|
||||||
|
p.face() = reverseFaceMap[p.face()];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
pIter().faceI_ = -1;
|
p.face() = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
pIter().initCellFacePt();
|
p.initCellFacePt();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
label trackStartCell = mapper.mergedCell(pIter().cellI_);
|
label trackStartCell = mapper.mergedCell(p.cell());
|
||||||
|
|
||||||
if (trackStartCell < 0)
|
if (trackStartCell < 0)
|
||||||
{
|
{
|
||||||
trackStartCell = 0;
|
trackStartCell = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
vector p = pIter().position();
|
vector pos = p.position();
|
||||||
|
|
||||||
const_cast<vector&>(pIter().position()) =
|
const_cast<vector&>(p.position()) =
|
||||||
polyMesh_.cellCentres()[trackStartCell];
|
polyMesh_.cellCentres()[trackStartCell];
|
||||||
|
|
||||||
pIter().stepFraction() = 0;
|
p.stepFraction() = 0;
|
||||||
|
|
||||||
pIter().initCellFacePt();
|
p.initCellFacePt();
|
||||||
|
|
||||||
pIter().track(p);
|
p.track(pos, td);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,6 +25,7 @@ Class
|
|||||||
Foam::Cloud
|
Foam::Cloud
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
Base cloud calls templated on particle type
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
Cloud.C
|
Cloud.C
|
||||||
@ -80,15 +81,9 @@ class Cloud
|
|||||||
|
|
||||||
const polyMesh& polyMesh_;
|
const polyMesh& polyMesh_;
|
||||||
|
|
||||||
//- Overall count of particles ever created. Never decreases.
|
|
||||||
mutable label particleCount_;
|
|
||||||
|
|
||||||
//- Temporary storage for addressing. Used in findTris.
|
//- Temporary storage for addressing. Used in findTris.
|
||||||
mutable DynamicList<label> labels_;
|
mutable DynamicList<label> labels_;
|
||||||
|
|
||||||
//- Search tree to allow spatial tet searching
|
|
||||||
mutable autoPtr<indexedOctree<treeDataCell> > cellTree_;
|
|
||||||
|
|
||||||
//- Count of how many tracking rescue corrections have been
|
//- Count of how many tracking rescue corrections have been
|
||||||
// applied
|
// applied
|
||||||
mutable label nTrackingRescues_;
|
mutable label nTrackingRescues_;
|
||||||
@ -114,8 +109,7 @@ class Cloud
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
template<class ParticleT>
|
friend class particle;
|
||||||
friend class Particle;
|
|
||||||
template<class ParticleT>
|
template<class ParticleT>
|
||||||
friend class IOPosition;
|
friend class IOPosition;
|
||||||
|
|
||||||
@ -133,10 +127,6 @@ public:
|
|||||||
//- Name of cloud properties dictionary
|
//- Name of cloud properties dictionary
|
||||||
static word cloudPropertiesName;
|
static word cloudPropertiesName;
|
||||||
|
|
||||||
//- Fraction of distance to tet centre to move a particle to
|
|
||||||
// 'rescue' it from a tracking problem
|
|
||||||
static const scalar trackingCorrectionTol;
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
@ -184,65 +174,15 @@ public:
|
|||||||
return polyMesh_;
|
return polyMesh_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Is this global face an internal face?
|
|
||||||
bool internalFace(const label faceI) const
|
|
||||||
{
|
|
||||||
return polyMesh_.isInternalFace(faceI);
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Is this global face a boundary face?
|
|
||||||
bool boundaryFace(const label faceI) const
|
|
||||||
{
|
|
||||||
return !internalFace(faceI);
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Which patch is this global face on
|
|
||||||
label facePatch(const label faceI) const
|
|
||||||
{
|
|
||||||
return polyMesh_.boundaryMesh().whichPatch(faceI);
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Which face of this patch is this global face
|
|
||||||
label patchFace(const label patchI, const label faceI) const
|
|
||||||
{
|
|
||||||
return polyMesh_.boundaryMesh()[patchI].whichFace(faceI);
|
|
||||||
}
|
|
||||||
|
|
||||||
label size() const
|
label size() const
|
||||||
{
|
{
|
||||||
return IDLList<ParticleType>::size();
|
return IDLList<ParticleType>::size();
|
||||||
};
|
};
|
||||||
|
|
||||||
//- Find the cell, tetFaceI and tetPtI for the given
|
DynamicList<label>& labels()
|
||||||
// position
|
{
|
||||||
void findCellFacePt
|
return labels_;
|
||||||
(
|
}
|
||||||
const point& pt,
|
|
||||||
label& cellI,
|
|
||||||
label& tetFaceI,
|
|
||||||
label& tetPtI
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Find the tetFaceI and tetPtI for the given position in
|
|
||||||
// the supplied cell, tetFaceI and tetPtI = -1 if not
|
|
||||||
// found
|
|
||||||
void findFacePt
|
|
||||||
(
|
|
||||||
label cellI,
|
|
||||||
const point& pt,
|
|
||||||
label& tetFaceI,
|
|
||||||
label& tetPtI
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Test if the given position is inside the give tet
|
|
||||||
bool inTet
|
|
||||||
(
|
|
||||||
const point& pt,
|
|
||||||
const tetPointRef& tet
|
|
||||||
) const;
|
|
||||||
|
|
||||||
//- Build (if necessary) and return the cell search tree
|
|
||||||
const indexedOctree<treeDataCell>& cellTree() const;
|
|
||||||
|
|
||||||
//- Return nTrackingRescues
|
//- Return nTrackingRescues
|
||||||
label nTrackingRescues() const
|
label nTrackingRescues() const
|
||||||
@ -314,9 +254,6 @@ public:
|
|||||||
return IDLList<ParticleType>::clear();
|
return IDLList<ParticleType>::clear();
|
||||||
};
|
};
|
||||||
|
|
||||||
//- Get unique particle creation id
|
|
||||||
label getNewParticleID() const;
|
|
||||||
|
|
||||||
//- Transfer particle to cloud
|
//- Transfer particle to cloud
|
||||||
void addParticle(ParticleType* pPtr);
|
void addParticle(ParticleType* pPtr);
|
||||||
|
|
||||||
@ -328,12 +265,13 @@ public:
|
|||||||
|
|
||||||
//- Move the particles
|
//- Move the particles
|
||||||
// passing the TrackingData to the track function
|
// passing the TrackingData to the track function
|
||||||
template<class TrackingData>
|
template<class TrackData>
|
||||||
void move(TrackingData& td, const scalar trackTime);
|
void move(TrackData& td, const scalar trackTime);
|
||||||
|
|
||||||
//- Remap the cells of particles corresponding to the
|
//- Remap the cells of particles corresponding to the
|
||||||
// mesh topology change
|
// mesh topology change
|
||||||
virtual void autoMap(const mapPolyMesh&);
|
template<class TrackData>
|
||||||
|
void autoMap(TrackData& td, const mapPolyMesh&);
|
||||||
|
|
||||||
|
|
||||||
// Read
|
// Read
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -24,7 +24,6 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "Cloud.H"
|
#include "Cloud.H"
|
||||||
#include "Particle.H"
|
|
||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
#include "IOPosition.H"
|
#include "IOPosition.H"
|
||||||
|
|
||||||
@ -58,12 +57,12 @@ void Foam::Cloud<ParticleType>::readCloudUniformProperties()
|
|||||||
if (uniformPropsDict.found(procName))
|
if (uniformPropsDict.found(procName))
|
||||||
{
|
{
|
||||||
uniformPropsDict.subDict(procName).lookup("particleCount")
|
uniformPropsDict.subDict(procName).lookup("particleCount")
|
||||||
>> particleCount_;
|
>> ParticleType::particleCount_;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
particleCount_ = 0;
|
ParticleType::particleCount_ = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,7 +85,7 @@ void Foam::Cloud<ParticleType>::writeCloudUniformProperties() const
|
|||||||
);
|
);
|
||||||
|
|
||||||
labelList np(Pstream::nProcs(), 0);
|
labelList np(Pstream::nProcs(), 0);
|
||||||
np[Pstream::myProcNo()] = particleCount_;
|
np[Pstream::myProcNo()] = ParticleType::particleCount_;
|
||||||
|
|
||||||
Pstream::listCombineGather(np, maxEqOp<label>());
|
Pstream::listCombineGather(np, maxEqOp<label>());
|
||||||
Pstream::listCombineScatter(np);
|
Pstream::listCombineScatter(np);
|
||||||
@ -107,7 +106,7 @@ void Foam::Cloud<ParticleType>::initCloud(const bool checkClass)
|
|||||||
{
|
{
|
||||||
readCloudUniformProperties();
|
readCloudUniformProperties();
|
||||||
|
|
||||||
IOPosition<ParticleType> ioP(*this);
|
IOPosition<Cloud<ParticleType> > ioP(*this);
|
||||||
|
|
||||||
if (ioP.headerOk())
|
if (ioP.headerOk())
|
||||||
{
|
{
|
||||||
@ -154,9 +153,7 @@ Foam::Cloud<ParticleType>::Cloud
|
|||||||
:
|
:
|
||||||
cloud(pMesh),
|
cloud(pMesh),
|
||||||
polyMesh_(pMesh),
|
polyMesh_(pMesh),
|
||||||
particleCount_(0),
|
|
||||||
labels_(),
|
labels_(),
|
||||||
cellTree_(),
|
|
||||||
nTrackingRescues_(),
|
nTrackingRescues_(),
|
||||||
cellWallFacesPtr_()
|
cellWallFacesPtr_()
|
||||||
{
|
{
|
||||||
@ -174,9 +171,7 @@ Foam::Cloud<ParticleType>::Cloud
|
|||||||
:
|
:
|
||||||
cloud(pMesh, cloudName),
|
cloud(pMesh, cloudName),
|
||||||
polyMesh_(pMesh),
|
polyMesh_(pMesh),
|
||||||
particleCount_(0),
|
|
||||||
labels_(),
|
labels_(),
|
||||||
cellTree_(),
|
|
||||||
nTrackingRescues_(),
|
nTrackingRescues_(),
|
||||||
cellWallFacesPtr_()
|
cellWallFacesPtr_()
|
||||||
{
|
{
|
||||||
@ -262,8 +257,7 @@ void Foam::Cloud<ParticleType>::writeFields() const
|
|||||||
{
|
{
|
||||||
if (this->size())
|
if (this->size())
|
||||||
{
|
{
|
||||||
const ParticleType& p = *this->first();
|
ParticleType::writeFields(*this);
|
||||||
ParticleType::writeFields(p.cloud());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -27,11 +27,8 @@ License
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class ParticleType>
|
template<class CloudType>
|
||||||
Foam::IOPosition<ParticleType>::IOPosition
|
Foam::IOPosition<CloudType>::IOPosition(const CloudType& c)
|
||||||
(
|
|
||||||
const Cloud<ParticleType>& c
|
|
||||||
)
|
|
||||||
:
|
:
|
||||||
regIOobject
|
regIOobject
|
||||||
(
|
(
|
||||||
@ -50,8 +47,8 @@ Foam::IOPosition<ParticleType>::IOPosition
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class ParticleType>
|
template<class CloudType>
|
||||||
bool Foam::IOPosition<ParticleType>::write() const
|
bool Foam::IOPosition<CloudType>::write() const
|
||||||
{
|
{
|
||||||
if (cloud_.size())
|
if (cloud_.size())
|
||||||
{
|
{
|
||||||
@ -64,19 +61,18 @@ bool Foam::IOPosition<ParticleType>::write() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class ParticleType>
|
template<class CloudType>
|
||||||
bool Foam::IOPosition<ParticleType>::writeData(Ostream& os) const
|
bool Foam::IOPosition<CloudType>::writeData(Ostream& os) const
|
||||||
{
|
{
|
||||||
os << cloud_.size() << nl << token::BEGIN_LIST << nl;
|
os << cloud_.size() << nl << token::BEGIN_LIST << nl;
|
||||||
|
|
||||||
forAllConstIter(typename Cloud<ParticleType>, cloud_, iter)
|
forAllConstIter(typename CloudType, cloud_, iter)
|
||||||
{
|
{
|
||||||
|
const typename CloudType::particleType& p = iter();
|
||||||
|
|
||||||
// Prevent writing additional fields
|
// Prevent writing additional fields
|
||||||
static_cast<const Particle<ParticleType>&>(iter()).write
|
p.write(os, false);
|
||||||
(
|
|
||||||
os,
|
|
||||||
false
|
|
||||||
);
|
|
||||||
os << nl;
|
os << nl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,13 +82,11 @@ bool Foam::IOPosition<ParticleType>::writeData(Ostream& os) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class ParticleType>
|
template<class CloudType>
|
||||||
void Foam::IOPosition<ParticleType>::readData
|
void Foam::IOPosition<CloudType>::readData(CloudType& c, bool checkClass)
|
||||||
(
|
|
||||||
Cloud<ParticleType>& c,
|
|
||||||
bool checkClass
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
|
const polyMesh& mesh = c.pMesh();
|
||||||
|
|
||||||
Istream& is = readStream(checkClass ? typeName : "");
|
Istream& is = readStream(checkClass ? typeName : "");
|
||||||
|
|
||||||
token firstToken(is);
|
token firstToken(is);
|
||||||
@ -102,16 +96,16 @@ void Foam::IOPosition<ParticleType>::readData
|
|||||||
label s = firstToken.labelToken();
|
label s = firstToken.labelToken();
|
||||||
|
|
||||||
// Read beginning of contents
|
// Read beginning of contents
|
||||||
is.readBeginList("Cloud<ParticleType>");
|
is.readBeginList("IOPosition<CloudType>::readData(CloudType, bool)");
|
||||||
|
|
||||||
for (label i=0; i<s; i++)
|
for (label i=0; i<s; i++)
|
||||||
{
|
{
|
||||||
// Do not read any fields, position only
|
// Do not read any fields, position only
|
||||||
c.append(new ParticleType(c, is, false));
|
c.append(new typename CloudType::particleType(mesh, is, false));
|
||||||
}
|
}
|
||||||
|
|
||||||
// Read end of contents
|
// Read end of contents
|
||||||
is.readEndList("Cloud<ParticleType>");
|
is.readEndList("IOPosition<CloudType>::readData(CloudType, bool)");
|
||||||
}
|
}
|
||||||
else if (firstToken.isPunctuation())
|
else if (firstToken.isPunctuation())
|
||||||
{
|
{
|
||||||
@ -119,12 +113,10 @@ void Foam::IOPosition<ParticleType>::readData
|
|||||||
{
|
{
|
||||||
FatalIOErrorIn
|
FatalIOErrorIn
|
||||||
(
|
(
|
||||||
"void IOPosition<ParticleType>::readData"
|
"void IOPosition<CloudType>::readData(CloudType&, bool)",
|
||||||
"(Cloud<ParticleType>&, bool)",
|
|
||||||
is
|
is
|
||||||
) << "incorrect first token, '(', found "
|
) << "incorrect first token, '(', found "
|
||||||
<< firstToken.info()
|
<< firstToken.info() << exit(FatalIOError);
|
||||||
<< exit(FatalIOError);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
token lastToken(is);
|
token lastToken(is);
|
||||||
@ -138,7 +130,7 @@ void Foam::IOPosition<ParticleType>::readData
|
|||||||
{
|
{
|
||||||
is.putBack(lastToken);
|
is.putBack(lastToken);
|
||||||
// Do not read any fields, position only
|
// Do not read any fields, position only
|
||||||
c.append(new ParticleType(c, is, false));
|
c.append(new typename CloudType::particleType(mesh, is, false));
|
||||||
is >> lastToken;
|
is >> lastToken;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -146,18 +138,16 @@ void Foam::IOPosition<ParticleType>::readData
|
|||||||
{
|
{
|
||||||
FatalIOErrorIn
|
FatalIOErrorIn
|
||||||
(
|
(
|
||||||
"void IOPosition<ParticleType>::readData"
|
"void IOPosition<ParticleType>::readData(CloudType&, bool)",
|
||||||
"(Cloud<ParticleType>&, bool)",
|
|
||||||
is
|
is
|
||||||
) << "incorrect first token, expected <int> or '(', found "
|
) << "incorrect first token, expected <int> or '(', found "
|
||||||
<< firstToken.info()
|
<< firstToken.info() << exit(FatalIOError);
|
||||||
<< exit(FatalIOError);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check state of IOstream
|
// Check state of IOstream
|
||||||
is.check
|
is.check
|
||||||
(
|
(
|
||||||
"void IOPosition<ParticleType>::readData(Cloud<ParticleType>&, bool)"
|
"void IOPosition<CloudType>::readData(CloudType&, bool)"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -46,7 +46,7 @@ namespace Foam
|
|||||||
Class IOPosition Declaration
|
Class IOPosition Declaration
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
template<class ParticleType>
|
template<class CloudType>
|
||||||
class IOPosition
|
class IOPosition
|
||||||
:
|
:
|
||||||
public regIOobject
|
public regIOobject
|
||||||
@ -55,7 +55,7 @@ class IOPosition
|
|||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- Reference to the cloud
|
//- Reference to the cloud
|
||||||
const Cloud<ParticleType>& cloud_;
|
const CloudType& cloud_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -65,19 +65,20 @@ public:
|
|||||||
//- Runtime type name information. Use cloud type.
|
//- Runtime type name information. Use cloud type.
|
||||||
virtual const word& type() const
|
virtual const word& type() const
|
||||||
{
|
{
|
||||||
return cloud_.type();
|
return Cloud<typename CloudType::particleType>::typeName;
|
||||||
|
//cloud_.type();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct from cloud
|
//- Construct from cloud
|
||||||
IOPosition(const Cloud<ParticleType>&);
|
IOPosition(const CloudType&);
|
||||||
|
|
||||||
|
|
||||||
// Member functions
|
// Member functions
|
||||||
|
|
||||||
virtual void readData(Cloud<ParticleType>& c, bool checkClass);
|
virtual void readData(CloudType& c, bool checkClass);
|
||||||
|
|
||||||
virtual bool write() const;
|
virtual bool write() const;
|
||||||
|
|
||||||
|
|||||||
@ -29,6 +29,7 @@ License
|
|||||||
#include "treeDataFace.H"
|
#include "treeDataFace.H"
|
||||||
#include "treeDataCell.H"
|
#include "treeDataCell.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
|
#include "meshTools.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -1237,7 +1238,7 @@ void Foam::InteractionLists<ParticleType>::receiveReferredData
|
|||||||
referredParticles_[constructMap[i]] = IDLList<ParticleType>
|
referredParticles_[constructMap[i]] = IDLList<ParticleType>
|
||||||
(
|
(
|
||||||
str,
|
str,
|
||||||
typename ParticleType::iNew(cloud_)
|
typename ParticleType::iNew(mesh_)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,7 @@
|
|||||||
passiveParticle = passiveParticle
|
particle/particle.C
|
||||||
indexedParticle = indexedParticle
|
particle/particleIO.C
|
||||||
|
passiveParticle/passiveParticleCloud.C
|
||||||
$(passiveParticle)/passiveParticleCloud.C
|
indexedParticle/indexedParticleCloud.C
|
||||||
$(indexedParticle)/indexedParticleCloud.C
|
|
||||||
|
|
||||||
InteractionLists/referredWallFace/referredWallFace.C
|
InteractionLists/referredWallFace/referredWallFace.C
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||||
|
|
||||||
LIB_LIBS = \
|
LIB_LIBS = \
|
||||||
-lmeshTools
|
-lmeshTools
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,18 +25,17 @@ Class
|
|||||||
Foam::indexedParticle
|
Foam::indexedParticle
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
Adds label index to base particle
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
indexedParticleI.H
|
indexedParticle.H
|
||||||
indexedParticle.C
|
|
||||||
indexedParticleIO.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef indexedParticle_H
|
#ifndef indexedParticle_H
|
||||||
#define indexedParticle_H
|
#define indexedParticle_H
|
||||||
|
|
||||||
#include "Particle.H"
|
#include "particle.H"
|
||||||
#include "IOstream.H"
|
#include "IOstream.H"
|
||||||
#include "autoPtr.H"
|
#include "autoPtr.H"
|
||||||
|
|
||||||
@ -51,7 +50,7 @@ namespace Foam
|
|||||||
|
|
||||||
class indexedParticle
|
class indexedParticle
|
||||||
:
|
:
|
||||||
public Particle<indexedParticle>
|
public particle
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
@ -65,7 +64,7 @@ public:
|
|||||||
//- Construct from components
|
//- Construct from components
|
||||||
indexedParticle
|
indexedParticle
|
||||||
(
|
(
|
||||||
const Cloud<indexedParticle>& c,
|
const polyMesh& mesh,
|
||||||
const vector& position,
|
const vector& position,
|
||||||
const label cellI,
|
const label cellI,
|
||||||
const label tetFaceI,
|
const label tetFaceI,
|
||||||
@ -73,47 +72,44 @@ public:
|
|||||||
const label index = 0
|
const label index = 0
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
Particle<indexedParticle>(c, position, cellI, tetFaceI, tetPtI),
|
particle(mesh, position, cellI, tetFaceI, tetPtI),
|
||||||
index_(index)
|
index_(index)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//- Construct from components, with searching for tetFace and tetPt
|
//- Construct from components, with searching for tetFace and tetPt
|
||||||
indexedParticle
|
indexedParticle
|
||||||
(
|
(
|
||||||
const Cloud<indexedParticle>& c,
|
const polyMesh& mesh,
|
||||||
const vector& position,
|
const vector& position,
|
||||||
const label cellI,
|
const label cellI,
|
||||||
const label index = 0
|
const label index = 0
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
Particle<indexedParticle>(c, position, cellI),
|
particle(mesh, position, cellI),
|
||||||
index_(index)
|
index_(index)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
indexedParticle
|
indexedParticle
|
||||||
(
|
(
|
||||||
const Cloud<indexedParticle>& c,
|
const polyMesh& mesh,
|
||||||
Istream& is,
|
Istream& is,
|
||||||
bool readFields = true
|
bool readFields = true
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
Particle<indexedParticle>(c, is, readFields)
|
particle(mesh, is, readFields)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//- Construct as a copy
|
//- Construct as a copy
|
||||||
indexedParticle(const indexedParticle& p)
|
indexedParticle(const indexedParticle& p)
|
||||||
:
|
:
|
||||||
Particle<indexedParticle>(p)
|
particle(p)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
virtual autoPtr<Particle<indexedParticle> > clone() const
|
virtual autoPtr<particle> clone() const
|
||||||
{
|
{
|
||||||
return autoPtr<Particle<indexedParticle> >
|
return autoPtr<particle>(new indexedParticle(*this));
|
||||||
(
|
|
||||||
new indexedParticle(*this)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -29,7 +29,6 @@ License
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineParticleTypeNameAndDebug(indexedParticle, 0);
|
|
||||||
defineTemplateTypeNameAndDebug(Cloud<indexedParticle>, 0);
|
defineTemplateTypeNameAndDebug(Cloud<indexedParticle>, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -25,15 +25,17 @@ Class
|
|||||||
Foam::passiveParticle
|
Foam::passiveParticle
|
||||||
|
|
||||||
Description
|
Description
|
||||||
|
Copy of base particle
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
|
passiveParticle.H
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef passiveParticle_H
|
#ifndef passiveParticle_H
|
||||||
#define passiveParticle_H
|
#define passiveParticle_H
|
||||||
|
|
||||||
#include "Particle.H"
|
#include "particle.H"
|
||||||
#include "IOstream.H"
|
#include "IOstream.H"
|
||||||
#include "autoPtr.H"
|
#include "autoPtr.H"
|
||||||
|
|
||||||
@ -48,7 +50,7 @@ namespace Foam
|
|||||||
|
|
||||||
class passiveParticle
|
class passiveParticle
|
||||||
:
|
:
|
||||||
public Particle<passiveParticle>
|
public particle
|
||||||
{
|
{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -58,53 +60,50 @@ public:
|
|||||||
//- Construct from components
|
//- Construct from components
|
||||||
passiveParticle
|
passiveParticle
|
||||||
(
|
(
|
||||||
const Cloud<passiveParticle>& c,
|
const polyMesh& mesh,
|
||||||
const vector& position,
|
const vector& position,
|
||||||
const label cellI,
|
const label cellI,
|
||||||
const label tetFaceI,
|
const label tetFaceI,
|
||||||
const label tetPtI
|
const label tetPtI
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
Particle<passiveParticle>(c, position, cellI, tetFaceI, tetPtI)
|
particle(mesh, position, cellI, tetFaceI, tetPtI)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//- Construct from components, with searching for tetFace and
|
//- Construct from components, with searching for tetFace and
|
||||||
// tetPt unless disabled by doCellFacePt = false.
|
// tetPt unless disabled by doCellFacePt = false.
|
||||||
passiveParticle
|
passiveParticle
|
||||||
(
|
(
|
||||||
const Cloud<passiveParticle>& c,
|
const polyMesh& mesh,
|
||||||
const vector& position,
|
const vector& position,
|
||||||
const label cellI,
|
const label cellI,
|
||||||
bool doCellFacePt = true
|
bool doCellFacePt = true
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
Particle<passiveParticle>(c, position, cellI, doCellFacePt)
|
particle(mesh, position, cellI, doCellFacePt)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
passiveParticle
|
passiveParticle
|
||||||
(
|
(
|
||||||
const Cloud<passiveParticle>& c,
|
const polyMesh& mesh,
|
||||||
Istream& is,
|
Istream& is,
|
||||||
bool readFields = true
|
bool readFields = true
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
Particle<passiveParticle>(c, is, readFields)
|
particle(mesh, is, readFields)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//- Construct as copy
|
//- Construct as copy
|
||||||
passiveParticle(const passiveParticle& p)
|
passiveParticle(const passiveParticle& p)
|
||||||
:
|
:
|
||||||
Particle<passiveParticle>(p)
|
particle(p)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
virtual autoPtr<Particle<passiveParticle> > clone() const
|
virtual autoPtr<particle> clone() const
|
||||||
{
|
{
|
||||||
return autoPtr<Particle<passiveParticle> >
|
return autoPtr<particle>(new passiveParticle(*this));
|
||||||
(
|
|
||||||
new passiveParticle(*this)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -29,7 +29,6 @@ License
|
|||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
defineParticleTypeNameAndDebug(passiveParticle, 0);
|
|
||||||
defineTemplateTypeNameAndDebug(Cloud<passiveParticle>, 0);
|
defineTemplateTypeNameAndDebug(Cloud<passiveParticle>, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2004-2010 OpenCFD Ltd.
|
\\ / A nd | Copyright (C) 2004-2011 OpenCFD Ltd.
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -62,9 +62,6 @@ class passiveParticleCloud
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Type of parcel the cloud was instantiated for
|
|
||||||
typedef passiveParticle parcelType;
|
|
||||||
|
|
||||||
// Constructors
|
// Constructors
|
||||||
|
|
||||||
//- Construct given mesh
|
//- Construct given mesh
|
||||||
|
|||||||
Reference in New Issue
Block a user