FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

surfaceInterpolateFields.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 \*---------------------------------------------------------------------------*/
00025 
00026 #include "surfaceInterpolateFields.H"
00027 //#include "dictionary.H"
00028 
00029 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00030 
00031 namespace Foam
00032 {
00033     defineTypeNameAndDebug(surfaceInterpolateFields, 0);
00034 }
00035 
00036 
00037 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00038 
00039 Foam::surfaceInterpolateFields::surfaceInterpolateFields
00040 (
00041     const word& name,
00042     const objectRegistry& obr,
00043     const dictionary& dict,
00044     const bool loadFromFiles
00045 )
00046 :
00047     name_(name),
00048     obr_(obr),
00049     active_(true),
00050     fieldSet_()
00051 {
00052     // Check if the available mesh is an fvMesh otherise deactivate
00053     if (!isA<fvMesh>(obr_))
00054     {
00055         active_ = false;
00056         WarningIn
00057         (
00058             "surfaceInterpolateFields::surfaceInterpolateFields"
00059             "("
00060                 "const word&, "
00061                 "const objectRegistry&, "
00062                 "const dictionary&, "
00063                 "const bool"
00064             ")"
00065         )   << "No fvMesh available, deactivating."
00066             << endl;
00067     }
00068 
00069     read(dict);
00070 }
00071 
00072 
00073 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00074 
00075 Foam::surfaceInterpolateFields::~surfaceInterpolateFields()
00076 {}
00077 
00078 
00079 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00080 
00081 void Foam::surfaceInterpolateFields::read(const dictionary& dict)
00082 {
00083     if (active_)
00084     {
00085         dict.lookup("fields") >> fieldSet_;
00086     }
00087 }
00088 
00089 
00090 void Foam::surfaceInterpolateFields::execute()
00091 {
00092     //Info<< type() << " " << name_ << ":" << nl;
00093 
00094     // Clear out any previously loaded fields 
00095     ssf_.clear();
00096     svf_.clear();
00097     sSpheretf_.clear();
00098     sSymmtf_.clear();
00099     stf_.clear();
00100 
00101     interpolateFields<scalar>(ssf_);
00102     interpolateFields<vector>(svf_);
00103     interpolateFields<sphericalTensor>(sSpheretf_);
00104     interpolateFields<symmTensor>(sSymmtf_);
00105     interpolateFields<tensor>(stf_);
00106 }
00107 
00108 
00109 void Foam::surfaceInterpolateFields::end()
00110 {
00111     // Do nothing
00112 }
00113 
00114 
00115 void Foam::surfaceInterpolateFields::write()
00116 {
00117     // Do nothing
00118 }
00119 
00120 
00121 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines