96 int 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()
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)
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()
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]);
static word defaultName(const label n=-1)
Default patch name: "patch" or "patchN".
static void addNote(const string ¬e)
Add extra notes for the usage information.
void size(const label n)
Older name for setAddressableSize.
A class for handling file names.
Like polyPatch but without reference to mesh. Used in boundaryMesh to hold data on patches...
errorManipArg< error, int > exit(error &err, const int errNo=1)
A face is a list of labels corresponding to mesh vertices.
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
An analytical geometric cellShape.
constexpr char nl
The newline '\n' character (0x0a)
wordList patchTypes(nPatches)
Ostream & endl(Ostream &os)
Add newline and flush stream.
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
static unsigned int defaultPrecision() noexcept
Return the default precision.
#define forAll(list, i)
Loop across all elements in list.
static const cellModel & ref(const modelType model)
Look up reference to cellModel by enumeration. Fatal on failure.
faceList faces() const
Faces of this cell.
void removeFiles(const fileName &instanceDir) const
Remove all files from mesh instance.
A class for handling words, derived from Foam::string.
A triangular face using a FixedList of labels corresponding to mesh vertices.
static word defaultRegion
Return the default region name.
wordList patchNames(nPatches)
A HashTable similar to std::unordered_map.
label find(const T &val) const
Find index of the first occurrence of the value.
virtual bool write(const bool writeOnProc=true) const
Write mesh using IO settings from time.
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
const word & constant() const noexcept
Return constant name.
point centre(const UList< point > &points) const
Return centre (centroid)
Input from file stream, using an ISstream.
vector areaNormal(const UList< point > &points) const
The area normal - with magnitude equal to area of face.
vector point
Point is a vector.
T get(const label index) const
Get a value from the argument at index.
#define WarningInFunction
Report a warning using Foam::Warning.
Tet point storage. Default constructable (tetrahedron is not)
void transfer(HashTable< T, Key, Hash > &rhs)
Transfer contents into this table.
Maps a geometry to a set of cell primitives.
static void addArgument(const string &argName, const string &usage="")
Append a (mandatory) argument to validArgs.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Mesh consisting of general polyhedral cells.
Foam::argList args(argc, argv)
Defines the attributes of an object for which implicit objectRegistry management is supported...
point centre(const UList< point > &points) const
Centroid of the cell.