44 sampledTriSurfaceMesh,
57 sampledTriSurfaceMesh::samplingSourceNames_;
85 Foam::sampledTriSurfaceMesh::nonCoupledboundaryTree()
const 90 if (!boundaryTreePtr_.valid())
104 bndFaces[bndI++] = pp.
start()+i;
112 overallBb = overallBb.
extend(1
e-4);
114 boundaryTreePtr_.reset
132 return boundaryTreePtr_();
140 const pointField& fc = surface_.faceCentres();
148 (sampleSource_ ==
cells || sampleSource_ == insideCells)
155 nearest[i].first() = great;
159 if (sampleSource_ ==
cells)
175 nearest[triI].second() = globalCells.toGlobal(nearInfo.
index());
179 else if (sampleSource_ == insideCells)
187 if (cellTree.
bb().contains(fc[triI]))
192 nearest[triI].first() = 0.0;
193 nearest[triI].second() = globalCells.toGlobal(index);
214 nearest[triI].second() = globalCells.toGlobal
234 if (nearest[triI].second() ==
labelMax)
238 else if (globalCells.isLocal(nearest[triI].second()))
240 cellOrFaceLabels[triI] = globalCells.toLocal
242 nearest[triI].second()
251 Pout<<
"Local out of faces:" << cellOrFaceLabels.size()
252 <<
" keeping:" << nFound <<
endl;
273 if (cellOrFaceLabels[facei] != -1)
280 if (reversePointMap[f[fp]] == -1)
283 reversePointMap[f[fp]] = newPointi++;
289 pointMap.setSize(newPointi);
300 faceList& faces = this->storedFaces();
307 reversePointMap[f[0]],
308 reversePointMap[f[1]],
309 reversePointMap[f[2]]
334 samplePoints_.setSize(pointMap.size());
335 sampleElements_.setSize(pointMap.size(), -1);
337 if (sampleSource_ ==
cells)
346 sampleElements_[pointi] = celli;
354 sampleElements_[pointi],
359 samplePoints_[pointi] = pt;
364 const cell& cFaces =
mesh().cells()[celli];
366 scalar minDistSqr = vGreat;
370 const face&
f =
mesh().faces()[cFaces[i]];
375 samplePoints_[pointi] = info.
rawPoint();
381 else if (sampleSource_ == insideCells)
390 sampleElements_[pointi] = celli;
391 samplePoints_[pointi] = pt;
404 sampleElements_[pointi] = facei;
405 samplePoints_[pointi] =
mesh().faces()[facei].nearestPoint
424 samplePoints_.clear();
425 sampleElements_.transfer(cellOrFaceLabels);
433 Info<<
"Dumping correspondence from local surface (points or faces)" 434 <<
" to mesh (cells or faces) to " << str.
name() <<
endl;
439 if (sampleSource_ ==
cells || sampleSource_ == insideCells)
441 forAll(samplePoints_, pointi)
449 label celli = sampleElements_[pointi];
452 str <<
"l " << vertI-2 <<
' ' << vertI-1 <<
' ' << vertI
458 forAll(samplePoints_, pointi)
466 label facei = sampleElements_[pointi];
469 str <<
"l " << vertI-2 <<
' ' << vertI-1 <<
' ' << vertI
476 if (sampleSource_ ==
cells || sampleSource_ == insideCells)
478 forAll(sampleElements_, triI)
483 label celli = sampleElements_[triI];
486 str <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
491 forAll(sampleElements_, triI)
496 label facei = sampleElements_[triI];
499 str <<
"l " << vertI-1 <<
' ' << vertI <<
nl;
506 needsUpdate_ =
false;
517 const word& surfaceName,
535 sampleSource_(sampleSource),
563 sampleSource_(samplingSourceNames_[dict.
lookup(
"source")]),
575 const word& sampleSourceName
593 sampleSource_(samplingSourceNames_[sampleSourceName]),
625 boundaryTreePtr_.clear();
626 sampleElements_.clear();
627 samplePoints_.clear();
644 return update(meshSearcher);
658 return update(meshSearcher);
667 return sampleField(vField);
676 return sampleField(vField);
684 return sampleField(vField);
693 return sampleField(vField);
702 return sampleField(vField);
711 return interpolateField(interpolator);
720 return interpolateField(interpolator);
728 return interpolateField(interpolator);
737 return interpolateField(interpolator);
746 return interpolateField(interpolator);
752 os <<
"sampledTriSurfaceMesh: " <<
name() <<
" :" 753 <<
" surface:" << surface_.objectRegistry::name()
754 <<
" faces:" << faces().size()
755 <<
" points:" <<
points().size();
polyMesh::cellDecomposition decompMode() const
Various (local, not parallel) searches on polyMesh; uses (demand driven) octree to search...
virtual ~sampledTriSurfaceMesh()
Destructor.
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.
virtual bool expire()
Mark the surface as needing an update.
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.
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.
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 bool update()
Update the surface as required.
samplingSource
Types of communications.
virtual bool needsUpdate() const
Does the surface need an update?
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 bool coupled() const
Return true if this patch is geometrically coupled (i.e. faces and.
virtual void clearGeom() const
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.
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
Triangle with additional region number.
const treeBoundBox & bb() const
Top bounding box.
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.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
label findInside(const point &) const
Find shape containing point. Only implemented for certain.
const Time & time() const
Return time.
fileName path(UMean.rootPath()/UMean.caseName()/"graphs"/UMean.instance())
defineTypeNameAndDebug(combustionModel, 0)
void operator()(nearInfo &x, const nearInfo &y) const
word name(const complex &)
Return a string representation of a complex.
void setSize(const label)
Reset size of List.
pointHit nearestPoint(const point &p, const pointField &) const
Return nearest point to face.
virtual tmp< scalarField > sample(const volScalarField &) const
Sample field on surface.
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.
Standard boundBox + extra functionality for use in octree.
const doubleScalar e
Elementary charge.
Mesh consisting of general polyhedral cells.
virtual void print(Ostream &) const
Write.
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...
sampledTriSurfaceMesh(const word &name, const polyMesh &mesh, const word &surfaceName, const samplingSource sampleSource)
Construct from components.
label index() const
Return index.
Tuple2< scalar, label > nearInfo
Private class for finding nearest.
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.