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"
111 const polyMesh&
mesh,
112 const fileName& surfName,
113 const scalar nearDist,
114 const bool includeInside,
115 const bool includeOutside
121 includeInside_(includeInside),
122 includeOutside_(includeOutside)
130 const polyMesh&
mesh,
131 const dictionary&
dict
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.
virtual const pointField & points() const
Return raw points.
surfaceToPoint(const polyMesh &mesh, const fileName &surfName, const scalar nearDist, const bool includeInside, const bool includeOutside)
Construct from components.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
virtual ~surfaceToPoint()
Destructor.
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.
Foam::fvMesh mesh(Foam::IOobject(regionName, runTime.name(), runTime, Foam::IOobject::MUST_READ), false)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const unitSet & lookup(const word &unitName)
Lookup and return the named unit from the table.
errorManipArg< error, int > exit(error &err, const int errNo=1)
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
void add(GeometricField< typename typeOfSum< Type1, Type2 >::type, GeoMesh, PrimitiveField1 > &gf, const GeometricField< Type1, GeoMesh, PrimitiveField2 > &gf1, const GeometricField< Type2, GeoMesh, PrimitiveField3 > &gf2)
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.
tmp< DimensionedField< scalar, GeoMesh, Field > > mag(const DimensionedField< Type, GeoMesh, PrimitiveField > &df)
treeBoundBox combine(const treeBoundBox &a, const treeBoundBox &b)
defineTypeNameAndDebug(atmosphericBoundaryLayer, 0)
string expand(const string &s, string::size_type &index, const dictionary &dict, const bool allowEnvVars, const bool allowEmpty)