96int main(
int argc,
char *argv[])
100 "Convert a neutral file format (Netgen v4.4) to OpenFOAM"
102 argList::addArgument(
"Neutral file");
134 const cellModel& tet = cellModel::ref(cellModel::TET);
147 <<
"Cannot handle multiple domains"
148 <<
nl <<
"Ignoring domain " << domain <<
" setting on line "
149 << str.lineNumber() <<
endl;
178 forAll(boundaryFaces, facei)
185 <<
"Invalid boundary region number " << patchi
186 <<
" on line " << str.lineNumber()
191 maxPatch =
max(maxPatch, patchi);
196 boundaryFaces[facei].setSize(3);
197 boundaryFaces[facei][0] = tri[0];
198 boundaryFaces[facei][1] = tri[1];
199 boundaryFaces[facei][2] = tri[2];
202 vertsToBoundary.insert(tri, facei);
219 for (
const face&
f : tris)
223 auto iter = vertsToBoundary.find(
triFace(
f[0],
f[1],
f[2]));
227 const triFace& tri = iter.key();
228 const label facei = iter.val();
236 if (((fc - cc) & areaNorm) < 0)
239 boundaryFaces[facei].flip();
243 vertsToBoundary.erase(iter);
249 if (vertsToBoundary.size())
253 <<
"There are boundary faces without attached cells."
254 <<
"Boundary faces (as triFaces):" << vertsToBoundary.toc()
267 patchNames[patchi] = polyPatch::defaultName(patchi);
283 allPatchFaces[patchi].append(boundaryFaces[facei]);
287 <<
"\tNeutral Boundary\tPatch name\tSize" <<
nl
288 <<
"\t----------------\t----------\t----" <<
endl;
290 forAll(allPatchFaces, patchi)
292 Info<<
'\t' << patchi <<
"\t\t\t"
294 << allPatchFaces[patchi].size() <<
endl;
296 patchFaces[patchi].transfer(allPatchFaces[patchi]);
307 polyMesh::defaultRegion,
322 IOstream::defaultPrecision(
max(10u, IOstream::defaultPrecision()));
A HashTable similar to std::unordered_map.
Input from file stream, using an ISstream.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
T get(const label index) const
Get a value from the argument at index.
Like polyPatch but without reference to mesh. Used in boundaryMesh to hold data on patches....
Maps a geometry to a set of cell primitives.
An analytical geometric cellShape.
point centre(const UList< point > &points) const
Centroid of the cell.
faceList faces() const
Faces of this cell.
A face is a list of labels corresponding to mesh vertices.
A class for handling file names.
Mesh consisting of general polyhedral cells.
Tet storage. Null constructable (unfortunately tetrahedron<point, point> is not)
A triangular face using a FixedList of labels corresponding to mesh vertices.
point centre(const UList< point > &points) const
Return centre (centroid)
vector areaNormal(const UList< point > &points) const
The area normal - with magnitude equal to area of face.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
A class for handling words, derived from Foam::string.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
const labelList nFaces(UPstream::listGatherValues< label >(aMesh.nFaces()))
#define WarningInFunction
Report a warning using Foam::Warning.
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
errorManipArg< error, int > exit(error &err, const int errNo=1)
constexpr char nl
The newline '\n' character (0x0a)
wordList patchTypes(nPatches)
wordList patchNames(nPatches)
Foam::argList args(argc, argv)
#define forAll(list, i)
Loop across all elements in list.