Go to the documentation of this file.
43 cylinderAnnulusToCell,
49 cylinderAnnulusToCell,
55 cylinderAnnulusToCell,
62 cylinderAnnulusToCell,
71 cylinderAnnulusToCell::typeName,
72 "\n Usage: cylinderAnnulusToCell (p1X p1Y p1Z) (p2X p2Y p2Z)"
73 " outerRadius innerRadius\n\n"
74 " Select all cells with cell centre within bounding cylinder annulus\n\n"
80 void Foam::cylinderAnnulusToCell::combine(topoSet&
set,
const bool add)
const
84 const vector axis = (point2_ - point1_);
85 const scalar magAxis2 =
magSqr(axis);
86 const scalar orad2 =
sqr(radius_);
87 const scalar irad2 = innerRadius_ > 0 ?
sqr(innerRadius_) : -1;
93 const vector d = ctrs[elemi] - point1_;
94 const scalar magD = d & axis;
96 if ((magD > 0) && (magD < magAxis2))
98 const scalar d2 = (d & d) -
sqr(magD)/magAxis2;
99 if ((d2 < orad2) && (d2 > irad2))
116 const scalar innerRadius
123 innerRadius_(innerRadius)
125 if (innerRadius_ > radius_)
128 <<
"inner radius = " << innerRadius_ <<
" cannot be larger than "
129 <<
"outer radius = " << radius_
159 point1_(checkIs(is)),
160 point2_(checkIs(is)),
161 radius_(readScalar(checkIs(is))),
162 innerRadius_(readScalar(checkIs(is)))
178 Info<<
" Adding cells with centre within cylinder annulus,"
179 <<
" with p1 = " << point1_ <<
", p2 = " << point2_
180 <<
", radius = " << radius_
181 <<
", inner radius = " << innerRadius_
191 Info<<
" Removing cells with centre within cylinder annulus,"
192 <<
" with p1 = " << point1_ <<
", p2 = " << point2_
193 <<
", radius = " << radius_
194 <<
", inner radius = " << innerRadius_
addToRunTimeSelectionTable(decompositionMethod, kahipDecomp, dictionary)
vectorField pointField
pointField is a vectorField.
Add elements to current set.
void set(List< bool > &bools, const labelRange &range)
Set the specified range 'on' in a boolList.
Class with constructor to add usage string to table.
Ostream & endl(Ostream &os)
Add newline and flush stream.
setAction
Enumeration defining the valid actions.
T get(const word &keyword, enum keyType::option matchOpt=keyType::REGEX) const
Create a new set and ADD elements to it.
Mesh consisting of general polyhedral cells.
#define forAll(list, i)
Loop across all elements in list.
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
virtual void applyToSet(const topoSetSource::setAction action, topoSet &set) const
Apply specified action to the topoSet.
cylinderAnnulusToCell(const polyMesh &mesh, const point &point1, const point &point2, const scalar radius, const scalar innerRadius=0)
Construct from components.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
messageStream Info
Information stream (stdout output on master, null elsewhere)
AccessType combine(const UList< T > &lists, AccessOp aop=accessOp< T >())
Combines sub-lists into a single list.
addNamedToRunTimeSelectionTable(topoSetCellSource, badQualityToCell, word, badQuality)
General set of labels of mesh quantity (points, cells, faces).
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
void add(FieldField< Field1, typename typeOfSum< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
A topoSetCellSource to select all cells whose cell centre inside a given bounding cylinder annulus.
Macros for easy insertion into run-time selection tables.
Subtract elements from current set.
Vector< scalar > vector
A scalar version of the templated Vector.
errorManipArg< error, int > exit(error &err, const int errNo=1)
const vectorField & cellCentres() const
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
dimensionedSymmTensor sqr(const dimensionedVector &dv)
static MinMax< T > ge(const T &minVal)
A semi-infinite range from minVal to the type max.
The topoSetCellSource is a intermediate class for handling topoSet sources for selecting cells.
T getCheck(const word &keyword, const Predicate &pred, enum keyType::option matchOpt=keyType::REGEX) const
void addOrDelete(topoSet &set, const label id, const bool add) const
Add or delete id from set. Add when 'add' is true.
const polyMesh & mesh_
Reference to the mesh.
defineTypeNameAndDebug(combustionModel, 0)