initial commit for version 1.5.x patch release
[OpenFOAM-1.5.x.git] / applications / utilities / mesh / conversion / gambitToFoam / gambitToFoam.L
blobf4061e2a66f39d7db1fa476147f696766a1357e4
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2008 OpenCFD Ltd.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     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, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Application
26     gambitToFoam
28 Description
29     Converts a GAMBIT mesh to FOAM format.
31 \*---------------------------------------------------------------------------*/
35 #undef yyFlexLexer
37  /* ------------------------------------------------------------------------- *\
38    ------ local definitions
39  \* ------------------------------------------------------------------------- */
41 #include "scalarList.H"
42 #include "IStringStream.H"
44 using namespace Foam;
46 #include "argList.H"
47 #include "Time.H"
48 #include "polyMesh.H"
49 #include "emptyPolyPatch.H"
50 #include "preservePatchTypes.H"
51 #include "cellModeller.H"
52 #include "cellShape.H"
53 #include "SLList.H"
54 #include "SLPtrList.H"
56 label nPoints = 0;
57 label nCells = 0;
58 label nCellStreams = 0;
59 label nPatches = 0;
61 label nCoordDirections = 0;
62 label nVectorComponents = 0;
65 pointField points(0);
66 labelList pointMap(0);
68 PtrList<labelList> cellLabels(0);
69 labelList cellMap(0);
70 labelList cellTypes(0);
71 labelList cellStreamIDs(0);
73 wordList patchNames(0);
74 labelListList patchCells(0);
75 labelListList patchCellFaces(0);
76 label nValuesForPatchFaces = 0;
78 // Dummy yywrap to keep yylex happy at compile time.
79 // It is called by yylex but is not used as the mechanism to change file.
80 // See <<EOF>>
81 #if YY_FLEX_SUBMINOR_VERSION < 34
82 extern "C" int yywrap()
83 #else
84 int yyFlexLexer::yywrap()
85 #endif
87     return 1;
92 one_space             [ \t\f\r]
93 space                 {one_space}*
94 some_space            {one_space}+
95 cspace                ","{space}
96 spaceNl               ({space}|\n)*
98 alpha                 [_[:alpha:]]
99 digit                 [[:digit:]]
100 dec_digit             [[:digit:]]
101 octal_digit           [0-7]
102 hex_digit             [[:xdigit:]]
104 lbrac                      "("
105 rbrac                      ")"
106 quote                      \"
107 dash                       "-"
108 dotColonDash               [.:-]
110 identifier            {alpha}({alpha}|{digit})*
111 integer               {dec_digit}+
112 label                 [0-9]{dec_digit}*
113 zeroLabel             {digit}*
115 word                  ({alpha}|{digit}|{dotColonDash})*
117 exponent_part         [eE][-+]?{digit}+
118 fractional_constant   [-+]?(({digit}*"."{digit}+)|({digit}+"."?))
120 double                ((({fractional_constant}{exponent_part}?)|({digit}+{exponent_part}))|0)
122 x                     {double}
123 y                     {double}
124 z                     {double}
125 scalar                {double}
126 labelListElement      {space}{zeroLabel}
127 scalarListElement     {space}{double}
128 labelList             ({labelListElement}+{space})
129 scalarList            ({scalarListElement}+{space})
131 starStar              ("**")
132 text                  ({space}({word}*{space})*\n)
134 dateDDMMYYYY          ({digit}{digit}"/"{digit}{digit}"/"{digit}{digit}{digit}{digit})
135 dateDDMonYYYY         ((({digit}{digit}{space})|({digit}{space})){alpha}*{space}{digit}{digit}{digit}{digit})
136 time                  ({digit}{digit}":"{digit}{digit}":"{digit}{digit})
138 versionNumber         ({digit}|".")*
140 controlInfo           ^{space}"CONTROL INFO"{space}{versionNumber}
141 applicationData       ^{space}"APPLICATION DATA"{space}{versionNumber}
142 nodalCoords           ^{space}"NODAL COORDINATES"{space}{versionNumber}
143 cellsAndElements      ^{space}"ELEMENTS/CELLS"{space}{versionNumber}
144 cellStreams           ^{space}"ELEMENT GROUP"{space}{versionNumber}
145 boundaryPatch         ^{space}"BOUNDARY CONDITIONS"{space}{versionNumber}
146 faceConnectivity      ^{space}"FACE CONNECTIVITY"{space}{versionNumber}
148 endOfSection          ^{space}"ENDOFSECTION"{space}
150 program               {space}"PROGRAM:"{space}
151 version               {space}"VERSION:"{space}
153 group                 {space}"GROUP:"{space}
154 elements              {space}"ELEMENTS:"{space}
155 material              {space}"MATERIAL:"{space}
156 nFlags                {space}"NFLAGS:"{space}
157 mtype                 {space}"MTYPE:"{space}
160  /* ------------------------------------------------------------------------- *\
161                       -----  Exclusive start states -----
162  \* ------------------------------------------------------------------------- */
164 %option stack
166 %x controlInfo
167 %x readControlHeader
168 %x readTitle
169 %x readProgramID
170 %x readVersionID
171 %x applicationData
172 %x nodalCoords
173 %x cellsAndElements
174 %x cellStreams
175 %x cellStreamTitle
176 %x cellStreamFlags
177 %x cellStreamLabels
178 %x readCellStreamGroupID
179 %x readCellStreamNElements
180 %x readCellStreamMaterial
181 %x readCellStreamNFlags
182 %x boundaryPatch
183 %x boundaryPatchParams
184 %x boundaryPatchFaces
185 %x faceConnectivity
187 %x globalMeshData
188 %x cellContLine
193     label nCellContinuationLines = 0;
194     label curNumberOfNodes = 0;
195     label curNumberOfCells = 0;
196     label curGroupID = 0;
197     label nFlagsForStream = 0;
198     label curBoundaryPatch = 0;
199     label curPatchFace = 0;
203  /* ------------------------------------------------------------------------- *\
204                             ------ Start Lexing ------
205  \* ------------------------------------------------------------------------- */
207  /*                      ------ Reading control header ------                 */
209 {controlInfo} {
210         BEGIN(readControlHeader);
211     }
214 <readControlHeader>{starStar}{space}{text} {
215         BEGIN(readTitle);
216     }
219 <readTitle>{text} {
221         Info  << "Title: " << YYText();
222         BEGIN(controlInfo);
223     }
226 <controlInfo>{spaceNl}{program} {
227         BEGIN(readProgramID);
228     }
231 <readProgramID>{space}{word} {
233         Info << "Written by " << YYText() << " ";
234         BEGIN(controlInfo);
235     }
238 <controlInfo>{spaceNl}{version} {
239         BEGIN(readVersionID);
240     }
243 <readVersionID>{space}{versionNumber} {
245         Info << " version " << YYText() << endl;
246         BEGIN(controlInfo);
247     }
250 <controlInfo>{space}{dateDDMonYYYY}{space}{time} {
252         Info << "File written on " << YYText() << endl;
253     }
256 <controlInfo>{space}{dateDDMMYYYY}{space}{time} {
258         Info << "File written on " << YYText() << endl;
259     }
262 <controlInfo>{spaceNl}"NUMNP"{space}"NELEM"{space}"NGRPS"{space}"NBSETS"{space}("NDFCD"|"NDCFD"){space}"NDFVL"{space}\n {
263         BEGIN(globalMeshData);
264     }
267 <globalMeshData>{spaceNl}{label}{space}{label}{space}{label}{space}{label}{space}{label}{space}{label}{space}\n {
269         IStringStream nodeStream(YYText());
271         nPoints = readLabel(nodeStream);
272         nCells = readLabel(nodeStream);
273         nCellStreams = readLabel(nodeStream);
274         nPatches = readLabel(nodeStream);
275         nCoordDirections = readLabel(nodeStream);
276         nVectorComponents = readLabel(nodeStream);
278         // reset list sizes - now known!
279         points.setSize(nPoints);
280         pointMap.setSize(nPoints);
282         cellLabels.setSize(nCells);
283         cellMap.setSize(nCells);
284         cellTypes.setSize(nCells);
285         cellStreamIDs.setSize(nCells);
287         patchNames.setSize(nPatches);
288         patchCells.setSize(nPatches);
289         patchCellFaces.setSize(nPatches);
291         Info<< "    number of points:  " <<  nPoints << endl
292             << "    number of cells:   " << nCells << endl
293             << "    number of patches: " << nPatches << endl;
295         BEGIN(controlInfo);
296     }
299  /*                 ------  Reading nodal coordinates ------                 */
301 {nodalCoords}{spaceNl} {
303         curNumberOfNodes = 0;
304         Info << "Reading nodal coordinates" << endl;
305         BEGIN(nodalCoords);
306     }
309 <nodalCoords>{spaceNl}{label}{space}{x}{space}{y}{space}{z}{space}\n {
311         IStringStream nodeStream(YYText());
313         label nodeI(readLabel(nodeStream));
315         // Note: coordinates must be read one at the time.
316         scalar x = readScalar(nodeStream);
317         scalar y = readScalar(nodeStream);
318         scalar z = readScalar(nodeStream);
320         // add mapping and scalced node to the list
321         pointMap[curNumberOfNodes] = nodeI;
322         points[curNumberOfNodes] = point(x, y, z);
323         curNumberOfNodes++;
324     }
327  /*                   ------ Reading cells and elements ------               */
329 {cellsAndElements}{spaceNl} {
331         curNumberOfCells = 0;
332         Info << "Reading cells" << endl;
333         BEGIN(cellsAndElements);
334     }
336 <cellsAndElements>{spaceNl}{label}{space}{label}{space}{label}{labelList} {
338         IStringStream elementStream(YYText());
340         label cellI(readLabel(elementStream));
341         label cellType(readLabel(elementStream));
342         label nVertices(readLabel(elementStream));
344         // reset number of continuation lines
345         nCellContinuationLines = 0;
347         cellMap[curNumberOfCells] = cellI;
348         cellTypes[curNumberOfCells] = cellType;
349         cellLabels.set(curNumberOfCells, new labelList(nVertices));
351         labelList& curLabels = cellLabels[curNumberOfCells];
353         // Find out how many labels are expected. If less or equal to
354         // seven, read them all and finish with it. If there is more,
355         // set read of the next line
356         label labelsToRead = min(8, nVertices);
357         label labelI = 0;
358         for (; labelI < labelsToRead; labelI++)
359         {
360             if (elementStream.eof()) break;
362             // Check token to avoid trailing space.
363             token curLabelTok(elementStream);
364             if (curLabelTok.isLabel())
365             {
366                 curLabels[labelI] = curLabelTok.labelToken();
367             }
368             else
369             {
370                 break;
371             }
372         }
374         if (labelI < nVertices)
375         {
376             BEGIN(cellContLine);
377         }
378         else
379         {
380             curNumberOfCells++;
381         }
382     }
385 <cellContLine>{spaceNl}{labelList} {
387         IStringStream elementStream(YYText());
389         nCellContinuationLines++;
391         labelList& curLabels = cellLabels[curNumberOfCells];
393         label labelsToRead = min
394         (
395             (nCellContinuationLines + 1)*7,
396             curLabels.size()
397         );
399         for
400         (
401             label labelI = nCellContinuationLines*7;
402             labelI < labelsToRead;
403             labelI++
404         )
405         {
406             curLabels[labelI] = readLabel(elementStream);
407         }
409         // if read is finished, go back to reading cells
410         if (curLabels.size() < (nCellContinuationLines + 1)*7)
411         {
412             curNumberOfCells++;
414             BEGIN(cellsAndElements);
415         }
416     }
419  /*             ------ Reading element group information ------               */
421 {cellStreams}{spaceNl} {
422         Info << "Reading cell streams" << endl;
423         BEGIN(cellStreams);
424     }
427 <cellStreams>{spaceNl}{group} {
428         BEGIN(readCellStreamGroupID);
429     }
432 <readCellStreamGroupID>{space}{label} {
433         IStringStream groupStream(YYText());
435         if (curGroupID > 0)
436         {
437             FatalErrorIn("gambitToFoam::main")
438                 << "<readCellStreamGroupID>{space}{label} : "
439                 << "trying to reset group ID while active"
440                 << abort(FatalError);
441         }
442         else
443         {
444             curGroupID = readLabel(groupStream);;
445         }
447         BEGIN(cellStreams);
448     }
451 <cellStreams>{spaceNl}{elements} {
452         BEGIN(readCellStreamNElements);
453     }
456 <readCellStreamNElements>{space}{label} {
458         IStringStream nElementsStream(YYText());
460         readLabel(nElementsStream);
462         BEGIN(cellStreams);
463     }
465 <cellStreams>{spaceNl}{material} {
466         BEGIN(readCellStreamMaterial);
467     }
470 <readCellStreamMaterial>{space}{label} {
472         IStringStream materialIDstream(YYText());
474         readLabel(materialIDstream);
476         BEGIN(cellStreams);
477     }
480 <cellStreams>{spaceNl}{nFlags} {
481         BEGIN(readCellStreamNFlags);
482     }
485 <readCellStreamNFlags>{space}{label} {
487         IStringStream nFlagsStream(YYText());
489         nFlagsForStream = readLabel(nFlagsStream);
491         BEGIN(cellStreamTitle);
492     }
495 <cellStreamTitle>{spaceNl}{word}{spaceNl} {
497         word streamName(Foam::string::validate<word>(YYText()));
499         BEGIN(cellStreamFlags);
500     }
503 <cellStreamFlags>{labelList} {
504         Info << "Reading cell stream labels" << endl;
505         BEGIN(cellStreamLabels);
506     }
509 <cellStreamLabels>{spaceNl}{labelList} {
511         IStringStream nFlagsStream(YYText());
513         label cellLabel;
514         while (nFlagsStream.read(cellLabel))
515         {
516             cellStreamIDs[cellLabel - 1] = curGroupID;
517         }
519         // reset current group ID and a number of flags
520         curGroupID = 0;
521         nFlagsForStream = 0;
522     }
525  /*            ------  Reading end of section and others ------               */
527 <cellStreamLabels>{endOfSection}\n {
529         Info << "Finished reading cell stream labels" << endl;
531         // reset current group ID and a number of flags
532         curGroupID = 0;
533         nFlagsForStream = 0;
535         BEGIN(INITIAL);
536     }
539 {boundaryPatch}{spaceNl} {
540         curPatchFace = 0;
541         Info << "Reading patches" << endl;
542         BEGIN(boundaryPatchParams);
543     }
546 <boundaryPatchParams>{spaceNl}{word}{labelList} {
548         IStringStream patchParamsStream(YYText());
550         patchParamsStream.read(patchNames[curBoundaryPatch]);
552         readLabel(patchParamsStream);
553         label nEntry(readLabel(patchParamsStream));
554         nValuesForPatchFaces = readLabel(patchParamsStream);
556         patchCells[curBoundaryPatch].setSize(nEntry);
557         patchCellFaces[curBoundaryPatch].setSize(nEntry);
559         Info<< "patch " << curBoundaryPatch
560             << ": name: " << patchNames[curBoundaryPatch]
561             << endl;
563         BEGIN(boundaryPatchFaces);
564     }
567 <boundaryPatchFaces>{spaceNl}{label}{space}{label}{space}{label}({scalarList}|{space}\n) {
569         // Face-based boundary condition
570         IStringStream patchFacesStream(YYText());
572         patchCells[curBoundaryPatch][curPatchFace] =
573             readLabel(patchFacesStream);
574         readLabel(patchFacesStream);
575         patchCellFaces[curBoundaryPatch][curPatchFace] =
576             readLabel(patchFacesStream);
578         // patch face values currently discarded
579         if (nValuesForPatchFaces > 0)
580         {
581             scalarList patchFaceValues(nValuesForPatchFaces);
583             forAll (patchFaceValues, fI)
584             {
585                 patchFaceValues[fI] = readScalar(patchFacesStream);
586             }
587         }
589         curPatchFace++;
590     }
593 <boundaryPatchFaces>{spaceNl}{label}({scalarList}|\n) {
595         // Vertex-based boundary condition
596         FatalErrorIn("gambitToFoam::main")
597             << "<boundaryPatchFaces>{spaceNl}{label}{scalarList} : "
598             << "boundary condition specified on vertices not supported"
599             << abort(FatalError);
600     }
603 <boundaryPatchFaces>{endOfSection}\n {
605         curBoundaryPatch++;
607         BEGIN(INITIAL);
608     }
611  /*             ------ Reading end of section and others ------               */
613 <controlInfo,nodalCoords,cellsAndElements>{endOfSection}\n {
614         BEGIN(INITIAL);
615     }
618  /* ------ Ignore remaining space and \n s.  Any other characters are errors. */
620 .|\n {}
623  /*  ------ On EOF return to previous file, if none exists terminate. ------  */
625 <<EOF>> {
626             yyterminate();
627     }
631 #include "fileName.H"
632 #include <fstream>
633 using std::ifstream;
635 int main(int argc, char *argv[])
637     argList::noParallel();
638     argList::validArgs.append("GAMBIT file");
639     argList::validOptions.insert("scale", "scale factor");
641     argList args(argc, argv);
643     if (!args.check())
644     {
645          FatalError.exit();
646     }
648     scalar scaleFactor = 1.0;
649     if (args.options().found("scale"))
650     {
651         scaleFactor = atof(args.options()["scale"].c_str());
652     }
654 #   include "createTime.H"
656     fileName gambitFile(args.additionalArgs()[0]);
657     ifstream gambitStream(gambitFile.c_str());
659     if (!gambitStream)
660     {
661         FatalErrorIn("gambitToFoam::main")
662             << args.executable()
663             << ": file " << gambitFile << " not found"
664             << abort(FatalError);
665     }
667     yyFlexLexer lexer(&gambitStream);
668     while(lexer.yylex() != 0)
669     {}
671     Info << "Finished lexing" << endl;
673     // make a point mapping array
674     label maxPointIndex = 0;
676     forAll (pointMap, pointI)
677     {
678         if (pointMap[pointI] > maxPointIndex)
679         {
680             maxPointIndex = pointMap[pointI];
681         }
682     }
685     labelList pointLookup(maxPointIndex + 1, -1);
687     forAll (pointMap, pointI)
688     {
689         pointLookup[pointMap[pointI] ] = pointI;
690     }
692     // make a cell mapping array
693     label maxCellIndex = 0;
695     forAll (cellMap, cellI)
696     {
697         if (cellMap[cellI] > maxCellIndex)
698         {
699             maxCellIndex = cellMap[cellI];
700         }
701     }
703     labelList cellLookup(maxCellIndex + 1);
705     forAll (cellMap, cellI)
706     {
707         cellLookup[cellMap[cellI] ] = cellI;
708     }
710     const cellModel& hex = *(cellModeller::lookup("hex"));
711     const cellModel& prism = *(cellModeller::lookup("prism"));
712     const cellModel& pyr = *(cellModeller::lookup("pyr"));
713     const cellModel& tet = *(cellModeller::lookup("tet"));
715     labelList labelsHex(8);
716     labelList labelsPrism(6);
717     labelList labelsPyramid(5);
718     labelList labelsTet(4);
720     cellShapeList cells(cellLabels.size());
722     forAll (cellTypes, cellI)
723     {
724         const labelList& curCellLabels = cellLabels[cellI];
726         // Tetrahedron
727         if (cellTypes[cellI] == 6)
728         {
729             labelsTet[0] = pointLookup[curCellLabels[0] ];
730             labelsTet[1] = pointLookup[curCellLabels[2] ];
731             labelsTet[2] = pointLookup[curCellLabels[3] ];
732             labelsTet[3] = pointLookup[curCellLabels[1] ];
734             cells[cellI] = cellShape(tet, labelsTet);
735         }
737         // Square-based pyramid
738         else if (cellTypes[cellI] == 7)
739         {
740             labelsPyramid[0] = pointLookup[curCellLabels[0] ];
741             labelsPyramid[1] = pointLookup[curCellLabels[1] ];
742             labelsPyramid[2] = pointLookup[curCellLabels[3] ];
743             labelsPyramid[3] = pointLookup[curCellLabels[2] ];
744             labelsPyramid[4] = pointLookup[curCellLabels[4] ];
746             cells[cellI] = cellShape(pyr, labelsPyramid);
747         }
749         // Triangular prism
750         else if (cellTypes[cellI] == 5)
751         {
752             labelsPrism[0] = pointLookup[curCellLabels[0] ];
753             labelsPrism[1] = pointLookup[curCellLabels[1] ];
754             labelsPrism[2] = pointLookup[curCellLabels[2] ];
755             labelsPrism[3] = pointLookup[curCellLabels[3] ];
756             labelsPrism[4] = pointLookup[curCellLabels[4] ];
757             labelsPrism[5] = pointLookup[curCellLabels[5] ];
759             cells[cellI] = cellShape(prism, labelsPrism);
760         }
762         // Hex
763         else if (cellTypes[cellI] == 4)
764         {
765             labelsHex[0] = pointLookup[curCellLabels[0] ];
766             labelsHex[1] = pointLookup[curCellLabels[1] ];
767             labelsHex[2] = pointLookup[curCellLabels[3] ];
768             labelsHex[3] = pointLookup[curCellLabels[2] ];
769             labelsHex[4] = pointLookup[curCellLabels[4] ];
770             labelsHex[5] = pointLookup[curCellLabels[5] ];
771             labelsHex[6] = pointLookup[curCellLabels[7] ];
772             labelsHex[7] = pointLookup[curCellLabels[6] ];
774             cells[cellI] = cellShape(hex, labelsHex);
775         }
776     }
778     // give foam model face number given a fluent model face number
779     label faceIndex[8][6] =
780     {
781         {-1, -1, -1, -1, -1, -1},  // 0
782         {-1, -1, -1, -1, -1, -1},  // 1
783         {-1, -1, -1, -1, -1, -1},  // 2
784         { 2,  1,  3,  0,  4,  5},  // Hex (3)
785         {-1, -1, -1, -1, -1, -1},  // 4
786         { 4,  3,  2,  0,  1, -1},  // Triangular prism (5)
787         { 0,  4,  3,  2,  1, -1},  // Pyramid (6)
788         { 2,  1,  0,  3, -1, -1}   // Tet (7)
789     };
791     faceListList boundary(patchCells.size());
793     forAll(patchCells, patchI)
794     {
795         labelList& curCells = patchCells[patchI];
796         labelList& curFaces = patchCellFaces[patchI];
798         faceList& patchFaces = boundary[patchI];
799         patchFaces.setSize(curCells.size());
801         forAll (curCells, faceI)
802         {
803             patchFaces[faceI] =
804                 cells[cellLookup[curCells[faceI] ] ].faces()
805                 [
806                     faceIndex
807                     [
808                         // this picks a cell type
809                         cells[cellLookup[curCells[faceI] ] ]
810                             .model().index()
811                     ]
812                     [curFaces[faceI] - 1] // this gives a fluent face - 1
813                 ];
815         }
816     }
818     Info << "gambitToFoam: " << endl
819         << "Gambit file format does not provide information about the type of "
820         << "the patch (eg. wall, symmetry plane, cyclic etc)." << endl
821         << "All the patches have been created "
822         << "as type patch. Please reset after mesh conversion as necessary."
823         << endl;
825     // Scale points
826     points *= scaleFactor;
828     wordList patchTypes(boundary.size(), polyPatch::typeName);
829     word defaultFacesName = "defaultFaces";
830     word defaultFacesType = emptyPolyPatch::typeName;
831     wordList patchPhysicalTypes(boundary.size());
833     preservePatchTypes
834     (
835         runTime,
836         runTime.constant(),
837         polyMesh::defaultRegion,
838         patchNames,
839         patchTypes,
840         defaultFacesName,
841         defaultFacesType,
842         patchPhysicalTypes
843     );
845     // Mesh will auto-write on construction
846     polyMesh pShapeMesh
847     (
848         IOobject
849         (
850             polyMesh::defaultRegion,
851             runTime.constant(),
852             runTime
853         ),
854         points,
855         cells,
856         boundary,
857         patchNames,
858         patchTypes,
859         defaultFacesName,
860         defaultFacesType,
861         patchPhysicalTypes
862     );
864     // Set the precision of the points data to 10
865     IOstream::defaultPrecision(10);
867     Info << "Writing polyMesh" << endl;
868     pShapeMesh.write();
870     Info<< nl << "End" << endl;
871     return 0;
875  /* ------------------------------------------------------------------------- *\
876     ------ End of gambitToFoam.L
877  \* ------------------------------------------------------------------------- */