1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend 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 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
25 Foam::SymmTensor4thOrder
28 Templated 3D symmetric fourth order tensor derived from VectorSpace
29 adding construction from 9 components,
30 element access using xxxx(), xxyy() etc. member functions
31 and double dot product with a second order tensor.
33 It is assumed that the 4th order tensor takes the form (6x6 matrix form):
40 where the tensor is symmetric and unspecified entries are zero.
43 Order is currently hacked due to missing operations on symmetry planes
47 SymmTensor4thOrderTemplateI.H
52 \*---------------------------------------------------------------------------*/
54 #ifndef SymmTensor4thOrderTemplate_H
55 #define SymmTensor4thOrderTemplate_H
57 #include "VectorSpace.H"
58 #include "SymmTensorTemplate.H"
60 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
65 /*---------------------------------------------------------------------------*\
66 Class SymmTensor4thOrder Declaration
67 \*---------------------------------------------------------------------------*/
70 class SymmTensor4thOrder
72 public VectorSpace<SymmTensor4thOrder<Cmpt>, Cmpt, 9>
77 //- Equivalent type of labels used for valid component indexing
78 typedef SymmTensor4thOrder<label> labelType;
85 rank = 2 // Hacked by PC: Actual rank of SymmTensor4thOrder is 4
88 //HJ, reconsider and fix. HJ, 23/Feb/2014
91 // Static data members
93 static const char* const typeName;
94 static const char* componentNames[];
96 static const SymmTensor4thOrder zero;
97 static const SymmTensor4thOrder one;
98 static const SymmTensor4thOrder max;
99 static const SymmTensor4thOrder min;
102 //- Component labeling enumeration
120 inline SymmTensor4thOrder();
122 //- Construct given VectorSpace
123 inline SymmTensor4thOrder
125 const VectorSpace<SymmTensor4thOrder<Cmpt>, Cmpt, 9>&
128 //- Construct given SymmTensor (for compilation)
129 inline SymmTensor4thOrder(const SymmTensor<Cmpt>&);
131 //- Construct given the nine components
132 inline SymmTensor4thOrder
134 const Cmpt txxxx, const Cmpt txxyy, const Cmpt txxzz,
135 const Cmpt tyyyy, const Cmpt tyyzz,
142 //- Construct from Istream
143 SymmTensor4thOrder(Istream&);
150 inline const Cmpt& xxxx() const;
151 inline const Cmpt& xxyy() const;
152 inline const Cmpt& xxzz() const;
153 inline const Cmpt& yyyy() const;
154 inline const Cmpt& yyzz() const;
155 inline const Cmpt& zzzz() const;
156 inline const Cmpt& xyxy() const;
157 inline const Cmpt& yzyz() const;
158 inline const Cmpt& zxzx() const;
171 //- Assign to a SymmTensor
172 //- maybe I need this to compile
173 inline void operator=(const SymmTensor<Cmpt>&);
178 class typeOfRank<Cmpt, 4>
182 typedef SymmTensor4thOrder<Cmpt> type;
187 class symmTypeOfRank<Cmpt, 4>
191 typedef SymmTensor4thOrder<Cmpt> type;
195 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
198 } // End namespace Foam
200 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
202 // Include inline implementations
203 #include "SymmTensor4thOrderTemplateI.H"
205 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
209 // ************************************************************************* //