MapPointField.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-2016 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
26Class
27 Foam::MapPointField
28
29Description
30 Map point field on topology change. This is a partial template
31 specialisation for GeoMesh=pointMesh
32
33See also
34 MapGeometricFields
35
36\*---------------------------------------------------------------------------*/
37
38#ifndef MapPointField_H
39#define MapPointField_H
40
41#include "Field.H"
42#include "pointMesh.H"
43
44// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45
46namespace Foam
47{
48
49template<class Type, class MeshMapper>
50class MapInternalField<Type, MeshMapper, pointMesh>
51{
52public:
55 {}
56
57 void operator()
58 (
60 const MeshMapper& mapper
61 ) const;
62};
63
64
65template<class Type, class MeshMapper>
67(
69 const MeshMapper& mapper
70) const
71{
72 if (field.size() != mapper.pointMap().sizeBeforeMapping())
73 {
75 << "Incompatible size before mapping. Field size: " << field.size()
76 << " map size: " << mapper.pointMap().sizeBeforeMapping()
77 << abort(FatalError);
78 }
79
80 field.autoMap(mapper.pointMap());
81}
82
83
84// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
85
86} // End namespace Foam
87
88// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
89
90#endif
91
92// ************************************************************************* //
Generic templated field type.
Definition: Field.H:82
Generic internal field mapper. For "real" mapping, add template specialisations for mapping of intern...
friend Ostream & operator(Ostream &, const faMatrix< Type > &)
Mesh representing a set of points created from polyMesh.
Definition: pointMesh.H:55
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