Loading...
Searching...
No Matches
Tensor2DI.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) 2011-2016 OpenFOAM Foundation
9 Copyright (C) 2018-2023 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27\*---------------------------------------------------------------------------*/
28
29// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
30
31template<class Cmpt>
33:
35{}
36
37
38template<class Cmpt>
40(
41 const VectorSpace<Tensor2D<Cmpt>, Cmpt, 4>& vs
43:
44 Tensor2D::vsType(vs)
45{}
46
47
48template<class Cmpt>
51 this->v_[XX] = st.xx(); this->v_[XY] = st.xy();
52 this->v_[YX] = st.xy(); this->v_[YY] = st.yy();
53}
54
55
56template<class Cmpt>
59 this->v_[XX] = st.ii(); this->v_[XY] = Zero;
60 this->v_[YX] = Zero; this->v_[YY] = st.ii();
61}
62
63
64template<class Cmpt>
66(
67 const Vector2D<Cmpt>& x,
68 const Vector2D<Cmpt>& y
69)
71 this->v_[XX] = x.x(); this->v_[XY] = x.y();
72 this->v_[YX] = y.x(); this->v_[YY] = y.y();
73}
74
75
76template<class Cmpt>
78(
79 const Cmpt txx, const Cmpt txy,
80 const Cmpt tyx, const Cmpt tyy
81)
83 this->v_[XX] = txx; this->v_[XY] = txy;
84 this->v_[YX] = tyx; this->v_[YY] = tyy;
85}
86
87
88template<class Cmpt>
90:
92{}
93
94
95// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
96
97template<class Cmpt>
99{
100 return Vector2D<Cmpt>(this->v_[XX], this->v_[XY]);
101}
102
103template<class Cmpt>
105{
106 return Vector2D<Cmpt>(this->v_[YX], this->v_[YY]);
107}
108
109
110template<class Cmpt>
112{
113 return Vector2D<Cmpt>(this->v_[XX], this->v_[YX]);
114}
115
116template<class Cmpt>
119 return Vector2D<Cmpt>(this->v_[XY], this->v_[YY]);
120}
121
122
123template<class Cmpt>
124template<Foam::direction Idx>
126{
127 if (Idx == 0) return cx();
128 else if (Idx == 1) return cy();
130 static_assert(Idx < 2, "Invalid column access");
131 return Zero;
132}
133
134
135template<class Cmpt>
137{
138 switch (c)
139 {
140 case 0: return cx(); break;
141 case 1: return cy(); break;
142 default:
144 << "Invalid column access " << c << abort(FatalError);
145 }
147 return Zero;
148}
149
150
151template<class Cmpt>
152template<Foam::direction Idx>
154{
155 if (Idx == 0) return x();
156 else if (Idx == 1) return y();
158 static_assert(Idx < 2, "Invalid row access");
159 return Zero;
160}
161
162
163template<class Cmpt>
165{
166 switch (r)
167 {
168 case 0: return x(); break;
169 case 1: return y(); break;
170 default:
172 << "Invalid row access " << r << abort(FatalError);
173 }
175 return Zero;
176}
177
178
179template<class Cmpt>
180template<Foam::direction Idx>
181inline void Foam::Tensor2D<Cmpt>::col(const Vector2D<Cmpt>& v)
182{
183 if (Idx == 0)
184 {
185 this->v_[XX] = v.x();
186 this->v_[YX] = v.y();
187 }
188 else if (Idx == 1)
189 {
190 this->v_[XY] = v.x();
191 this->v_[YY] = v.y();
192 }
194 static_assert(Idx < 2, "Invalid column access");
195}
196
197
198template<class Cmpt>
199template<Foam::direction Idx>
200inline void Foam::Tensor2D<Cmpt>::row(const Vector2D<Cmpt>& v)
201{
202 if (Idx == 0)
203 {
204 this->v_[XX] = v.x(); this->v_[XY] = v.y();
205 }
206 else if (Idx == 1)
207 {
208 this->v_[YX] = v.x(); this->v_[YY] = v.y();
210
211 static_assert(Idx < 2, "Invalid row access");
212}
213
214
215template<class Cmpt>
217(
218 const Vector2D<Cmpt>& x,
219 const Vector2D<Cmpt>& y
220)
222 this->v_[XX] = x.x(); this->v_[XY] = y.x();
223 this->v_[YX] = x.y(); this->v_[YY] = y.y();
224}
225
226
227template<class Cmpt>
229(
230 const Vector2D<Cmpt>& x,
231 const Vector2D<Cmpt>& y
232)
234 this->v_[XX] = x.x(); this->v_[XY] = x.y();
235 this->v_[YX] = y.x(); this->v_[YY] = y.y();
236}
237
238
239template<class Cmpt>
241(
242 const direction c,
243 const Vector2D<Cmpt>& v
244)
245{
246 switch (c)
247 {
248 case 0: col<0>(v); break;
249 case 1: col<1>(v); break;
250 default:
252 << "Invalid column access " << c << abort(FatalError);
253 }
254}
255
256
257template<class Cmpt>
259(
260 const direction r,
261 const Vector2D<Cmpt>& v
262)
263{
264 switch (r)
265 {
266 case 0: row<0>(v); break;
267 case 1: row<1>(v); break;
268 default:
270 << "Invalid row access " << r << abort(FatalError);
271 }
272}
273
274
275template<class Cmpt>
277{
278 return Vector2D<Cmpt>(this->v_[XX], this->v_[YY]);
279}
280
281
282template<class Cmpt>
284{
285 this->v_[XX] = v.x(); this->v_[YY] = v.y();
286}
287
288
289template<class Cmpt>
290inline Foam::scalar Foam::Tensor2D<Cmpt>::diagSqr() const
291{
292 return
293 (
294 Foam::magSqr(this->xx())
295 + Foam::magSqr(this->yy())
296 );
297}
298
299
300// * * * * * * * * * * * * * * * Member Operations * * * * * * * * * * * * * //
301
302template<class Cmpt>
304{
305 return Tensor2D<Cmpt>
306 (
307 xx(), yx(),
308 xy(), yy()
309 );
310}
311
312
313template<class Cmpt>
314inline Cmpt Foam::Tensor2D<Cmpt>::det() const
315{
316 return (xx()*yy() - xy()*yx());
317}
318
319
320template<class Cmpt>
322{
323 return Tensor2D<Cmpt>
324 (
325 yy(), -xy(),
326 -yx(), xx()
327 );
328}
329
330
331template<class Cmpt>
334 return this->adjunct().T();
335}
336
337
338template<class Cmpt>
341{
342 const Tensor2D<Cmpt>& t1 = *this;
343
344 return Tensor2D<Cmpt>
345 (
346 t1.xx()*t2.xx() + t1.xy()*t2.yx(),
347 t1.xx()*t2.xy() + t1.xy()*t2.yy(),
348
349 t1.yx()*t2.xx() + t1.yy()*t2.yx(),
350 t1.yx()*t2.xy() + t1.yy()*t2.yy()
351 );
352}
353
354
355template<class Cmpt>
358{
359 const Tensor2D<Cmpt>& t1 = *this;
360
361 return Tensor2D<Cmpt>
362 (
363 t1.xx()*t2.xx(), t1.xy()*t2.xy(),
364 t1.yx()*t2.yx(), t1.yy()*t2.yy()
365 );
366}
367
368
369// Invert without much error handling
370template<class Cmpt>
372{
373 const Cmpt detval = this->det();
374
375 #ifdef FULLDEBUG
376 if (mag(detval) < SMALL)
377 {
379 << "SymmTensor2D not properly invertible, determinant:"
380 << detval << " tensor:" << *this << nl
381 << abort(FatalError);
382 }
383 #endif
384
385 return this->adjunct()/detval;
386}
387
388
389// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
390
391template<class Cmpt>
394 this->v_[XX] = st.xx(); this->v_[XY] = st.xy();
395 this->v_[YX] = st.xy(); this->v_[YY] = st.yy();
396}
397
398
399template<class Cmpt>
401{
402 this->v_[XX] = st.ii(); this->v_[XY] = Zero;
403 this->v_[YX] = Zero; this->v_[YY] = st.ii();
404}
405
406
407// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
408
409namespace Foam
410{
412// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
413
414//- Return the trace of a Tensor2D
415template<class Cmpt>
416inline Cmpt tr(const Tensor2D<Cmpt>& t)
417{
418 return t.xx() + t.yy();
419}
420
422//- Return the spherical part of a Tensor2D
423template<class Cmpt>
425{
427 (
428 0.5*tr(t)
429 );
430}
431
432
433//- Return the symmetric part of a Tensor2D
434template<class Cmpt>
436{
437 return SymmTensor2D<Cmpt>
438 (
439 t.xx(), 0.5*(t.xy() + t.yx()),
440 t.yy()
441 );
442}
443
444
445//- Return the twice the symmetric part of a Tensor2D
446template<class Cmpt>
447inline SymmTensor2D<Cmpt> twoSymm(const Tensor2D<Cmpt>& t)
449 return SymmTensor2D<Cmpt>
450 (
451 t.xx() + t.xx(), t.xy() + t.yx(),
452 t.yy() + t.yy()
453 );
454}
455
456
457//- Return the skew-symmetric part of a Tensor2D
458template<class Cmpt>
459inline Tensor2D<Cmpt> skew(const Tensor2D<Cmpt>& t)
460{
461 return Tensor2D<Cmpt>
463 Zero, 0.5*(t.xy() - t.yx()),
464 0.5*(t.yx() - t.xy()), Zero
465 );
466}
467
468
469//- Return the deviatoric part of a Tensor2D
470template<class Cmpt>
471inline Tensor2D<Cmpt> dev(const Tensor2D<Cmpt>& t)
472{
473 return t - sph(t);
474}
475
477//- Return the two-third deviatoric part of a Tensor2D
478template<class Cmpt>
479inline Tensor2D<Cmpt> dev2(const Tensor2D<Cmpt>& t)
480{
481 return t - 2*sph(t);
482}
483
484
485//- Return the determinant of a Tensor2D
486template<class Cmpt>
487inline Cmpt det(const Tensor2D<Cmpt>& t)
488{
489 return t.det();
490}
491
492
493//- Return the cofactor of a Tensor2D
494template<class Cmpt>
495inline Tensor2D<Cmpt> cof(const Tensor2D<Cmpt>& t)
497 return t.cof();
498}
499
500
501//- Return the inverse of a Tensor2D, using given determinant value
502template<class Cmpt>
503inline Tensor2D<Cmpt> inv(const Tensor2D<Cmpt>& t, const Cmpt detval)
504{
505 #ifdef FULLDEBUG
506 if (mag(detval) < SMALL)
507 {
509 << "Tensor2D not properly invertible, determinant:"
510 << detval << " tensor:" << t << nl
511 << abort(FatalError);
512 }
513 #endif
514
515 return t.adjunct()/detval;
517
518
519//- Return the inverse of a Tensor2D
520template<class Cmpt>
521inline Tensor2D<Cmpt> inv(const Tensor2D<Cmpt>& t)
522{
523 return t.inv();
524}
525
526
527//- Return the 1st invariant of a Tensor2D
528template<class Cmpt>
529inline Cmpt invariantI(const Tensor2D<Cmpt>& t)
530{
531 return tr(t);
532}
533
534
535//- Return the 2nd invariant of a Tensor2D
536template<class Cmpt>
537inline Cmpt invariantII(const Tensor2D<Cmpt>& t)
538{
539 return det(t);
540}
541
542
543// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
544
545//- Sum of a SphericalTensor2D and a Tensor2D
546template<class Cmpt>
547inline Tensor2D<Cmpt>
549{
550 return Tensor2D<Cmpt>
551 (
552 st1.ii() + t2.xx(), t2.xy(),
553 t2.yx(), st1.ii() + t2.yy()
554 );
555}
557
558//- Sum of a Tensor2D and a SphericalTensor2D
559template<class Cmpt>
560inline Tensor2D<Cmpt>
562{
563 return Tensor2D<Cmpt>
564 (
565 t1.xx() + st2.ii(), t1.xy(),
566 t1.yx(), t1.yy() + st2.ii()
567 );
568}
570
571//- Sum of a SymmTensor2D and a Tensor2D
572template<class Cmpt>
573inline Tensor2D<Cmpt>
574operator+(const SymmTensor2D<Cmpt>& st1, const Tensor2D<Cmpt>& t2)
575{
576 return Tensor2D<Cmpt>
577 (
578 st1.xx() + t2.xx(), st1.xy() + t2.xy(),
579 st1.xy() + t2.yx(), st1.yy() + t2.yy()
580 );
581}
582
583
584//- Sum of a Tensor2D and a SymmTensor2D
585template<class Cmpt>
586inline Tensor2D<Cmpt>
587operator+(const Tensor2D<Cmpt>& t1, const SymmTensor2D<Cmpt>& st2)
588{
589 return Tensor2D<Cmpt>
590 (
591 t1.xx() + st2.xx(), t1.xy() + st2.xy(),
592 t1.yx() + st2.xy(), t1.yy() + st2.yy()
593 );
594}
595
596
597//- Subtract a Tensor2D from a SphericalTensor2D
598template<class Cmpt>
601{
602 return Tensor2D<Cmpt>
603 (
604 st1.ii() - t2.xx(), -t2.xy(),
605 -t2.yx(), st1.ii() - t2.yy()
606 );
607}
608
609
610//- Subtract a SphericalTensor2D from a Tensor2D
611template<class Cmpt>
612inline Tensor2D<Cmpt>
613operator-(const Tensor2D<Cmpt>& t1, const SphericalTensor2D<Cmpt>& st2)
615 return Tensor2D<Cmpt>
616 (
617 t1.xx() - st2.ii(), t1.xy(),
618 t1.yx(), t1.yy() - st2.ii()
619 );
620}
621
622
623//- Subtract a Tensor2D from a SymmTensor2D
624template<class Cmpt>
625inline Tensor2D<Cmpt>
626operator-(const SymmTensor2D<Cmpt>& st1, const Tensor2D<Cmpt>& t2)
627{
628 return Tensor2D<Cmpt>
630 st1.xx() - t2.xx(), st1.xy() - t2.xy(),
631 st1.xy() - t2.yx(), st1.yy() - t2.yy()
632 );
633}
634
635
636//- Subtract a SymmTensor2D from a Tensor2D
637template<class Cmpt>
638inline Tensor2D<Cmpt>
639operator-(const Tensor2D<Cmpt>& t1, const SymmTensor2D<Cmpt>& st2)
640{
641 return Tensor2D<Cmpt>
642 (
643 t1.xx() - st2.xx(), t1.xy() - st2.xy(),
644 t1.yx() - st2.xy(), t1.yy() - st2.yy()
645 );
646}
647
648
649//- Division of a Tensor2D by a Cmpt
650template<class Cmpt>
651inline Tensor2D<Cmpt>
652operator/(const Tensor2D<Cmpt>& t, const Cmpt s)
653{
654 #ifdef FULLDEBUG
655 if (mag(s) < VSMALL)
656 {
658 << "Tensor2D = " << t
659 << " is not divisible due to a zero value in Cmpt:"
660 << "Cmpt = " << s
661 << abort(FatalError);
662 }
663 #endif
664
665 return Tensor2D<Cmpt>
666 (
667 t.xx()/s, t.xy()/s,
668 t.yx()/s, t.yy()/s
669 );
670}
671
672
673//- Inner-product of a Tensor2D and a Tensor2D
674template<class Cmpt>
676operator&(const Tensor2D<Cmpt>& t1, const Tensor2D<Cmpt>& t2)
677{
678 return t1.inner(t2);
679}
680
681
682//- Inner-product of a SphericalTensor2D and Tensor2D
683template<class Cmpt>
684inline Tensor2D<Cmpt>
685operator&(const SphericalTensor2D<Cmpt>& st1, const Tensor2D<Cmpt>& t2)
686{
687 return Tensor2D<Cmpt>
688 (
689 st1.ii()*t2.xx(),
690 st1.ii()*t2.xy(),
691 st1.ii()*t2.yx(),
692 st1.ii()*t2.yy()
693 );
694}
695
696
697//- Inner-product of a Tensor2D and a SphericalTensor2D
698template<class Cmpt>
699inline Tensor2D<Cmpt>
700operator&(const Tensor2D<Cmpt>& t1, const SphericalTensor2D<Cmpt>& st2)
701{
702 return Tensor2D<Cmpt>
703 (
704 t1.xx()*st2.ii(),
705 t1.xy()*st2.ii(),
706
707 t1.yx()*st2.ii(),
708 t1.yy()*st2.ii()
709 );
710}
711
712
713//- Inner-product of a SymmTensor2D and Tensor2D
714template<class Cmpt>
716operator&(const SymmTensor2D<Cmpt>& st1, const Tensor2D<Cmpt>& t2)
717{
718 return Tensor2D<Cmpt>
719 (
720 st1.xx()*t2.xx() + st1.xy()*t2.yx(),
721 st1.xx()*t2.xy() + st1.xy()*t2.yy(),
722
723 st1.xy()*t2.xx() + st1.yy()*t2.yx(),
724 st1.xy()*t2.xy() + st1.yy()*t2.yy()
725 );
727
728
729//- Inner-product of a Tensor2D and a SymmTensor2D
730template<class Cmpt>
731inline Tensor2D<Cmpt>
732operator&(const Tensor2D<Cmpt>& t1, const SymmTensor2D<Cmpt>& st2)
733{
734 return Tensor2D<Cmpt>
735 (
736 t1.xx()*st2.xx() + t1.xy()*st2.xy(),
737 t1.xx()*st2.xy() + t1.xy()*st2.yy(),
738
739 t1.yx()*st2.xx() + t1.yy()*st2.xy(),
740 t1.yx()*st2.xy() + t1.yy()*st2.yy()
741 );
742}
744
745
746//- Inner-product of a Tensor2D and a Vector2D
747template<class Cmpt>
749operator&(const Tensor2D<Cmpt>& t, const Vector2D<Cmpt>& v)
750{
751 return Vector2D<Cmpt>
752 (
753 t.xx()*v.x() + t.xy()*v.y(),
754 t.yx()*v.x() + t.yy()*v.y()
755 );
756}
757
758
759//- Inner-product of a Vector2D and a Tensor2D
760template<class Cmpt>
762operator&(const Vector2D<Cmpt>& v, const Tensor2D<Cmpt>& t)
763{
764 return Vector2D<Cmpt>
765 (
766 v.x()*t.xx() + v.y()*t.yx(),
767 v.x()*t.xy() + v.y()*t.yy()
768 );
769}
770
771
772//- Double-inner-product of a SphericalTensor2D and a Tensor2D
773template<class Cmpt>
774inline Cmpt
775operator&&(const SphericalTensor2D<Cmpt>& st1, const Tensor2D<Cmpt>& t2)
776{
777 return (st1.ii()*t2.xx() + st1.ii()*t2.yy());
778}
780
781//- Double-inner-product of a Tensor2D and a SphericalTensor2D
782template<class Cmpt>
783inline Cmpt
785{
786 return (t1.xx()*st2.ii() + t1.yy()*st2.ii());
787}
788
789
790//- Double-inner-product of a SymmTensor2D and a Tensor2D
791template<class Cmpt>
792inline Cmpt
793operator&&(const SymmTensor2D<Cmpt>& st1, const Tensor2D<Cmpt>& t2)
794{
795 return
796 (
797 st1.xx()*t2.xx() + st1.xy()*t2.xy()
798 + st1.xy()*t2.yx() + st1.yy()*t2.yy()
799 );
800}
801
802
803//- Double-inner-product of a Tensor2D and a SymmTensor2D
804template<class Cmpt>
805inline Cmpt
806operator&&(const Tensor2D<Cmpt>& t1, const SymmTensor2D<Cmpt>& st2)
807{
808 return
809 (
810 t1.xx()*st2.xx() + t1.xy()*st2.xy()
811 + t1.yx()*st2.xy() + t1.yy()*st2.yy()
812 );
814
815
816//- Outer-product of a Vector2D and a Vector2D
817template<class Cmpt>
818inline typename outerProduct<Vector2D<Cmpt>, Vector2D<Cmpt>>::type
819operator*(const Vector2D<Cmpt>& v1, const Vector2D<Cmpt>& v2)
820{
821 return Tensor2D<Cmpt>
822 (
823 v1.x()*v2.x(), v1.x()*v2.y(),
824 v1.y()*v2.x(), v1.y()*v2.y()
825 );
826}
827
829// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
830
831template<class Cmpt>
832class typeOfSum<SphericalTensor2D<Cmpt>, Tensor2D<Cmpt>>
833{
834public:
835
836 typedef Tensor2D<Cmpt> type;
837};
838
839template<class Cmpt>
840class typeOfSum<Tensor2D<Cmpt>, SphericalTensor2D<Cmpt>>
841{
842public:
843
844 typedef Tensor2D<Cmpt> type;
845};
846
847
848template<class Cmpt>
849class innerProduct<Tensor2D<Cmpt>, Tensor2D<Cmpt>>
851public:
852
853 typedef Tensor2D<Cmpt> type;
854};
855
856template<class Cmpt>
857class innerProduct<SphericalTensor2D<Cmpt>, Tensor2D<Cmpt>>
858{
859public:
860
861 typedef Tensor2D<Cmpt> type;
862};
863
864template<class Cmpt>
866{
867public:
868
869 typedef Tensor2D<Cmpt> type;
870};
871
872template<class Cmpt>
873class innerProduct<Tensor2D<Cmpt>, Vector2D<Cmpt>>
874{
875public:
876
877 typedef Vector2D<Cmpt> type;
878};
879
880template<class Cmpt>
881class innerProduct<Vector2D<Cmpt>, Tensor2D<Cmpt>>
882{
883public:
884
885 typedef Vector2D<Cmpt> type;
886};
887
888
889template<class Cmpt>
890class outerProduct<Vector2D<Cmpt>, Vector2D<Cmpt>>
891{
892public:
894 typedef Tensor2D<Cmpt> type;
895};
896
898// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
899
900} // End namespace Foam
902// ************************************************************************* //
scalar y
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
A templated (2 x 2) diagonal tensor of objects of <T>, effectively containing 1 element,...
const Cmpt & ii() const noexcept
A templated (2 x 2) symmetric tensor of objects of <T>, effectively containing 3 elements,...
const Cmpt & yy() const noexcept
const Cmpt & xx() const noexcept
const Cmpt & xy() const noexcept
A templated (2 x 2) tensor of objects of <T> derived from VectorSpace.
Definition Tensor2D.H:55
scalar diagSqr() const
The L2-norm squared of the diagonal.
Definition Tensor2DI.H:283
const Cmpt & yy() const noexcept
Definition Tensor2D.H:156
Tensor2D< Cmpt > adjunct() const
Return adjunct matrix (transpose of cofactor matrix).
Definition Tensor2DI.H:314
Vector2D< Cmpt > y() const
Extract vector for row 1.
Definition Tensor2DI.H:97
Vector2D< Cmpt > cy() const
Extract vector for column 1.
Definition Tensor2DI.H:110
void cols(const Vector2D< Cmpt > &x, const Vector2D< Cmpt > &y)
Set column values.
Definition Tensor2DI.H:210
Tensor2D()=default
Default construct.
Vector2D< Cmpt > row() const
Extract vector for given row: compile-time check of index.
Tensor2D< Cmpt > schur(const Tensor2D< Cmpt > &t2) const
Schur-product of this with another Tensor2D.
Definition Tensor2DI.H:350
const Cmpt & yx() const noexcept
Definition Tensor2D.H:155
Tensor2D< Cmpt > cof() const
Return cofactor matrix (transpose of adjunct matrix).
Definition Tensor2DI.H:325
Vector2D< Cmpt > x() const
Extract vector for row 0.
Definition Tensor2DI.H:91
void rows(const Vector2D< Cmpt > &x, const Vector2D< Cmpt > &y)
Set row values.
Definition Tensor2DI.H:222
Tensor2D & operator=(const Tensor2D &)=default
Copy assignment.
Cmpt det() const
The determinate.
Definition Tensor2DI.H:307
Vector2D< Cmpt > cx() const
Extract vector for column 0.
Definition Tensor2DI.H:104
Tensor2D< Cmpt > T() const
Return non-Hermitian transpose.
Definition Tensor2DI.H:296
Tensor2D< Cmpt > inv() const
Return inverse.
Definition Tensor2DI.H:364
const Cmpt & xx() const noexcept
Definition Tensor2D.H:153
Vector2D< Cmpt > diag() const
Extract the diagonal as a vector.
Definition Tensor2DI.H:269
const Cmpt & xy() const noexcept
Definition Tensor2D.H:154
Vector2D< Cmpt > col() const
Extract vector for given column: compile-time check of index.
Tensor2D< Cmpt > inner(const Tensor2D< Cmpt > &t2) const
Inner-product of this with another Tensor2D.
Definition Tensor2DI.H:333
Templated 2D Vector derived from VectorSpace adding construction from 2 components,...
Definition Vector2D.H:54
const Cmpt & x() const noexcept
Access to the vector x component.
Definition Vector2D.H:127
const Cmpt & y() const noexcept
Access to the vector y component.
Definition Vector2D.H:132
Templated vector space.
Definition VectorSpace.H:75
VectorSpace< Tensor2D< Cmpt >, Cmpt, Ncmpts > vsType
Definition VectorSpace.H:86
typeOfRank< typenamepTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) -2 >::type type
Definition products.H:155
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition zero.H:58
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition error.H:600
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Namespace for OpenFOAM.
tmp< faMatrix< Type > > operator-(const faMatrix< Type > &)
Unary negation.
dimensionedSymmTensor dev2(const dimensionedSymmTensor &dt)
dimensionedSymmTensor dev(const dimensionedSymmTensor &dt)
dimensionedScalar det(const dimensionedSphericalTensor &dt)
dimensionedSymmTensor symm(const dimensionedSymmTensor &dt)
dimensionedScalar tr(const dimensionedSphericalTensor &dt)
tmp< faMatrix< Type > > operator+(const faMatrix< Type > &, const faMatrix< Type > &)
dimensionedSymmTensor twoSymm(const dimensionedSymmTensor &dt)
Cmpt invariantII(const SymmTensor2D< Cmpt > &st)
Return the 2nd invariant of a SymmTensor2D.
Cmpt invariantI(const SymmTensor2D< Cmpt > &st)
Return the 1st invariant of a SymmTensor2D.
tmp< faMatrix< Type > > operator*(const areaScalarField::Internal &, const faMatrix< Type > &)
fileName::Type type(const fileName &name, const bool followLink=true)
Return the file type: DIRECTORY or FILE, normally following symbolic links.
Definition POSIX.C:801
dimensionedScalar operator/(const scalar s1, const dimensionedScalar &ds2)
dimensionedSymmTensor cof(const dimensionedSymmTensor &dt)
tmp< GeometricField< Type, faPatchField, areaMesh > > operator&(const faMatrix< Type > &, const DimensionedField< Type, areaMesh > &)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
errorManip< error > abort(error &err)
Definition errorManip.H:139
SphericalTensor< Cmpt > sph(const DiagTensor< Cmpt > &dt)
Return the spherical part of a DiagTensor as a SphericalTensor.
uint8_t direction
Definition direction.H:49
static constexpr const zero Zero
Global zero (0).
Definition zero.H:127
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
dimensionedSphericalTensor inv(const dimensionedSphericalTensor &dt)
dimensioned< typename scalarProduct< Type1, Type2 >::type > operator&&(const dimensioned< Type1 > &, const dimensioned< Type2 > &)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
dimensionedTensor skew(const dimensionedTensor &dt)
constexpr char nl
The newline '\n' character (0x0a).
Definition Ostream.H:50