Go to the documentation of this file.
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_)
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());
98 indexedOctree<treeDataFace> patchTree
117 List<mappedPatchBase::nearInfo> nearest(sampleCoords_.size());
119 forAll(sampleCoords_, sampleI)
121 const point& sample = 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
170 Info<<
"Dumping mapping as lines from supplied points to"
171 <<
" nearest patch face to file " << str.name() <<
endl;
177 if (nearest[i].first().hit())
183 str <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
198 label facei = nearInfo.index();
200 samplingPts.append(nearInfo.hitPoint());
201 samplingCells.append(
mesh().faceOwner()[facei]);
202 samplingFaces.append(facei);
203 samplingSegments.append(0);
204 samplingCurveDist.append(1.0 * sampleI);
213 samplingPts.append(sampleCoords_[sampleI]);
214 samplingCells.append(-1);
215 samplingFaces.append(-1);
216 samplingSegments.append(0);
217 samplingCurveDist.append(1.0 * sampleI);
224 void Foam::patchCloudSet::genSamples()
227 DynamicList<point> samplingPts;
228 DynamicList<label> samplingCells;
229 DynamicList<label> samplingFaces;
230 DynamicList<label> samplingSegments;
231 DynamicList<scalar> samplingCurveDist;
242 samplingPts.shrink();
243 samplingCells.shrink();
244 samplingFaces.shrink();
245 samplingSegments.shrink();
246 samplingCurveDist.shrink();
274 const scalar searchDist
278 sampleCoords_(sampleCoords),
280 searchDist_(searchDist)
300 searchDist_(
dict.
get<scalar>(
"maxDistance"))
int debug
Static debugging option.
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
Holds list of sampling points which is filled at construction time. Various implementations of this b...
List< label > labelList
A List of labels.
const word & name() const
A class for handling words, derived from Foam::string.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
static Vector< Cmpt > uniform(const Cmpt &s)
Return a VectorSpace with all elements = s.
static const boundBox invertedBox
A large inverted boundBox: min/max == +/- ROOTVGREAT.
static bool master(const label communicator=worldComm)
Am I the master process.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Mesh consisting of general polyhedral cells.
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.
#define forAll(list, i)
Loop across all elements in list.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
messageStream Info
Information stream (uses stdout - output is on the master only)
word name(const complex &c)
Return string representation of complex.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
const polyMesh & mesh() const
dimensionedSymmTensor sqr(const dimensionedVector &dv)
PointIndexHit< point > pointIndexHit
A PointIndexHit for 3D points.
#define DebugInfo
Report an information message using Foam::Info.
static int myProcNo(const label communicator=worldComm)
Number of this process (starting from masterNo() = 0)
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
const dimensionedScalar e
Elementary charge.
A List of wordRe with additional matching capabilities.
labelHashSet patchSet(const UList< wordRe > &patchNames, const bool warnNotFound=true, const bool useGroups=true) const
Return the set of patch IDs corresponding to the given names.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
static void listCombineScatter(const List< commsStruct > &comms, List< T > &Value, const int tag, const label comm)
Scatter data. Reverse of combineGather.
vector point
Point is a vector.
defineTypeNameAndDebug(combustionModel, 0)
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.