43 normalToFace::typeName,
44 "\n Usage: normalToFace (nx ny nz) <tol>\n\n" 45 " Select faces with normal aligned to unit vector (nx ny nz)\n" 52 void Foam::normalToFace::setNormal()
54 normal_ /=
mag(normal_) + vSmall;
56 Info<<
" normalToFace : Normalised vector to " << normal_ <<
endl;
58 if (tol_ < -1 || tol_ > 1)
61 <<
"tolerance not within range -1..1 : " << tol_
87 normal_(dict.
lookup(
"normal")),
88 tol_(dict.
lookup<scalar>(
"cos"))
120 Info<<
" Adding faces according to normal being aligned with " 121 << normal_ <<
" (to within " << tol_ <<
") ..." <<
endl;
126 n /=
mag(n) + vSmall;
128 if (
mag(1 - (n & normal_)) < tol_)
136 Info<<
" Removing faces according to normal being aligned with " 137 << normal_ <<
" (to within " << tol_ <<
") ..." <<
endl;
144 const label facei = iter.key();
147 n /=
mag(n) + vSmall;
149 if (
mag(1 - (n & normal_)) < tol_)
151 toBeRemoved.
append(facei);
157 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 successful.
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.