49 bool Foam::sampledSets::boundaryPoints::calcSamples
51 DynamicList<point>& samplingPositions,
53 DynamicList<label>& samplingSegments,
54 DynamicList<label>& samplingCells,
55 DynamicList<label>& samplingFaces
62 label nPatchFaces = 0;
66 nPatchFaces += pp.
size();
75 patchFaces[nPatchFaces++] = pp.start()+i;
84 const boundBox patchBb(pp.points(), pp.meshPoints(),
false);
85 patchBB.min() =
min(patchBB.min(), patchBb.min());
86 patchBB.max() =
max(patchBB.max(), patchBb.max());
88 patchBB = patchBB.extend(1
e-4);
91 indexedOctree<treeDataFace> patchTree
112 const point& sample = points_[sampleI];
116 ? patchTree.findNearest(sample,
sqr(maxDistance_))
122 nearest[sampleI].elementi = patchFaces[pih.index()];
123 nearest[sampleI].data.first() =
magSqr(pih.hitPoint() - sample);
124 nearest[sampleI].data.second() = pih.hitPoint();
132 RemoteData<Tuple2<scalar, point>>::smallestFirstEqOp()
139 OBJstream str(
mesh().
time().path()/(
name() +
"_nearest.obj"));
143 if (nearest[sampleI].proci != -1)
150 nearest[sampleI].data.second()
160 if (nearest[sampleI].proci != -1)
164 const label facei = nearest[sampleI].elementi;
166 samplingPositions.append(nearest[sampleI].data.second());
167 samplingSegments.append(sampleI);
168 samplingCells.append(
mesh().faceOwner()[facei]);
169 samplingFaces.append(facei);
175 <<
"Unable to find location on patches " << patches_
176 <<
" for the point " << points_[sampleI]
177 <<
" within a distance of " << maxDistance_ <<
endl;
198 maxDistance_(
dict.
lookup<scalar>(
"maxDistance"))
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
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)
static void listCombineScatter(const List< commsStruct > &comms, List< T > &Value, const int tag, const label comm)
Scatter data. Reverse of combineGather.
static bool master(const label communicator=0)
Am I the master process.
static int myProcNo(const label communicator=0)
Number of this process (starting from masterNo() = 0)
label size() const
Return the number of elements in the UPtrList.
A list of keywords followed by any number of values (e.g. words and numbers) or sub-dictionaries.
Motion of the mesh specified as a list of pointMeshMovers.
Mesh consisting of general polyhedral cells.
const polyBoundaryMesh & boundary() const
Return boundary mesh.
const labelIOList & tetBasePtIs() const
Return the tetBasePtIs.
Holds list of sampling points which is filled at construction time. Various implementations of this b...
const polyMesh & mesh() const
Access the mesh.
const word & name() const
Access the name.
Specified point samples within patches.
virtual ~boundaryPoints()
Destructor.
boundaryPoints(const word &name, const polyMesh &mesh, const dictionary &dict)
Construct from dictionary.
Set of sets to sample. Call sampledSets.write() to sample&write files.
A class for handling words, derived from string.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define WarningInFunction
Report a warning using Foam::Warning.
defineTypeNameAndDebug(arcUniform, 0)
addToRunTimeSelectionTable(sampledSet, arcUniform, word)
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
List< label > labelList
A List of labels.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
PointIndexHit< point > pointIndexHit
Ostream & endl(Ostream &os)
Add newline and flush stream.
line< point, const point & > linePointRef
Line using referred points.
vector point
Point is a vector.
tmp< DimensionedField< typename outerProduct< Type, Type >::type, GeoMesh, Field >> sqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dimensioned< Type > min(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
word name(const LagrangianState state)
Return a string representation of a Lagrangian state enumeration.
HashSet< label, Hash< label > > labelHashSet
A HashSet with label keys.
tmp< DimensionedField< scalar, GeoMesh, Field > > magSqr(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
dimensioned< Type > max(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
faceListList boundary(nPatches)