50 surfaceToPoint::typeName,
51 "\n Usage: surfaceToPoint <surface> <near> <inside> <outside>\n\n" 52 " <surface> name of triSurface\n" 53 " <near> scalar; include points with coordinate <= near to surface\n" 54 " <inside> boolean; whether to include points on opposite side of" 56 " <outside> boolean; whether to include points on this side of" 63 void Foam::surfaceToPoint::combine(topoSet&
set,
const bool add)
const 67 triSurface surf(surfName_, surfType_, scale_);
71 Info<<
" Read surface from " << surfName_
72 <<
" in = "<< timer.cpuTimeIncrement() <<
" s" <<
nl <<
endl;
76 triSurfaceSearch querySurf(surf);
78 if (includeInside_ || includeOutside_)
82 forAll(pointInside, pointi)
84 if (pointInside[pointi] ? includeInside_ : includeOutside_)
96 const vector span(nearDist_, nearDist_, nearDist_);
100 const point& pt = meshPoints[pointi];
104 if (inter.hit() && inter.point().dist(pt) < nearDist_)
113 void Foam::surfaceToPoint::checkSettings()
const 115 if (nearDist_ < 0 && !includeInside_ && !includeOutside_)
118 <<
"Illegal point selection specification." 119 <<
" Result would be either all or no points." <<
endl 120 <<
"Please set one of includeInside or includeOutside" 121 <<
" to true, set nearDistance to a value > 0" 131 const polyMesh&
mesh,
132 const fileName& surfName,
133 const scalar nearDist,
134 const bool includeInside,
135 const bool includeOutside
138 topoSetPointSource(
mesh),
143 includeInside_(includeInside),
144 includeOutside_(includeOutside)
158 surfType_(
dict.getOrDefault<
word>(
"fileType",
word::null)),
159 scale_(
dict.getOrDefault<scalar>(
"scale", -1)),
160 nearDist_(
dict.
get<scalar>(
"nearDistance")),
161 includeInside_(
dict.
get<bool>(
"includeInside")),
162 includeOutside_(
dict.
get<bool>(
"includeOutside"))
175 surfName_(checkIs(is)),
178 nearDist_(readScalar(checkIs(is))),
179 includeInside_(
readBool(checkIs(is))),
180 includeOutside_(
readBool(checkIs(is)))
198 Info<<
" Adding points in relation to surface " 199 << surfName_ <<
" ..." <<
endl;
208 Info<<
" Removing points in relation to surface " 209 << surfName_ <<
" ..." <<
endl;
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
The topoSetPointSource is a intermediate class for handling topoSet sources for selecting points...
A class for handling file names.
errorManipArg< error, int > exit(error &err, const int errNo=1)
bool verbose_
Output verbosity (default: true)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
A list of keyword definitions, which are a keyword followed by a number of values (eg...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Create a new set and ADD elements to it.
Add elements to current set.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)...
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
PointIndexHit< point > pointIndexHit
A PointIndexHit with a 3D point.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
surfaceToPoint(const polyMesh &mesh, const fileName &surfName, const scalar nearDist, const bool includeInside, const bool includeOutside)
Construct from components.
void addOrDelete(topoSet &set, const label id, const bool add) const
Add or delete id from set. Add when 'add' is true.
Macros for easy insertion into run-time selection tables.
virtual const pointField & points() const
Return raw points.
#define forAll(list, i)
Loop across all elements in list.
AccessType combine(const UList< T > &lists, AccessOp aop=accessOp< T >())
Combines sub-lists into a single list.
vectorField pointField
pointField is a vectorField.
A class for handling words, derived from Foam::string.
setAction
Enumeration defining various actions.
const polyMesh & mesh_
Reference to the mesh.
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
defineTypeNameAndDebug(combustionModel, 0)
General set of labels of mesh quantity (points, cells, faces).
Subtract elements from current set.
vector point
Point is a vector.
cpuTimePosix cpuTime
Selection of preferred clock mechanism for the elapsed cpu time.
Class with constructor to add usage string to table.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Mesh consisting of general polyhedral cells.
List< bool > boolList
A List of bools.
bool readBool(Istream &is)
Read bool from stream using Foam::Switch(Istream&)
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)
string expand(const std::string &s, const HashTable< string > &mapping, const char sigil='$')
Expand occurrences of variables according to the mapping and return the expanded string.