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

genericFvPatchField.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) 1991-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 "genericFvPatchField.H"
00027 #include <finiteVolume/fvPatchFieldMapper.H>
00028 
00029 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
00030 
00031 template<class Type>
00032 Foam::genericFvPatchField<Type>::genericFvPatchField
00033 (
00034     const fvPatch& p,
00035     const DimensionedField<Type, volMesh>& iF
00036 )
00037 :
00038     calculatedFvPatchField<Type>(p, iF)
00039 {
00040     FatalErrorIn
00041     (
00042         "genericFvPatchField<Type>::genericFvPatchField"
00043         "(const fvPatch& p, const DimensionedField<Type, volMesh>& iF)"
00044     )   << "Not Implemented\n    "
00045         << "Trying to construct an genericFvPatchField on patch "
00046         << this->patch().name()
00047         << " of field " << this->dimensionedInternalField().name()
00048         << abort(FatalError);
00049 }
00050 
00051 
00052 template<class Type>
00053 Foam::genericFvPatchField<Type>::genericFvPatchField
00054 (
00055     const fvPatch& p,
00056     const DimensionedField<Type, volMesh>& iF,
00057     const dictionary& dict
00058 )
00059 :
00060     calculatedFvPatchField<Type>(p, iF, dict, false),
00061     actualTypeName_(dict.lookup("type")),
00062     dict_(dict)
00063 {
00064     if (!dict.found("value"))
00065     {
00066         FatalIOErrorIn
00067         (
00068             "genericFvPatchField<Type>::genericFvPatchField"
00069             "(const fvPatch&, const Field<Type>&, const dictionary&)",
00070             dict
00071         )   << "\n    Cannot find 'value' entry"
00072             << " on patch " << this->patch().name()
00073             << " of field " << this->dimensionedInternalField().name()
00074             << " in file " << this->dimensionedInternalField().objectPath()
00075             << nl
00076             << "    which is required to set the"
00077                " values of the generic patch field." << nl
00078             << "    (Actual type " << actualTypeName_ << ")" << nl
00079             << "\n    Please add the 'value' entry to the write function "
00080                "of the user-defined boundary-condition\n"
00081                "    or link the boundary-condition into libfoamUtil.so"
00082             << exit(FatalIOError);
00083     }
00084 
00085     for
00086     (
00087         dictionary::const_iterator iter = dict_.begin();
00088         iter != dict_.end();
00089         ++iter
00090     )
00091     {
00092         if (iter().keyword() != "type" && iter().keyword() != "value")
00093         {
00094             if
00095             (
00096                 iter().isStream()
00097              && iter().stream().size()
00098             )
00099             {
00100                 ITstream& is = iter().stream();
00101 
00102                 // Read first token
00103                 token firstToken(is);
00104 
00105                 if
00106                 (
00107                     firstToken.isWord()
00108                  && firstToken.wordToken() == "nonuniform"
00109                 )
00110                 {
00111                     token fieldToken(is);
00112 
00113                     if (!fieldToken.isCompound())
00114                     {
00115                         if
00116                         (
00117                             fieldToken.isLabel()
00118                          && fieldToken.labelToken() == 0
00119                         )
00120                         {
00121                             scalarFields_.insert
00122                             (
00123                                 iter().keyword(),
00124                                 new scalarField(0)
00125                             );
00126                         }
00127                         else
00128                         {
00129                             FatalIOErrorIn
00130                             (
00131                                 "genericFvPatchField<Type>::genericFvPatchField"
00132                                 "(const fvPatch&, const Field<Type>&, "
00133                                 "const dictionary&)",
00134                                 dict
00135                             )   << "\n    token following 'nonuniform' "
00136                                   "is not a compound"
00137                                 << "\n    on patch " << this->patch().name()
00138                                 << " of field "
00139                                 << this->dimensionedInternalField().name()
00140                                 << " in file "
00141                                 << this->dimensionedInternalField().objectPath()
00142                             << exit(FatalIOError);
00143                         }
00144                     }
00145                     else if
00146                     (
00147                         fieldToken.compoundToken().type()
00148                      == token::Compound<List<scalar> >::typeName
00149                     )
00150                     {
00151                         scalarField* fPtr = new scalarField;
00152                         fPtr->transfer
00153                         (
00154                             dynamicCast<token::Compound<List<scalar> > >
00155                             (
00156                                 fieldToken.transferCompoundToken()
00157                             )
00158                         );
00159 
00160                         if (fPtr->size() != this->size())
00161                         {
00162                             FatalIOErrorIn
00163                             (
00164                                 "genericFvPatchField<Type>::genericFvPatchField"
00165                                 "(const fvPatch&, const Field<Type>&, "
00166                                 "const dictionary&)",
00167                                 dict
00168                             )   << "\n    size of field " << iter().keyword()
00169                                 << " (" << fPtr->size() << ')'
00170                                 << " is not the same size as the patch ("
00171                                 << this->size() << ')'
00172                                 << "\n    on patch " << this->patch().name()
00173                                 << " of field "
00174                                 << this->dimensionedInternalField().name()
00175                                 << " in file "
00176                                 << this->dimensionedInternalField().objectPath()
00177                                 << exit(FatalIOError);
00178                         }
00179 
00180                         scalarFields_.insert(iter().keyword(), fPtr);
00181                     }
00182                     else if
00183                     (
00184                         fieldToken.compoundToken().type()
00185                      == token::Compound<List<vector> >::typeName
00186                     )
00187                     {
00188                         vectorField* fPtr = new vectorField;
00189                         fPtr->transfer
00190                         (
00191                             dynamicCast<token::Compound<List<vector> > >
00192                             (
00193                                 fieldToken.transferCompoundToken()
00194                             )
00195                         );
00196 
00197                         if (fPtr->size() != this->size())
00198                         {
00199                             FatalIOErrorIn
00200                             (
00201                                 "genericFvPatchField<Type>::genericFvPatchField"
00202                                 "(const fvPatch&, const Field<Type>&, "
00203                                 "const dictionary&)",
00204                                 dict
00205                             )   << "\n    size of field " << iter().keyword()
00206                                 << " (" << fPtr->size() << ')'
00207                                 << " is not the same size as the patch ("
00208                                 << this->size() << ')'
00209                                 << "\n    on patch " << this->patch().name()
00210                                 << " of field "
00211                                 << this->dimensionedInternalField().name()
00212                                 << " in file "
00213                                 << this->dimensionedInternalField().objectPath()
00214                                 << exit(FatalIOError);
00215                         }
00216 
00217                         vectorFields_.insert(iter().keyword(), fPtr);
00218                     }
00219                     else if
00220                     (
00221                         fieldToken.compoundToken().type()
00222                      == token::Compound<List<sphericalTensor> >::typeName
00223                     )
00224                     {
00225                         sphericalTensorField* fPtr = new sphericalTensorField;
00226                         fPtr->transfer
00227                         (
00228                             dynamicCast
00229                             <
00230                                 token::Compound<List<sphericalTensor> >
00231                             >
00232                             (
00233                                 fieldToken.transferCompoundToken()
00234                             )
00235                         );
00236 
00237                         if (fPtr->size() != this->size())
00238                         {
00239                             FatalIOErrorIn
00240                             (
00241                                 "genericFvPatchField<Type>::genericFvPatchField"
00242                                 "(const fvPatch&, const Field<Type>&, "
00243                                 "const dictionary&)",
00244                                 dict
00245                             )   << "\n    size of field " << iter().keyword()
00246                                 << " (" << fPtr->size() << ')'
00247                                 << " is not the same size as the patch ("
00248                                 << this->size() << ')'
00249                                 << "\n    on patch " << this->patch().name()
00250                                 << " of field "
00251                                 << this->dimensionedInternalField().name()
00252                                 << " in file "
00253                                 << this->dimensionedInternalField().objectPath()
00254                                 << exit(FatalIOError);
00255                         }
00256 
00257                         sphericalTensorFields_.insert(iter().keyword(), fPtr);
00258                     }
00259                     else if
00260                     (
00261                         fieldToken.compoundToken().type()
00262                      == token::Compound<List<symmTensor> >::typeName
00263                     )
00264                     {
00265                         symmTensorField* fPtr = new symmTensorField;
00266                         fPtr->transfer
00267                         (
00268                             dynamicCast
00269                             <
00270                                 token::Compound<List<symmTensor> >
00271                             >
00272                             (
00273                                 fieldToken.transferCompoundToken()
00274                             )
00275                         );
00276 
00277                         if (fPtr->size() != this->size())
00278                         {
00279                             FatalIOErrorIn
00280                             (
00281                                 "genericFvPatchField<Type>::genericFvPatchField"
00282                                 "(const fvPatch&, const Field<Type>&, "
00283                                 "const dictionary&)",
00284                                 dict
00285                             )   << "\n    size of field " << iter().keyword()
00286                                 << " (" << fPtr->size() << ')'
00287                                 << " is not the same size as the patch ("
00288                                 << this->size() << ')'
00289                                 << "\n    on patch " << this->patch().name()
00290                                 << " of field "
00291                                 << this->dimensionedInternalField().name()
00292                                 << " in file "
00293                                 << this->dimensionedInternalField().objectPath()
00294                                 << exit(FatalIOError);
00295                         }
00296 
00297                         symmTensorFields_.insert(iter().keyword(), fPtr);
00298                     }
00299                     else if
00300                     (
00301                         fieldToken.compoundToken().type()
00302                      == token::Compound<List<tensor> >::typeName
00303                     )
00304                     {
00305                         tensorField* fPtr = new tensorField;
00306                         fPtr->transfer
00307                         (
00308                             dynamicCast<token::Compound<List<tensor> > >
00309                             (
00310                                 fieldToken.transferCompoundToken()
00311                             )
00312                         );
00313 
00314                         if (fPtr->size() != this->size())
00315                         {
00316                             FatalIOErrorIn
00317                             (
00318                                 "genericFvPatchField<Type>::genericFvPatchField"
00319                                 "(const fvPatch&, const Field<Type>&, "
00320                                 "const dictionary&)",
00321                                 dict
00322                             )   << "\n    size of field " << iter().keyword()
00323                                 << " (" << fPtr->size() << ')'
00324                                 << " is not the same size as the patch ("
00325                                 << this->size() << ')'
00326                                 << "\n    on patch " << this->patch().name()
00327                                 << " of field "
00328                                 << this->dimensionedInternalField().name()
00329                                 << " in file "
00330                                 << this->dimensionedInternalField().objectPath()
00331                                 << exit(FatalIOError);
00332                         }
00333 
00334                         tensorFields_.insert(iter().keyword(), fPtr);
00335                     }
00336                     else
00337                     {
00338                         FatalIOErrorIn
00339                         (
00340                             "genericFvPatchField<Type>::genericFvPatchField"
00341                             "(const fvPatch&, const Field<Type>&, "
00342                             "const dictionary&)",
00343                             dict
00344                         )   << "\n    compound " << fieldToken.compoundToken()
00345                             << " not supported"
00346                             << "\n    on patch " << this->patch().name()
00347                             << " of field "
00348                             << this->dimensionedInternalField().name()
00349                             << " in file "
00350                             << this->dimensionedInternalField().objectPath()
00351                             << exit(FatalIOError);
00352                     }
00353                 }
00354                 else if
00355                 (
00356                     firstToken.isWord()
00357                  && firstToken.wordToken() == "uniform"
00358                 )
00359                 {
00360                     token fieldToken(is);
00361 
00362                     if (!fieldToken.isPunctuation())
00363                     {
00364                         scalarFields_.insert
00365                         (
00366                             iter().keyword(),
00367                             new scalarField
00368                             (
00369                                 this->size(),
00370                                 fieldToken.number()
00371                             )
00372                         );
00373                     }
00374                     else
00375                     {
00376                         // Read as scalarList.
00377                         is.putBack(fieldToken);
00378 
00379                         scalarList l(is);
00380 
00381                         if (l.size() == vector::nComponents)
00382                         {
00383                             vector vs(l[0], l[1], l[2]);
00384 
00385                             vectorFields_.insert
00386                             (
00387                                 iter().keyword(),
00388                                 new vectorField(this->size(), vs)
00389                             );
00390                         }
00391                         else if (l.size() == sphericalTensor::nComponents)
00392                         {
00393                             sphericalTensor vs(l[0]);
00394 
00395                             sphericalTensorFields_.insert
00396                             (
00397                                 iter().keyword(),
00398                                 new sphericalTensorField(this->size(), vs)
00399                             );
00400                         }
00401                         else if (l.size() == symmTensor::nComponents)
00402                         {
00403                             symmTensor vs(l[0], l[1], l[2], l[3], l[4], l[5]);
00404 
00405                             symmTensorFields_.insert
00406                             (
00407                                 iter().keyword(),
00408                                 new symmTensorField(this->size(), vs)
00409                             );
00410                         }
00411                         else if (l.size() == tensor::nComponents)
00412                         {
00413                             tensor vs
00414                             (
00415                                 l[0], l[1], l[2],
00416                                 l[3], l[4], l[5],
00417                                 l[6], l[7], l[8]
00418                             );
00419 
00420                             tensorFields_.insert
00421                             (
00422                                 iter().keyword(),
00423                                 new tensorField(this->size(), vs)
00424                             );
00425                         }
00426                         else
00427                         {
00428                             FatalIOErrorIn
00429                             (
00430                                 "genericFvPatchField<Type>::genericFvPatchField"
00431                                 "(const fvPatch&, const Field<Type>&, "
00432                                 "const dictionary&)",
00433                                 dict
00434                             )   << "\n    unrecognised native type " << l
00435                                 << "\n    on patch " << this->patch().name()
00436                                 << " of field "
00437                                 << this->dimensionedInternalField().name()
00438                                 << " in file "
00439                                 << this->dimensionedInternalField().objectPath()
00440                                 << exit(FatalIOError);
00441                         }
00442                     }
00443                 }
00444             }
00445         }
00446     }
00447 }
00448 
00449 
00450 template<class Type>
00451 Foam::genericFvPatchField<Type>::genericFvPatchField
00452 (
00453     const genericFvPatchField<Type>& ptf,
00454     const fvPatch& p,
00455     const DimensionedField<Type, volMesh>& iF,
00456     const fvPatchFieldMapper& mapper
00457 )
00458 :
00459     calculatedFvPatchField<Type>(ptf, p, iF, mapper),
00460     actualTypeName_(ptf.actualTypeName_),
00461     dict_(ptf.dict_)
00462 {
00463     for
00464     (
00465         HashPtrTable<scalarField>::const_iterator iter =
00466             ptf.scalarFields_.begin();
00467         iter != ptf.scalarFields_.end();
00468         ++iter
00469     )
00470     {
00471         scalarFields_.insert(iter.key(), new scalarField(*iter(), mapper));
00472     }
00473 
00474     for
00475     (
00476         HashPtrTable<vectorField>::const_iterator iter =
00477             ptf.vectorFields_.begin();
00478         iter != ptf.vectorFields_.end();
00479         ++iter
00480     )
00481     {
00482         vectorFields_.insert(iter.key(), new vectorField(*iter(), mapper));
00483     }
00484 
00485     for
00486     (
00487         HashPtrTable<sphericalTensorField>::const_iterator iter =
00488             ptf.sphericalTensorFields_.begin();
00489         iter != ptf.sphericalTensorFields_.end();
00490         ++iter
00491     )
00492     {
00493         sphericalTensorFields_.insert
00494         (
00495             iter.key(),
00496             new sphericalTensorField(*iter(), mapper)
00497         );
00498     }
00499 
00500     for
00501     (
00502         HashPtrTable<symmTensorField>::const_iterator iter =
00503             ptf.symmTensorFields_.begin();
00504         iter != ptf.symmTensorFields_.end();
00505         ++iter
00506     )
00507     {
00508         symmTensorFields_.insert
00509         (
00510             iter.key(),
00511             new symmTensorField(*iter(), mapper)
00512         );
00513     }
00514 
00515     for
00516     (
00517         HashPtrTable<tensorField>::const_iterator iter =
00518             ptf.tensorFields_.begin();
00519         iter != ptf.tensorFields_.end();
00520         ++iter
00521     )
00522     {
00523         tensorFields_.insert(iter.key(), new tensorField(*iter(), mapper));
00524     }
00525 }
00526 
00527 
00528 template<class Type>
00529 Foam::genericFvPatchField<Type>::genericFvPatchField
00530 (
00531     const genericFvPatchField<Type>& ptf
00532 )
00533 :
00534     calculatedFvPatchField<Type>(ptf),
00535     actualTypeName_(ptf.actualTypeName_),
00536     dict_(ptf.dict_),
00537     scalarFields_(ptf.scalarFields_),
00538     vectorFields_(ptf.vectorFields_),
00539     sphericalTensorFields_(ptf.sphericalTensorFields_),
00540     symmTensorFields_(ptf.symmTensorFields_),
00541     tensorFields_(ptf.tensorFields_)
00542 {}
00543 
00544 
00545 template<class Type>
00546 Foam::genericFvPatchField<Type>::genericFvPatchField
00547 (
00548     const genericFvPatchField<Type>& ptf,
00549     const DimensionedField<Type, volMesh>& iF
00550 )
00551 :
00552     calculatedFvPatchField<Type>(ptf, iF),
00553     actualTypeName_(ptf.actualTypeName_),
00554     dict_(ptf.dict_),
00555     scalarFields_(ptf.scalarFields_),
00556     vectorFields_(ptf.vectorFields_),
00557     sphericalTensorFields_(ptf.sphericalTensorFields_),
00558     symmTensorFields_(ptf.symmTensorFields_),
00559     tensorFields_(ptf.tensorFields_)
00560 {}
00561 
00562 
00563 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
00564 
00565 template<class Type>
00566 void Foam::genericFvPatchField<Type>::autoMap
00567 (
00568     const fvPatchFieldMapper& m
00569 )
00570 {
00571     calculatedFvPatchField<Type>::autoMap(m);
00572 
00573     for
00574     (
00575         HashPtrTable<scalarField>::iterator iter = scalarFields_.begin();
00576         iter != scalarFields_.end();
00577         ++iter
00578     )
00579     {
00580         iter()->autoMap(m);
00581     }
00582 
00583     for
00584     (
00585         HashPtrTable<vectorField>::iterator iter = vectorFields_.begin();
00586         iter != vectorFields_.end();
00587         ++iter
00588     )
00589     {
00590         iter()->autoMap(m);
00591     }
00592 
00593     for
00594     (
00595         HashPtrTable<sphericalTensorField>::iterator iter =
00596             sphericalTensorFields_.begin();
00597         iter != sphericalTensorFields_.end();
00598         ++iter
00599     )
00600     {
00601         iter()->autoMap(m);
00602     }
00603 
00604     for
00605     (
00606         HashPtrTable<symmTensorField>::iterator iter =
00607             symmTensorFields_.begin();
00608         iter != symmTensorFields_.end();
00609         ++iter
00610     )
00611     {
00612         iter()->autoMap(m);
00613     }
00614 
00615     for
00616     (
00617         HashPtrTable<tensorField>::iterator iter = tensorFields_.begin();
00618         iter != tensorFields_.end();
00619         ++iter
00620     )
00621     {
00622         iter()->autoMap(m);
00623     }
00624 }
00625 
00626 
00627 template<class Type>
00628 void Foam::genericFvPatchField<Type>::rmap
00629 (
00630     const fvPatchField<Type>& ptf,
00631     const labelList& addr
00632 )
00633 {
00634     calculatedFvPatchField<Type>::rmap(ptf, addr);
00635 
00636     const genericFvPatchField<Type>& dptf =
00637         refCast<const genericFvPatchField<Type> >(ptf);
00638 
00639     for
00640     (
00641         HashPtrTable<scalarField>::iterator iter = scalarFields_.begin();
00642         iter != scalarFields_.end();
00643         ++iter
00644     )
00645     {
00646         HashPtrTable<scalarField>::const_iterator dptfIter =
00647             dptf.scalarFields_.find(iter.key());
00648 
00649         if (dptfIter != dptf.scalarFields_.end())
00650         {
00651             iter()->rmap(*dptfIter(), addr);
00652         }
00653     }
00654 
00655     for
00656     (
00657         HashPtrTable<vectorField>::iterator iter = vectorFields_.begin();
00658         iter != vectorFields_.end();
00659         ++iter
00660     )
00661     {
00662         HashPtrTable<vectorField>::const_iterator dptfIter =
00663             dptf.vectorFields_.find(iter.key());
00664 
00665         if (dptfIter != dptf.vectorFields_.end())
00666         {
00667             iter()->rmap(*dptfIter(), addr);
00668         }
00669     }
00670 
00671     for
00672     (
00673         HashPtrTable<sphericalTensorField>::iterator iter =
00674             sphericalTensorFields_.begin();
00675         iter != sphericalTensorFields_.end();
00676         ++iter
00677     )
00678     {
00679         HashPtrTable<sphericalTensorField>::const_iterator dptfIter =
00680             dptf.sphericalTensorFields_.find(iter.key());
00681 
00682         if (dptfIter != dptf.sphericalTensorFields_.end())
00683         {
00684             iter()->rmap(*dptfIter(), addr);
00685         }
00686     }
00687 
00688     for
00689     (
00690         HashPtrTable<symmTensorField>::iterator iter =
00691             symmTensorFields_.begin();
00692         iter != symmTensorFields_.end();
00693         ++iter
00694     )
00695     {
00696         HashPtrTable<symmTensorField>::const_iterator dptfIter =
00697             dptf.symmTensorFields_.find(iter.key());
00698 
00699         if (dptfIter != dptf.symmTensorFields_.end())
00700         {
00701             iter()->rmap(*dptfIter(), addr);
00702         }
00703     }
00704 
00705     for
00706     (
00707         HashPtrTable<tensorField>::iterator iter = tensorFields_.begin();
00708         iter != tensorFields_.end();
00709         ++iter
00710     )
00711     {
00712         HashPtrTable<tensorField>::const_iterator dptfIter =
00713             dptf.tensorFields_.find(iter.key());
00714 
00715         if (dptfIter != dptf.tensorFields_.end())
00716         {
00717             iter()->rmap(*dptfIter(), addr);
00718         }
00719     }
00720 }
00721 
00722 
00723 template<class Type>
00724 Foam::tmp<Foam::Field<Type> >
00725 Foam::genericFvPatchField<Type>::valueInternalCoeffs
00726 (
00727     const tmp<scalarField>&
00728 ) const
00729 {
00730     FatalErrorIn
00731     (
00732         "genericFvPatchField<Type>::"
00733         "valueInternalCoeffs(const tmp<scalarField>&) const"
00734     )   << "\n    "
00735            "valueInternalCoeffs cannot be called for a genericFvPatchField"
00736            " (actual type " << actualTypeName_ << ")"
00737         << "\n    on patch " << this->patch().name()
00738         << " of field " << this->dimensionedInternalField().name()
00739         << " in file " << this->dimensionedInternalField().objectPath()
00740         << "\n    You are probably trying to solve for a field with a "
00741            "generic boundary condition."
00742         << exit(FatalError);
00743 
00744     return *this;
00745 }
00746 
00747 
00748 template<class Type>
00749 Foam::tmp<Foam::Field<Type> >
00750 Foam::genericFvPatchField<Type>::valueBoundaryCoeffs
00751 (
00752     const tmp<scalarField>&
00753 ) const
00754 {
00755     FatalErrorIn
00756     (
00757         "genericFvPatchField<Type>::"
00758         "valueBoundaryCoeffs(const tmp<scalarField>&) const"
00759     )   << "\n    "
00760            "valueBoundaryCoeffs cannot be called for a genericFvPatchField"
00761            " (actual type " << actualTypeName_ << ")"
00762         << "\n    on patch " << this->patch().name()
00763         << " of field " << this->dimensionedInternalField().name()
00764         << " in file " << this->dimensionedInternalField().objectPath()
00765         << "\n    You are probably trying to solve for a field with a "
00766            "generic boundary condition."
00767         << exit(FatalError);
00768 
00769     return *this;
00770 }
00771 
00772 
00773 template<class Type>
00774 Foam::tmp<Foam::Field<Type> >
00775 Foam::genericFvPatchField<Type>::gradientInternalCoeffs() const
00776 {
00777     FatalErrorIn
00778     (
00779         "genericFvPatchField<Type>::"
00780         "gradientInternalCoeffs() const"
00781     )   << "\n    "
00782            "gradientInternalCoeffs cannot be called for a genericFvPatchField"
00783            " (actual type " << actualTypeName_ << ")"
00784         << "\n    on patch " << this->patch().name()
00785         << " of field " << this->dimensionedInternalField().name()
00786         << " in file " << this->dimensionedInternalField().objectPath()
00787         << "\n    You are probably trying to solve for a field with a "
00788            "generic boundary condition."
00789         << exit(FatalError);
00790 
00791     return *this;
00792 }
00793 
00794 template<class Type>
00795 Foam::tmp<Foam::Field<Type> >
00796 Foam::genericFvPatchField<Type>::gradientBoundaryCoeffs() const
00797 {
00798     FatalErrorIn
00799     (
00800         "genericFvPatchField<Type>::"
00801         "gradientBoundaryCoeffs() const"
00802     )   << "\n    "
00803            "gradientBoundaryCoeffs cannot be called for a genericFvPatchField"
00804            " (actual type " << actualTypeName_ << ")"
00805         << "\n    on patch " << this->patch().name()
00806         << " of field " << this->dimensionedInternalField().name()
00807         << " in file " << this->dimensionedInternalField().objectPath()
00808         << "\n    You are probably trying to solve for a field with a "
00809            "generic boundary condition."
00810         << exit(FatalError);
00811 
00812     return *this;
00813 }
00814 
00815 
00816 template<class Type>
00817 void Foam::genericFvPatchField<Type>::write(Ostream& os) const
00818 {
00819     os.writeKeyword("type") << actualTypeName_ << token::END_STATEMENT << nl;
00820 
00821     for
00822     (
00823         dictionary::const_iterator iter = dict_.begin();
00824         iter != dict_.end();
00825         ++iter
00826     )
00827     {
00828         if (iter().keyword() != "type" && iter().keyword() != "value")
00829         {
00830             if
00831             (
00832                 iter().isStream()
00833              && iter().stream().size()
00834              && iter().stream()[0].isWord()
00835              && iter().stream()[0].wordToken() == "nonuniform"
00836             )
00837             {
00838                 if (scalarFields_.found(iter().keyword()))
00839                 {
00840                     scalarFields_.find(iter().keyword())()
00841                         ->writeEntry(iter().keyword(), os);
00842                 }
00843                 else if (vectorFields_.found(iter().keyword()))
00844                 {
00845                     vectorFields_.find(iter().keyword())()
00846                         ->writeEntry(iter().keyword(), os);
00847                 }
00848                 else if (sphericalTensorFields_.found(iter().keyword()))
00849                 {
00850                     sphericalTensorFields_.find(iter().keyword())()
00851                         ->writeEntry(iter().keyword(), os);
00852                 }
00853                 else if (symmTensorFields_.found(iter().keyword()))
00854                 {
00855                     symmTensorFields_.find(iter().keyword())()
00856                         ->writeEntry(iter().keyword(), os);
00857                 }
00858                 else if (tensorFields_.found(iter().keyword()))
00859                 {
00860                     tensorFields_.find(iter().keyword())()
00861                         ->writeEntry(iter().keyword(), os);
00862                 }
00863             }
00864             else
00865             {
00866                iter().write(os);
00867             }
00868         }
00869     }
00870 
00871     this->writeEntry("value", os);
00872 }
00873 
00874 
00875 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines