Go to the documentation of this file.
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_
107 dict.get<scalar>(
"cos")
117 normal_(checkIs(is)),
118 tol_(readScalar(checkIs(is)))
136 Info<<
" Adding faces according to normal being aligned with "
137 << normal_ <<
" (to within " << tol_ <<
") ..." <<
endl;
140 forAll(mesh_.faceAreas(), facei)
144 if (
mag(1 - (
n & normal_)) < tol_)
154 Info<<
" Removing faces according to normal being aligned with "
155 << normal_ <<
" (to within " << tol_ <<
") ..." <<
endl;
164 if (
mag(1 - (
n & normal_)) < tol_)
166 toBeRemoved.append(facei);
170 set.
unset(toBeRemoved);
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
label size() const noexcept
The number of elements in table.
Class with constructor to add usage string to table.
normalToFace(const polyMesh &mesh, const vector &normal, const scalar tol)
Construct from components.
Ostream & endl(Ostream &os)
Add newline and flush stream.
setAction
Enumeration defining the valid actions.
Base class of a topoSet source for selecting faces.
Create a new set and ADD elements to it.
Vector< Cmpt > & normalise()
Normalise the vector by its magnitude.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
messageStream Info
Information stream (uses stdout - output is on the master only)
virtual bool set(const label id)
Set an index.
addNamedToRunTimeSelectionTable(topoSetCellSource, badQualityToCell, word, badQuality)
General set of labels of mesh quantity (points, cells, faces).
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Macros for easy insertion into run-time selection tables.
Subtract elements from the set.
errorManipArg< error, int > exit(error &err, const int errNo=1)
VectorSpace< Form, Cmpt, Ncmpts > normalised(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
virtual bool unset(const label id)
Unset an index.
A topoSetFaceSource to select faces based on normal.
defineTypeNameAndDebug(combustionModel, 0)