ENH: minor update of particle methods

This commit is contained in:
Mark Olesen
2022-07-04 15:43:02 +02:00
parent b4a482751b
commit 71246b94b7
21 changed files with 206 additions and 524 deletions

View File

@ -34,8 +34,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef DTRMParticle_H
#define DTRMParticle_H
#ifndef Foam_DTRMParticle_H
#define Foam_DTRMParticle_H
#include "particle.H"
#include "IOstream.H"
@ -50,12 +50,13 @@ SourceFiles
namespace Foam
{
// Forward Declarations
class DTRMParticle;
using namespace Foam::radiation;
// Forward declaration of friend functions
Ostream& operator<<(Ostream&, const DTRMParticle&);
using namespace Foam::radiation;
/*---------------------------------------------------------------------------*\
Class DTRMParticle Declaration
\*---------------------------------------------------------------------------*/
@ -130,7 +131,7 @@ public:
);
// Member functions
// Member Functions
inline const interpolationCell<scalar>& aInterp() const;
inline const interpolationCell<scalar>& eInterp() const;
@ -232,37 +233,34 @@ public:
// Access
//- Return const access to the initial position
inline const point& p0() const;
const point& p0() const noexcept { return p0_; }
//- Return const access to the target position
inline const point& p1() const;
const point& p1() const noexcept { return p1_; }
//- Return const access to the initial intensity
inline scalar I0() const;
scalar I0() const noexcept { return I0_; }
//- Return const access to the current intensity
inline scalar I() const;
scalar I() const noexcept { return I_; }
//- Return const access dA
inline scalar dA() const;
scalar dA() const noexcept { return dA_; }
// Edit
//- Return access to the target position
inline point& p1();
point& p1() noexcept { return p1_; }
//- Return access to the initial intensity
inline scalar& I0();
scalar& I0() noexcept { return I0_; }
//- Return access to the current intensity
inline scalar& I();
scalar& I() noexcept { return I_; }
//- Return access to dA
inline scalar& dA();
//- Return access to reflectedId
inline label& reflectedId();
scalar& dA() noexcept { return dA_; }
// Tracking

View File

@ -107,58 +107,4 @@ inline Foam::scalar& Foam::DTRMParticle::trackingData::Q(label celli)
}
inline const Foam::point& Foam::DTRMParticle::p0() const
{
return p0_;
}
inline const Foam::point& Foam::DTRMParticle::p1() const
{
return p1_;
}
inline Foam::scalar Foam::DTRMParticle::I0() const
{
return I0_;
}
inline Foam::scalar Foam::DTRMParticle::I() const
{
return I_;
}
inline Foam::scalar Foam::DTRMParticle::dA() const
{
return dA_;
}
inline Foam::scalar& Foam::DTRMParticle::dA()
{
return dA_;
}
inline Foam::point& Foam::DTRMParticle::p1()
{
return p1_;
}
inline Foam::scalar& Foam::DTRMParticle::I0()
{
return I0_;
}
inline Foam::scalar& Foam::DTRMParticle::I()
{
return I_;
}
// ************************************************************************* //

View File

@ -35,8 +35,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef passivePositionParticle_H
#define passivePositionParticle_H
#ifndef Foam_passivePositionParticle_H
#define Foam_passivePositionParticle_H
#include "passiveParticle.H"
@ -130,7 +130,9 @@ public:
};
const point& cachedPosition() const
// Member Functions
const point& cachedPosition() const noexcept
{
return cachedPosition_;
}

View File

