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

PatchInteractionModel.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) 2008-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 "PatchInteractionModel.H"
00027 
00028 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
00029 
00030 template<class CloudType>
00031 Foam::wordList Foam::PatchInteractionModel<CloudType>::interactionTypeNames_
00032 (
00033     IStringStream
00034     (
00035         "(rebound stick escape)"
00036     )()
00037 );
00038 
00039 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00040 
00041 template<class CloudType>
00042 Foam::word Foam::PatchInteractionModel<CloudType>::interactionTypeToWord
00043 (
00044     const interactionType& itEnum
00045 )
00046 {
00047     switch (itEnum)
00048     {
00049         case itRebound:
00050         {
00051             return "rebound";
00052             break;
00053         }
00054         case itStick:
00055         {
00056             return "stick";
00057             break;
00058         }
00059         case itEscape:
00060         {
00061             return "escape";
00062             break;
00063         }
00064         default:
00065         {
00066             return "other";
00067         }
00068     }
00069 #ifdef __ICC
00070     // Prevent Icc complaining about missing return statement.
00071     return word::null;
00072 #endif
00073 }
00074 
00075 
00076 template<class CloudType>
00077 typename Foam::PatchInteractionModel<CloudType>::interactionType
00078 Foam::PatchInteractionModel<CloudType>::wordToInteractionType
00079 (
00080     const word& itWord
00081 )
00082 {
00083     if (itWord == "rebound")
00084     {
00085         return itRebound;
00086     }
00087     else if (itWord == "stick")
00088     {
00089         return itStick;
00090     }
00091     else if (itWord == "escape")
00092     {
00093         return itEscape;
00094     }
00095     else
00096     {
00097         return itOther;
00098     }
00099 }
00100 
00101 
00102 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00103 
00104 template<class CloudType>
00105 Foam::PatchInteractionModel<CloudType>::PatchInteractionModel
00106 (
00107     const dictionary& dict,
00108     CloudType& owner,
00109     const word& type
00110 )
00111 :
00112     dict_(dict),
00113     owner_(owner),
00114     coeffDict_(dict.subDict(type + "Coeffs"))
00115 {}
00116 
00117 
00118 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
00119 
00120 template<class CloudType>
00121 Foam::PatchInteractionModel<CloudType>::~PatchInteractionModel()
00122 {}
00123 
00124 
00125 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00126 
00127 template<class CloudType>
00128 const CloudType&
00129 Foam::PatchInteractionModel<CloudType>::owner() const
00130 {
00131     return owner_;
00132 }
00133 
00134 
00135 template<class CloudType>
00136 const Foam::dictionary& Foam::PatchInteractionModel<CloudType>::dict() const
00137 {
00138     return dict_;
00139 }
00140 
00141 
00142 template<class CloudType>
00143 const Foam::dictionary&
00144 Foam::PatchInteractionModel<CloudType>::coeffDict() const
00145 {
00146     return coeffDict_;
00147 }
00148 
00149 
00150 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00151 
00152 #include "NewPatchInteractionModel.C"
00153 
00154 // ************************ vim: set sw=4 sts=4 et: ************************ //
00155 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines