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-------------------------------------------------------------------------------
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::MapFaEdgeField
28
29Description
30 Map edge internal field on topology change. This is a partial
31 template specialisation, see MapGeometricFields.
32
33Author
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
47namespace Foam
48{
49
50template<class Type, class MeshMapper>
51class MapInternalField<Type, MeshMapper, edgeMesh>
52{
53public:
56 {}
57
58 void operator()
59 (
61 const MeshMapper& mapper
62 ) const;
63};
64
65
66template<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// ************************************************************************* //
Generic templated field type.
Definition: Field.H:82
Generic internal field mapper. For "real" mapping, add template specialisations for mapping of intern...
Mesh data needed to do the Finite Area discretisation.
Definition: edgeFaMesh.H:56
friend Ostream & operator(Ostream &, const faMatrix< Type > &)
rDeltaTY field()
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
Namespace for OpenFOAM.
messageStream Info
Information stream (stdout output on master, null elsewhere)
Ostream & endl(Ostream &os)
Add newline and flush stream.
Definition: Ostream.H:372
errorManip< error > abort(error &err)
Definition: errorManip.H:144
error FatalError