@ -37,8 +37,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef functionObjects_eulerianParticle_H
#define functionObjects_eulerianParticle_H
#ifndef Foam_functionObjects_eulerianParticle_H
#define Foam_functionObjects_eulerianParticle_H
#include "label.H"
#include "scalar.H"
@ -49,7 +49,7 @@ SourceFiles
namespace Foam
{
// Forward declaration of classes
// Forward Declarations
class Istream;
class Ostream;
@ -71,10 +71,9 @@ namespace functionObjects
class eulerianParticle
{
public:
// Public data
// Public Data
//- Index of face in faceZone that this particle hits. Also used to
// identify the index of the coarse face of the surface agglomeration
@ -95,7 +94,7 @@ public:
scalar time;
//- Constructor
//- Default construct
eulerianParticle();

View File

@ -35,8 +35,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef findCellParticle_H
#define findCellParticle_H
#ifndef Foam_findCellParticle_H
#define Foam_findCellParticle_H
#include "particle.H"
#include "autoPtr.H"
@ -102,17 +102,11 @@ public:
{}
// Member functions
// Member Functions
labelListList& cellToData()
{
return cellToData_;
}
labelListList& cellToData() noexcept { return cellToData_; }
List<List<point>>& cellToEnd()
{
return cellToEnd_;
}
List<List<point>>& cellToEnd() noexcept { return cellToEnd_; }
};
@ -130,8 +124,8 @@ public:
const label data
);
//- Construct from a position and a cell, searching for the rest of the
// required topology
//- Construct from a position and a cell,
//- searching for the rest of the required topology
findCellParticle
(
const polyMesh& mesh,
@ -182,40 +176,22 @@ public:
// Member Functions
//- Point to track from
const point& start() const
{
return start_;
}
const point& start() const noexcept { return start_; }
//- Point to track from
point& start()
{
return start_;
}
point& start() noexcept { return start_; }
//- Point to track to
const point& end() const
{
return end_;
}
const point& end() const noexcept { return end_; }
//- Point to track to
point& end()
{
return end_;
}
point& end() noexcept { return end_; }
//- Transported label
label data() const
{
return data_;
}
label data() const noexcept { return data_; }
//- Transported label
label& data()
{
return data_;
}
label& data() noexcept { return data_; }
// Tracking

View File

@ -35,8 +35,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef streamLineParticle_H
#define streamLineParticle_H
#ifndef Foam_streamLineParticle_H
#define Foam_streamLineParticle_H
#include "particle.H"
#include "autoPtr.H"
@ -48,8 +48,7 @@ SourceFiles
namespace Foam
{
// Forward declaration of friend functions and operators
// Forward Declarations
class streamLineParticle;
class streamLineParticleCloud;

View File

@ -37,8 +37,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef wallBoundedParticle_H
#define wallBoundedParticle_H
#ifndef Foam_wallBoundedParticle_H
#define Foam_wallBoundedParticle_H
#include "particle.H"
#include "autoPtr.H"
@ -49,8 +49,7 @@ SourceFiles
namespace Foam
{
// Forward declaration of friend functions and operators
// Forward Declarations
class wallBoundedParticle;
Ostream& operator<<(Ostream&, const wallBoundedParticle&);
@ -72,15 +71,14 @@ public:
:
public particle::trackingData
{
public:
const bitSet& isWallPatch_;
// Constructors
template <class TrackCloudType>
inline trackingData
template<class TrackCloudType>
trackingData
(
const TrackCloudType& cloud,
const bitSet& isWallPatch
@ -94,7 +92,7 @@ public:
protected:
// Protected data
// Protected Data
//- Particle position is updated locally as opposed to via track
// functions of the base Foam::particle class
@ -214,17 +212,11 @@ public:
// Access
//- -1 or label of mesh edge
inline label meshEdgeStart() const
{
return meshEdgeStart_;
}
//- The mesh edge label or -1
label meshEdgeStart() const noexcept { return meshEdgeStart_; }
//- -1 or diagonal edge
inline label diagEdge() const
{
return diagEdge_;
}
//- The diagonal edge label or -1
label diagEdge() const noexcept { return diagEdge_; }
// Track

View File

@ -36,8 +36,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef wallBoundedStreamLineParticle_H
#define wallBoundedStreamLineParticle_H
#ifndef Foam_wallBoundedStreamLineParticle_H
#define Foam_wallBoundedStreamLineParticle_H
#include "wallBoundedParticle.H"
#include "autoPtr.H"
@ -50,12 +50,9 @@ SourceFiles
namespace Foam
{
class wallBoundedStreamLineParticleCloud;
// Forward declaration of friend functions and operators
// Forward Declarations
class wallBoundedStreamLineParticle;
class wallBoundedStreamLineParticleCloud;
Ostream& operator<<(Ostream&, const wallBoundedStreamLineParticle&);
@ -68,7 +65,6 @@ class wallBoundedStreamLineParticle
:
public wallBoundedParticle
{
public:
//- Class used to pass tracking data to the trackToEdge function
@ -76,10 +72,8 @@ public:
:
public wallBoundedParticle::trackingData
{
public:
const PtrList<interpolation<scalar>>& vsInterp_;
const PtrList<interpolation<vector>>& vvInterp_;
const label UIndex_;
@ -92,7 +86,7 @@ public:
// Constructors
template <class TrackCloudType>
template<class TrackCloudType>
trackingData
(
TrackCloudType& cloud,
@ -107,11 +101,7 @@ public:
List<DynamicList<vectorList>>& allVectors
)
:
wallBoundedParticle::trackingData
(
cloud,
isWallPatch
),
wallBoundedParticle::trackingData(cloud, isWallPatch),
vsInterp_(vsInterp),
vvInterp_(vvInterp),
UIndex_(UIndex),
@ -128,7 +118,7 @@ public:
protected:
// Protected data
// Protected Data
//- Track with +U or -U
bool trackForward_;

View File

@ -84,7 +84,7 @@ Foam::Cloud<ParticleType>::Cloud
geometryType_(cloud::geometryType::COORDINATES)
{
checkPatches();
polyMesh_.oldCellCentres();
(void)polyMesh_.oldCellCentres();
// Ask for the tetBasePtIs to trigger all processors to build
// them, otherwise, if some processors have no particles then
@ -322,8 +322,8 @@ void Foam::Cloud<ParticleType>::autoMap(const mapPolyMesh& mapper)
// Ask for the tetBasePtIs to trigger all processors to build
// them, otherwise, if some processors have no particles then
// there is a comms mismatch.
polyMesh_.tetBasePtIs();
polyMesh_.oldCellCentres();
(void)polyMesh_.tetBasePtIs();
(void)polyMesh_.oldCellCentres();
const vectorField& positions = globalPositionsPtr_();

View File

@ -155,7 +155,7 @@ void Foam::Cloud<ParticleType>::initCloud(const bool checkClass)
// Ask for the tetBasePtIs to trigger all processors to build
// them, otherwise, if some processors have no particles then
// there is a comms mismatch.
polyMesh_.tetBasePtIs();
(void)polyMesh_.tetBasePtIs();
}
@ -177,8 +177,8 @@ Foam::Cloud<ParticleType>::Cloud
{
checkPatches();
polyMesh_.tetBasePtIs();
polyMesh_.oldCellCentres();
(void)polyMesh_.tetBasePtIs();
(void)polyMesh_.oldCellCentres();
initCloud(checkClass);
}

View File

@ -35,8 +35,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef indexedParticle_H
#define indexedParticle_H
#ifndef Foam_indexedParticle_H
#define Foam_indexedParticle_H
#include "particle.H"
#include "IOstream.H"
@ -55,7 +55,7 @@ class indexedParticle
:
public particle
{
// Private data
// Private Data
label index_;
@ -121,15 +121,9 @@ public:
// Member Functions
label index() const
{
return index_;
}
label index() const noexcept { return index_; }
label& index()
{
return index_;
}
label& index() noexcept { return index_; }
};

View File

@ -41,8 +41,8 @@ SeeAlso
\*---------------------------------------------------------------------------*/
#ifndef injectedParticle_H
#define injectedParticle_H
#ifndef Foam_injectedParticle_H
#define Foam_injectedParticle_H
#include "particle.H"
#include "IOstream.H"
@ -53,7 +53,7 @@ SeeAlso
namespace Foam
{
// Forward declarations
// Forward Declarations
class injectedParticle;
Ostream& operator<<(Ostream&, const injectedParticle&);
@ -67,7 +67,7 @@ class injectedParticle
{
protected:
// Protected data
// Protected Data
// Particle properties
@ -187,31 +187,31 @@ public:
// Access
//- Return const access to the tag
inline label tag() const;
label tag() const noexcept { return tag_; }
//- Return const access to the start of injection
inline scalar soi() const;
scalar soi() const noexcept { return soi_; }
//- Return const access to diameter
inline scalar d() const;
scalar d() const noexcept { return d_; }
//- Return const access to velocity
inline const vector& U() const;
const vector& U() const noexcept { return U_; }
// Edit
//- Return the tag
inline label& tag();
label& tag() noexcept { return tag_; }
//- Return the start of injection
inline scalar& soi();
scalar& soi() noexcept { return soi_; }
//- Return access to diameter
inline scalar& d();
scalar& d() noexcept { return d_; }
//- Return access to velocity
inline vector& U();
vector& U() noexcept { return U_; }
// I-O

View File

@ -25,7 +25,6 @@ License
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
inline Foam::injectedParticle::injectedParticle
@ -64,52 +63,4 @@ inline Foam::injectedParticle::injectedParticle
{}
inline Foam::label Foam::injectedParticle::tag() const
{
return tag_;
}
inline Foam::scalar Foam::injectedParticle::soi() const
{
return soi_;
}
inline Foam::scalar Foam::injectedParticle::d() const
{
return d_;
}
inline const Foam::vector& Foam::injectedParticle::U() const
{
return U_;
}
inline Foam::label& Foam::injectedParticle::tag()
{
return tag_;
}
inline Foam::scalar& Foam::injectedParticle::soi()
{
return soi_;
}
inline Foam::scalar& Foam::injectedParticle::d()
{
return d_;
}
inline Foam::vector& Foam::injectedParticle::U()
{
return U_;
}
// ************************************************************************* //

View File

@ -276,10 +276,9 @@ void Foam::particle::changeFace(const label tetTriI)
// Find the face in the same cell that shares the edge, and the
// corresponding tetrahedra point
tetPti_ = -1;
forAll(mesh_.cells()[celli_], cellFaceI)
for (const label newFaceI : mesh_.cells()[celli_])
{
const label newFaceI = mesh_.cells()[celli_][cellFaceI];
const class face& newFace = mesh_.faces()[newFaceI];
const Foam::face& newFace = mesh_.faces()[newFaceI];
const label newOwner = mesh_.faceOwner()[newFaceI];
// Exclude the current face
@ -374,10 +373,9 @@ void Foam::particle::changeToMasterPatch()
{
label thisPatch = patch();
forAll(mesh_.cells()[celli_], cellFaceI)
for (const label otherFaceI : mesh_.cells()[celli_])
{
// Skip the current face and any internal faces
const label otherFaceI = mesh_.cells()[celli_][cellFaceI];
if (facei_ == otherFaceI || mesh_.isInternalFace(otherFaceI))
{
continue;
@ -386,8 +384,8 @@ void Foam::particle::changeToMasterPatch()
// Compare the two faces. If they are the same, chose the one with the
// lower patch index. In the case of an ACMI-wall pair, this will be
// the ACMI, which is what we want.
const class face& thisFace = mesh_.faces()[facei_];
const class face& otherFace = mesh_.faces()[otherFaceI];
const Foam::face& thisFace = mesh_.faces()[facei_];
const Foam::face& otherFace = mesh_.faces()[otherFaceI];
if (face::compare(thisFace, otherFace) != 0)
{
const label otherPatch =
@ -442,12 +440,12 @@ void Foam::particle::locate
// Loop all cell tets to find the one containing the position. Track
// through each tet from the cell centre. If a tet contains the position
// then the track will end with a single trackToTri.
const class cell& c = mesh_.cells()[celli_];
const Foam::cell& c = mesh_.cells()[celli_];
scalar minF = VGREAT;
label minTetFacei = -1, minTetPti = -1;
forAll(c, cellTetFacei)
{
const class face& f = mesh_.faces()[c[cellTetFacei]];
const Foam::face& f = mesh_.faces()[c[cellTetFacei]];
for (label tetPti = 1; tetPti < f.size() - 1; ++tetPti)
{
coordinates_ = barycentric(1, 0, 0, 0);
@ -735,10 +733,7 @@ Foam::scalar Foam::particle::trackToStationaryTri
if (debug)
{
vector o, b, v1, v2;
stationaryTetGeometry(o, b, v1, v2);
Pout<< "Tet points o=" << o << ", b=" << b
<< ", v1=" << v1 << ", v2=" << v2 << endl
Pout<< "Tet points: " << currentTetIndices().tet(mesh_) << endl
<< "Tet determinant = " << detA << endl
<< "Start local coordinates = " << y0 << endl;
}

View File

@ -106,7 +106,7 @@ public:
// Constructor
template <class TrackCloudType>
template<class TrackCloudType>
trackingData(const TrackCloudType& cloud)
{}
};
@ -177,15 +177,6 @@ private:
// Tetrahedra functions
//- Get the vertices of the current tet
inline void stationaryTetGeometry
(
vector& centre,
vector& base,
vector& vertex1,
vector& vertex2
) const;
//- Get the transformation associated with the current tet. This
// will convert a barycentric position within the tet to a
// Cartesian position in the global coordinate system. The
@ -292,7 +283,7 @@ private:
protected:
// Patch interactions
// Patch Interactions
//- Read particle from stream. Optionally (for old format) return
// read position. Used by construct-from-Istream

View File

@ -31,31 +31,11 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
void Foam::particle::stationaryTetGeometry
(
vector& centre,
vector& base,
vector& vertex1,
vector& vertex2
) const
{
const triFace triIs(currentTetIndices().faceTriIs(mesh_));
const vectorField& ccs = mesh_.cellCentres();
const pointField& pts = mesh_.points();
centre = ccs[celli_];
base = pts[triIs[0]];
vertex1 = pts[triIs[1]];
vertex2 = pts[triIs[2]];
}
inline Foam::barycentricTensor Foam::particle::stationaryTetTransform() const
{
vector centre, base, vertex1, vertex2;
stationaryTetGeometry(centre, base, vertex1, vertex2);
const tetPointRef tet = currentTetIndices().tet(mesh_);
return barycentricTensor(centre, base, vertex1, vertex2);
return barycentricTensor(tet.a(), tet.b(), tet.c(), tet.d());
}
@ -247,10 +227,8 @@ inline Foam::Pair<Foam::scalar> Foam::particle::stepFractionSpan() const
return Pair<scalar>(tFrac, dtFrac);
}
else
{
return Pair<scalar>(0, 1);
}
}
@ -274,10 +252,8 @@ inline Foam::barycentricTensor Foam::particle::currentTetTransform() const
{
return movingTetTransform(0)[0];
}
else
{
return stationaryTetTransform();
}
}
@ -354,10 +330,7 @@ void Foam::particle::patchData(vector& n, vector& U) const
}
else
{
vector centre, base, vertex1, vertex2;
stationaryTetGeometry(centre, base, vertex1, vertex2);
n = triPointRef(base, vertex1, vertex2).unitNormal();
n = currentTetIndices().faceTri(mesh_).unitNormal();
U = Zero;
}

View File

@ -35,8 +35,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef passiveParticle_H
#define passiveParticle_H
#ifndef Foam_passiveParticle_H
#define Foam_passiveParticle_H
#include "particle.H"
#include "IOstream.H"
@ -55,7 +55,6 @@ class passiveParticle
:
public particle
{
public:
// Constructors

View File

@ -38,8 +38,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef solidParticle_H
#define solidParticle_H
#ifndef Foam_solidParticle_H
#define Foam_solidParticle_H
#include "particle.H"
#include "IOstream.H"
@ -53,12 +53,11 @@ namespace Foam
{
// Forward Declarations
class solidParticleCloud;
class solidParticle;
class solidParticleCloud;
Ostream& operator<<(Ostream&, const solidParticle&);
/*---------------------------------------------------------------------------*\
Class solidParticle Declaration
\*---------------------------------------------------------------------------*/
@ -99,25 +98,41 @@ public:
// Constructors
inline trackingData
trackingData
(
const solidParticleCloud& spc,
const solidParticleCloud& cld,
const interpolationCellPoint<scalar>& rhoInterp,
const interpolationCellPoint<vector>& UInterp,
const interpolationCellPoint<scalar>& nuInterp,
const vector& g
);
)
:
particle::trackingData(cld),
rhoInterp_(rhoInterp),
UInterp_(UInterp),
nuInterp_(nuInterp),
g_(g)
{}
// Member functions
// Member Functions
inline const interpolationCellPoint<scalar>& rhoInterp() const;
const interpolationCellPoint<scalar>& nuInterp() const noexcept
{
return nuInterp_;
}
inline const interpolationCellPoint<vector>& UInterp() const;
const interpolationCellPoint<vector>& UInterp() const noexcept
{
return UInterp_;
}
inline const interpolationCellPoint<scalar>& nuInterp() const;
const interpolationCellPoint<scalar>& rhoInterp() const noexcept
{
return rhoInterp_;
}
inline const vector& g() const;
const vector& g() const noexcept { return g_; }
};
@ -132,15 +147,20 @@ public:
//- Construct from a position and a cell
// Searches for the rest of the required topology.
// Other properties are zero initialised.
inline solidParticle
solidParticle
(
const polyMesh& mesh,
const vector& position,
const label celli = -1
);
)
:
particle(mesh, position, celli),
d_(0),
U_(Zero)
{}
//- Construct from components
inline solidParticle
solidParticle
(
const polyMesh& mesh,
const barycentric& coordinates,
@ -149,7 +169,12 @@ public:
const label tetPti,
const scalar d,
const vector& U
);
)
:
particle(mesh, coordinates, celli, tetFacei, tetPti),
d_(d),
U_(U)
{}
//- Construct from Istream
solidParticle
@ -190,10 +215,10 @@ public:
// Access
//- Return diameter
inline scalar d() const;
scalar d() const noexcept { return d_; }
//- Return velocity
inline const vector& U() const;
const vector& U() const noexcept { return U_; }
// Tracking
@ -249,10 +274,6 @@ template<> struct is_contiguous<solidParticle> : std::true_type {};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "solidParticleI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -1,118 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
inline Foam::solidParticle::trackingData::trackingData
(
const solidParticleCloud& spc,
const interpolationCellPoint<scalar>& rhoInterp,
const interpolationCellPoint<vector>& UInterp,
const interpolationCellPoint<scalar>& nuInterp,
const vector& g
)
:
particle::trackingData(spc),
rhoInterp_(rhoInterp),
UInterp_(UInterp),
nuInterp_(nuInterp),
g_(g)
{}
inline Foam::solidParticle::solidParticle
(
const polyMesh& mesh,
const vector& position,
const label celli
)
:
particle(mesh, position, celli),
d_(0),
U_(Zero)
{}
inline Foam::solidParticle::solidParticle
(
const polyMesh& mesh,
const barycentric& coordinates,
const label celli,
const label tetFacei,
const label tetPti,
const scalar d,
const vector& U
)
:
particle(mesh, coordinates, celli, tetFacei, tetPti),
d_(d),
U_(U)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
inline const Foam::interpolationCellPoint<Foam::scalar>&
Foam::solidParticle::trackingData::rhoInterp() const
{
return rhoInterp_;
}
inline const Foam::interpolationCellPoint<Foam::vector>&
Foam::solidParticle::trackingData::UInterp() const
{
return UInterp_;
}
inline const Foam::interpolationCellPoint<Foam::scalar>&
Foam::solidParticle::trackingData::nuInterp() const
{
return nuInterp_;
}
inline const Foam::vector& Foam::solidParticle::trackingData::g() const
{
return g_;
}
inline Foam::scalar Foam::solidParticle::d() const
{
return d_;
}
inline const Foam::vector& Foam::solidParticle::U() const
{
return U_;
}
// ************************************************************************* //

View File

@ -36,8 +36,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef trackedParticle_H
#define trackedParticle_H
#ifndef Foam_trackedParticle_H
#define Foam_trackedParticle_H
#include "bitSet.H"
#include "particle.H"
@ -64,7 +64,7 @@ class trackedParticle
:
public particle
{
// Private data
// Private Data
//- Start point to track from
point start_;
@ -141,8 +141,8 @@ public:
const label k
);
//- Construct from a position and a cell, searching for the rest of the
// required topology
//- Construct from a position and a cell,
//- searching for the rest of the required topology
trackedParticle
(
const polyMesh& mesh,
@ -193,52 +193,28 @@ public:
// Member Functions
//- Point to track from
point& start()
{
return start_;
}
point& start() noexcept { return start_; }
//- Point to track to
point& end()
{
return end_;
}
point& end() noexcept { return end_; }
//- Transported label
label i() const
{
return i_;
}
label i() const noexcept { return i_; }
//- Transported label
label& i()
{
return i_;
}
label& i() noexcept { return i_; }
//- Transported label
label j() const
{
return j_;
}
label j() const noexcept { return j_; }
//- Transported label
label& j()
{
return j_;
}
label& j() noexcept { return j_; }
//- Transported label
label k() const
{
return k_;
}
label k() const noexcept { return k_; }
//- Transported label
label& k()
{
return k_;
}
label& k() noexcept { return k_; }

View File

@ -38,8 +38,8 @@ SourceFiles
\*---------------------------------------------------------------------------*/
#ifndef passivePositionParticle_H
#define passivePositionParticle_H
#ifndef Foam_passivePositionParticle_H
#define Foam_passivePositionParticle_H
#include "particle.H"
#include "IOstream.H"
@ -82,7 +82,6 @@ public:
location_(position())
{}
//- Construct from components (supplied location)
passivePositionParticle
(
@ -98,7 +97,6 @@ public:
location_(position)
{}
//- Construct from Istream
passivePositionParticle
(
@ -165,16 +163,16 @@ public:
// Member Functions
//- Return current particle position
inline const point& location() const
//- The cached particle position
const point& location() const noexcept
{
return location_;
}
//- Write the particle position and cell id
// Uses cached location() instead of calculated position()
virtual void writePosition(Ostream& os) const
{
// Use cached location() instead of calculated position()
if (os.format() == IOstream::ASCII)
{
os << location() << token::SPACE << cell();