Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 #include <finiteVolume/fv.H>
00030 #include <OpenFOAM/HashTable.H>
00031 #include <finiteVolume/linear.H>
00032 
00033 
00034 
00035 namespace Foam
00036 {
00037 
00038 
00039 
00040 namespace fv
00041 {
00042 
00043 
00044 
00045 
00046 template<class Type>
00047 convectionScheme<Type>::convectionScheme(const convectionScheme& cs)
00048 :
00049     refCount(),
00050     mesh_(cs.mesh_)
00051 {}
00052 
00053 
00054 
00055 
00056 template<class Type>
00057 tmp<convectionScheme<Type> > convectionScheme<Type>::New
00058 (
00059     const fvMesh& mesh,
00060     const surfaceScalarField& faceFlux,
00061     Istream& schemeData
00062 )
00063 {
00064     if (fv::debug)
00065     {
00066         Info<< "convectionScheme<Type>::New"
00067                "(const fvMesh&, const surfaceScalarField&, Istream&) : "
00068                "constructing convectionScheme<Type>"
00069             << endl;
00070     }
00071 
00072     if (schemeData.eof())
00073     {
00074         FatalIOErrorIn
00075         (
00076             "convectionScheme<Type>::New"
00077             "(const fvMesh&, const surfaceScalarField&, Istream&)",
00078             schemeData
00079         )   << "Convection scheme not specified" << endl << endl
00080             << "Valid convection schemes are :" << endl
00081             << IstreamConstructorTablePtr_->sortedToc()
00082             << exit(FatalIOError);
00083     }
00084 
00085     word schemeName(schemeData);
00086 
00087     typename IstreamConstructorTable::iterator cstrIter =
00088         IstreamConstructorTablePtr_->find(schemeName);
00089 
00090     if (cstrIter == IstreamConstructorTablePtr_->end())
00091     {
00092         FatalIOErrorIn
00093         (
00094             "convectionScheme<Type>::New"
00095             "(const fvMesh&, const surfaceScalarField&, Istream&)",
00096             schemeData
00097         )   << "unknown convection scheme " << schemeName << endl << endl
00098             << "Valid convection schemes are :" << endl
00099             << IstreamConstructorTablePtr_->sortedToc()
00100             << exit(FatalIOError);
00101     }
00102 
00103     return cstrIter()(mesh, faceFlux, schemeData);
00104 }
00105 
00106 
00107 template<class Type>
00108 tmp<convectionScheme<Type> > convectionScheme<Type>::New
00109 (
00110     const fvMesh& mesh,
00111     const typename multivariateSurfaceInterpolationScheme<Type>::
00112         fieldTable& fields,
00113     const surfaceScalarField& faceFlux,
00114     Istream& schemeData
00115 )
00116 {
00117     if (fv::debug)
00118     {
00119         Info<< "convectionScheme<Type>::New"
00120                "(const fvMesh&, "
00121                "const typename multivariateSurfaceInterpolationScheme<Type>"
00122                "::fieldTable&, const surfaceScalarField&, Istream&) : "
00123                "constructing convectionScheme<Type>"
00124             << endl;
00125     }
00126 
00127     if (schemeData.eof())
00128     {
00129         FatalIOErrorIn
00130         (
00131             "convectionScheme<Type>::New"
00132                "(const fvMesh&, "
00133                "const typename multivariateSurfaceInterpolationScheme<Type>"
00134                "::fieldTable&, const surfaceScalarField&, Istream&)",
00135             schemeData
00136         )   << "Convection scheme not specified" << endl << endl
00137             << "Valid convection schemes are :" << endl
00138             << MultivariateConstructorTablePtr_->sortedToc()
00139             << exit(FatalIOError);
00140     }
00141 
00142     word schemeName(schemeData);
00143 
00144     typename MultivariateConstructorTable::iterator cstrIter =
00145         MultivariateConstructorTablePtr_->find(schemeName);
00146 
00147     if (cstrIter == MultivariateConstructorTablePtr_->end())
00148     {
00149         FatalIOErrorIn
00150         (
00151             "convectionScheme<Type>::New"
00152             "(const fvMesh&, "
00153             "const typename multivariateSurfaceInterpolationScheme<Type>"
00154             "::fieldTable&, const surfaceScalarField&, Istream&)",
00155             schemeData
00156         )   << "unknown convection scheme " << schemeName << endl << endl
00157             << "Valid convection schemes are :" << endl
00158             << MultivariateConstructorTablePtr_->sortedToc()
00159             << exit(FatalIOError);
00160     }
00161 
00162     return cstrIter()(mesh, fields, faceFlux, schemeData);
00163 }
00164 
00165 
00166 
00167 
00168 template<class Type>
00169 convectionScheme<Type>::~convectionScheme()
00170 {}
00171 
00172 
00173 
00174 
00175 template<class Type>
00176 void convectionScheme<Type>::operator=(const convectionScheme<Type>& cs)
00177 {
00178     if (this == &cs)
00179     {
00180         FatalErrorIn
00181         (
00182             "convectionScheme<Type>::operator=(const convectionScheme<Type>&)"
00183         )   << "attempted assignment to self"
00184             << abort(FatalError);
00185     }
00186 }
00187 
00188 
00189 
00190 
00191 } 
00192 
00193 
00194 
00195 } 
00196 
00197