Go to the documentation of this file.
37 const trackingData& td,
38 const point& position,
49 sampledScalars_.setSize(td.vsInterp_.size());
50 forAll(td.vsInterp_, scalari)
52 sampledScalars_[scalari].append
54 td.vsInterp_[scalari].interpolate
63 sampledVectors_.setSize(td.vvInterp_.size());
64 forAll(td.vvInterp_, vectori)
66 sampledVectors_[vectori].append
68 td.vvInterp_[vectori].interpolate
77 const DynamicList<vector>&
U = sampledVectors_[td.UIndex_];
90 const bool trackForward,
95 trackForward_(trackForward),
115 is >> trackForward_ >> lifeTime_
116 >> sampledPositions_ >> sampledScalars
119 sampledScalars_.
setSize(sampledScalars.size());
122 sampledScalars_[i].transfer(sampledScalars[i]);
124 sampledVectors_.setSize(sampledVectors.size());
127 sampledVectors_[i].transfer(sampledVectors[i]);
141 trackForward_(
p.trackForward_),
142 lifeTime_(
p.lifeTime_),
143 sampledPositions_(
p.sampledPositions_),
144 sampledScalars_(
p.sampledScalars_),
145 sampledVectors_(
p.sampledVectors_)
175 sampledPositions_.append(position());
183 scalar magU =
mag(
U);
199 else if (subIter == 0)
212 trackToAndHitFace(dt*
U, 0,
cloud, td);
234 Pout<<
"streamLineParticle: Removing stagnant particle:"
235 << position() <<
" sampled positions:"
236 << sampledPositions_.
size() <<
endl;
243 sampledPositions_.append(position());
244 interpolateFields(td, position(),
cell(),
face());
248 Pout<<
"streamLineParticle: Removing particle:" << position()
249 <<
" sampled positions:" << sampledPositions_.
size()
259 forAll(sampledScalars_, i)
265 forAll(sampledVectors_, i)
376 const bool valid =
c.size();
385 c.checkFieldIOobject(
c, lifeTime);
392 c.checkFieldIOobject(
c, sampledPositions);
397 p.lifeTime_ = lifeTime[i];
398 p.sampledPositions_.transfer(sampledPositions[i]);
408 const label np =
c.size();
424 lifeTime[i] =
p.lifeTime_;
425 sampledPositions[i] =
p.sampledPositions_;
429 lifeTime.write(np > 0);
430 sampledPositions.write(np > 0);
438 os << static_cast<const particle&>(
p)
streamLineParticle(const polyMesh &c, const vector &position, const label celli, const bool trackForward, const label lifeTime)
Construct from components.
int debug
Static debugging option.
List< scalar > scalarList
A List of scalars.
void hitSymmetryPatch(streamLineParticleCloud &, trackingData &)
Overridable function to handle the particle hitting a.
scalar mag() const
The magnitude of the bounding box span.
void hitProcessorPatch(streamLineParticleCloud &, trackingData &)
A primitive field of type <T> with automated input and output.
A Cloud of streamLine particles.
Particle class that samples fields as it passes through. Used in streamline calculation.
scalar stepFraction() const
Return the fraction of time-step completed.
static constexpr direction size()
Return the number of elements in the VectorSpace = Ncmpts.
static void readFields(TrackCloudType &c)
Read the fields associated with the owner cloud.
static void writeFields(const Cloud< streamLineParticle > &)
Write.
static void writeFields(const TrackCloudType &c)
Write the fields associated with the owner cloud.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void hitCyclicACMIPatch(streamLineParticleCloud &, trackingData &, const vector &direction)
Overridable function to handle the particle hitting a.
void hitWedgePatch(streamLineParticleCloud &, trackingData &)
Overridable function to handle the particle hitting a wedge.
List< DynamicList< scalarList > > & allScalars_
prefixOSstream Pout
An Ostream wrapper for parallel output to std::cout.
DynamicList< vectorList > & allPositions_
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
const scalar trackLength_
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
bool move(streamLineParticleCloud &, trackingData &, const scalar)
Track all particles to their end point.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
void transfer(List< T > &list)
vector position() const
Return current particle position.
bool keepParticle
Flag to indicate whether to keep particle (false = delete)
bool switchProcessor
Flag to switch processor.
List< DynamicList< vectorList > > & allVectors_
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
void hitWallPatch(streamLineParticleCloud &, trackingData &)
Overridable function to handle the particle hitting a wallPatch.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
void hitSymmetryPlanePatch(streamLineParticleCloud &, trackingData &)
Overridable function to handle the particle hitting a.
errorManip< error > abort(error &err)
void hitCyclicAMIPatch(streamLineParticleCloud &, trackingData &, const vector &direction)
Overridable function to handle the particle hitting a.
scalar trackToFace(const vector &displacement, const scalar fraction)
As particle::track, but also stops on internal faces.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
const boundBox & bounds() const
Return mesh bounding box.
A cloud is a registry collection of lagrangian particles.
bool hitPatch(streamLineParticleCloud &, trackingData &)
Overridable function to handle the particle hitting a patch.
List< vector > vectorList
A List of vectors.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
void hitCyclicPatch(streamLineParticleCloud &, trackingData &)
Overridable function to handle the particle hitting a cyclic.
const dimensionedScalar c
Speed of light in a vacuum.
A face is a list of labels corresponding to mesh vertices.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
vector point
Point is a vector.
void setSize(const label newSize)
Alias for resize(const label)
A cell is defined as a list of faces with extra functionality.
Ostream & operator<<(Ostream &, const boundaryPatch &)
static void readFields(Cloud< streamLineParticle > &)
Read.