1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2007 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/>.
28 Test direct mapped b.c. by mapping face centres (mesh.C().boundaryField()).
30 \*---------------------------------------------------------------------------*/
35 #include "volFields.H"
36 #include "meshTools.H"
39 #include "volFields.H"
40 #include "directMappedFixedValueFvPatchFields.H"
44 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
49 int main(int argc, char *argv[])
51 # include "addTimeOptions.H"
52 # include "setRootCase.H"
53 # include "createTime.H"
54 # include "createMesh.H"
56 wordList patchFieldTypes
58 mesh.boundaryMesh().size(),
59 calculatedFvPatchVectorField::typeName
62 forAll(mesh.boundaryMesh(), patchI)
64 if (isA<directMappedPolyPatch>(mesh.boundaryMesh()[patchI]))
66 patchFieldTypes[patchI] =
67 directMappedFixedValueFvPatchVectorField::typeName;
71 Pout<< "patchFieldTypes:" << patchFieldTypes << endl;
84 dimensionedVector("zero", dimLength, vector::zero),
88 cc.internalField() = mesh.C().internalField();
89 cc.boundaryField().updateCoeffs();
91 forAll(cc.boundaryField(), patchI)
95 isA<directMappedFixedValueFvPatchVectorField>
97 cc.boundaryField()[patchI]
101 Pout<< "Detected a directMapped patch:" << patchI << endl;
103 OFstream str(mesh.boundaryMesh()[patchI].name() + ".obj");
104 Pout<< "Writing mapped values to " << str.name() << endl;
107 const fvPatchVectorField& fvp = cc.boundaryField()[patchI];
111 meshTools::writeOBJ(str, fvp.patch().Cf()[i]);
113 meshTools::writeOBJ(str, fvp[i]);
115 str << "l " << vertI-1 << ' ' << vertI << nl;
120 Info<< "End\n" << endl;
126 // ************************************************************************* //