50void Foam::patchCloudSet::calcSamples
52 DynamicList<point>& samplingPts,
53 DynamicList<label>& samplingCells,
54 DynamicList<label>& samplingFaces,
55 DynamicList<label>& samplingSegments,
56 DynamicList<scalar>& samplingCurveDist
63 for (
const label patchi : patchSet_)
69 DebugInfo <<
" " << pp.name() <<
" size " << pp.size() <<
endl;
75 for (
const label patchi : patchSet_)
81 patchFaces[sz++] = pp.start()+i;
85 bb.add(pp.points(), pp.meshPoints());
94 bb.min() -= point::uniform(ROOTVSMALL);
95 bb.max() += point::uniform(ROOTVSMALL);
98 indexedOctree<treeDataFace> patchTree
117 List<mappedPatchBase::nearInfo> nearest(sampleCoords_.
size());
119 forAll(sampleCoords_, sampleI)
126 if (patchFaces.size())
128 nearInfo = patchTree.findNearest(
sample,
sqr(searchDist_));
139 nearest[sampleI].second().first() =
Foam::sqr(GREAT);
145 nearInfo.setIndex(patchFaces[nearInfo.index()]);
147 nearest[sampleI].second().first() =
magSqr
169 Info<<
"Dumping mapping as lines from supplied points to"
170 <<
" nearest patch face to file " << str.name() <<
endl;
176 if (nearest[i].
first().hit())
182 str <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
197 label facei = nearInfo.index();
199 samplingPts.append(nearInfo.hitPoint());
200 samplingCells.append(
mesh().faceOwner()[facei]);
201 samplingFaces.append(facei);
202 samplingSegments.append(0);
203 samplingCurveDist.append(1.0 * sampleI);
212 samplingPts.append(sampleCoords_[sampleI]);
213 samplingCells.append(-1);
214 samplingFaces.append(-1);
215 samplingSegments.append(0);
216 samplingCurveDist.append(1.0 * sampleI);
223void Foam::patchCloudSet::genSamples()
226 DynamicList<point> samplingPts;
227 DynamicList<label> samplingCells;
228 DynamicList<label> samplingFaces;
229 DynamicList<label> samplingSegments;
230 DynamicList<scalar> samplingCurveDist;
241 samplingPts.shrink();
242 samplingCells.shrink();
243 samplingFaces.shrink();
244 samplingSegments.shrink();
245 samplingCurveDist.shrink();
273 const scalar searchDist
277 sampleCoords_(sampleCoords),
279 searchDist_(searchDist)
299 searchDist_(
dict.get<scalar>(
"maxDistance"))
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
Minimal example by using system/controlDict.functions:
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
static void listCombineAllGather(const List< commsStruct > &comms, List< T > &values, const CombineOp &cop, const int tag, const label comm)
After completion all processors have the same data.
T & first()
Return the first element of the list.
void size(const label n)
Older name for setAddressableSize.
label size() const noexcept
The number of elements in the list.
static const boundBox invertedBox
A large inverted boundBox: min/max == +/- ROOTVGREAT.
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface....
const word & name() const noexcept
The coord-set name.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
Like Foam::cloudSet but samples nearest patch face.
Mesh consisting of general polyhedral cells.
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
int myProcNo() const noexcept
Return processor number.
Holds list of sampling points which is filled at construction time. Various implementations of this b...
const polyMesh & mesh() const noexcept
splitCell * master() const
A List of wordRe with additional matching capabilities.
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
#define DebugInfo
Report an information message using Foam::Info.
List< label > labelList
A List of labels.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
PointIndexHit< point > pointIndexHit
A PointIndexHit for 3D points.
messageStream Info
Information stream (stdout output on master, null elsewhere)
vector point
Point is a vector.
Ostream & endl(Ostream &os)
Add newline and flush stream.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
constexpr char nl
The newline '\n' character (0x0a)
#define forAll(list, i)
Loop across all elements in list.