46 void Foam::sampledSets::lineFace::calcSamples
66 const label bFaceI = bHits[0].index();
68 const scalar bDot = bNormal & (end - start);
78 label startFaceI = -1, startCellI = -1;
83 startCellI = searchEngine.
findCell(start);
89 if (bHits.
size() == 0 && startCellI == -1)
95 if (bHitI == -1 && startCellI == -1)
98 <<
"The initial location for the line " << start <<
" to " << end
105 label sampleSegmentI = 0;
106 bHitI < bHits.
size();
107 bHitI += 2, sampleSegmentI += 1
113 startPt = bHits[bHitI].hitPoint();
114 startFaceI = bHits[bHitI].index();
115 startCellI = mesh.
faceOwner()[startFaceI];
121 if (startFaceI != -1)
123 sampleParticle.
track(start - end, 0);
127 <<
"Failed to associate with the starting boundary face" 137 const scalar dist =
mag(pt - start);
139 samplingSegments.
size() == 0
140 || samplingSegments.
last() != sampleSegmentI;
142 if (sampleParticle.
onFace())
147 samplingSegments.
append(sampleSegmentI);
148 samplingCurveDist.
append(dist);
151 const vector s = (1 - dist/
mag(end - start))*(end - start);
168 void Foam::sampledSets::lineFace::calcSamples
192 void Foam::sampledSets::lineFace::genSamples()
212 samplingSegments.
shrink();
213 samplingCurveDist.
shrink();
237 start_(dict.
lookup(
"start")),
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
VectorSpace< Form, Cmpt, Ncmpts > normalised(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
static const Vector< scalar > max
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool onBoundaryFace() const
Is the particle on a boundary face?
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void size(const label)
Override size to be inconsistent with allocated storage.
virtual ~lineFace()
Destructor.
scalar trackToCell(const vector &displacement, const scalar fraction)
As particle::track, but stops when a new cell is reached.
Macros for easy insertion into run-time selection tables.
label cell() const
Return current cell particle is in.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
Holds list of sampling points which is filled at construction time. Various implementations of this b...
label face() const
Return current face particle is on otherwise -1.
label findCell(const point &location, const label seedCelli=-1, const bool useTreeSearch=true) const
Find cell containing location.
A class for handling words, derived from string.
virtual const labelList & faceOwner() const
Return face owner.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
addToRunTimeSelectionTable(sampledSet, arcUniform, word)
DynamicList< T, SizeInc, SizeMult, SizeDiv > & shrink()
Shrink the allocated space to the number of elements used.
bool onFace() const
Is the particle on a face?
virtual bool write()
Sample and write.
const vectorField & faceAreas() const
dimensioned< scalar > mag(const dimensioned< Type > &)
Mesh consisting of general polyhedral cells.
List< pointIndexHit > intersections(const point &pStart, const point &pEnd) const
Find all intersections of boundary within segment pStart .. pEnd.
T & last()
Return the last element of the list.
defineTypeNameAndDebug(arcUniform, 0)
scalar track(const vector &displacement, const scalar fraction)
Track along the displacement for a given fraction of the overall.
lineFace(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const dictionary &dict)
Construct from dictionary.
vector position() const
Return current particle position.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
T & first()
Return reference to the first element of the list.