66 scalar minDistSqr =
sqr(GREAT);
67 point nearestPt(GREAT, GREAT, GREAT);
69 for (label facei : cFaces)
71 if (isWallPatch[facei])
77 label fp =
f.fcIndex(fp0);
78 for (label i = 2; i <
f.size(); i++)
81 const label nextFp =
f.fcIndex(fp);
84 const triPointRef tri(basePoint, thisPoint, nextPoint);
88 const scalar d2 = nearInfo.
distance();
91 nearestPt = nearInfo.
point();
102 return Tuple2<Foam::tetIndices, Foam::point>
128 return (1.0 - ROOTSMALL)*pt + ROOTSMALL*tri.
centre();
156 const sampledSet& seedPoints = sampledSetPoints();
160 const label celli = seedPoints.
cells()[seedi];
164 const point& seedPt = seedPoints[seedi];
167 findNearestTet(isWallPatch, seedPt, celli)
171 if (ids.
face() != -1 && isWallPatch[ids.
face()])
187 pushIn(ids.
faceTri(mesh_), nearestId.second()),
193 (trackDir_ == trackDirType::FORWARD),
198 if (trackDir_ == trackDirType::BIDIRECTIONAL)
207 pushIn(ids.
faceTri(mesh_), nearestId.second()),
221 Pout<<
type() <<
" : ignoring seed " << seedPt
222 <<
" since not in wall cell." <<
endl;
230 Log <<
type() <<
" : seeded " << nSeeds <<
" particles." <<
endl;
234 PtrList<interpolation<scalar>> vsInterp;
235 PtrList<interpolation<vector>> vvInterp;
237 refPtr<interpolation<vector>> UInterp
239 initInterpolations(nSeeds, vsInterp, vvInterp)
243 wallBoundedStreamLineParticle::trackingData
td
263 particles.
move(particles,
td, trackTime);
306 faceSet faces(mesh_,
"lowQualityTetFaces", mesh_.nFaces()/100+1);
322 <<
"Found " << nFaces
323 <<
" faces with low quality or negative volume "
324 <<
"decomposition tets. Writing to faceSet " << faces.name()
330 for (
const cell& cFaces : mesh_.cells())
332 numFacesPerEdge.
clear();
334 for (
const label facei : cFaces)
336 const face&
f = mesh_.faces()[facei];
339 const edge e(
f[fp],
f.nextLabel(fp));
341 ++(numFacesPerEdge(
e, 0));
350 <<
"problem cell:" << cFaces
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
void move(TrackCloudType &cloud, typename ParticleType::trackingData &td, const scalar trackTime)
Move the particles.
void addParticle(ParticleType *pPtr)
Transfer particle to cloud.
Map from edge (expressed as its endpoints) to value. Hashing (and ==) on an edge is symmetric.
label size() const noexcept
The number of elements in table.
void clear()
Remove all entries from table.
const word & name() const noexcept
Return the object name.
scalar distance() const noexcept
Return distance to hit.
const point_type & point() const noexcept
Return the point, no checks.
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Class to control time during OpenFOAM simulations that is also the top-level objectRegistry.
A 2-tuple for storing two objects of dissimilar types. The container is similar in purpose to std::pa...
const T1 & first() const noexcept
Access the first element.
const T2 & second() const noexcept
Access the second element.
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Like polyPatch but without reference to mesh. Used in boundaryMesh to hold data on patches....
A cell is defined as a list of faces with extra functionality.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
An edge is a list of two vertex labels. This can correspond to a directed graph edge or an edge on a ...
A face is a list of labels corresponding to mesh vertices.
Abstract base-class for Time/database function objects.
const fvMesh & mesh_
Reference to the fvMesh.
word cloudName_
Optional specified name of particles.
const sampledSet & sampledSetPoints() const
Demand driven construction of the sampledSet.
streamLineBase(const word &name, const Time &runTime, const dictionary &dict)
Construct for given objectRegistry and dictionary.
label lifeTime_
Maximum lifetime (= number of cells) of particle.
autoPtr< indirectPrimitivePatch > wallPatch() const
Construct patch out of all wall patch faces.
List< DynamicList< scalarList > > allScalars_
Per scalarField, per track, the sampled values.
trackDirType trackDir_
Whether to use +U, -U or both.
dictionary dict_
Input dictionary.
scalar trackLength_
Track length.
virtual bool read(const dictionary &dict)
Read the field average data.
refPtr< interpolation< vector > > initInterpolations(const label nSeeds, PtrList< interpolation< scalar > > &vsInterp, PtrList< interpolation< vector > > &vvInterp)
Initialise interpolators and track storage.
@ FORWARD
Use "forward" tracking.
@ BIDIRECTIONAL
Use "bidirectional" tracking.
List< DynamicList< vectorList > > allVectors_
Per vectorField, per track, the sampled values.
DynamicList< List< point > > allTracks_
All tracks. Per track the points it passed through.
Generates streamline data by sampling a set of user-specified fields along a particle track,...
wallBoundedStreamLine(const word &name, const Time &runTime, const dictionary &dict)
Construct from name, Time and dictionary.
Tuple2< tetIndices, point > findNearestTet(const bitSet &isWallPatch, const point &seedPt, const label celli) const
Find wall tet on cell.
virtual bool read(const dictionary &dict)
Read the function-object dictionary.
point pushIn(const triPointRef &tri, const point &pt) const
Push a point a tiny bit towards the centre of the triangle it is in to avoid tracking problems.
virtual void track()
Do the actual tracking to fill the track data.
static const scalar minTetQuality
Minimum tetrahedron quality.
static bool checkFaceTets(const polyMesh &mesh, scalar tol=minTetQuality, const bool report=false, labelHashSet *setPtr=nullptr)
Check face-decomposition tet volume.
virtual const faceList & faces() const
Return raw faces.
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.
virtual const pointField & points() const
Return raw points.
const cellList & cells() const
A class for managing references or pointers (no reference counting).
const T & cref() const
Return const reference to the object or to the contents of a (non-null) managed pointer.
Holds list of sampling points which is filled at construction time. Various implementations of this b...
const labelList & cells() const noexcept
Storage and named access for the indices of a tet which is part of the decomposition of a cell.
label face() const noexcept
Return the face index.
triPointRef faceTri(const polyMesh &mesh) const
The triangle geometry for the face for this tet. The normal of the tri points out of the cell.
label tetPt() const noexcept
Return the characterising tet point index.
label cell() const noexcept
Return the cell index.
static Point centre(const Point &p0, const Point &p1, const Point &p2)
The centre (centroid) of three points.
pointHit nearestPoint(const point &p) const
Return nearest point to p on triangle.
A Cloud of wall-bounded streamLine particles.
Class used to pass tracking data to the trackToEdge function.
Particle class that samples fields as it passes through. Used in streamline calculation.
A class for handling words, derived from Foam::string.
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
wallPoints::trackData td(isBlockedFace, regionToBlockSize)
#define WarningInFunction
Report a warning using Foam::Warning.
Namespace for handling debugging switches.
Function objects are OpenFOAM utilities to ease workflow configurations and enhance workflows.
List< word > wordList
List of word.
bool read(const char *buf, int32_t &val)
Same as readInt32.
PointHit< point > pointHit
A PointHit with a 3D point.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
T returnReduce(const T &value, BinaryOp bop, const int tag=UPstream::msgType(), const int communicator=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensionedScalar sqrt(const dimensionedScalar &ds)
errorManip< error > abort(error &err)
vector point
Point is a vector.
triangle< point, const point & > triPointRef
A triangle using referred points.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
prefixOSstream Pout
OSstream wrapped stdout (std::cout) with parallel prefix.
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.