67 scalar minMag = GREAT;
72 if (
mag(
n[cmpt]) < minMag)
74 minMag =
mag(
n[cmpt]);
79 offsets[0][minCmpt] = 1.0;
81 offsets[0] -=
n[minCmpt]*
n;
82 offsets[0] /=
mag(offsets[0]);
84 offsets[1] =
n ^ offsets[0];
95void Foam::searchableSurfaceWithGaps::offsetVecs
103 offset0.setSize(start.size());
104 offset1.setSize(start.size());
108 const Pair<vector> offsets(offsetVecs(start[i], end[i]));
109 offset0[i] = offsets[0];
110 offset1[i] = offsets[1];
115Foam::label Foam::searchableSurfaceWithGaps::countMisses
117 const List<pointIndexHit>& info,
130 missMap.setSize(nMiss);
137 missMap[nMiss++] = i;
146Foam::label Foam::searchableSurfaceWithGaps::countMisses
148 const List<pointIndexHit>& plusInfo,
149 const List<pointIndexHit>& minInfo,
156 if (!plusInfo[i].hit() || !minInfo[i].hit())
162 missMap.setSize(nMiss);
167 if (!plusInfo[i].hit() || !minInfo[i].hit())
169 missMap[nMiss++] = i;
186 gap_(
dict.get<scalar>(
"gap")),
197 bounds() = subGeom_[0].bounds();
214 surface().findLine(start, end, info);
218 label nMiss = countMisses(info, compactMap);
245 const vectorField smallVec(1
e-6*(compactEnd-compactStart));
250 compactStart+offset0-smallVec,
251 compactEnd+offset0+smallVec,
257 compactStart-offset0-smallVec,
258 compactEnd-offset0+smallVec,
265 if (plusInfo[i].hit() && minInfo[i].hit())
267 info[compactMap[i]] = plusInfo[i];
268 info[compactMap[i]].rawPoint() -= offset0[i];
273 nMiss = countMisses(plusInfo, minInfo, plusMissMap);
286 label mapI = plusMissMap[i];
287 compactStart[i] = compactStart[mapI];
288 compactEnd[i] = compactEnd[mapI];
289 compactMap[i] = compactMap[mapI];
290 offset0[i] = offset0[mapI];
291 offset1[i] = offset1[mapI];
299 const vectorField smallVec(1
e-6*(compactEnd-compactStart));
303 compactStart+offset1-smallVec,
304 compactEnd+offset1+smallVec,
309 compactStart-offset1-smallVec,
310 compactEnd-offset1+smallVec,
317 if (plusInfo[i].hit() && minInfo[i].hit())
319 info[compactMap[i]] = plusInfo[i];
320 info[compactMap[i]].rawPoint() -= offset1[i];
336 findLine(start, end, info);
349 findLine(start, end, nearestInfo);
351 info.setSize(start.
size());
354 if (nearestInfo[pointi].hit())
356 info[pointi].setSize(1);
357 info[pointi][0] = nearestInfo[pointi];
361 info[pointi].
clear();
Various functions to operate on Lists.
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
const objectRegistry & db() const noexcept
Return the local objectRegistry.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
void setSize(const label n)
Alias for resize()
void clear()
Clear the list, i.e. set size to zero.
An ordered pair of two objects of type <T> with first() and second() elements.
void size(const label n)
Older name for setAddressableSize.
const T * set(const label i) const
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Type * getObjectPtr(const word &name, const bool recursive=false) const
static constexpr direction nComponents
Number of components in bool is 1.
searchableSurface using multiple slightly shifted underlying surfaces to make sure pierces don't go t...
virtual void findLine(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Find first intersection on segment from start to end.
virtual void findLineAll(const pointField &start, const pointField &end, List< List< pointIndexHit > > &) const
Get all intersections in order from start to end.
virtual void findLineAny(const pointField &start, const pointField &end, List< pointIndexHit > &) const
Return any intersection on segment from start to end.
Base class of (analytical or triangulated) surface. Encapsulates all the search routines....
virtual const boundBox & bounds() const
Return const reference to boundBox.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
IOobject io("surfaceFilmProperties", mesh.time().constant(), mesh, IOobject::READ_IF_PRESENT, IOobject::NO_WRITE, false)
List< label > labelList
A List of labels.
vectorField pointField
pointField is a vectorField.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
static constexpr const zero Zero
Global zero (0)
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Reduce (copy) and return value.
#define forAll(list, i)
Loop across all elements in list.