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"
71void 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;
160 for (
const label facei :
static_cast<const labelHashSet&
>(set))
164 if (
mag(1 - (
n & normal_)) < tol_)
166 toBeRemoved.
append(facei);
170 set.unset(toBeRemoved);
Macros for easy insertion into run-time selection tables.
#define addNamedToRunTimeSelectionTable(baseType, thisType, argNames, lookupName)
Add to construction table with 'lookupName' as the key.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
void append(const T &val)
Copy append an element to the end of this list.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A topoSetFaceSource to select faces whose surface normal aligned with a given direction.
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
Mesh consisting of general polyhedral cells.
The topoSetFaceSource is a intermediate class for handling topoSet sources for selecting faces.
Class with constructor to add usage string to table.
Base class of a source for a topoSet.
setAction
Enumeration defining various actions.
@ SUBTRACT
Subtract elements from current set.
@ ADD
Add elements to current set.
@ NEW
Create a new set and ADD elements to it.
General set of labels of mesh quantity (points, cells, faces).
A class for handling words, derived from Foam::string.
#define defineTypeNameAndDebug(Type, DebugSwitch)
Define the typeName and debug information.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define forAll(list, i)
Loop across all elements in list.