55 Foam::directions::directionTypeNames_;
61 void Foam::directions::writeOBJ(
Ostream& os,
const point& pt)
63 os <<
"v " << pt.
x() <<
' ' << pt.
y() <<
' ' << pt.
z() <<
endl;
67 void Foam::directions::writeOBJ
78 os <<
"l " << vertI + 1 <<
' ' << vertI + 2 <<
endl;
85 void Foam::directions::writeOBJ
92 Pout<<
"Writing cell info to " << fName <<
" as vectors at the cellCentres" 104 scalar minDist = GREAT;
113 scalar scale = 0.5*minDist;
115 writeOBJ(xDirStream, ctr, ctr + scale*dirs[cellI], vertI);
120 void Foam::directions::check2D
131 <<
"is not normal to plane defined in dynamicMeshDict." 133 <<
"Either make case 3D or adjust vector." 165 <<
"useHexTopology specified but cell " << cellI
166 <<
" on face " << patchFaceI <<
" of patch " << pp.
name()
170 const vector& cutDir = ppField[patchFaceI];
186 changedFaces[patchFaceI] = meshFaceI;
187 changedFacesInfo[patchFaceI] =
199 changedFaces[patchFaceI] = pp.
start() + patchFaceI;
200 changedFacesInfo[patchFaceI] =
227 label index = cellInfo[cellI].index();
233 <<
"Cell " << cellI <<
" never visited to determine " 234 <<
"local coordinate system" <<
endl 235 <<
"Using direction " << defaultDir <<
" instead" <<
endl;
237 dirField[cellI] = defaultDir;
241 else if (index == -2)
244 dirField[cellI] = cellInfo[cellI].n();
248 else if (index == -1)
251 <<
"Illegal index " << index <<
endl 263 Pout<<
"Calculated local coords for " << defaultDir
265 <<
" Geometric cut cells : " << nGeom <<
endl 266 <<
" Topological cut cells : " << nTopo <<
endl 267 <<
" Unset cells : " << nUnset <<
endl 276 Foam::directions::directions
287 bool wantNormal =
false;
288 bool wantTan1 =
false;
289 bool wantTan2 =
false;
293 directionType wantedDir = directionTypeNames_[wantedDirs[i]];
295 if (wantedDir == NORMAL)
299 else if (wantedDir == TAN1)
303 else if (wantedDir == TAN2)
312 const word coordSystem(dict.
lookup(
"coordinateSystem"));
314 if (coordSystem ==
"global")
319 check2D(correct2DPtr, tan1);
322 check2D(correct2DPtr, tan2);
325 normal /=
mag(normal);
327 Pout<<
"Global Coordinate system:" <<
endl 328 <<
" normal : " << normal <<
endl 329 <<
" tan1 : " << tan1 <<
endl 330 <<
" tan2 : " << tan2
346 else if (coordSystem ==
"patchLocal")
350 const word patchName(patchDict.
lookup(
"patch"));
358 "directions::directions(const polyMesh&, const dictionary&," 359 "const twoDPointCorrector*)" 360 ) <<
"Cannot find patch " 378 "directions::directions(const polyMesh&, const dictionary&," 379 "const twoDPointCorrector*)" 380 ) <<
"Discarding user specified tan1 since 2D case." <<
endl 381 <<
"Recalculated tan1 from face normal and planeNormal as " 390 if (wantNormal || wantTan2)
404 this->operator[](nDirs++) = normalDirs;
408 if (wantTan1 || wantTan2)
423 this->operator[](nDirs++) = tan1Dirs;
430 this->operator[](nDirs++) = tan2Dirs;
437 "directions::directions(const polyMesh&, const dictionary&," 438 "const twoDPointCorrector*)" 439 ) <<
"Unknown coordinate system " 440 << coordSystem <<
endl 441 <<
"Known types are global and patchLocal" Holds direction in which to split cell (in fact a local coordinate axes). Information is a label and ...
const labelListList & cellCells() const
const word & name() const
Return name.
dimensioned< scalar > mag(const dimensioned< Type > &)
label cutDirToEdge(const primitiveMesh &, const label cellI, const vector &cutDir)
Reverse of edgeToCutDir: given direction find edge bundle and.
A class for handling words, derived from string.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
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.
const vectorField & cellCentres() const
A list of keyword definitions, which are a keyword followed by any number of values (e...
const dictionary & subDict(const word &) const
Find and return a sub-dictionary.
vector edgeToCutDir(const primitiveMesh &, const label cellI, const label edgeI)
Given edge on hex find all 'parallel' (i.e. non-connected)
A patch is a list of labels that address the faces in the global face list.
Class applies a two-dimensional correction to mesh motion point field.
Cell-face mesh analysis engine.
const vector & planeNormal() const
Return plane normal.
const double e
Elementary charge.
Ostream & endl(Ostream &os)
Add newline and flush stream.
#define WarningIn(functionName)
Report a warning using Foam::Warning.
Field< vector > vectorField
Specialisation of Field<T> for vector.
label nTotalCells() const
Return total number of cells in decomposed mesh.
A cellMatcher for hex cells.
errorManip< error > abort(error &err)
virtual const labelList & faceOwner() const
Return face owner.
const Field< PointType > & faceNormals() const
Return face normals for patch.
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
Initialise the NamedEnum HashTable from the static list of names.
#define FatalErrorIn(functionName)
Report an error message using Foam::FatalError.
label start() const
Return start label of this patch in the polyMesh face list.
directionType
Enumeration listing the possible coordinate directions.
Holds information regarding type of cell. Used in inside/outside determination in cellClassification...
Mesh consisting of general polyhedral cells.
ITstream & lookup(const word &, bool recursive=false, bool patternMatch=true) const
Find and return an entry data stream.
List< word > wordList
A List of words.
A class for handling file names.
A normal distribution model.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
dimensioned< Type > min(const dimensioned< Type > &, const dimensioned< Type > &)
void writeOBJ(Ostream &os, const point &pt)
Write obj representation of point.
label findPatchID(const word &patchName) const
Find patch index given a name.
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.
bool isA(const Type &t)
Check if a dynamic_cast to typeid is possible.
A class for managing temporary objects.
const globalMeshData & globalData() const
Return parallel info.
prefixOSstream Pout(cout,"Pout")