1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 \\ / A nd | Copyright held by original author
7 -------------------------------------------------------------------------------
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
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
29 Specialisation of Field<T> for TensorN.
34 \*---------------------------------------------------------------------------*/
36 #ifndef TensorNFields_H
37 #define TensorNFields_H
39 #include "VectorTensorNFieldsFwd.H"
43 #include "FieldFunctionsM.H"
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
47 #define TensorN_FieldFunctions(tensorType,diagTensorType, \
48 sphericalTensorType,vectorType,CmptType, \
51 UNARY_FUNCTION(tensorType, tensorType, inv) \
52 UNARY_FUNCTION(diagTensorType, tensorType, diag) \
53 UNARY_FUNCTION(tensorType, tensorType, negSumDiag) \
55 BINARY_OPERATOR(tensorType, CmptType, tensorType, /, divide) \
56 BINARY_TYPE_OPERATOR(tensorType, CmptType, tensorType, /, divide) \
58 BINARY_OPERATOR(vectorType, vectorType, tensorType, /, divide) \
59 BINARY_TYPE_OPERATOR(vectorType, vectorType, tensorType, /, divide) \
61 BINARY_OPERATOR(tensorType, tensorType, tensorType, /, divide) \
62 BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, /, divide) \
64 BINARY_OPERATOR(tensorType, tensorType, diagTensorType, /, divide) \
65 BINARY_TYPE_OPERATOR(tensorType, tensorType, diagTensorType, /, divide) \
67 BINARY_OPERATOR(tensorType, diagTensorType, tensorType, /, divide) \
68 BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, /, divide) \
70 BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, /, divide) \
71 BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, /, divide) \
73 BINARY_OPERATOR(tensorType, tensorType, sphericalTensorType, /, divide) \
74 BINARY_TYPE_OPERATOR(tensorType, tensorType, sphericalTensorType, /, divide) \
76 BINARY_OPERATOR(tensorType, tensorType, tensorType, +, add) \
77 BINARY_OPERATOR(tensorType, tensorType, tensorType, -, subtract) \
79 BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, +, add) \
80 BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, -, subtract) \
82 BINARY_OPERATOR(tensorType, diagTensorType, tensorType, +, add) \
83 BINARY_OPERATOR(tensorType, diagTensorType, tensorType, -, subtract) \
85 BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, +, add) \
86 BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, -, subtract) \
88 BINARY_OPERATOR(tensorType, tensorType, diagTensorType, +, add) \
89 BINARY_OPERATOR(tensorType, tensorType, diagTensorType, -, subtract) \
91 BINARY_TYPE_OPERATOR(tensorType, tensorType, diagTensorType, +, add) \
92 BINARY_TYPE_OPERATOR(tensorType, tensorType, diagTensorType, -, subtract) \
94 BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, +, add) \
95 BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, -, subtract) \
97 BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, +, add) \
98 BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, -, subtract) \
100 BINARY_OPERATOR(tensorType, tensorType, sphericalTensorType, +, add) \
101 BINARY_OPERATOR(tensorType, tensorType, sphericalTensorType, -, subtract) \
103 BINARY_TYPE_OPERATOR(tensorType, tensorType, sphericalTensorType, +, add) \
104 BINARY_TYPE_OPERATOR(tensorType, tensorType, sphericalTensorType, -, subtract)
106 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
111 forAllVectorTensorNTypes(TensorN_FieldFunctions)
115 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 #undef TensorN_FieldFunctions
119 #include "undefFieldFunctionsM.H"
121 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 // ************************************************************************* //