62 normalToFace::typeName,
63 "\n Usage: normalToFace (nx ny nz) <tol>\n\n" 64 " Select faces with normal aligned to unit vector (nx ny nz)\n" 71 void Foam::normalToFace::setNormal()
75 if (tol_ < -1 || tol_ > 1)
78 <<
"tolerance not within range -1..1 : " << tol_
93 topoSetFaceSource(
mesh),
114 normal_(checkIs(is)),
115 tol_(readScalar(checkIs(is)))
133 Info<<
" Adding faces according to normal being aligned with " 134 << normal_ <<
" (to within " << tol_ <<
") ..." <<
endl;
137 forAll(mesh_.faceAreas(), facei)
141 if (
mag(1 - (
n & normal_)) < tol_)
151 Info<<
" Removing faces according to normal being aligned with " 152 << normal_ <<
" (to within " << tol_ <<
") ..." <<
endl;
155 DynamicList<label> toBeRemoved(
set.size()/10);
157 for (
const label facei : static_cast<const labelHashSet&>(
set))
161 if (
mag(1 - (
n & normal_)) < tol_)
163 toBeRemoved.append(facei);
167 set.unset(toBeRemoved);
List< ReturnType > get(const UPtrList< T > &list, const AccessOp &aop)
List of values generated by applying the access operation to each list item.
errorManipArg< error, int > exit(error &err, const int errNo=1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
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)...
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
Macros for easy insertion into run-time selection tables.
addNamedToRunTimeSelectionTable(topoSetCellSource, badQualityToCell, word, badQuality)
#define forAll(list, i)
Loop across all elements in list.
The topoSetFaceSource is a intermediate class for handling topoSet sources for selecting faces...
setAction
Enumeration defining various actions.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
defineTypeNameAndDebug(combustionModel, 0)
General set of labels of mesh quantity (points, cells, faces).
Subtract elements from current set.
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.
normalToFace(const polyMesh &mesh, const vector &normal, const scalar tol)
Construct from components.
addToRunTimeSelectionTable(functionObject, pointHistory, dictionary)