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

patchInteractionData.H

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) 2009-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 Class
00025     Foam::patchInteractionData
00026 
00027 Description
00028     Helper class for the LocalInteraction patch interaction model
00029 
00030 \*---------------------------------------------------------------------------*/
00031 
00032 #ifndef patchInteractionData_H
00033 #define patchInteractionData_H
00034 
00035 #include <OpenFOAM/Istream.H>
00036 
00037 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00038 
00039 namespace Foam
00040 {
00041 /*---------------------------------------------------------------------------*\
00042                     Class patchInteractionData Declaration
00043 \*---------------------------------------------------------------------------*/
00044 
00045 // Forward declaration of classes
00046 class patchInteractionData;
00047 
00048 // Forward declaration of friend functions
00049 Istream& operator>>
00050 (
00051     Istream& is,
00052     patchInteractionData& pid
00053 );
00054 
00055 
00056 class patchInteractionData
00057 {
00058     // Private data
00059 
00060         //- Interaction type name
00061         word interactionTypeName_;
00062 
00063         //- Patch name
00064         word patchName_;
00065 
00066         //- Elasticity coefficient
00067         scalar e_;
00068 
00069         //- Restitution coefficient
00070         scalar mu_;
00071 
00072 
00073 public:
00074 
00075     // Constructor
00076 
00077         //- Construct null
00078         patchInteractionData();
00079 
00080 
00081     // Member functions
00082 
00083         // Access
00084 
00085             //- Return const access to the interaction type name
00086             const word& interactionTypeName() const;
00087 
00088             //- Return const access to the patch name
00089             const word& patchName() const;
00090 
00091             //- Return const access to the elasticity coefficient
00092             scalar e() const;
00093 
00094             //- Return const access to the restitution coefficient
00095             scalar mu() const;
00096 
00097 
00098         // I-O
00099 
00100             //- Istream operator
00101             friend Istream& operator>>
00102             (
00103                 Istream& is,
00104                 patchInteractionData& pid
00105             );
00106 /*            {
00107                 is.check
00108                 (
00109                     "Istream& operator>>"
00110                     "(Istream&, patchInteractionData&)"
00111                 );
00112 
00113                 const dictionaryEntry entry(dictionary::null, is);
00114 
00115                 pid.patchName_ = entry.keyword();
00116                 entry.lookup("type") >> pid.interactionTypeName_;
00117                 pid.e_ = entry.lookupOrDefault<scalar>("e", 1.0);
00118                 pid.mu_ = entry.lookupOrDefault<scalar>("mu", 0.0);
00119 
00120                 if
00121                 (
00122                     PatchInteractionModel<CloudType>::wordToInteractionType
00123                     (
00124                         pid.interactionTypeName_
00125                     )
00126                 == PatchInteractionModel<CloudType>::itOther)
00127                 {
00128                     FatalErrorIn
00129                     (
00130                         "friend Istream& operator>>"
00131                         "("
00132                             "Istream&, "
00133                             "patchInteractionData&"
00134                         ")"
00135                     )   << "Unknown patch interaction type "
00136                         << pid.interactionTypeName_
00137                         << ". Valid selections are:"
00138                         << PatchInteractionModel<CloudType>::
00139                         interactionTypeNames_
00140                         << endl << abort(FatalError);
00141                 }
00142 
00143                 return is;
00144             }
00145 */};
00146 
00147 
00148 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00149 
00150 } // End namespace Foam
00151 
00152 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00153 
00154 #endif
00155 
00156 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines