BUG: createBaffles.C: converting coupled faces into baffles
[OpenFOAM-2.0.x.git] / applications / utilities / mesh / conversion / sammToFoam / writeMesh.C
blobf570552ce99abb1ae326e5cba5f4f9a806533d04
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software: you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by
13     the Free Software Foundation, either version 3 of the License, or
14     (at your option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
24 Description
25     Create intermediate mesh files from SAMM files
27 \*---------------------------------------------------------------------------*/
29 #include "sammMesh.H"
30 #include "Time.H"
31 #include "polyMesh.H"
33 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
35 void sammMesh::writeMesh()
37     if (isShapeMesh_)
38     {
39         Info<< "This is a shapeMesh." << endl;
41         polyMesh pShapeMesh
42         (
43             IOobject
44             (
45                 polyMesh::defaultRegion,
46                 runTime_.constant(),
47                 runTime_
48             ),
49             xferCopy(points_),           // we could probably re-use the data
50             cellShapes_,
51             boundary_,
52             patchNames_,
53             patchTypes_,
54             defaultFacesName_,
55             defaultFacesType_,
56             patchPhysicalTypes_
57         );
59         Info<< "Writing polyMesh" << endl;
60         pShapeMesh.write();
61     }
62     else
63     {
64         // This is a polyMesh.
66         createPolyMeshData();
68         Info<< "This is a polyMesh" << endl;
70         polyMesh pMesh
71         (
72             IOobject
73             (
74                 polyMesh::defaultRegion,
75                 runTime_.constant(),
76                 runTime_
77             ),
78             xferCopy(points_),           // we could probably re-use the data
79             xferCopy(meshFaces_),
80             xferCopy(cellPolys_)
81         );
83         pMesh.addPatches(polyBoundaryPatches(pMesh));
85         Info<< "Writing polyMesh" << endl;
86         pMesh.write();
87     }
91 // ************************************************************************* //