fixed writing out entries in advective bc
[OpenFOAM-1.6-ext.git] / src / VectorN / OpenFOAM / expandContract / ExpandTensorNField.H
blobabd8b22a4699324abf4ac581449b252eaf4566ef
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright held by original author
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
11     OpenFOAM is free software; you can redistribute it and/or modify it
12     under the terms of the GNU General Public License as published by the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
16     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
19     for more details.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Description
26     Global functions for expansion and contraction of tensor field
27     to diagonal type
29 Author
30     Hrvoje Jasak, Wikki Ltd.  All rights reserved
32 SourceFiles
33     ExpandTensorNField.C
35 \*---------------------------------------------------------------------------*/
37 #ifndef expandTensorNField_H
38 #define expandTensorNField_H
40 #include "Field.H"
41 #include "VectorNFieldTypes.H"
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
45 #define UNARY_FUNCTION(typeF1, typeF2, FUNC)                                  \
46 void FUNC(Field<typeF1>& f1, const UList<typeF2>& f2);                        \
47 void FUNC(Field<typeF1>& f1, const tmp<Field<typeF2> >& tf2);
50 #define ExpandFieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
51         vectorType, cmptType, args...)                                        \
52                                                                               \
53 UNARY_FUNCTION(cmptType, tensorType, contractScalar)                          \
54 UNARY_FUNCTION(cmptType, diagTensorType, contractScalar)                      \
55 UNARY_FUNCTION(cmptType, sphericalTensorType, contractScalar)                 \
56 UNARY_FUNCTION(cmptType, vectorType, contractScalar)                          \
57                                                                               \
58 UNARY_FUNCTION(vectorType, tensorType, contractLinear)                        \
59 UNARY_FUNCTION(vectorType, diagTensorType, contractLinear)                    \
60 UNARY_FUNCTION(vectorType, sphericalTensorType, contractLinear)               \
61                                                                               \
62 UNARY_FUNCTION(vectorType, cmptType, expandScalar)                            \
63 UNARY_FUNCTION(tensorType, cmptType, expandScalar)                            \
64 UNARY_FUNCTION(diagTensorType, cmptType, expandScalar)                        \
65 UNARY_FUNCTION(sphericalTensorType, cmptType, expandScalar)                   \
66                                                                               \
67 UNARY_FUNCTION(tensorType, vectorType, expandLinear)                          \
68 UNARY_FUNCTION(diagTensorType, vectorType, expandLinear)                      \
69 UNARY_FUNCTION(sphericalTensorType, vectorType, expandLinear)
71 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
73 namespace Foam
76 // * * * * * * * * * * * * * * * Global Functions  * * * * * * * * * * * * * //
78 forAllVectorTensorNTypes(ExpandFieldFunctions)
81 // template <class Cmpt, int length>
82 // void contractScalar
83 // (
84 //     Field<Cmpt>& res,
85 //     const UList<TensorN<Cmpt, length> >& f
86 // );
87 // 
88 // template <class Cmpt, int length>
89 // void contractScalar
90 // (
91 //     Field<Cmpt>& res,
92 //     const UList<DiagTensorN<Cmpt, length> >& f
93 // );
94 // 
95 // template <class Cmpt, int length>
96 // void contractScalar
97 // (
98 //     Field<Cmpt>& res,
99 //     const UList<SphericalTensorN<Cmpt, length> >& f
100 // );
101 // 
102 // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103 // 
104 // template <class Cmpt, int length>
105 // void contractLinear
106 // (
107 //     Field<VectorN<Cmpt, length> >& res,
108 //     const UList<TensorN<Cmpt, length> >& f
109 // );
110 // 
111 // template <class Cmpt, int length>
112 // void contractLinear
113 // (
114 //     Field<VectorN<Cmpt, length> >& res,
115 //     const UList<DiagTensorN<Cmpt, length> >& f
116 // );
117 // 
118 // template <class Cmpt, int length>
119 // void contractLinear
120 // (
121 //     Field<VectorN<Cmpt, length> >& res,
122 //     const UList<SphericalTensorN<Cmpt, length> >& f
123 // );
124 // 
125 // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
126 // 
127 // template <class Cmpt, int length>
128 // void expandScalar
129 // (
130 //     Field<VectorN<Cmpt, length> >& res,
131 //     const UList<Cmpt>& f
132 // );
133 // 
134 // template <class Cmpt, int length>
135 // void expandScalar
136 // (
137 //     Field<TensorN<Cmpt, length> >& res,
138 //     const UList<Cmpt>& f
139 // );
140 // 
141 // template <class Cmpt, int length>
142 // void expandScalar
143 // (
144 //     Field<DiagTensorN<Cmpt, length> >& res,
145 //     const UList<Cmpt>& f
146 // );
147 // 
148 // template <class Cmpt, int length>
149 // void expandScalar
150 // (
151 //     Field<SphericalTensorN<Cmpt, length> >& res,
152 //     const UList<Cmpt>& f
153 // );
154 // 
155 // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
156 // 
157 // template <class Cmpt, int length>
158 // void expandLinear
159 // (
160 //     Field<TensorN<Cmpt, length> >& res,
161 //     const UList<VectorN<Cmpt, length> >& f
162 // );
163 // 
164 // template <class Cmpt, int length>
165 // void expandLinear
166 // (
167 //     Field<DiagTensorN<Cmpt, length> >& res,
168 //     const UList<VectorN<Cmpt, length> >& f
169 // );
170 // 
171 // template <class Cmpt, int length>
172 // void expandLinear
173 // (
174 //     Field<SphericalTensorN<Cmpt, length> >& res,
175 //     const UList<VectorN<Cmpt, length> >& f
176 // );
178 } // End namespace Foam
180 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
182 #undef UNARY_FUNCTION
183 #undef ExpandFieldFunctions
185 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
187 // #ifdef NoRepository
188 // #   include "ExpandTensorNField.C"
189 // #endif
191 // ************************************************************************* //
193 #endif