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] =
224 label index = cellInfo[celli].index();
230 <<
"Cell " << celli <<
" never visited to determine " 231 <<
"local coordinate system" <<
endl 232 <<
"Using direction " << defaultDir <<
" instead" <<
endl;
234 dirField[celli] = defaultDir;
238 else if (index == -2)
241 dirField[celli] = cellInfo[celli].n();
245 else if (index == -1)
248 <<
"Illegal index " << index <<
endl 264 Info<<
"Calculated local coords for " << defaultDir
266 <<
" Geometric cut cells : " << nGeom <<
endl 267 <<
" Topological cut cells : " << nTopo <<
endl 268 <<
" Unset cells : " << nUnset <<
endl 287 const word coordSystem(dict.
lookup(
"coordinateSystem"));
294 if (coordSystem !=
"fieldBased")
298 directionType wantedDir = directionTypeNames_[wantedDirs[i]];
304 else if (wantedDir == e1)
308 else if (wantedDir == e2)
316 if (coordSystem ==
"global")
321 check2D(correct2DPtr, e1);
324 check2D(correct2DPtr, e2);
329 Info<<
"Global Coordinate system:" <<
endl 330 <<
" e3 : " << e3 <<
endl 331 <<
" e1 : " << e1 <<
endl 348 else if (coordSystem ==
"patchLocal")
352 const word patchName(patchDict.
lookup(
"patch"));
359 <<
"Cannot find patch " 376 <<
"Discarding user specified e1 since 2D case." <<
endl 377 <<
"Recalculated e1 from face normal and planeNormal as " 386 if (wantE3 || wantE2)
400 this->operator[](nDirs++) = e3Dirs;
404 if (wantE1 || wantE2)
419 this->operator[](nDirs++) = e1Dirs;
426 this->operator[](nDirs++) = e2Dirs;
429 else if (coordSystem ==
"fieldBased")
433 operator[](nDirs++) =
449 <<
"Unknown coordinate system " 450 << coordSystem <<
endl 451 <<
"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.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
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.
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.
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 ...
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
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.
const fileName & instance() const
#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.
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.