Initial commit for version 2.0.x patch release
[OpenFOAM-2.0.x.git] / src / regionModels / surfaceFilmModels / kinematicSingleLayer / kinematicSingleLayerTemplates.C
blobc1fb50103d6fed52f4fb0d5b03fc22dfddecbb3b
1 /*---------------------------------------------------------------------------*\\r
2   =========                 |\r
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox\r
4    \\    /   O peration     |\r
5     \\  /    A nd           | Copyright (C) 2010-2011 OpenCFD Ltd.\r
6      \\/     M anipulation  |\r
7 -------------------------------------------------------------------------------\r
8 License\r
9     This file is part of OpenFOAM.\r
11     OpenFOAM is free software: you can redistribute it and/or modify it\r
12     under the terms of the GNU General Public License as published by\r
13     the Free Software Foundation, either version 3 of the License, or\r
14     (at your option) any later version.\r
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT\r
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\r
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License\r
19     for more details.\r
21     You should have received a copy of the GNU General Public License\r
22     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.\r
24 \*---------------------------------------------------------------------------*/\r
26 #include "kinematicSingleLayer.H"\r
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //\r
30 namespace Foam\r
31 {\r
32 namespace regionModels\r
33 {\r
34 namespace surfaceFilmModels\r
35 {\r
37 // * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //\r
39 template<class Type>\r
40 void kinematicSingleLayer::constrainFilmField\r
41 (\r
42     Type& field,\r
43     const typename Type::cmptType& value\r
44 )\r
45 {\r
46     forAll(intCoupledPatchIDs_, i)\r
47     {\r
48         label patchI = intCoupledPatchIDs_[i];\r
49         field.boundaryField()[patchI] = value;\r
50         if (debug)\r
51         {\r
52             Info<< "Constraining " << field.name()\r
53                 << " boundary " << field.boundaryField()[patchI].patch().name()\r
54                 << " to " << value << endl;\r
55         }\r
56     }\r
57     forAll(passivePatchIDs_, i)\r
58     {\r
59         label patchI = passivePatchIDs_[i];\r
60         field.boundaryField()[patchI] = value;\r
61         if (debug)\r
62         {\r
63             Info<< "Constraining " << field.name()\r
64                 << " boundary " << field.boundaryField()[patchI].patch().name()\r
65                 << " to " << value << endl;\r
66         }\r
67     }\r
68 }\r
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //\r
73 } // end namespace Foam\r
74 } // end namespace regionModels\r
75 } // end namespace surfaceFilmModels\r
77 // ************************************************************************* //\r