55 Foam::directions::directionTypeNames_;
60 void Foam::directions::writeOBJ(
Ostream& os,
const point& pt)
62 os <<
"v " << pt.
x() <<
' ' << pt.
y() <<
' ' << pt.
z() <<
endl;
66 void Foam::directions::writeOBJ
77 os <<
"l " << vertI + 1 <<
' ' << vertI + 2 <<
endl;
83 void Foam::directions::writeOBJ
90 Pout<<
"Writing cell info to " << fName <<
" as vectors at the cellCentres" 113 writeOBJ(xDirStream, ctr, ctr + scale*dirs[celli], vertI);
118 void Foam::directions::check2D
129 <<
"is not normal to plane defined in dynamicMeshDict." 131 <<
"Either make case 3D or adjust vector." 162 <<
"useHexTopology specified but cell " << celli
163 <<
" on face " << patchFacei <<
" of patch " << pp.
name()
167 const vector& cutDir = ppField[patchFacei];
183 changedFaces[patchFacei] = meshFacei;
184 changedFacesInfo[patchFacei] =
196 changedFaces[patchFacei] = pp.
start() + patchFacei;
197 changedFacesInfo[patchFacei] =
231 <<
"Cell " << celli <<
" never visited to determine " 232 <<
"local coordinate system" <<
endl 233 <<
"Using direction " << defaultDir <<
" instead" <<
endl;
235 dirField[celli] = defaultDir;
239 else if (index == -2)
242 dirField[celli] =
cellInfo[celli].n();
246 else if (index == -1)
249 <<
"Illegal index " << index <<
endl 265 Info<<
"Calculated local coords for " << defaultDir
267 <<
" Geometric cut cells : " << nGeom <<
endl 268 <<
" Topological cut cells : " << nTopo <<
endl 269 <<
" Unset cells : " << nUnset <<
endl 288 const word coordSystem(dict.
lookup(
"coordinateSystem"));
295 if (coordSystem !=
"fieldBased")
299 directionType wantedDir = directionTypeNames_[wantedDirs[i]];
305 else if (wantedDir == e1)
309 else if (wantedDir == e2)
317 if (coordSystem ==
"global")
322 check2D(correct2DPtr, e1);
325 check2D(correct2DPtr, e2);
330 Info<<
"Global Coordinate system:" <<
endl 331 <<
" e3 : " << e3 <<
endl 332 <<
" e1 : " << e1 <<
endl 349 else if (coordSystem ==
"patchLocal")
353 const word patchName(patchDict.
lookup(
"patch"));
360 <<
"Cannot find patch " 377 <<
"Discarding user specified e1 since 2D case." <<
endl 378 <<
"Recalculated e1 from face normal and planeNormal as " 387 if (wantE3 || wantE2)
401 this->operator[](nDirs++) = e3Dirs;
405 if (wantE1 || wantE2)
420 this->operator[](nDirs++) = e1Dirs;
427 this->operator[](nDirs++) = e2Dirs;
430 else if (coordSystem ==
"fieldBased")
434 operator[](nDirs++) =
450 <<
"Unknown coordinate system " 451 << coordSystem <<
endl 452 <<
"Known types are global, patchLocal and fieldBased" const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
bool isA(const Type &t)
Check if a dynamic_cast to typeid is possible.
#define forAll(list, i)
Loop across all elements in list.
const word & name() const
Return name.
A class for handling file names.
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.
Cell-face mesh analysis engine.
Ostream & endl(Ostream &os)
Add newline and flush stream.
Wave propagation of information through grid. Every iteration information goes through one layer of c...
label nTotalCells() const
Return total number of cells in decomposed mesh.
A simple wrapper around bool so that it can be read as a word: true/false, on/off, yes/no, y/n, t/f, or none/any.
label findPatchID(const word &patchName) const
Find patch index given a name.
A cellMatcher for hex cells.
Holds information regarding type of cell. Used in inside/outside determination in cellClassification...
Initialise the NamedEnum HashTable from the static list of names.
scalar minDist(const List< pointIndexHit > &hitList)
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
Class applies a two-dimensional correction to mesh motion point field.
A class for handling words, derived from string.
static label edgeToFaceIndex(const primitiveMesh &mesh, const label celli, const label facei, const label edgeI)
Given edge on hex cell find corresponding edge on face. Is either.
virtual const labelList & faceOwner() const
Return face owner.
layerAndWeight min(const layerAndWeight &a, const layerAndWeight &b)
const globalMeshData & globalData() const
Return parallel info.
const Field< PointType > & faceNormals() const
Return face normals for patch.
const vectorField & cellCentres() const
errorManip< error > abort(error &err)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
const vector & planeNormal() const
Return plane normal.
Holds direction in which to split cell (in fact a local coordinate axes). Information is a label and ...
void reduce(const List< UPstream::commsStruct > &comms, T &Value, const BinaryOp &bop, const int tag, const label comm)
IOField< vector > vectorIOField
vectorField with IO.
List< word > wordList
A List of words.
#define WarningInFunction
Report a warning using Foam::Warning.
prefixOSstream Pout(cout, "Pout")
label start() const
Return start label of this patch in the polyMesh face list.
directionType
Enumeration listing the possible coordinate directions.
dimensioned< scalar > mag(const dimensioned< Type > &)
Field< vector > vectorField
Specialisation of Field<T> for vector.
const doubleScalar e
Elementary charge.
fileName & instance() const
Return the instance directory, constant, system, <time> etc.
Mesh consisting of general polyhedral cells.
A class for managing temporary objects.
A patch is a list of labels that address the faces in the global face list.
directions(const polyMesh &mesh, const dictionary &dict, const twoDPointCorrector *correct2DPtr=nullptr)
Construct from mesh and dictionary and optional 2D corrector.
IOobject defines the attributes of an object for which implicit objectRegistry management is supporte...
const labelListList & cellCells() const
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.