37 namespace sampledSurfaces
80 > Foam::sampledSurfaces::triSurfaceMesh::samplingSourceNames_;
86 Foam::sampledSurfaces::triSurfaceMesh::nonCoupledboundaryTree()
const 91 if (!boundaryTreePtr_.valid())
105 bndFaces[bndI++] = pp.
start()+i;
113 overallBb = overallBb.
extend(1
e-4);
115 boundaryTreePtr_.reset
133 return boundaryTreePtr_();
144 const pointField& fc = surface_.faceCentres();
152 (sampleSource_ ==
cells || sampleSource_ == insideCells)
159 nearest[i].first() = great;
163 if (sampleSource_ ==
cells)
179 nearest[triI].second() = globalCells.toGlobal(nearInfo.
index());
183 else if (sampleSource_ == insideCells)
191 if (cellTree.
bb().contains(fc[triI]))
196 nearest[triI].first() = 0.0;
197 nearest[triI].second() = globalCells.toGlobal(index);
218 nearest[triI].second() = globalCells.toGlobal
238 if (nearest[triI].second() ==
labelMax)
242 else if (globalCells.isLocal(nearest[triI].second()))
244 cellOrFaceLabels[triI] = globalCells.toLocal
246 nearest[triI].second()
255 Pout<<
"Local out of faces:" << cellOrFaceLabels.size()
256 <<
" keeping:" << nFound <<
endl;
277 if (cellOrFaceLabels[facei] != -1)
284 if (reversePointMap[f[fp]] == -1)
287 reversePointMap[f[fp]] = newPointi++;
293 pointMap.setSize(newPointi);
304 faceList& faces = this->storedFaces();
311 reversePointMap[f[0]],
312 reversePointMap[f[1]],
313 reversePointMap[f[2]]
338 samplePoints_.setSize(pointMap.size());
339 sampleElements_.setSize(pointMap.size(), -1);
341 if (sampleSource_ ==
cells)
350 sampleElements_[pointi] = celli;
358 sampleElements_[pointi],
363 samplePoints_[pointi] = pt;
368 const cell& cFaces =
mesh().cells()[celli];
370 scalar minDistSqr = vGreat;
374 const face&
f =
mesh().faces()[cFaces[i]];
379 samplePoints_[pointi] = info.
rawPoint();
385 else if (sampleSource_ == insideCells)
394 sampleElements_[pointi] = celli;
395 samplePoints_[pointi] = pt;
408 sampleElements_[pointi] = facei;
409 samplePoints_[pointi] =
mesh().faces()[facei].nearestPoint
428 samplePoints_.clear();
429 sampleElements_.transfer(cellOrFaceLabels);
437 Info<<
"Dumping correspondence from local surface (points or faces)" 438 <<
" to mesh (cells or faces) to " << str.
name() <<
endl;
443 if (sampleSource_ ==
cells || sampleSource_ == insideCells)
445 forAll(samplePoints_, pointi)
453 label celli = sampleElements_[pointi];
456 str <<
"l " << vertI-2 <<
' ' << vertI-1 <<
' ' << vertI
462 forAll(samplePoints_, pointi)
470 label facei = sampleElements_[pointi];
473 str <<
"l " << vertI-2 <<
' ' << vertI-1 <<
' ' << vertI
480 if (sampleSource_ ==
cells || sampleSource_ == insideCells)
482 forAll(sampleElements_, triI)
487 label celli = sampleElements_[triI];
490 str <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
495 forAll(sampleElements_, triI)
500 label facei = sampleElements_[triI];
503 str <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
510 needsUpdate_ =
false;
521 const word& surfaceName,
539 sampleSource_(sampleSource),
567 sampleSource_(samplingSourceNames_[dict.
lookup(
"source")]),
579 const word& sampleSourceName
597 sampleSource_(samplingSourceNames_[sampleSourceName]),
629 boundaryTreePtr_.clear();
630 sampleElements_.clear();
631 samplePoints_.clear();
648 return update(meshSearcher);
662 return update(meshSearcher);
672 return sampleField(vField);
682 return sampleField(vField);
691 return sampleField(vField);
701 return sampleField(vField);
711 return sampleField(vField);
721 return interpolateField(interpolator);
731 return interpolateField(interpolator);
740 return interpolateField(interpolator);
750 return interpolateField(interpolator);
760 return interpolateField(interpolator);
766 os <<
"triSurfaceMesh: " <<
name() <<
" :" 767 <<
" surface:" << surface_.objectRegistry::name()
768 <<
" faces:" << faces().size()
769 <<
" points:" <<
points().size();
polyMesh::cellDecomposition decompMode() const
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
static void listCombineScatter(const List< commsStruct > &comms, List< T > &Value, const int tag, const label comm)
Scatter data. Reverse of combineGather.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
const indexedOctree< treeDataCell > & cellTree() const
Get (demand driven) reference to octree holding all cells.
A face is a list of labels corresponding to mesh vertices.
A list of keyword definitions, which are a keyword followed by any number of values (e...
An abstract class for surfaces with sampling.
A 2-tuple for storing two objects of different types.
Encapsulation of data needed to search for faces.
defineTypeNameAndDebug(distanceSurface, 0)
triSurfaceMesh(const word &name, const polyMesh &mesh, const word &surfaceName, const samplingSource sampleSource)
Construct from components.
const Type1 & first() const
Return first.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
void size(const label)
Override size to be inconsistent with allocated storage.
bool interpolate() const
Interpolation requested for surface.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual bool update()
Update the surface as required.
Tuple2< scalar, label > nearInfo
Private class for finding nearest.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
const fileName & name() const
Return the name of the stream.
Initialise the NamedEnum HashTable from the static list of names.
static void listCombineGather(const List< commsStruct > &comms, List< T > &Value, const CombineOp &cop, const int tag, const label comm)
Macros for easy insertion into run-time selection tables.
Pair< int > faceMap(const label facePi, const face &faceP, const label faceNi, const face &faceN)
virtual ~triSurfaceMesh()
Destructor.
const Point & hitPoint() const
Return hit point.
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
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))
vectorField pointField
pointField is a vectorField.
virtual void print(Ostream &) const
Write.
virtual bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
virtual void clearGeom() const
static const word & geometryDir()
Return the geometry directory name.
A class for handling words, derived from string.
A triangular face using a FixedList of labels corresponding to mesh vertices.
const word & constant() const
Return constant name.
virtual tmp< scalarField > sample(const volScalarField &) const
Sample field on surface.
bool hit() const
Is there a hit.
const Field< PointType > & points() const
Return reference to global points.
const Type & shapes() const
Reference to shape.
static const label labelMax
const treeBoundBox & bb() const
Top bounding box.
virtual bool expire()
Mark the surface as needing an update.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
const Point & rawPoint() const
Return point with no checking.
label findInside(const point &) const
Find shape containing point. Only implemented for certain.
const Time & time() const
Return time.
addToRunTimeSelectionTable(sampledSurface, distanceSurface, word)
word name(const complex &)
Return a string representation of a complex.
samplingSource
Types of communications.
void setSize(const label)
Reset size of List.
std::remove_reference< ::Foam::List< labelledTri > >::type::value_type FaceType
pointHit nearestPoint(const point &p, const pointField &) const
Return nearest point to face.
A cell is defined as a list of faces with extra functionality.
prefixOSstream Pout(cout, "Pout")
A List with indirect addressing.
label start() const
Return start label of this patch in the polyMesh face list.
virtual bool needsUpdate() const
Does the surface need an update?
Standard boundBox + extra functionality for use in octree.
void operator()(nearInfo &x, const nearInfo &y) const
const doubleScalar e
Elementary charge.
Mesh consisting of general polyhedral cells.
scalar distance() const
Return distance to hit.
A class for managing temporary objects.
A patch is a list of labels that address the faces in the global face list.
Triangulated surface description with patch information.
A topoSetSource to select faces based on use of points.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
label index() const
Return index.
treeBoundBox extend(const scalar s) const
Return asymetrically extended bounding box, with guaranteed.
face triFaceFace() const
Return triangle as a face.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
fileName path(UMean.rootPath()/UMean.caseName()/functionObjects::writeFile::outputPrefix/"graphs"/UMean.instance())