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 -------------------------------------------------------------------------------
10 License
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 
26 Description
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 
40 namespace Foam
41 {
42 
43 template<class Type, class MeshMapper>
44 class MapInternalField<Type, MeshMapper, volMesh>
45 {
46 public:
47 
49  {}
50 
51  void operator()
52  (
54  const MeshMapper& mapper
55  ) const;
56 };
57 
58 
59 template<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 // ************************************************************************* //
rDeltaTY field()
error FatalError
Error stream (stdout output on all processes), with additional &#39;FOAM FATAL ERROR&#39; header text and sta...
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:598
Mesh data needed to do the Finite Volume discretisation.
Definition: volMesh.H:45
errorManip< error > abort(error &err)
Definition: errorManip.H:139
Generic internal field mapper. For "real" mapping, add template specialisations for mapping of intern...
Field with dimensions and associated with geometry type GeoMesh which is used to size the field and a...
Definition: areaFieldsFwd.H:42
Namespace for OpenFOAM.