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
26 GeometricTensorNFields
29 Specialisation of GeometricField<T> for TensorN.
32 GeometricTensorNFields.C
34 \*---------------------------------------------------------------------------*/
36 #ifndef GeometricTensorNFields_H
37 #define GeometricTensorNFields_H
39 #include "GeometricField.H"
40 #include "DimensionedTensorNFields.H"
41 #include "TensorNFieldFields.H"
43 #define TEMPLATE template<template<class> class PatchField, class GeoMesh>
44 #include "GeometricFieldFunctionsM.H"
46 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
48 #define TensorN_FieldFunctions(tensorType, diagTensorType, sphericalTensorType, \
49 vectorType, CmptType, args...) \
51 UNARY_FUNCTION(tensorType, tensorType,inv,inv) \
52 UNARY_FUNCTION(diagTensorType, tensorType,diag,diag) \
53 UNARY_FUNCTION(tensorType, tensorType,negSumDiag,negSumDiag) \
54 UNARY_FUNCTION(CmptType, tensorType,contractScalar,contractScalar) \
55 UNARY_FUNCTION(vectorType, tensorType,contractLinear,contractLinear) \
57 BINARY_OPERATOR(tensorType, CmptType, tensorType, *,'*',multiply) \
58 BINARY_TYPE_OPERATOR(tensorType, CmptType, tensorType, *,'*',multiply) \
60 BINARY_OPERATOR(tensorType, CmptType, tensorType, /,'|',divide) \
61 BINARY_TYPE_OPERATOR(tensorType, CmptType, tensorType, /,'|',divide) \
63 BINARY_OPERATOR(vectorType, vectorType, tensorType, /,'|',divide) \
64 BINARY_TYPE_OPERATOR(vectorType, vectorType, tensorType, /,'|',divide) \
66 BINARY_OPERATOR(tensorType, tensorType, tensorType, /,'|',divide) \
67 BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, /,'|',divide) \
69 BINARY_OPERATOR(tensorType, tensorType, diagTensorType, /,'|',divide) \
70 BINARY_TYPE_OPERATOR(tensorType, tensorType, diagTensorType, /,'|',divide) \
72 BINARY_OPERATOR(tensorType, diagTensorType, tensorType, /,'|',divide) \
73 BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, /,'|',divide) \
75 BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, /,'|',divide) \
76 BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, /,'|',divide) \
78 BINARY_OPERATOR(tensorType, tensorType, sphericalTensorType, /,'|',divide) \
79 BINARY_TYPE_OPERATOR(tensorType, tensorType, sphericalTensorType, /,'|',divide) \
81 BINARY_OPERATOR(tensorType, tensorType, tensorType, +,'+',add) \
82 BINARY_OPERATOR(tensorType, tensorType, tensorType, -,'-',subtract) \
84 BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, +,'+',add) \
85 BINARY_TYPE_OPERATOR(tensorType, tensorType, tensorType, -,'-',subtract) \
87 BINARY_OPERATOR(tensorType, diagTensorType, tensorType, +,'+',add) \
88 BINARY_OPERATOR(tensorType, diagTensorType, tensorType, -,'-',subtract) \
90 BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, +,'+',add) \
91 BINARY_TYPE_OPERATOR(tensorType, diagTensorType, tensorType, -,'-',subtract) \
93 BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, +,'+',add) \
94 BINARY_OPERATOR(tensorType, sphericalTensorType, tensorType, -,'-',subtract) \
96 BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, +,'+',add) \
97 BINARY_TYPE_OPERATOR(tensorType, sphericalTensorType, tensorType, -,'-',subtract)
99 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
104 forAllVectorTensorNTypes(TensorN_FieldFunctions)
108 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
110 #undef TensorN_FieldFunctions
112 #include "undefFieldFunctionsM.H"
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
117 # include "GeometricTensorNFields.C"
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 // ************************************************************************* //