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_)
58 boolList pointInside(querySurf.calcInside(mesh_.points()));
60 forAll(pointInside, pointi)
62 bool isInside = pointInside[pointi];
64 if ((isInside && includeInside_) || (!isInside && includeOutside_))
66 addOrDelete(
set, pointi, add);
76 const vector span(nearDist_, nearDist_, nearDist_);
80 const point& pt = meshPoints[pointi];
84 if (inter.hit() && (
mag(inter.hitPoint() - pt) < nearDist_))
86 addOrDelete(
set, pointi, add);
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)
136 nearDist_(dict.
lookup<scalar>(
"nearDistance")),
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.
string expand(const string &, const HashTable< string, word, string::hash > &mapping, const char sigil='$')
Expand occurrences of variables according to the mapping.
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual ~surfaceToPoint()
Destructor.
PointIndexHit< point > pointIndexHit
Vector< scalar > vector
A scalar version of the templated Vector.
surfaceToPoint(const polyMesh &mesh, const fileName &surfName, const scalar nearDist, const bool includeInside, const bool includeOutside)
Construct from components.
Macros for easy insertion into run-time selection tables.
Base class of a source for a topoSet.
List< bool > boolList
Bool container classes.
vectorField pointField
pointField is a vectorField.
setAction
Enumeration defining the valid actions.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
defineTypeNameAndDebug(combustionModel, 0)
General set of labels of mesh quantity (points, cells, faces).
vector point
Point is a vector.
dimensioned< scalar > mag(const dimensioned< Type > &)
Mesh consisting of general polyhedral cells.
treeBoundBox combine(const treeBoundBox &a, const treeBoundBox &b)
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.