44 void Foam::surfaceToPoint::combine(topoSet& set,
const bool add)
const
48 triSurface surf(surfName_);
50 Info<<
" Read surface from " << surfName_
51 <<
" in = "<< timer.cpuTimeIncrement() <<
" s" <<
endl <<
endl;
54 triSurfaceSearch querySurf(surf);
56 if (includeInside_ || includeOutside_)
60 forAll(pointInside, pointi)
62 bool isInside = pointInside[pointi];
64 if ((isInside && includeInside_) || (!isInside && includeOutside_))
76 const vector span(nearDist_, nearDist_, nearDist_);
80 const point& pt = meshPoints[pointi];
84 if (inter.hit() && (
mag(inter.hitPoint() - pt) < nearDist_))
93 void Foam::surfaceToPoint::checkSettings()
const
95 if (nearDist_ < 0 && !includeInside_ && !includeOutside_)
98 <<
"Illegal point selection specification."
99 <<
" Result would be either all or no points." <<
endl
100 <<
"Please set one of includeInside or includeOutside"
101 <<
" to true, set nearDistance to a value > 0"
113 const scalar nearDist,
114 const bool includeInside,
115 const bool includeOutside
121 includeInside_(includeInside),
122 includeOutside_(includeOutside)
138 includeOutside_(
readBool(
dict.lookup(
"includeOutside")))
160 Info<<
" Adding points in relation to surface " << surfName_
167 Info<<
" Removing points in relation to surface " << surfName_
#define forAll(list, i)
Loop across all elements in list.
Macros for easy insertion into run-time selection tables.
A list of keyword definitions, which are a keyword followed by any number of values (e....
A class for handling file names.
Mesh consisting of general polyhedral cells.
virtual const pointField & points() const
Return raw points.
A topoSetSource to selects points based on relation to surface.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
surfaceToPoint(const polyMesh &mesh, const fileName &surfName, const scalar nearDist, const bool includeInside, const bool includeOutside)
Construct from components.
virtual ~surfaceToPoint()
Destructor.
Base class of a source for a topoSet.
void addOrDelete(topoSet &set, const label celli, const bool) const
Add (if bool) celli to set or delete celli from set.
setAction
Enumeration defining the valid actions.
General set of labels of mesh quantity (points, cells, faces).
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
PointIndexHit< point > pointIndexHit
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimLength
vectorField pointField
pointField is a vectorField.
List< bool > boolList
Bool container classes.
vector point
Point is a vector.
Vector< scalar > vector
A scalar version of the templated Vector.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensioned< scalar > mag(const dimensioned< Type > &)
defineTypeNameAndDebug(combustionModel, 0)
treeBoundBox combine(const treeBoundBox &a, const treeBoundBox &b)
string expand(const string &s, string::size_type &index, const dictionary &dict, const bool allowEnvVars, const bool allowEmpty)