Go to the documentation of this file.
66 const word& subsetName,
92 # pragma omp parallel for schedule(dynamic, 40)
94 forAll(nearestTriangle, triI)
100 octreePtr_->findNearestSurfacePoint
106 importFaceCentres[triI]
110 scalar maxEdgeDSq(0.);
114 const point&
s = importSurfPoints[tri[pI]];
115 const point&
e = importSurfPoints[tri[(pI+1)%3]];
121 if( (nt < 0) || (dSq > 0.09 * maxEdgeDSq) )
123 Warning <<
"Could not find a matching triangle " <<
endl;
124 Warning <<
"It seems that your surface meshes do not overlap" <<
endl;
128 vector nTri = importFaceNormals[triI];
129 const scalar magSqrTri =
magSqr(nTri);
132 if( magSqrTri < VSMALL )
139 if( dSqNormal < VSMALL )
142 if( ((nTri &
normal) / (magSqrTri * dSqNormal)) > angleTol )
143 nearestTriangle[triI] = nt;
152 # pragma omp parallel for schedule(dynamic, 40) private(containedTriangles)
157 boundBox bb(fCentres[triI], fCentres[triI]);
159 scalar maxEdgeDSq(0.);
178 forAll(containedTriangles, ctI)
183 containedTriangles[ctI],
188 const scalar distSq =
magSqr(
p - fCentres[triI]);
192 nt = containedTriangles[ctI];
198 if( (nt < 0) || (dSq > 0.09 * maxEdgeDSq) )
202 if( nearestTriangle[nt] == triI )
205 vector nTri = fNornals[triI];
206 const scalar magSqrTri =
magSqr(nTri);
209 if( magSqrTri < VSMALL )
216 if( dSqNormal < VSMALL )
219 if( ((nTri &
normal) / (magSqrTri * dSqNormal)) > angleTol )
220 nearestTriangle[nt] = triI;
224 const label subsetId = surf_.addFacetSubset(subsetName);
226 forAll(nearestTriangle, triI)
228 if( nearestTriangle[triI] < 0 )
231 surf_.addFacetToSubset(subsetId, nearestTriangle[triI]);
const vectorField & facetNormals() const
return normals of facets
A class for handling words, derived from string.
const point & max() const
Maximum describing the bounding box.
#define forAll(list, i)
Loop across all elements in list.
const pointField & points() const
access to points
point nearestPointOnTheTriangle(const triangle< point, point > &tri, const point &)
find the nearest point on the triangle to the given point
Ostream & endl(Ostream &os)
Add newline and flush stream.
const vectorField & facetCentres() const
return centres of facets
void deleteDemandDrivenData(DataPtr &dataPtr)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
meshOctree * octreePtr_
pointer to meshOctree, needed for searching on the master surface
Pre-declare SubField and related Field type.
void createOctreeWithRefinedBoundary(const direction maxLevel, const label nTrianglesInLeaf=15)
void addSurfaceAsSubset(const triSurf &importSurf, const word &subsetName, const scalar angleTol=5.*M_PI/180.)
const point & min() const
Minimum describing the bounding box.
~triSurfaceImportSurfaceAsSubset()
void findTrianglesInBox(const boundBox &, DynList< label > &) const
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))
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
triSurfaceImportSurfaceAsSubset(const triSurfaceImportSurfaceAsSubset &)
Disallow default bitwise copy construct.
label size() const
return the number of triangles
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
Triangle with additional region number.
A bounding box defined in terms of the points at its extremities.
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
dimensioned< scalar > magSqr(const dimensioned< Type > &)
void createOctree(const triSurf &, meshOctree &)
A normal distribution model.