MapFvVolField.H
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2015 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Description
27 Map volume internal field on topology change. This is a partial
28 template specialisation, see MapGeometricFields.
29
30\*---------------------------------------------------------------------------*/
31
32#ifndef MapFvVolField_H
33#define MapFvVolField_H
34
35#include "Field.H"
36#include "volMesh.H"
37
38// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
39
40namespace Foam
41{
42
43template<class Type, class MeshMapper>
44class MapInternalField<Type, MeshMapper, volMesh>
45{
46public:
47
49 {}
50
51 void operator()
52 (
54 const MeshMapper& mapper
55 ) const;
56};
57
58
59template<class Type, class MeshMapper>
61(
63 const MeshMapper& mapper
64) const
65{
66 if (field.size() != mapper.volMap().sizeBeforeMapping())
67 {
69 << "Incompatible size before mapping. Field size: " << field.size()
70 << " map size: " << mapper.volMap().sizeBeforeMapping()
71 << abort(FatalError);
72 }
73
74 field.autoMap(mapper.volMap());
75}
76
77
78// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
79
80} // End namespace Foam
81
82// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
83
84#endif
85
86// ************************************************************************* //
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Generic internal field mapper. For "real" mapping, add template specialisations for mapping of intern...
friend Ostream & operator(Ostream &, const faMatrix< Type > &)
Mesh data needed to do the Finite Volume discretisation.
Definition: volMesh.H:54
rDeltaTY field()
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
Namespace for OpenFOAM.
errorManip< error > abort(error &err)
Definition: errorManip.H:144
error FatalError