Go to the documentation of this file.
52 "extendedFeatureEdgeMesh",
61 if (!fName.empty() && extendedEdgeMesh::canRead(fName))
68 Info<<
"Read extendedFeatureEdgeMesh " << extFeatObj.
name()
70 eMeshPtr().writeStats(
Info);
106 Info<<
"Read edgeMesh " << featObj.
name() <<
nl
118 forAll(pointEdges, pointI)
120 if (pointEdges[pointI].size() > 2)
122 oldToNew[pointI] = newPoints.size();
128 label nFeatures = newPoints.size();
131 if (oldToNew[pointI] == -1)
133 oldToNew[pointI] = newPoints.size();
143 const edge&
e = edges[edgeI];
144 newEdges[edgeI] =
edge
186 if (
dict.found(
"levels"))
193 <<
" : levels should be at least size 1" <<
endl
194 <<
"levels : " <<
dict[
"levels"]
198 distances_[featI].setSize(distLevels.
size());
199 levels_[featI].setSize(distLevels.
size());
203 distances_[featI][j] = distLevels[j].first();
204 levels_[featI][j] = distLevels[j].second();
211 (distances_[featI][j] <= distances_[featI][j-1])
212 || (levels_[featI][j] > levels_[featI][j-1])
216 <<
" : Refinement should be specified in order"
217 <<
" of increasing distance"
218 <<
" (and decreasing refinement level)." <<
endl
219 <<
"Distance:" << distances_[featI][j]
220 <<
" refinementLevel:" << levels_[featI][j]
233 Info<<
"Refinement level according to distance to "
234 << featFileName <<
" (" << eMesh.
points().size() <<
" points, "
238 Info<<
" level " << levels_[featI][j]
239 <<
" for all cells within " << distances_[featI][j]
240 <<
" metre." <<
endl;
261 bb.
min() -=
point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
262 bb.
max() +=
point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
304 if (!regionEdgeTreesPtr_.valid())
306 regionEdgeTreesPtr_.reset
327 bb.
min() -=
point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
328 bb.
max() +=
point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
350 return regionEdgeTreesPtr_();
362 const labelList& levels = levels_[featI];
373 label candidateI = 0;
379 if (levels[levelI] > maxLevel[pointI])
381 candidates[candidateI] = pt[pointI];
382 candidateMap[candidateI] = pointI;
383 candidateDistSqr[candidateI] =
sqr(distances[levelI]);
389 candidates.setSize(candidateI);
390 candidateMap.
setSize(candidateI);
391 candidateDistSqr.setSize(candidateI);
397 forAll(candidates, candidateI)
401 candidates[candidateI],
402 candidateDistSqr[candidateI]
415 mag(
nearInfo[candidateI].hitPoint()-candidates[candidateI])
418 label pointI = candidateMap[candidateI];
421 maxLevel[pointI] = levels[minDistI+1];
436 distances_(featDicts.
size()),
437 levels_(featDicts.
size()),
438 edgeTrees_(featDicts.
size()),
439 pointTrees_(featDicts.
size())
537 nearNormal.setSize(
samples.size());
544 if (tree.
shapes().size() > 0)
557 distSqr = nearestDistSqr[sampleI];
564 nearFeature[sampleI] = featI;
574 nearNormal[sampleI] =
e.vec(td.
points());
575 nearNormal[sampleI] /=
mag(nearNormal[sampleI])+VSMALL;
596 nearNormal.setSize(
samples.size());
603 forAll(regionTrees, featI)
618 distSqr = nearestDistSqr[sampleI];
628 nearFeature[sampleI] = featI;
637 nearNormal[sampleI] =
e.vec(td.
points());
638 nearNormal[sampleI] /=
mag(nearNormal[sampleI])+VSMALL;
711 forAll(pointTrees_, featI)
715 if (tree.
shapes().pointLabels().size() > 0)
722 if (nearFeature[sampleI] != -1)
728 distSqr = nearestDistSqr[sampleI];
735 nearFeature[sampleI] = featI;
761 findHigherLevel(pt, featI, maxLevel);
768 scalar overallMax = -GREAT;
771 overallMax =
max(overallMax,
max(distances_[featI]));
Simple random number generator.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
label index() const
Return index.
fileName filePath() const
Return complete path + object name if the file exists.
autoPtr< BasicCompressibleTurbulenceModel > New(const volScalarField &rho, const volVectorField &U, const surfaceScalarField &phi, const typename BasicCompressibleTurbulenceModel::transportModel &transport, const word &propertiesName)
A class for handling file names.
List< label > labelList
A List of labels.
const point & max() const
Maximum describing the bounding box.
#define forAll(list, i)
Loop across all elements in list.
refinementFeatures(const objectRegistry &io, const PtrList< dictionary > &featDicts)
Construct from description.
void findNearestPoint(const pointField &samples, const scalarField &nearestDistSqr, labelList &nearFeature, List< pointIndexHit > &nearInfo) const
Find nearest feature point. Sets.
bool read(const char *, int32_t &)
Standard boundBox + extra functionality for use in octree.
const Time & time() const
Return time.
void buildTrees(const label)
Build edge tree and feature point tree.
An edge is a list of two point labels. The functionality it provides supports the discretisation on a...
bool hit() const
Is there a hit.
const labelList & regionEdges() const
Return the feature edges which are on the boundary between.
scalar maxDistance() const
Highest distance of all features.
const Type & shapes() const
Reference to shape.
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< scalar > mag(const dimensioned< Type > &)
Ostream & incrIndent(Ostream &os)
Increment the indent level.
Holds (reference to) pointField. Encapsulation of data needed for octree searches....
Tuple2< scalar, label > nearInfo
Private class for finding nearest.
Registry of regIOobjects.
fileName objectPath() const
Return complete path + object name.
PtrList< indexedOctree< treeDataEdge > > edgeTrees_
Edge.
scalarField samples(nIntervals, 0)
label nonFeatureStart() const
Return the index of the start of the non-feature points.
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
bool set(const label) const
Is element set.
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.
treeBoundBox extend(Random &, const scalar s) const
Return slightly wider bounding box.
const Point & hitPoint() const
Return hit point.
const pointField & points() const
Return points.
DynamicField< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
const edgeList & edges() const
virtual void writeStats(Ostream &) const
Non-pointer based hierarchical recursive searching.
Holds data for octree to work on an edges subset.
const T & operator[](const label) const
Return element const reference.
const word & name() const
Return name.
volVectorField vectorField(fieldObject, mesh)
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
label findLower(const ListType &, typename ListType::const_reference, const label start, const BinaryOp &bop)
Find last element < given value in sorted list and return index,.
PtrList< indexedOctree< treeDataPoint > > pointTrees_
Features points.
const point & min() const
Minimum describing the bounding box.
const edgeList & edges() const
Return edges.
labelList identity(const label len)
Create identity map (map[i] == i) of given length.
const labelListList & pointEdges() const
Return edges.
A list of keyword definitions, which are a keyword followed by any number of values (e....
#define forAllReverse(list, i)
Reverse loop across all elements in list.
void read(const objectRegistry &, const PtrList< dictionary > &)
Read set of feature edge meshes.
Ostream & decrIndent(Ostream &os)
Decrement the indent level.
const double e
Elementary charge.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const pointField & points() const
dimensioned< Type > max(const dimensioned< Type > &, const dimensioned< Type > &)
void setSize(const label)
Reset size of List.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
const PtrList< indexedOctree< treeDataEdge > > & regionEdgeTrees() const
List< labelList > labelListList
A List of labelList.
Description of feature edges and points.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
PointIndexHit< point > pointIndexHit
void findNearestRegionEdge(const pointField &samples, const scalarField &nearestDistSqr, labelList &nearFeature, List< pointIndexHit > &nearInfo, vectorField &nearNormal) const
Find nearest point on nearest region edge. Sets.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
volScalarField scalarField(fieldObject, mesh)
const word & constant() const
Return constant name.
const dimensionedScalar e
Elementary charge.
label size() const
Return the number of elements in the PtrList.
label readLabel(Istream &is)
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.
#define FatalIOErrorInFunction(ios)
Report an error message using Foam::FatalIOError.
void size(const label)
Override size to be inconsistent with allocated storage.
A 2-tuple for storing two objects of different types.
vector point
Point is a vector.
void findHigherLevel(const pointField &pt, const label featI, labelList &maxLevel) const
Find shell level higher than ptLevel.
Points connected by edges.
void findNearestEdge(const pointField &samples, const scalarField &nearestDistSqr, labelList &nearFeature, List< pointIndexHit > &nearInfo, vectorField &nearNormal) const
Find nearest point on nearest feature edge. Sets.
dimensioned< scalar > magSqr(const dimensioned< Type > &)
cachedRandom rndGen(label(0), -1)