1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright (C) 2010-2010 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/>.
24 \*---------------------------------------------------------------------------*/
26 #include "surfaceInterpolateFields.H"
28 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
32 defineTypeNameAndDebug(surfaceInterpolateFields, 0);
36 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
38 Foam::surfaceInterpolateFields::surfaceInterpolateFields
41 const objectRegistry& obr,
42 const dictionary& dict,
43 const bool loadFromFiles
51 // Check if the available mesh is an fvMesh otherise deactivate
52 if (!isA<fvMesh>(obr_))
57 "surfaceInterpolateFields::surfaceInterpolateFields"
60 "const objectRegistry&, "
64 ) << "No fvMesh available, deactivating."
72 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
74 Foam::surfaceInterpolateFields::~surfaceInterpolateFields()
78 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
80 void Foam::surfaceInterpolateFields::read(const dictionary& dict)
84 dict.lookup("fields") >> fieldSet_;
89 void Foam::surfaceInterpolateFields::execute()
93 // Clear out any previously loaded fields
100 interpolateFields<scalar>(ssf_);
101 interpolateFields<vector>(svf_);
102 interpolateFields<sphericalTensor>(sSpheretf_);
103 interpolateFields<symmTensor>(sSymmtf_);
104 interpolateFields<tensor>(stf_);
109 void Foam::surfaceInterpolateFields::end()
115 void Foam::surfaceInterpolateFields::write()
119 Info<< "Writing interpolated surface fields to "
120 << obr_.time().timeName() << endl;
130 forAll(sSpheretf_, i)
132 sSpheretf_[i].write();
146 // ************************************************************************* //