42 void Foam::normalToFace::setNormal()
44 normal_ /=
mag(normal_) + vSmall;
46 Info<<
" normalToFace : Normalised vector to " << normal_ <<
endl;
48 if (tol_ < -1 || tol_ > 1)
51 <<
"tolerance not within range -1..1 : " << tol_
100 Info<<
" Adding faces according to normal being aligned with "
101 << normal_ <<
" (to within " << tol_ <<
") ..." <<
endl;
103 forAll(mesh_.faceAreas(), facei)
105 vector n = mesh_.faceAreas()[facei];
106 n /=
mag(
n) + vSmall;
108 if (
mag(1 - (
n & normal_)) < tol_)
116 Info<<
" Removing faces according to normal being aligned with "
117 << normal_ <<
" (to within " << tol_ <<
") ..." <<
endl;
124 const label facei = iter.key();
126 vector n = mesh_.faceAreas()[facei];
127 n /=
mag(
n) + vSmall;
129 if (
mag(1 - (
n & normal_)) < tol_)
131 toBeRemoved.
append(facei);
137 set.
erase(toBeRemoved[i]);
#define forAll(list, i)
Loop across all elements in list.
#define forAllConstIter(Container, container, iter)
Iterate across all elements in the container object of type.
Macros for easy insertion into run-time selection tables.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
bool insert(const Key &key)
Insert a new entry.
bool erase(const iterator &)
Erase a hashedEntry specified by given iterator.
label size() const
Return number of elements in table.
A list of keyword definitions, which are a keyword followed by any number of values (e....
A topoSetSource to select faces based on normal.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
virtual ~normalToFace()
Destructor.
normalToFace(const polyMesh &mesh, const vector &normal, const scalar tol)
Construct from components.
Mesh consisting of general polyhedral cells.
Base class of a source for a topoSet.
setAction
Enumeration defining the valid actions.
General set of labels of mesh quantity (points, cells, faces).
A class for handling words, derived from string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
errorManipArg< error, int > exit(error &err, const int errNo=1)
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
addToRunTimeSelectionTable(polyPatch, mergedCyclicPolyPatch, word)
Ostream & endl(Ostream &os)
Add newline and flush stream.
const dimensionSet dimless
dimensioned< scalar > mag(const dimensioned< Type > &)
defineTypeNameAndDebug(combustionModel, 0)