96int main(
int argc,
char *argv[])
100 "Convert a neutral file format (Netgen v4.4) to OpenFOAM"
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()
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()
277 List<DynamicList<face>> allPatchFaces(
nPatches);
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]);
A HashTable similar to std::unordered_map.
Input from file stream as an ISstream, normally using std::ifstream for the actual input.
Defines the attributes of an object for which implicit objectRegistry management is supported,...
static unsigned int minPrecision(unsigned int prec) noexcept
Set the minimum default precision.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
static void addNote(const string ¬e)
Add extra notes for the usage information.
Like polyPatch but without reference to mesh. Used in boundaryMesh to hold data on patches....
Maps a geometry to a set of cell primitives.
static const cellModel & ref(const modelType model)
Look up reference to cellModel by enumeration. Fatal on failure.
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.
static word defaultName(const label n=-1)
Default patch name: "patch" or "patchN".
Mesh consisting of general polyhedral cells.
static word defaultRegion
Return the default region name.
Tet point storage. Default constructable (tetrahedron is not).
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.
#define WarningInFunction
Report a warning using Foam::Warning.
List< word > wordList
List of word.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
List< label > labelList
A List of labels.
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).
List< face > faceList
List of faces.
Ostream & endl(Ostream &os)
Add newline and flush stream.
List< faceList > faceListList
List of faceList.
vector point
Point is a vector.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
vectorField pointField
pointField is a vectorField.
errorManipArg< error, int > exit(error &err, const int errNo=1)
List< cellShape > cellShapeList
List of cellShape.
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.