Go to the documentation of this file.
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"
63 if (tol_ < -1 || tol_ > 1)
66 <<
"tolerance not within range -1..1 : " <<
tol_
105 normal_(checkIs(is)),
128 Info<<
" Adding faces according to normal being aligned with "
129 << normal_ <<
" (to within " << tol_ <<
") ..." <<
endl;
131 forAll(mesh_.faceAreas(), faceI)
133 vector n = mesh_.faceAreas()[faceI];
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();
154 vector n = mesh_.faceAreas()[faceI];
155 n /=
mag(
n) + VSMALL;
157 if (
mag(1 - (
n & normal_)) < tol_)
159 toBeRemoved.
append(faceI);
165 set.
erase(toBeRemoved[i]);
const scalar tol_
Tolerance (i.e. cos of angle between normal_ and faceNormal)
#define forAll(list, i)
Loop across all elements in list.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &) const
void setNormal()
Normalize normal and check tolerance.
addToRunTimeSelectionTable(ensightPart, ensightPartCells, istream)
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.
dimensioned< scalar > mag(const dimensioned< Type > &)
Mesh consisting of general polyhedral cells.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
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)....
bool erase(const iterator &)
Erase a hashedEntry specified by given iterator.
General set of labels of mesh quantity (points, cells, faces).
static addToUsageTable usage_
Add usage string.
A list of keyword definitions, which are a keyword followed by any number of values (e....
label size() const
Return number of elements in table.
Macros for easy insertion into run-time selection tables.
Base class of a source for a topoSet.
DynamicList< T, SizeInc, SizeMult, SizeDiv > & append(const T &)
Append an element at the end of the list.
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual ~normalToFace()
Destructor.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if succesful.
bool insert(const Key &key)
Insert a new entry.
defineTypeNameAndDebug(combustionModel, 0)
vector normal_
(unit)vector to compare to
A normal distribution model.
stressControl lookup("compactNormalStress") >> compactNormalStress