FreeFOAM The Cross-Platform CFD Toolkit
surfaceInterpolateFields.C
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
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.
15 
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
19  for more details.
20 
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/>.
23 
24 \*---------------------------------------------------------------------------*/
25 
27 //#include "dictionary.H"
28 
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
30 
31 namespace Foam
32 {
33  defineTypeNameAndDebug(surfaceInterpolateFields, 0);
34 }
35 
36 
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 
40 (
41  const word& name,
42  const objectRegistry& obr,
43  const dictionary& dict,
44  const bool loadFromFiles
45 )
46 :
47  name_(name),
48  obr_(obr),
49  active_(true),
50  fieldSet_()
51 {
52  // Check if the available mesh is an fvMesh otherise deactivate
53  if (!isA<fvMesh>(obr_))
54  {
55  active_ = false;
56  WarningIn
57  (
58  "surfaceInterpolateFields::surfaceInterpolateFields"
59  "("
60  "const word&, "
61  "const objectRegistry&, "
62  "const dictionary&, "
63  "const bool"
64  ")"
65  ) << "No fvMesh available, deactivating."
66  << endl;
67  }
68 
69  read(dict);
70 }
71 
72 
73 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
74 
76 {}
77 
78 
79 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
80 
82 {
83  if (active_)
84  {
85  dict.lookup("fields") >> fieldSet_;
86  }
87 }
88 
89 
91 {
92  //Info<< type() << " " << name_ << ":" << nl;
93 
94  // Clear out any previously loaded fields
95  ssf_.clear();
96  svf_.clear();
97  sSpheretf_.clear();
98  sSymmtf_.clear();
99  stf_.clear();
100 
101  interpolateFields<scalar>(ssf_);
102  interpolateFields<vector>(svf_);
103  interpolateFields<sphericalTensor>(sSpheretf_);
104  interpolateFields<symmTensor>(sSymmtf_);
105  interpolateFields<tensor>(stf_);
106 }
107 
108 
110 {
111  // Do nothing
112 }
113 
114 
116 {
117  // Do nothing
118 }
119 
120 
121 // ************************ vim: set sw=4 sts=4 et: ************************ //