48 normalToFace::typeName,
49 "\n Usage: normalToFace (nx ny nz) <tol>\n\n" 50 " Select faces with normal aligned to unit vector (nx ny nz)\n" 57 void Foam::normalToFace::setNormal()
59 normal_ /=
mag(normal_) + VSMALL;
61 Info<<
" normalToFace : Normalized vector to " << normal_ <<
endl;
63 if (tol_ < -1 || tol_ > 1)
66 <<
"tolerance not within range -1..1 : " << tol_
94 normal_(dict.
lookup(
"normal")),
128 Info<<
" Adding faces according to normal being aligned with " 129 << normal_ <<
" (to within " << tol_ <<
") ..." <<
endl;
134 n /=
mag(n) + VSMALL;
136 if (
mag(1 - (n & normal_)) < tol_)
144 Info<<
" Removing faces according to normal being aligned with " 145 << normal_ <<
" (to within " << tol_ <<
") ..." <<
endl;
152 const label facei = iter.key();
155 n /=
mag(n) + VSMALL;
157 if (
mag(1 - (n & normal_)) < tol_)
159 toBeRemoved.
append(facei);
165 set.erase(toBeRemoved[i]);
#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.
errorManipArg< error, int > exit(error &err, const int errNo=1)
A list of keyword definitions, which are a keyword followed by any number of values (e...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
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.
static Istream & checkIs(Istream &is)
Check state of stream.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
Macros for easy insertion into run-time selection tables.
Base class of a source for a topoSet.
stressControl lookup("compactNormalStress") >> compactNormalStress
setAction
Enumeration defining the valid actions.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
virtual ~normalToFace()
Destructor.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
defineTypeNameAndDebug(combustionModel, 0)
General set of labels of mesh quantity (points, cells, faces).
Class with constructor to add usage string to table.
const vectorField & faceAreas() const
dimensioned< scalar > mag(const dimensioned< Type > &)
Mesh consisting of general polyhedral cells.
normalToFace(const polyMesh &mesh, const vector &normal, const scalar tol)
Construct from components.