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

errorEstimate.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) 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 Class
00025     Foam::errorEstimate
00026 
00027 Description
00028     Residual error estimation
00029 
00030 SourceFiles
00031     errorEstimate.C
00032 
00033 \*---------------------------------------------------------------------------*/
00034 
00035 #ifndef errorEstimate_H
00036 #define errorEstimate_H
00037 
00038 #include <finiteVolume/volFields.H>
00039 #include <finiteVolume/surfaceFields.H>
00040 
00041 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00042 
00043 namespace Foam
00044 {
00045 
00046 /*---------------------------------------------------------------------------*\
00047                         Class errorEstimate Declaration
00048 \*---------------------------------------------------------------------------*/
00049 
00050 template<class Type>
00051 class errorEstimate
00052 :
00053     public refCount
00054 {
00055     // Private data
00056 
00057         // Reference to GeometricField<Type, fvPatchField, volMesh>
00058         const GeometricField<Type, fvPatchField, volMesh>& psi_;
00059 
00060         //- Dimension set
00061         dimensionSet dimensions_;
00062 
00063         //- Cell residual pointer
00064         Field<Type> residual_;
00065 
00066         //- Normalisation factor
00067         scalarField normFactor_;
00068 
00069 
00070     // Private Member Functions
00071 
00072         //- Return boundary condition types for the error field
00073         wordList errorBCTypes() const;
00074 
00075 public:
00076 
00077     // Static data members
00078 
00079     ClassName("errorEstimate");
00080 
00081 
00082     // Constructors
00083 
00084         //- Construct from components
00085         errorEstimate
00086         (
00087             const GeometricField<Type, fvPatchField, volMesh>& psi,
00088             const dimensionSet& ds,
00089             const Field<Type>& res,
00090             const scalarField& norm
00091         );
00092 
00093         //- Construct as copy
00094         errorEstimate(const errorEstimate<Type>&);
00095 
00096 
00097     // Destructor
00098 
00099         ~errorEstimate();
00100 
00101 
00102     // Member Functions
00103 
00104         // Access
00105 
00106             //- Return field
00107             const GeometricField<Type, fvPatchField, volMesh>& psi() const
00108             {
00109                 return psi_;
00110             }
00111 
00112             //- Return residual dimensions
00113             const dimensionSet& dimensions() const
00114             {
00115                 return dimensions_;
00116             }
00117 
00118         // Raw residual (for calculus)
00119 
00120             Field<Type>& res()
00121             {
00122                 return residual_;
00123             }
00124 
00125             const Field<Type>& res() const
00126             {
00127                 return residual_;
00128             }
00129 
00130 
00131         // Error Estimate
00132 
00133             //- Cell residual (volume intensive)
00134             tmp<GeometricField<Type, fvPatchField, volMesh> > residual() const;
00135 
00136             //- Normalisation factor
00137             tmp<volScalarField> normFactor() const;
00138 
00139             //- Error estimate
00140             tmp<GeometricField<Type, fvPatchField, volMesh> > error() const;
00141 
00142 
00143     // Member Operators
00144 
00145         void operator=(const errorEstimate<Type>&);
00146         void operator=(const tmp<errorEstimate<Type> >&);
00147 
00148         void negate();
00149 
00150         void operator+=(const errorEstimate<Type>&);
00151         void operator+=(const tmp<errorEstimate<Type> >&);
00152 
00153         void operator-=(const errorEstimate<Type>&);
00154         void operator-=(const tmp<errorEstimate<Type> >&);
00155 
00156         void operator+=(const GeometricField<Type,fvPatchField,volMesh>&);
00157         void operator+=(const tmp<GeometricField<Type,fvPatchField,volMesh> >&);
00158 
00159         void operator-=(const GeometricField<Type,fvPatchField,volMesh>&);
00160         void operator-=(const tmp<GeometricField<Type,fvPatchField,volMesh> >&);
00161 
00162         void operator+=(const dimensioned<Type>&);
00163         void operator-=(const dimensioned<Type>&);
00164 
00165         void operator*=(const volScalarField&);
00166         void operator*=(const tmp<volScalarField>&);
00167 
00168         void operator*=(const dimensioned<scalar>&);
00169 
00170 
00171     // Friend Functions
00172 
00173     // Friend Operators
00174 };
00175 
00176 
00177 // * * * * * * * * * * * * * * * Global functions  * * * * * * * * * * * * * //
00178 
00179 template<class Type>
00180 void checkMethod
00181 (
00182     const errorEstimate<Type>&,
00183     const errorEstimate<Type>&,
00184     const char*
00185 );
00186 
00187 template<class Type>
00188 void checkMethod
00189 (
00190     const errorEstimate<Type>&,
00191     const GeometricField<Type, fvPatchField, volMesh>&,
00192     const char*
00193 );
00194 
00195 template<class Type>
00196 void checkMethod
00197 (
00198     const errorEstimate<Type>&,
00199     const dimensioned<Type>&,
00200     const char*
00201 );
00202 
00203 
00204 // * * * * * * * * * * * * * * * Global operators  * * * * * * * * * * * * * //
00205 
00206 template<class Type>
00207 tmp<errorEstimate<Type> > operator-
00208 (
00209     const errorEstimate<Type>&
00210 );
00211 
00212 template<class Type>
00213 tmp<errorEstimate<Type> > operator-
00214 (
00215     const tmp<errorEstimate<Type> >&
00216 );
00217 
00218 template<class Type>
00219 tmp<errorEstimate<Type> > operator+
00220 (
00221     const errorEstimate<Type>&,
00222     const errorEstimate<Type>&
00223 );
00224 
00225 template<class Type>
00226 tmp<errorEstimate<Type> > operator+
00227 (
00228     const tmp<errorEstimate<Type> >&,
00229     const errorEstimate<Type>&
00230 );
00231 
00232 template<class Type>
00233 tmp<errorEstimate<Type> > operator+
00234 (
00235     const errorEstimate<Type>&,
00236     const tmp<errorEstimate<Type> >&
00237 );
00238 
00239 template<class Type>
00240 tmp<errorEstimate<Type> > operator+
00241 (
00242     const tmp<errorEstimate<Type> >&,
00243     const tmp<errorEstimate<Type> >&
00244 );
00245 
00246 template<class Type>
00247 tmp<errorEstimate<Type> > operator-
00248 (
00249     const errorEstimate<Type>&,
00250     const errorEstimate<Type>&
00251 );
00252 
00253 template<class Type>
00254 tmp<errorEstimate<Type> > operator-
00255 (
00256     const tmp<errorEstimate<Type> >&,
00257     const errorEstimate<Type>&
00258 );
00259 
00260 template<class Type>
00261 tmp<errorEstimate<Type> > operator-
00262 (
00263     const errorEstimate<Type>&,
00264     const tmp<errorEstimate<Type> >&
00265 );
00266 
00267 template<class Type>
00268 tmp<errorEstimate<Type> > operator-
00269 (
00270     const tmp<errorEstimate<Type> >&,
00271     const tmp<errorEstimate<Type> >&
00272 );
00273 
00274 template<class Type>
00275 tmp<errorEstimate<Type> > operator==
00276 (
00277     const errorEstimate<Type>&,
00278     const errorEstimate<Type>&
00279 );
00280 
00281 template<class Type>
00282 tmp<errorEstimate<Type> > operator==
00283 (
00284     const tmp<errorEstimate<Type> >&,
00285     const errorEstimate<Type>&
00286 );
00287 
00288 template<class Type>
00289 tmp<errorEstimate<Type> > operator==
00290 (
00291     const errorEstimate<Type>&,
00292     const tmp<errorEstimate<Type> >&
00293 );
00294 
00295 template<class Type>
00296 tmp<errorEstimate<Type> > operator==
00297 (
00298     const tmp<errorEstimate<Type> >&,
00299     const tmp<errorEstimate<Type> >&
00300 );
00301 
00302 template<class Type>
00303 tmp<errorEstimate<Type> > operator+
00304 (
00305     const errorEstimate<Type>&,
00306     const GeometricField<Type, fvPatchField, volMesh>&
00307 );
00308 
00309 template<class Type>
00310 tmp<errorEstimate<Type> > operator+
00311 (
00312     const tmp<errorEstimate<Type> >&,
00313     const GeometricField<Type, fvPatchField, volMesh>&
00314 );
00315 
00316 template<class Type>
00317 tmp<errorEstimate<Type> > operator+
00318 (
00319     const errorEstimate<Type>&,
00320     const tmp<GeometricField<Type, fvPatchField, volMesh> >&
00321 );
00322 
00323 template<class Type>
00324 tmp<errorEstimate<Type> > operator+
00325 (
00326     const tmp<errorEstimate<Type> >&,
00327     const tmp<GeometricField<Type, fvPatchField, volMesh> >&
00328 );
00329 
00330 template<class Type>
00331 tmp<errorEstimate<Type> > operator+
00332 (
00333     const GeometricField<Type, fvPatchField, volMesh>&,
00334     const errorEstimate<Type>&
00335 );
00336 
00337 template<class Type>
00338 tmp<errorEstimate<Type> > operator+
00339 (
00340     const GeometricField<Type, fvPatchField, volMesh>&,
00341     const tmp<errorEstimate<Type> >&
00342 );
00343 
00344 template<class Type>
00345 tmp<errorEstimate<Type> > operator+
00346 (
00347     const tmp<GeometricField<Type, fvPatchField, volMesh> >&,
00348     const errorEstimate<Type>&
00349 );
00350 
00351 template<class Type>
00352 tmp<errorEstimate<Type> > operator+
00353 (
00354     const tmp<GeometricField<Type, fvPatchField, volMesh> >&,
00355     const tmp<errorEstimate<Type> >&
00356 );
00357 
00358 template<class Type>
00359 tmp<errorEstimate<Type> > operator-
00360 (
00361     const errorEstimate<Type>&,
00362     const GeometricField<Type, fvPatchField, volMesh>&
00363 );
00364 
00365 template<class Type>
00366 tmp<errorEstimate<Type> > operator-
00367 (
00368     const tmp<errorEstimate<Type> >&,
00369     const GeometricField<Type, fvPatchField, volMesh>&
00370 );
00371 
00372 template<class Type>
00373 tmp<errorEstimate<Type> > operator-
00374 (
00375     const errorEstimate<Type>&,
00376     const tmp<GeometricField<Type, fvPatchField, volMesh> >&
00377 );
00378 
00379 template<class Type>
00380 tmp<errorEstimate<Type> > operator-
00381 (
00382     const tmp<errorEstimate<Type> >&,
00383     const tmp<GeometricField<Type, fvPatchField, volMesh> >&
00384 );
00385 
00386 template<class Type>
00387 tmp<errorEstimate<Type> > operator-
00388 (
00389     const GeometricField<Type, fvPatchField, volMesh>&,
00390     const errorEstimate<Type>&
00391 );
00392 
00393 template<class Type>
00394 tmp<errorEstimate<Type> > operator-
00395 (
00396     const GeometricField<Type, fvPatchField, volMesh>&,
00397     const tmp<errorEstimate<Type> >&
00398 );
00399 
00400 template<class Type>
00401 tmp<errorEstimate<Type> > operator-
00402 (
00403     const tmp<GeometricField<Type, fvPatchField, volMesh> >&,
00404     const errorEstimate<Type>&
00405 );
00406 
00407 template<class Type>
00408 tmp<errorEstimate<Type> > operator-
00409 (
00410     const tmp<GeometricField<Type, fvPatchField, volMesh> >&,
00411     const tmp<errorEstimate<Type> >&
00412 );
00413 
00414 template<class Type>
00415 tmp<errorEstimate<Type> > operator+
00416 (
00417     const tmp<errorEstimate<Type> >&,
00418     const dimensioned<Type>&
00419 );
00420 
00421 template<class Type>
00422 tmp<errorEstimate<Type> > operator+
00423 (
00424     const dimensioned<Type>&,
00425     const tmp<errorEstimate<Type> >&
00426 );
00427 
00428 template<class Type>
00429 tmp<errorEstimate<Type> > operator-
00430 (
00431     const tmp<errorEstimate<Type> >&,
00432     const dimensioned<Type>&
00433 );
00434 
00435 template<class Type>
00436 tmp<errorEstimate<Type> > operator-
00437 (
00438     const dimensioned<Type>&,
00439     const tmp<errorEstimate<Type> >&
00440 );
00441 
00442 template<class Type>
00443 tmp<errorEstimate<Type> > operator==
00444 (
00445     const errorEstimate<Type>&,
00446     const GeometricField<Type, fvPatchField, volMesh>&
00447 );
00448 
00449 template<class Type>
00450 tmp<errorEstimate<Type> > operator==
00451 (
00452     const tmp<errorEstimate<Type> >&,
00453     const GeometricField<Type, fvPatchField, volMesh>&
00454 );
00455 
00456 template<class Type>
00457 tmp<errorEstimate<Type> > operator==
00458 (
00459     const errorEstimate<Type>&,
00460     const tmp<GeometricField<Type, fvPatchField, volMesh> >&
00461 );
00462 
00463 template<class Type>
00464 tmp<errorEstimate<Type> > operator==
00465 (
00466     const tmp<errorEstimate<Type> >&,
00467     const tmp<GeometricField<Type, fvPatchField, volMesh> >&
00468 );
00469 
00470 template<class Type>
00471 tmp<errorEstimate<Type> > operator==
00472 (
00473     const errorEstimate<Type>&,
00474     const dimensioned<Type>&
00475 );
00476 
00477 template<class Type>
00478 tmp<errorEstimate<Type> > operator==
00479 (
00480     const tmp<errorEstimate<Type> >&,
00481     const dimensioned<Type>&
00482 );
00483 
00484 
00485 template<class Type>
00486 tmp<errorEstimate<Type> > operator*
00487 (
00488     const volScalarField&,
00489     const errorEstimate<Type>&
00490 );
00491 
00492 template<class Type>
00493 tmp<errorEstimate<Type> > operator*
00494 (
00495     const volScalarField&,
00496     const tmp<errorEstimate<Type> >&
00497 );
00498 
00499 template<class Type>
00500 tmp<errorEstimate<Type> > operator*
00501 (
00502     const tmp<volScalarField>&,
00503     const errorEstimate<Type>&
00504 );
00505 
00506 template<class Type>
00507 tmp<errorEstimate<Type> > operator*
00508 (
00509     const tmp<volScalarField>&,
00510     const tmp<errorEstimate<Type> >&
00511 );
00512 
00513 
00514 template<class Type>
00515 tmp<errorEstimate<Type> > operator*
00516 (
00517     const dimensioned<scalar>&,
00518     const errorEstimate<Type>&
00519 );
00520 
00521 template<class Type>
00522 tmp<errorEstimate<Type> > operator*
00523 (
00524     const dimensioned<scalar>&,
00525     const tmp<errorEstimate<Type> >&
00526 );
00527 
00528 
00529 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00530 
00531 } // End namespace Foam
00532 
00533 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00534 
00535 #ifdef NoRepository
00536 #   include <errorEstimation/errorEstimate.C>
00537 #endif
00538 
00539 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00540 
00541 #endif
00542 
00543 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines