OpenFOAM logo
Open Source CFD Toolkit

FieldMapper.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-2005 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 the
00013     Free Software Foundation; either version 2 of the License, or (at your
00014     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, write to the Free Software Foundation,
00023     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00024 
00025 Class
00026     FieldMapper
00027 
00028 Description
00029     Abstract base class to hold the Field mapping addressing and weights.
00030 
00031 \*---------------------------------------------------------------------------*/
00032 
00033 #ifndef FieldMapper_H
00034 #define FieldMapper_H
00035 
00036 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00037 
00038 namespace Foam
00039 {
00040 
00041 /*---------------------------------------------------------------------------*\
00042                            Class FieldMapper Declaration
00043 \*---------------------------------------------------------------------------*/
00044 
00045 class FieldMapper
00046 {
00047 
00048 public:
00049 
00050     // Constructors
00051 
00052         //- Null constructor
00053         FieldMapper()
00054         {}
00055 
00056 
00057     // Destructor
00058 
00059         virtual ~FieldMapper()
00060         {}
00061 
00062 
00063     // Member Functions
00064 
00065         virtual label size() const = 0;
00066 
00067         virtual bool direct() const = 0;
00068 
00069         virtual const unallocLabelList& directAddressing() const
00070         {
00071             FatalErrorIn("FieldMapper::directAddressing() const")
00072                 << "attempt to access null direct addressing"
00073                 << abort(FatalError);
00074 
00075             return unallocLabelList::null();
00076         }
00077 
00078         virtual const labelListList& addressing() const
00079         {
00080             FatalErrorIn("FieldMapper::addressing() const")
00081                 << "attempt to access null interpolation addressing"
00082                 << abort(FatalError);
00083 
00084             return labelListList::null();
00085         }
00086 
00087         virtual const scalarListList& weights() const
00088         {
00089             FatalErrorIn("FieldMapper::weights() const")
00090                 << "attempt to access null interpolation weights"
00091                 << abort(FatalError);
00092 
00093             return scalarListList::null();
00094         }
00095 
00096 
00097     // Member Operators
00098 
00099         template<class Type>
00100         tmp<Field<Type> > operator()(const Field<Type>& f) const
00101         {
00102             return tmp<Field<Type> >(new Field<Type>(f, *this));
00103         }
00104 };
00105 
00106 
00107 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00108 
00109 } // End namespace Foam
00110 
00111 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
00112 
00113 #endif
00114 
00115 // ************************************************************************* //
For further information go to www.openfoam.org