Go to the documentation of this file.
44 sampledTriSurfaceMesh,
73 if (
y.first() <
x.first())
104 bndFaces[bndI++] = pp.
start()+i;
114 overallBb.
min() -=
point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
115 overallBb.
max() +=
point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
143 const pointField& fc = surface_.faceCentres();
151 (sampleSource_ ==
cells || sampleSource_ == insideCells)
158 nearest[i].first() = GREAT;
162 if (sampleSource_ ==
cells)
182 else if (sampleSource_ == insideCells)
195 nearest[triI].first() = 0.0;
196 nearest[triI].second() = globalCells.
toGlobal(index);
220 nearest[triI].second() = globalCells.
toGlobal
235 labelList cellOrFaceLabels(fc.size(), -1);
240 if (nearest[triI].second() ==
labelMax)
244 else if (globalCells.
isLocal(nearest[triI].second()))
246 cellOrFaceLabels[triI] = globalCells.
toLocal
248 nearest[triI].second()
257 Pout<<
"Local out of faces:" << cellOrFaceLabels.
size()
258 <<
" keeping:" << nFound <<
endl;
271 labelList reversePointMap(
s.points().size(), -1);
279 if (cellOrFaceLabels[faceI] != -1)
286 if (reversePointMap[
f[fp]] == -1)
288 pointMap[newPointI] =
f[fp];
289 reversePointMap[
f[fp]] = newPointI++;
306 faceList& faces = this->storedFaces();
313 reversePointMap[
f[0]],
314 reversePointMap[
f[1]],
315 reversePointMap[
f[2]]
325 this->storedPoints() =
pointField(
s.points(), pointMap);
340 samplePoints_.setSize(pointMap.
size());
341 sampleElements_.setSize(pointMap.
size(), -1);
343 if (sampleSource_ ==
cells)
352 sampleElements_[pointI] = cellI;
360 sampleElements_[pointI],
365 samplePoints_[pointI] = pt;
372 scalar minDistSqr = VGREAT;
381 samplePoints_[pointI] = info.
rawPoint();
387 else if (sampleSource_ == insideCells)
396 sampleElements_[pointI] = cellI;
397 samplePoints_[pointI] = pt;
410 sampleElements_[pointI] = faceI;
411 samplePoints_[pointI] =
mesh().
faces()[faceI].nearestPoint
430 samplePoints_.
clear();
431 sampleElements_.transfer(cellOrFaceLabels);
439 Info<<
"Dumping correspondence from local surface (points or faces)"
440 <<
" to mesh (cells or faces) to " << str.
name() <<
endl;
445 if (sampleSource_ ==
cells || sampleSource_ == insideCells)
447 forAll(samplePoints_, pointI)
455 label cellI = sampleElements_[pointI];
458 str <<
"l " << vertI-2 <<
' ' << vertI-1 <<
' ' << vertI
464 forAll(samplePoints_, pointI)
472 label faceI = sampleElements_[pointI];
475 str <<
"l " << vertI-2 <<
' ' << vertI-1 <<
' ' << vertI
482 if (sampleSource_ ==
cells || sampleSource_ == insideCells)
484 forAll(sampleElements_, triI)
489 label cellI = sampleElements_[triI];
492 str <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
497 forAll(sampleElements_, triI)
502 label faceI = sampleElements_[triI];
505 str <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
512 needsUpdate_ =
false;
523 const word& surfaceName,
541 sampleSource_(sampleSource),
569 sampleSource_(samplingSourceNames_[
dict.
lookup(
"source")]),
581 const word& sampleSourceName
599 sampleSource_(samplingSourceNames_[sampleSourceName]),
631 boundaryTreePtr_.clear();
632 sampleElements_.clear();
633 samplePoints_.clear();
647 Info <<
endl <<
"current STL model name is : "<<surface_.objectRegistry::name() <<
endl<<
endl;
651 surface_.triSurface::points(),
652 surface_.triSurface::meshPoints()
660 bb.
min() -= 0.5*span;
661 bb.
max() += 0.5*span;
668 return update(meshSearcher);
682 return update(meshSearcher);
691 return sampleField(vField);
700 return sampleField(vField);
708 return sampleField(vField);
717 return sampleField(vField);
726 return sampleField(vField);
735 return interpolateField(interpolator);
744 return interpolateField(interpolator);
752 return interpolateField(interpolator);
761 return interpolateField(interpolator);
770 return interpolateField(interpolator);
776 os <<
"sampledTriSurfaceMesh: " <<
name() <<
" :"
777 <<
" surface:" << surface_.objectRegistry::name()
778 <<
" faces:" << faces().size()
779 <<
" points:" <<
points().size();
virtual const pointField & points() const
Points of surface.
vectorField pointField
pointField is a vectorField.
Simple random number generator.
virtual void print(Ostream &) const
Write.
GeometricField< tensor, fvPatchField, volMesh > volTensorField
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
A class for handling words, derived from string.
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search.
void print(const char *msg, Ostream &os, const PtrList< GeoField > &flds)
const point & max() const
Maximum describing the bounding box.
virtual bool needsUpdate() const
Does the surface need an update?
sampledTriSurfaceMesh(const word &name, const polyMesh &mesh, const word &surfaceName, const samplingSource sampleSource)
Construct from components.
#define forAll(list, i)
Loop across all elements in list.
autoPtr< indexedOctree< treeDataFace > > boundaryTreePtr_
Search tree for all non-coupled boundary faces.
virtual bool update()
Update the surface as required.
A class for managing temporary objects.
This class describes the interaction of a face and a point. It carries the info of a successful hit a...
samplingSource
Types of communications.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
void inflate(const scalar s)
Inflate box by factor*mag(span) in all dimensions.
static const label labelMax
const Point & rawPoint() const
Return point with no checking.
Standard boundBox + extra functionality for use in octree.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
const cellList & cells() const
const Type & shapes() const
Reference to shape.
face triFaceFace() const
Return triangle as a face.
static const NamedEnum< samplingSource, 3 > samplingSourceNames_
bool isLocal(const label i) const
Is on local processor.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Mesh consisting of general polyhedral cells.
Tuple2< scalar, label > nearInfo
Private class for finding nearest.
vector span() const
The bounding box span (from minimum to maximum)
const indexedOctree< treeDataCell > & cellTree() const
Get (demand driven) reference to octree holding all cells.
polyMesh::cellDecomposition decompMode() const
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
scalar distance() const
Return distance to hit.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Pre-declare SubField and related Field type.
GeometricField< symmTensor, fvPatchField, volMesh > volSymmTensorField
Triangulated surface description with patch information.
treeBoundBox extend(Random &, const scalar s) const
Return slightly wider bounding box.
A patch is a list of labels that address the faces in the global face list.
An abstract class for surfaces with sampling.
const point & min() const
Minimum describing the bounding box.
label findInside(const point &) const
Find shape containing point. Only implemented for certain.
A list of keyword definitions, which are a keyword followed by any number of values (e....
virtual tmp< scalarField > sample(const volScalarField &) const
Sample field on surface.
Macros for easy insertion into run-time selection tables.
const indexedOctree< treeDataFace > & nonCoupledboundaryTree() const
Get tree of all non-coupled boundary faces.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
const double e
Elementary charge.
gmvFile<< "tracers "<< particles.size()<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().x()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().y()<< " ";}gmvFile<< nl;forAllConstIter(Cloud< passiveParticle >, particles, iter){ gmvFile<< iter().position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
label start() const
Return start label of this patch in the polyMesh face list.
const treeBoundBox & bb() const
Top bounding box.
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
void setSize(const label)
Reset size of List.
label toLocal(const label i) const
From global to local on current processor.
virtual const faceList & faces() const
Return raw faces.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
bool contains(const vector &dir, const point &) const
Contains point (inside or on edge) and moving in direction.
A triangular face using a FixedList of labels corresponding to mesh vertices.
prefixOSstream Pout(cout, "Pout")
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Encapsulation of data needed to search for faces.
const word & constant() const
Return constant name.
A topoSetSource to select faces based on use of points.
void clear()
Clear the list, i.e. set size to zero.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
virtual void clearGeom() const
void operator()(nearInfo &x, const nearInfo &y) const
Triangle with additional region number.
virtual ~sampledTriSurfaceMesh()
Destructor.
const Time & time() const
Return the top-level database.
A List with indirect addressing.
void findNearest(const label nodeI, const linePointRef &ln, treeBoundBox &tightest, label &nearestShapeI, point &linePoint, point &nearestPoint, const FindNearestOp &fnOp) const
Find nearest point to line.
A face is a list of labels corresponding to mesh vertices.
const polyMesh & mesh() const
Access to the underlying mesh.
const fileName & name() const
Return the name of the stream.
void size(const label)
Override size to be inconsistent with allocated storage.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
A 2-tuple for storing two objects of different types.
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.
Generic GeometricField class.
virtual bool expire()
Mark the surface as needing an update.
bool interpolate() const
Interpolation requested for surface.
defineTypeNameAndDebug(combustionModel, 0)
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
A cell is defined as a list of faces with extra functionality.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
cachedRandom rndGen(label(0), -1)
word name(const complex &)
Return a string representation of a complex.
Initialise the NamedEnum HashTable from the static list of names.
label toGlobal(const label i) const
From local to global.