42 searchableSurfaceWithGaps,
68 scalar minMag = GREAT;
73 if (
mag(
n[cmpt]) < minMag)
75 minMag =
mag(
n[cmpt]);
80 offsets[0][minCmpt] = 1.0;
82 offsets[0] -=
n[minCmpt]*
n;
83 offsets[0] /=
mag(offsets[0]);
85 offsets[1] =
n ^ offsets[0];
96 void Foam::searchableSurfaceWithGaps::offsetVecs
104 offset0.setSize(start.size());
105 offset1.setSize(start.size());
109 const Pair<vector> offsets(offsetVecs(start[i],
end[i]));
110 offset0[i] = offsets[0];
111 offset1[i] = offsets[1];
116 Foam::label Foam::searchableSurfaceWithGaps::countMisses
118 const List<pointIndexHit>& info,
131 missMap.setSize(nMiss);
138 missMap[nMiss++] = i;
147 Foam::label Foam::searchableSurfaceWithGaps::countMisses
149 const List<pointIndexHit>& plusInfo,
150 const List<pointIndexHit>& minInfo,
157 if (!plusInfo[i].hit() || !minInfo[i].hit())
163 missMap.setSize(nMiss);
168 if (!plusInfo[i].hit() || !minInfo[i].hit())
170 missMap[nMiss++] = i;
180 Foam::searchableSurfaceWithGaps::searchableSurfaceWithGaps
219 label nMiss = countMisses(info, compactMap);
246 const vectorField smallVec(1
e-6*(compactEnd-compactStart));
251 compactStart+offset0-smallVec,
252 compactEnd+offset0+smallVec,
258 compactStart-offset0-smallVec,
259 compactEnd-offset0+smallVec,
266 if (plusInfo[i].hit() && minInfo[i].hit())
268 info[compactMap[i]] = plusInfo[i];
269 info[compactMap[i]].point() -= offset0[i];
274 nMiss = countMisses(plusInfo, minInfo, plusMissMap);
287 label mapI = plusMissMap[i];
288 compactStart[i] = compactStart[mapI];
289 compactEnd[i] = compactEnd[mapI];
290 compactMap[i] = compactMap[mapI];
291 offset0[i] = offset0[mapI];
292 offset1[i] = offset1[mapI];
300 const vectorField smallVec(1
e-6*(compactEnd-compactStart));
304 compactStart+offset1-smallVec,
305 compactEnd+offset1+smallVec,
310 compactStart-offset1-smallVec,
311 compactEnd-offset1+smallVec,
318 if (plusInfo[i].hit() && minInfo[i].hit())
320 info[compactMap[i]] = plusInfo[i];
321 info[compactMap[i]].point() -= offset1[i];
333 List<pointIndexHit>& info
337 findLine(start,
end, info);
350 findLine(start,
end, nearestInfo);
352 info.setSize(start.
size());
355 if (nearestInfo[pointi].hit())
357 info[pointi].setSize(1);
358 info[pointi][0] = nearestInfo[pointi];
362 info[pointi].
clear();
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
virtual void findLineAll(const pointField &start, const pointField &end, List< List< pointIndexHit >> &) const
Get all intersections in order from start to end.
void size(const label n)
Older name for setAddressableSize.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
A list of keyword definitions, which are a keyword followed by a number of values (eg...
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
::Foam::direction nComponents(const expressions::valueTypeCode) noexcept
The number of components associated with given valueTypeCode.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines. WIP.
virtual const boundBox & bounds() const
Return const reference to boundBox.
Macros for easy insertion into run-time selection tables.
Various functions to operate on Lists.
#define forAll(list, i)
Loop across all elements in list.
vectorField pointField
pointField is a vectorField.
const dimensionedScalar e
Elementary charge.
void setSize(const label n)
Alias for resize()
An ordered pair of two objects of type <T> with first() and second() elements.
void clear()
Clear the list, i.e. set size to zero.
A class for handling words, derived from Foam::string.
bool returnReduceOr(const bool value, const int communicator=UPstream::worldComm)
Perform logical (or) MPI Allreduce on a copy. Uses UPstream::reduceOr.
const wordList surface
Standard surface field types (scalar, vector, tensor, etc)
virtual void findLineAny(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Return any intersection on segment from start to end.
defineTypeNameAndDebug(combustionModel, 0)
vector point
Point is a vector.
List< label > labelList
A List of labels.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, IOobject::NO_REGISTER)
virtual void findLine(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Find first intersection on segment from start to end.
Defines the attributes of an object for which implicit objectRegistry management is supported...
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
static constexpr const zero Zero
Global zero (0)