50 void 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_)
75 for (
const label patchi : patchSet_)
81 patchFaces[sz++] =
pp.start()+i;
85 bb.add(
pp.points(),
pp.meshPoints());
92 bb.inflate(
rndGen, 1
e-4, ROOTVSMALL);
95 indexedOctree<treeDataFace> patchTree
97 treeDataFace(
mesh(), patchFaces),
110 List<mappedPatchBase::nearInfo> nearest(sampleCoords_.
size());
112 forAll(sampleCoords_, sampleI)
114 const auto& treeData = patchTree.shapes();
115 const point& sample = sampleCoords_[sampleI];
118 auto& distSqrProc = nearest[sampleI].second();
121 if (patchFaces.size())
123 nearInfo = patchTree.findNearest(sample,
sqr(searchDist_));
140 const label objectIndex = treeData.objectIndex(nearInfo.index());
142 nearInfo.setIndex(objectIndex);
144 distSqrProc.first() = sample.distSqr(nearInfo.point());
162 Info<<
"Dumping mapping as lines from supplied points to" 163 <<
" nearest patch face to file " << str.name() <<
endl;
169 if (nearest[i].
first().hit())
175 str <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
190 label facei = nearInfo.index();
192 samplingPts.append(nearInfo.point());
193 samplingCells.append(
mesh().faceOwner()[facei]);
194 samplingFaces.append(facei);
195 samplingSegments.append(0);
196 samplingCurveDist.append(1.0 * sampleI);
205 samplingPts.append(sampleCoords_[sampleI]);
206 samplingCells.append(-1);
207 samplingFaces.append(-1);
208 samplingSegments.append(0);
209 samplingCurveDist.append(1.0 * sampleI);
216 void Foam::patchCloudSet::genSamples()
219 DynamicList<point> samplingPts;
220 DynamicList<label> samplingCells;
221 DynamicList<label> samplingFaces;
222 DynamicList<label> samplingSegments;
223 DynamicList<scalar> samplingCurveDist;
234 samplingPts.shrink();
235 samplingCells.shrink();
236 samplingFaces.shrink();
237 samplingSegments.shrink();
238 samplingCurveDist.shrink();
261 const polyMesh&
mesh,
262 const meshSearch& searchEngine,
264 const List<point>& sampleCoords,
266 const scalar searchDist
269 sampledSet(
name,
mesh, searchEngine, axis),
270 sampleCoords_(sampleCoords),
272 searchDist_(searchDist)
292 searchDist_(
dict.
get<scalar>(
"maxDistance"))
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
void size(const label n)
Older name for setAddressableSize.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
constexpr char nl
The newline '\n' character (0x0a)
T & first()
Access first element of the list, position [0].
Addressing for all faces on surface of mesh. Can either be read from polyMesh or from triSurface...
Ostream & endl(Ostream &os)
Add newline and flush stream.
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
static int myProcNo(const label communicator=worldComm)
Rank of this process in the communicator (starting from masterNo()). Can be negative if the process i...
Macros for easy insertion into run-time selection tables.
#define forAll(list, i)
Loop across all elements in list.
HashSet< label, Hash< label > > labelHashSet
A HashSet of labels, uses label hasher.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
const dimensionedScalar e
Elementary charge.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Holds list of sampling points which is filled at construction time. Various implementations of this b...
const polyBoundaryMesh & boundaryMesh() const noexcept
Return boundary mesh.
A class for handling words, derived from Foam::string.
A List of wordRe with additional matching capabilities.
const word & name() const noexcept
The coord-set name.
#define DebugInfo
Report an information message using Foam::Info.
const polyMesh & mesh() const noexcept
int debug
Static debugging option.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
defineTypeNameAndDebug(combustionModel, 0)
patchCloudSet(const word &name, const polyMesh &mesh, const meshSearch &searchEngine, const word &axis, const List< point > &sampleCoords, const labelHashSet &patchSet, const scalar searchDist)
Construct from components.
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
vector point
Point is a vector.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Mesh consisting of general polyhedral cells.
List< label > labelList
A List of labels.
uindirectPrimitivePatch pp(UIndirectList< face >(mesh.faces(), faceLabels), mesh.points())
static void listCombineReduce(List< T > &values, const CombineOp &cop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
After completion all processors have the same data.