1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
25 Foam::meshWriters::Elmer
28 Writes polyMesh in CSC/Elmer format: generates the files
36 The cellTableId and cellTable information are used (if available).
37 Otherwise the cellZones are used (if available).
42 \*---------------------------------------------------------------------------*/
44 #ifndef ElmerMeshWriter_H
45 #define ElmerMeshWriter_H
47 #include "meshWriter.H"
48 #include "wordReList.H"
63 // Elmer element type labels
64 #define ELMER_ETYPE_BAD 0 // Not a valid element type
65 #define ELMER_ETYPE_TRIA 303
66 #define ELMER_ETYPE_QUAD 404
67 #define ELMER_ETYPE_TET 504
68 #define ELMER_ETYPE_PRISM 706
69 #define ELMER_ETYPE_PYRAM 605
70 #define ELMER_ETYPE_HEX 808
72 const wordRe& faceZoneExcludePattern;
74 //- Disallow default bitwise copy construct
77 //- Disallow default bitwise assignment
78 void operator=(const Elmer&);
80 //- Get the Elmer face element type ID based on the number of vertices of a face
81 label getFaceType(const label nvert, const word &zname) const;
83 //- Save the mesh.header file containing the global counters
84 bool writeHeader() const;
86 //- Save the mesh.names file containing the names of all zones & patches
87 void writeNames() const;
89 //- Save the mesh.nodes file
90 void writeNodes() const;
92 //- Save the mesh.elements file. This file contains only the volume
93 //- elements, not the faces on the boundaries
94 void writeElements () const;
96 //- Save the mesh.boundary file. This file contains only the faces elements
98 void writeBoundary () const;
100 //- Build the cell table information
101 void getCellTable ();
108 //- Construct from polyMesh and option arguments.
112 const wordRe& excludePattern,
113 const scalar scaleFactor = 1.0
122 //- Write mesh in elmer format
123 virtual bool write(const fileName& dirName = fileName::null) const;
127 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
129 } // End namespace Foam
131 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
133 } // End namespace meshWriters
138 // ************************************************************************* //