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 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
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
29 Test direct mapped b.c. by mapping face centres (mesh.C().boundaryField()).
31 \*---------------------------------------------------------------------------*/
36 #include "volFields.H"
37 #include "meshTools.H"
40 #include "volFields.H"
41 #include "directMappedFixedValueFvPatchFields.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
50 int main(int argc, char *argv[])
52 # include "addTimeOptions.H"
53 # include "setRootCase.H"
54 # include "createTime.H"
55 # include "createMesh.H"
57 wordList patchFieldTypes
59 mesh.boundaryMesh().size(),
60 calculatedFvPatchVectorField::typeName
63 forAll(mesh.boundaryMesh(), patchI)
65 if (isA<directMappedPolyPatch>(mesh.boundaryMesh()[patchI]))
67 patchFieldTypes[patchI] =
68 directMappedFixedValueFvPatchVectorField::typeName;
72 Pout<< "patchFieldTypes:" << patchFieldTypes << endl;
85 dimensionedVector("zero", dimLength, vector::zero),
89 cc.internalField() = mesh.C().internalField();
90 cc.boundaryField().updateCoeffs();
92 forAll(cc.boundaryField(), patchI)
96 isA<directMappedFixedValueFvPatchVectorField>
98 cc.boundaryField()[patchI]
102 Pout<< "Detected a directMapped patch:" << patchI << endl;
104 OFstream str(mesh.boundaryMesh()[patchI].name() + ".obj");
105 Pout<< "Writing mapped values to " << str.name() << endl;
108 const fvPatchVectorField& fvp = cc.boundaryField()[patchI];
112 meshTools::writeOBJ(str, fvp.patch().Cf()[i]);
114 meshTools::writeOBJ(str, fvp[i]);
116 str << "l " << vertI-1 << ' ' << vertI << nl;
121 Info<< "End\n" << endl;
127 // ************************************************************************* //