Go to the documentation of this file.
29 #include "triSurface.H"
45 surfaceToPoint::typeName,
46 "\n Usage: surfaceToPoint <surface> <near> <inside> <outside>\n\n"
47 " <surface> name of triSurface\n"
48 " <near> scalar; include points with coordinate <= near to surface\n"
49 " <inside> boolean; whether to include points on opposite side of"
51 " <outside> boolean; whether to include points on this side of"
65 <<
" in = "<<
timer.cpuTimeIncrement() <<
" s" <<
endl <<
endl;
74 forAll(pointInside, pointI)
76 bool isInside = pointInside[pointI];
94 const point& pt = meshPoints[pointI];
109 if (nearDist_ < 0 && !includeInside_ && !includeOutside_)
112 <<
"Illegal point selection specification."
113 <<
" Result would be either all or no points." <<
endl
114 <<
"Please set one of includeInside or includeOutside"
115 <<
" to true, set nearDistance to a value > 0"
127 const scalar nearDist,
128 const bool includeInside,
129 const bool includeOutside
135 includeInside_(includeInside),
136 includeOutside_(includeOutside)
165 surfName_(checkIs(is)),
167 includeInside_(
readBool(checkIs(is))),
168 includeOutside_(
readBool(checkIs(is)))
190 Info<<
" Adding points in relation to surface " << surfName_
197 Info<<
" Removing points in relation to surface " << surfName_
Starts timing CPU usage and return elapsed time from start.
virtual const pointField & points() const
Return raw points.
const bool includeInside_
Include all points on opposite sign of normal on nearest surface.
A class for handling file names.
#define forAll(list, i)
Loop across all elements in list.
pointIndexHit nearest(const point &, const vector &span) const
Calculate nearest point on surface for single searchPoint. Returns.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
AccessType combine(const List< T > &, AccessOp aop=accessOp< T >())
Combines sublists into one big list.
Class with constructor to add usage string to table.
void combine(topoSet &set, const bool add) const
Depending on surface add to or delete from pointSet.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
bool hit() const
Is there a hit.
static addToUsageTable usage_
Add usage string.
Ostream & endl(Ostream &os)
Add newline and flush stream.
setAction
Enumeration defining the valid actions.
const fileName surfName_
Name of surface file.
dimensioned< scalar > mag(const dimensioned< Type > &)
Helper class to search on triSurface.
void checkSettings() const
Check settings at construction time.
Mesh consisting of general polyhedral cells.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
This class describes the interaction of (usually) a face and a point. It carries the info of a succes...
Pre-declare SubField and related Field type.
Triangulated surface description with patch information.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
const Point & hitPoint() const
Return hit point.
General set of labels of mesh quantity (points, cells, faces).
const scalar nearDist_
If > 0 : include points with distance to surface less than nearDist.
A list of keyword definitions, which are a keyword followed by any number of values (e....
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Macros for easy insertion into run-time selection tables.
virtual ~surfaceToPoint()
Destructor.
Base class of a source for a topoSet.
surfaceToPoint(const polyMesh &mesh, const fileName &surfName, const scalar nearDist, const bool includeInside, const bool includeOutside)
Construct from components.
boolList calcInside(const pointField &searchPoints) const
Calculate for each searchPoint inside/outside status.
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
const bool includeOutside_
Include all points on this sign of normal on nearest surface.
A 1D array of objects of type <T>, where the size of the vector is known and used for subscript bound...
string & expand(const bool allowEmpty=false)
Expand initial tildes and all occurences of environment variables.
Implements a timeout mechanism via sigalarm.
defineTypeNameAndDebug(combustionModel, 0)
void addOrDelete(topoSet &set, const label cellI, const bool) const
Add (if bool) cellI to set or delete cellI from set.