1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 1991-2009 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
25 \*---------------------------------------------------------------------------*/
27 #include "rawTopoChangerFvMesh.H"
30 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
32 template<class Type, template<class> class PatchField, class GeoMesh>
33 void Foam::rawTopoChangerFvMesh::setUnmappedValues
35 GeometricField<Type, PatchField, GeoMesh>& fld,
36 const PackedList<1>& mappedFace,
37 const GeometricField<Type, PatchField, GeoMesh>& baseFld
40 //Pout<< "Checking field " << fld.name() << endl;
42 forAll(fld.boundaryField(), patchI)
44 PatchField<Type>& fvp = const_cast<PatchField<Type>&>
46 fld.boundaryField()[patchI]
49 label start = fvp.patch().patch().start();
52 if (!mappedFace[start+i])
54 //Pout<< "** Resetting unassigned value on patch "
55 // << fvp.patch().name()
56 // << " localface:" << i
57 // << " to:" << baseFld.boundaryField()[patchI][i] << endl;
58 fvp[i] = baseFld.boundaryField()[patchI][i];
65 template<class Type, template<class> class PatchField, class GeoMesh>
66 void Foam::rawTopoChangerFvMesh::zeroUnmappedValues
68 const PackedList<1>& mappedFace
71 typedef GeometricField<Type, PatchField, GeoMesh> FieldType;
73 const wordList fldNames(names(FieldType::typeName));
77 //Pout<< "Checking field " << fldNames[i] << endl;
79 FieldType& fld = const_cast<FieldType&>
81 lookupObject<FieldType>(fldNames[i])
100 dimensioned<Type>("0", fld.dimensions(), pTraits<Type>::zero)
107 // ************************************************************************* //