1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
7 -------------------------------------------------------------------------------
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
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 \*---------------------------------------------------------------------------*/
26 #include "STARCDsurfaceFormatCore.H"
29 #include "IStringStream.H"
31 // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
33 // parse things like this:
35 // don't bother with the older comma-delimited format
38 Foam::fileFormats::STARCDsurfaceFormatCore::readInpCellTable
47 " *CTNA[^ ]*" // keyword - min 4 chars
48 "[[:space:]]+" // space delimited
49 "([0-9]+)" // 1: <digits>
50 "[[:space:]]+" // space delimited
51 "([^,[:space:]].*)", // 2: <name>
57 while (is.good() && is.getLine(line).good())
59 if (ctnameRE.match(line, groups))
61 const label tableId = atoi(groups[0].c_str());
64 string::stripInvalid<word>(groups[1]);
66 if (!groups[1].empty())
68 lookup.insert(tableId, groups[1]);
77 void Foam::fileFormats::STARCDsurfaceFormatCore::writeCase
80 const pointField& pointLst,
82 const UList<surfZone>& zoneLst
85 word caseName = os.name().lessExt().name();
87 os << "! STAR-CD file written " << clock::dateTime().c_str() << nl
88 << "! " << pointLst.size() << " points, " << nFaces << " faces" << nl
89 << "! case " << caseName << nl
90 << "! ------------------------------" << nl;
92 forAll(zoneLst, zoneI)
94 os << "ctable " << zoneI + 1 << " shell" << " ,,,,,," << nl
95 << "ctname " << zoneI + 1 << " "
96 << zoneLst[zoneI].name() << nl;
99 os << "! ------------------------------" << nl
100 << "*set icvo mxv - 1" << nl
101 << "vread " << caseName << ".vrt icvo,,,coded" << nl
102 << "cread " << caseName << ".cel icvo,,,add,coded" << nl
110 // ************************************************************************* //