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_)
170 for (label subIter = 0; subIter <
max(1, td.
nSubCycle_); subIter++)
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)
Base cloud calls templated on particle type.
A primitive field of type <T> with automated input and output.
virtual bool check(const char *operation) const
Check IOstream status for given operation.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void transfer(List< T > &list)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
void size(const label n)
Older name for setAddressableSize.
scalar mag() const
The magnitude of the bounding box span.
A cell is defined as a list of faces with extra functionality.
A cloud is a registry collection of lagrangian particles.
A face is a list of labels corresponding to mesh vertices.
void writeFields() const
Write fields.
Reads fields from the time directories and adds them to the mesh database for further post-processing...
void interpolateFields()
Linearly interpolate volume fields to generate surface fields.
bool switchProcessor
Flag to switch processor.
bool keepParticle
Flag to indicate whether to keep particle (false = delete)
scalar trackToFace(const vector &displacement, const scalar fraction)
As particle::track, but also stops on internal faces.
vector position() const
Return current particle position.
scalar stepFraction() const noexcept
Return the fraction of time-step completed.
Mesh consisting of general polyhedral cells.
const boundBox & bounds() const
Return mesh bounding box.
virtual bool write(const bool valid=true) const
Write using setting from DB.
A Cloud of streamLine particles.
DynamicList< vectorList > & allPositions_
const scalar trackLength_
List< DynamicList< vectorList > > & allVectors_
List< DynamicList< scalarList > > & allScalars_
Particle class that samples fields as it passes through. Used in streamline calculation.
void hitCyclicACMIPatch(streamLineParticleCloud &, trackingData &, const vector &direction)
Overridable function to handle the particle hitting a.
void hitSymmetryPatch(streamLineParticleCloud &, trackingData &)
Overridable function to handle the particle hitting a.
void hitSymmetryPlanePatch(streamLineParticleCloud &, trackingData &)
Overridable function to handle the particle hitting a.
void hitCyclicPatch(streamLineParticleCloud &, trackingData &)
Overridable function to handle the particle hitting a cyclic.
void hitCyclicAMIPatch(streamLineParticleCloud &, trackingData &, const vector &direction)
Overridable function to handle the particle hitting a.
static void readFields(Cloud< streamLineParticle > &)
Read.
void hitWedgePatch(streamLineParticleCloud &, trackingData &)
Overridable function to handle the particle hitting a wedge.
void hitProcessorPatch(streamLineParticleCloud &, trackingData &)
bool hitPatch(streamLineParticleCloud &, trackingData &)
Overridable function to handle the particle hitting a patch.
void hitWallPatch(streamLineParticleCloud &, trackingData &)
Overridable function to handle the particle hitting a wallPatch.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
OBJstream os(runTime.globalPath()/outputName)
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
List< scalar > scalarList
A List of scalars.
void readFields(const typename GeoFieldType::Mesh &mesh, const IOobjectList &objects, const wordHashSet &selectedFields, LIFOStack< regIOobject * > &storedObjects)
Read the selected GeometricFields of the templated type.
List< vector > vectorList
A List of vectors.
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
errorManip< error > abort(error &err)
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
#define forAll(list, i)
Loop across all elements in list.