MapFaEdgeField.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) 2016-2017 Wikki Ltd
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 Class
27  Foam::MapFaEdgeField
28 
29 Description
30  Map edge internal field on topology change. This is a partial
31  template specialisation, see MapGeometricFields.
32 
33 Author
34  Zeljko Tukovic, FMENA
35  Hrvoje Jasak, Wikki Ltd.
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef MapFaEdgeField_H
40 #define MapFaEdgeField_H
41 
42 #include "Field.H"
43 #include "edgeFaMesh.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 template<class Type, class MeshMapper>
51 class MapInternalField<Type, MeshMapper, edgeMesh>
52 {
53 public:
54 
56  {}
57 
58  void operator()
59  (
61  const MeshMapper& mapper
62  ) const;
63 };
64 
65 
66 template<class Type, class MeshMapper>
68 (
70  const MeshMapper& mapper
71 ) const
72 {
73  if (field.size() != mapper.edgeMap().sizeBeforeMapping())
74  {
76  << "Incompatible size before mapping. Field size: " << field.size()
77  << " map size: " << mapper.edgeMap().sizeBeforeMapping()
78  << abort(FatalError);
79  }
80 
81  Info<< "Note: No mapping of FA edge fields. Please reconsider algorithm"
82  << endl;
83 
84  field.autoMap(mapper.edgeMap());
85 
86  // Flip the flux
87 // const labelList flipFaces = mapper.edgeMap().flipFaceFlux().toc();
88 
89 // forAll(flipFaces, i)
90 // {
91 // if (flipFaces[i] < field.size())
92 // {
93 // field[flipFaces[i]] *= -1.0;
94 // }
95 // }
96 }
97 
98 
99 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
100 
101 } // End namespace Foam
102 
103 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104 
105 #endif
106 
107 // ************************************************************************* //
Foam::MapInternalField< Type, MeshMapper, edgeMesh >::MapInternalField
MapInternalField()
Definition: MapFaEdgeField.H:54
Foam::MapInternalField::MapInternalField
MapInternalField()
Definition: MapGeometricFields.H:51
Foam::endl
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:369
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Field.H
edgeFaMesh.H
field
rDeltaTY field()
Foam::FatalError
error FatalError
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:144
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
Foam::MapInternalField
Generic internal field mapper. For "real" mapping, add template specialisations for mapping of intern...
Definition: MapGeometricFields.H:47
Foam::edgeMesh
Mesh data needed to do the Finite Area discretisation.
Definition: edgeFaMesh.H:53