34 const trackingData& td,
35 const point& position,
46 sampledScalars_.setSize(td.vsInterp_.size());
47 forAll(td.vsInterp_, scalarI)
49 sampledScalars_[scalarI].append
51 td.vsInterp_[scalarI].interpolate
60 sampledVectors_.setSize(td.vvInterp_.size());
61 forAll(td.vvInterp_, vectorI)
63 sampledVectors_[vectorI].append
65 td.vvInterp_[vectorI].interpolate
74 const DynamicList<vector>& U = sampledVectors_[td.UIndex_];
109 is >> lifeTime_ >> sampledPositions_ >> sampledScalars
112 sampledScalars_.setSize(sampledScalars.
size());
115 sampledScalars_[i].transfer(sampledScalars[i]);
117 sampledVectors_.setSize(sampledVectors.size());
120 sampledVectors_[i].transfer(sampledVectors[i]);
127 "streamLineParticle::streamLineParticle" 128 "(const Cloud<streamLineParticle>&, Istream&, bool)" 139 lifeTime_(p.lifeTime_),
140 sampledPositions_(p.sampledPositions_),
141 sampledScalars_(p.sampledScalars_)
171 sampledPositions_.append(
position());
179 scalar magU =
mag(U);
195 else if (subIter == 0)
230 Pout<<
"streamLineParticle: Removing stagnant particle:" 231 <<
position() <<
" sampled positions:" 232 << sampledPositions_.size() <<
endl;
239 sampledPositions_.append(
position());
244 Pout<<
"streamLineParticle: Removing particle:" <<
position()
245 <<
" sampled positions:" << sampledPositions_.size()
255 forAll(sampledScalars_, i)
261 forAll(sampledVectors_, i)
391 bool valid = c.
size();
412 iter().lifeTime_ = lifeTime[i];
413 iter().sampledPositions_.transfer(sampledPositions[i]);
439 lifeTime[i] = iter().lifeTime_;
440 sampledPositions[i] = iter().sampledPositions_;
444 lifeTime.
write(np > 0);
445 sampledPositions.write(np > 0);
453 os << static_cast<const particle&>(
p)
460 os.
check(
"Ostream& operator<<(Ostream&, const streamLineParticle&)");
const scalar trackLength_
void hitProcessorPatch(streamLineParticleCloud &, trackingData &)
static void writeFields(const Cloud< streamLineParticle > &)
Write.
const polyMesh & mesh() const
Return the mesh database.
#define forAll(list, i)
Loop across all elements in list.
List< DynamicList< vectorList > > & allVectors_
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void hitWedgePatch(streamLineParticleCloud &, trackingData &)
Overridable function to handle the particle hitting a wedge.
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
#define forAllIter(Container, container, iter)
Iterate across all elements in the container object of type.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
scalar trackToFace(const vector &displacement, const scalar fraction)
As particle::track, but stops when a face is hit.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
scalar trackToAndHitFace(const vector &displacement, const scalar fraction, TrackCloudType &cloud, trackingData &td)
Convenience function. Combines trackToFace and hitFace.
label size() const
Return the number of particles in the cloud.
const dimensionedScalar & c
Speed of light in a vacuum.
bool hitPatch(streamLineParticleCloud &, trackingData &)
Overridable function to handle the particle hitting a patch.
List< DynamicList< scalarList > > & allScalars_
List< vector > vectorList
A List of vectors.
label cell() const
Return current cell particle is in.
label face() const
Return current face particle is on otherwise -1.
void hitSymmetryPlanePatch(streamLineParticleCloud &, trackingData &)
Overridable function to handle the particle hitting a.
DynamicList< vectorList > & allPositions_
bool switchProcessor
Flag to switch processor.
particle(const polyMesh &mesh, const barycentric &coordinates, const label celli, const label tetFacei, const label tetPti)
Construct from components.
Particle class that samples fields as it passes through. Used in streamline calculation.
scalar mag() const
The magnitude of the bounding box span.
List< scalar > scalarList
A List of scalars.
void hitCyclicAMIPatch(const vector &, const scalar, streamLineParticleCloud &, trackingData &)
Overridable function to handle the particle hitting a.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
errorManip< error > abort(error &err)
static void readFields(Cloud< streamLineParticle > &)
Read.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
bool onFace() const
Is the particle on a face?
void hitCyclicRepeatAMIPatch(const vector &, const scalar, streamLineParticleCloud &, trackingData &)
Overridable function to handle the particle hitting a.
streamLineParticle(const polyMesh &c, const vector &position, const label celli, const label lifeTime)
Construct from components.
scalar stepFraction() const
Return the fraction of time-step completed.
A Cloud of streamLine particles.
const boundBox & bounds() const
Return mesh bounding box.
vector point
Point is a vector.
bool keepParticle
Flag to indicate whether to keep particle (false = delete)
static void readFields(TrackCloudType &c)
Read the fields associated with the owner cloud.
prefixOSstream Pout(cout, "Pout")
static void writeFields(const TrackCloudType &c)
Write the fields associated with the owner cloud.
Ostream & operator<<(Ostream &, const ensightPart &)
bool move(streamLineParticleCloud &, trackingData &, const scalar)
Track all particles to their end point.
void checkFieldIOobject(const Cloud< ParticleType > &c, const IOField< DataType > &data) const
Check lagrangian data field.
dimensioned< scalar > mag(const dimensioned< Type > &)
Mesh consisting of general polyhedral cells.
void hitCyclicACMIPatch(const vector &, const scalar, streamLineParticleCloud &, trackingData &)
Overridable function to handle the particle hitting a.
virtual bool write(const bool write=true) const
Write using setting from DB.
IOobject fieldIOobject(const word &fieldName, const IOobject::readOption r) const
Helper to construct IOobject for field and current time.
void hitWallPatch(streamLineParticleCloud &, trackingData &)
Overridable function to handle the particle hitting a wallPatch.
A primitive field of type <T> with automated input and output.
vector position() const
Return current particle position.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.
void hitSymmetryPatch(streamLineParticleCloud &, trackingData &)
Overridable function to handle the particle hitting a.
void hitCyclicPatch(streamLineParticleCloud &, trackingData &)
Overridable function to handle the particle hitting a cyclic.