33 Foam::vector Foam::streamlinesParticle::interpolateFields
35 const trackingData& td,
36 const point& position,
47 sampledScalars_.setSize(td.vsInterp_.size());
48 forAll(td.vsInterp_, scalarI)
50 sampledScalars_[scalarI].append
52 td.vsInterp_[scalarI].interpolate
61 sampledVectors_.setSize(td.vvInterp_.size());
62 forAll(td.vvInterp_, vectorI)
64 sampledVectors_[vectorI].append
66 td.vvInterp_[vectorI].interpolate
75 const DynamicList<vector>& U = sampledVectors_[td.UIndex_];
111 is >> lifeTime_ >> age_ >> sampledPositions_ >> sampledTimes_
112 >> sampledScalars >> sampledVectors;
114 sampledScalars_.setSize(sampledScalars.
size());
117 sampledScalars_[i].transfer(sampledScalars[i]);
119 sampledVectors_.setSize(sampledVectors.size());
122 sampledVectors_[i].transfer(sampledVectors[i]);
129 "streamlinesParticle::streamlinesParticle" 130 "(const Cloud<streamlinesParticle>&, Istream&, bool)" 141 lifeTime_(p.lifeTime_),
143 sampledPositions_(p.sampledPositions_),
144 sampledTimes_(p.sampledTimes_),
145 sampledScalars_(p.sampledScalars_),
146 sampledVectors_(p.sampledVectors_)
176 sampledPositions_.append(
position());
177 sampledTimes_.
append(age_);
185 scalar magU =
mag(U);
201 else if (subIter == 0)
239 Pout<<
"streamlinesParticle: Removing stagnant particle:" 240 <<
position() <<
" sampled positions:" 241 << sampledPositions_.size() <<
endl;
248 sampledPositions_.append(
position());
249 sampledTimes_.
append(age_);
254 Pout<<
"streamlinesParticle: Removing particle:" <<
position()
255 <<
" sampled positions:" << sampledPositions_.size()
271 forAll(sampledScalars_, i)
277 forAll(sampledVectors_, i)
407 bool valid = c.
size();
435 iter().lifeTime_ = lifeTime[i];
436 iter().sampledPositions_.transfer(sampledPositions[i]);
437 iter().sampledTimes_.transfer(sampledTimes[i]);
468 lifeTime[i] = iter().lifeTime_;
469 sampledPositions[i] = iter().sampledPositions_;
470 sampledTimes[i] = iter().sampledTimes_;
474 lifeTime.
write(np > 0);
475 sampledPositions.write(np > 0);
476 sampledTimes.write(np > 0);
484 os << static_cast<const particle&>(
p)
493 os.
check(
"Ostream& operator<<(Ostream&, const streamlinesParticle&)");
void hitCyclicACMIPatch(const vector &, const scalar, streamlinesCloud &, trackingData &)
Overridable function to handle the particle hitting a.
void hitProcessorPatch(streamlinesCloud &, trackingData &)
const polyMesh & mesh() const
Return the mesh database.
#define forAll(list, i)
Loop across all elements in list.
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(streamlinesCloud &, trackingData &, const scalar)
Track all particles to their end point.
void hitCyclicAMIPatch(const vector &, const scalar, streamlinesCloud &, trackingData &)
Overridable function to handle the particle hitting a.
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.
void hitWallPatch(streamlinesCloud &, trackingData &)
Overridable function to handle the particle hitting a wallPatch.
#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.
List< vector > vectorList
A List of vectors.
const scalar trackLength_
static void writeFields(const Cloud< streamlinesParticle > &)
Write.
label cell() const
Return current cell particle is in.
DynamicList< vectorList > & allPositions_
List< DynamicList< scalarList > > & allScalars_
label face() const
Return current face particle is on otherwise -1.
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.
scalar mag() const
The magnitude of the bounding box span.
List< scalar > scalarList
A List of scalars.
A Cloud of streamlines particles.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
bool hitPatch(streamlinesCloud &, trackingData &)
Overridable function to handle the particle hitting a patch.
void hitWedgePatch(streamlinesCloud &, trackingData &)
Overridable function to handle the particle hitting a wedge.
Particle class that samples fields as it passes through. Used in streamlines calculation.
DynamicList< scalarList > & allTimes_
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
errorManip< error > abort(error &err)
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 hitCyclicPatch(streamlinesCloud &, trackingData &)
Overridable function to handle the particle hitting a cyclic.
scalar stepFraction() const
Return the fraction of time-step completed.
const boundBox & bounds() const
Return mesh bounding box.
void hitSymmetryPatch(streamlinesCloud &, trackingData &)
Overridable function to handle the particle hitting a.
vector point
Point is a vector.
List< DynamicList< vectorList > > & allVectors_
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")
void hitCyclicRepeatAMIPatch(const vector &, const scalar, streamlinesCloud &, trackingData &)
Overridable function to handle the particle hitting a.
static void writeFields(const TrackCloudType &c)
Write the fields associated with the owner cloud.
Ostream & operator<<(Ostream &, const ensightPart &)
void checkFieldIOobject(const Cloud< ParticleType > &c, const IOField< DataType > &data) const
Check lagrangian data field.
dimensioned< scalar > mag(const dimensioned< Type > &)
static void readFields(Cloud< streamlinesParticle > &)
Read.
Mesh consisting of general polyhedral cells.
virtual bool write(const bool write=true) const
Write using setting from DB.
void hitSymmetryPlanePatch(streamlinesCloud &, trackingData &)
Overridable function to handle the particle hitting a.
streamlinesParticle(const polyMesh &c, const vector &position, const label celli, const label lifeTime)
Construct from components.
IOobject fieldIOobject(const word &fieldName, const IOobject::readOption r) const
Helper to construct IOobject for field and current time.
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.