Loading...
Searching...
No Matches
VectorSpaceI.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) 2019-2025 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#include "error.H"
30#include "products.H"
32#include "ops.H"
33#include <type_traits>
34
35// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
36
37template<class Form, class Cmpt, Foam::direction Ncmpts>
39{
41}
42
43
44template<class Form, class Cmpt, Foam::direction Ncmpts>
46(
48)
50 VectorSpaceOps<Ncmpts>::copy_n(vs.cbegin(), this->begin());
51}
52
53
54template<class Form, class Cmpt, Foam::direction Ncmpts>
55template<class Form2, class Cmpt2>
57(
59)
60{
62}
63
64
65template<class Form, class Cmpt, Foam::direction Ncmpts>
66template<class SubVector, Foam::direction BStart>
69(
70 const vsType& vs
71)
72:
73 vs_(vs)
74{
75 static_assert
76 (
78 "Requested block size > VectorSpace size"
79 );
80}
81
82
83// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
84
85template<class Form, class Cmpt, Foam::direction Ncmpts>
87(
88 const direction d
89) const
90{
91 #ifdef FULLDEBUG
92 if (d >= Ncmpts)
93 {
95 << "index out of range"
96 << abort(FatalError);
97 }
98 #endif
99
100 return v_[d];
101}
102
103
104template<class Form, class Cmpt, Foam::direction Ncmpts>
106(
107 const direction d
108)
109{
110 #ifdef FULLDEBUG
111 if (d >= Ncmpts)
112 {
114 << "index out of range"
115 << abort(FatalError);
116 }
117 #endif
118
119 return v_[d];
120}
121
122
123template<class Form, class Cmpt, Foam::direction Ncmpts>
125(
126 Cmpt& c,
127 const direction d
128) const
129{
130 #ifdef FULLDEBUG
131 if (d >= Ncmpts)
132 {
134 << "index out of range"
135 << abort(FatalError);
136 }
137 #endif
138
139 c = v_[d];
140}
141
142
143template<class Form, class Cmpt, Foam::direction Ncmpts>
145(
146 const direction d,
147 const Cmpt& c
148)
149{
150 #ifdef FULLDEBUG
151 if (d >= Ncmpts)
152 {
154 << "index out of range"
155 << abort(FatalError);
157 #endif
158
159 v_[d] = c;
160}
162
163template<class Form, class Cmpt, Foam::direction Ncmpts>
165{
167}
168
169
170template<class Form, class Cmpt, Foam::direction Ncmpts>
172{
173 Form v;
174 v.fill(s);
175 return v;
177
178
179template<class Form, class Cmpt, Foam::direction Ncmpts>
180template<class SubVector, Foam::direction BStart>
182 ConstBlock<SubVector, BStart>
184{
185 return *this;
186}
187
188
189// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
190
191template<class Form, class Cmpt, Foam::direction Ncmpts>
193(
194 const direction d
195) const
196{
197 #ifdef FULLDEBUG
198 if (d >= Ncmpts)
199 {
201 << "index out of range"
202 << abort(FatalError);
203 }
204 #endif
205
206 return v_[d];
207}
208
209
210template<class Form, class Cmpt, Foam::direction Ncmpts>
212(
213 const direction d
214)
215{
216 #ifdef FULLDEBUG
217 if (d >= Ncmpts)
218 {
220 << "index out of range"
221 << abort(FatalError);
222 }
223 #endif
224
225 return v_[d];
227
228
229template<class Form, class Cmpt, Foam::direction Ncmpts>
230template<class SubVector, Foam::direction BStart>
231inline const Cmpt&
233ConstBlock<SubVector, BStart>::operator[]
234(
235 const direction d
236) const
238 #ifdef FULLDEBUG
239 if (d >= Ncmpts)
240 {
242 << "index out of range"
243 << abort(FatalError);
244 }
245 #endif
246
247 return vs_[BStart + d];
251template<class Form, class Cmpt, Foam::direction Ncmpts>
252template<class SubVector, Foam::direction BStart>
253inline const Cmpt&
256(
257 const direction i,
258 const direction j
259) const
261 #ifdef FULLDEBUG
262 if (i >= Ncmpts)
263 {
265 << "index " << i << " out of range"
266 << abort(FatalError);
267 }
268
269 if (j)
270 {
272 << "index " << j << " != 0"
273 << abort(FatalError);
274 }
275 #endif
276
277 return vs_[BStart + i];
278}
279
280
281template<class Form, class Cmpt, Foam::direction Ncmpts>
283(
285)
287 VectorSpaceOps<Ncmpts>::copy_n(vs.cbegin(), this->begin());
288}
289
290
291template<class Form, class Cmpt, Foam::direction Ncmpts>
292template<class Form2, class Cmpt2>
294(
297{
298 VectorSpaceOps<Ncmpts>::copy_n(vs.cbegin(), this->begin());
299}
300
301
302template<class Form, class Cmpt, Foam::direction Ncmpts>
304(
307{
309}
310
311
312template<class Form, class Cmpt, Foam::direction Ncmpts>
314(
317{
319}
320
321
322template<class Form, class Cmpt, Foam::direction Ncmpts>
324{
326}
327
328
329template<class Form, class Cmpt, Foam::direction Ncmpts>
331(
332 const scalar s
334{
336}
337
338
339template<class Form, class Cmpt, Foam::direction Ncmpts>
341(
342 const scalar s
343)
344{
346}
347
348
349// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
351namespace Foam
352{
353
354// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
355
356template<class Form, class Cmpt, direction Ncmpts>
357inline Cmpt& setComponent
358(
360 const direction d
362{
363 return vs.component(d);
364}
365
366
367template<class Form, class Cmpt, direction Ncmpts>
368inline const Cmpt& component
369(
370 const VectorSpace<Form, Cmpt, Ncmpts>& vs,
371 const direction d
372)
373{
374 return vs.component(d);
376
377
378// Powers of a Form
379// Equivalent to outer-products between the Form and itself
380// Form^0 = 1.0
381template<class Form, class Cmpt, direction Ncmpts>
382inline typename powProduct<Form, 0>::type pow
383(
384 const VectorSpace<Form, Cmpt, Ncmpts>&,
386 = pTraits<typename powProduct<Form, 0>::type>::zero
387)
389 return 1.0;
390}
391
392
393// Form^1 = Form
394template<class Form, class Cmpt, direction Ncmpts>
395inline typename powProduct<Form, 1>::type pow
396(
397 const VectorSpace<Form, Cmpt, Ncmpts>& v,
399 = pTraits<typename powProduct<Form, 1>::type>::zero
400)
402 return static_cast<const Form&>(v);
403}
404
405
406// Form^2 = sqr(Form)
407template<class Form, class Cmpt, direction Ncmpts>
408inline typename powProduct<Form, 2>::type pow
409(
410 const VectorSpace<Form, Cmpt, Ncmpts>& v,
412 = pTraits<typename powProduct<Form, 2>::type>::zero
414{
415 return sqr(static_cast<const Form&>(v));
416}
417
418
419template<class Form, class Cmpt, direction Ncmpts>
420inline scalar magSqr
421(
422 const VectorSpace<Form, Cmpt, Ncmpts>& vs
423)
424{
425 scalar ms = magSqr(vs.v_[0]);
427 return ms;
428}
429
430
431template<class Form, class Cmpt, direction Ncmpts>
432inline scalar mag
433(
434 const VectorSpace<Form, Cmpt, Ncmpts>& vs
435)
436{
437 return ::sqrt(magSqr(static_cast<const Form&>(vs)));
438}
439
441//- Return the vector type normalised by its magnitude
442// For small magnitudes (less than ROOTVSMALL) return zero.
443template<class Form, class Cmpt, direction Ncmpts>
445(
447)
448{
449 #ifdef __clang__
450 volatile // Use volatile to avoid aggressive branch optimization
451 #endif
452 const scalar s(mag(vs));
453 return s < ROOTVSMALL ? Zero : vs/s;
455
456
457template<class Form, class Cmpt, direction Ncmpts>
458inline VectorSpace<Form, Cmpt, Ncmpts> cmptMultiply
459(
460 const VectorSpace<Form, Cmpt, Ncmpts>& vs1,
461 const VectorSpace<Form, Cmpt, Ncmpts>& vs2
462)
463{
464 Form v;
465 VectorSpaceOps<Ncmpts,0>::op(v, vs1, vs2, cmptMultiplyOp<Cmpt>());
466 return v;
468
469
470template<class Form, class Cmpt, direction Ncmpts>
471inline VectorSpace<Form, Cmpt, Ncmpts> cmptPow
472(
473 const VectorSpace<Form, Cmpt, Ncmpts>& vs1,
474 const VectorSpace<Form, Cmpt, Ncmpts>& vs2
475)
476{
477 Form v;
478 VectorSpaceOps<Ncmpts,0>::op(v, vs1, vs2, cmptPowOp<Cmpt>());
479 return v;
481
482
483template<class Form, class Cmpt, direction Ncmpts>
484inline VectorSpace<Form, Cmpt, Ncmpts> cmptDivide
485(
486 const VectorSpace<Form, Cmpt, Ncmpts>& vs1,
487 const VectorSpace<Form, Cmpt, Ncmpts>& vs2
488)
489{
490 Form v;
491 VectorSpaceOps<Ncmpts,0>::op(v, vs1, vs2, cmptDivideOp<Cmpt>());
492 return v;
494
495
496template<class Form, class Cmpt, direction Ncmpts>
497inline VectorSpace<Form, Cmpt, Ncmpts> stabilise
498(
499 const VectorSpace<Form, Cmpt, Ncmpts>& vs,
500 const Cmpt& small
501)
502{
503 Form v;
504 VectorSpaceOps<Ncmpts,0>::opVS(v, vs, small, stabiliseOp<Cmpt>());
505 return v;
507
508
509template<class Form, class Cmpt, direction Ncmpts>
510inline Cmpt cmptMax
511(
512 const VectorSpace<Form, Cmpt, Ncmpts>& vs
513)
514{
515 Cmpt cMax = vs.v_[0];
516 VectorSpaceOps<Ncmpts,1>::SeqOp(cMax, vs, maxEqOp<Cmpt>());
517 return cMax;
519
520
521template<class Form, class Cmpt, direction Ncmpts>
522inline Cmpt cmptMin
523(
524 const VectorSpace<Form, Cmpt, Ncmpts>& vs
525)
526{
527 Cmpt cMin = vs.v_[0];
528 VectorSpaceOps<Ncmpts,1>::SeqOp(cMin, vs, minEqOp<Cmpt>());
529 return cMin;
531
532
533template<class Form, class Cmpt, direction Ncmpts>
534inline Cmpt cmptSum
535(
536 const VectorSpace<Form, Cmpt, Ncmpts>& vs
537)
538{
539 Cmpt sum = vs.v_[0];
540 VectorSpaceOps<Ncmpts,1>::SeqOp(sum, vs, plusEqOp<Cmpt>());
541 return sum;
543
544
545template<class Form, class Cmpt, direction Ncmpts>
546inline Cmpt cmptAv
547(
548 const VectorSpace<Form, Cmpt, Ncmpts>& vs
549)
550{
551 return cmptSum(vs)/Ncmpts;
553
554
555template<class Form, class Cmpt, direction Ncmpts>
556inline Cmpt cmptProduct
557(
558 const VectorSpace<Form, Cmpt, Ncmpts>& vs
559)
560{
561 Cmpt product = vs.v_[0];
562 VectorSpaceOps<Ncmpts,1>::SeqOp(product, vs, multiplyEqOp<Cmpt>());
563 return product;
565
566
567template<class Form, class Cmpt, direction Ncmpts>
568inline Form cmptSqr
569(
570 const VectorSpace<Form, Cmpt, Ncmpts>& vs
571)
572{
573 Form v;
574 VectorSpaceOps<Ncmpts,0>::eqOp(v, vs, eqSqrOp<Cmpt>());
575 return v;
577
578
579template<class Form, class Cmpt, direction Ncmpts>
580inline Form cmptMag
581(
582 const VectorSpace<Form, Cmpt, Ncmpts>& vs
583)
584{
585 Form v;
586 VectorSpaceOps<Ncmpts,0>::eqOp(v, vs, eqMagOp<Cmpt>());
587 return v;
589
590
591template<class Form, class Cmpt, direction Ncmpts>
592inline Form cmptMagSqr
593(
594 const VectorSpace<Form, Cmpt, Ncmpts>& vs
595)
596{
597 Form v;
598 VectorSpaceOps<Ncmpts,0>::eqOp(v, vs, eqMagSqrOp<Cmpt>());
599 return v;
601
602
603template<class Form, class Cmpt, direction Ncmpts>
604inline Form max
605(
606 const VectorSpace<Form, Cmpt, Ncmpts>& vs1,
607 const VectorSpace<Form, Cmpt, Ncmpts>& vs2
608)
609{
610 Form v;
611 VectorSpaceOps<Ncmpts,0>::op(v, vs1, vs2, maxOp<Cmpt>());
612 return v;
614
615
616template<class Form, class Cmpt, direction Ncmpts>
617inline Form min
618(
619 const VectorSpace<Form, Cmpt, Ncmpts>& vs1,
620 const VectorSpace<Form, Cmpt, Ncmpts>& vs2
621)
622{
623 Form v;
624 VectorSpaceOps<Ncmpts,0>::op(v, vs1, vs2, minOp<Cmpt>());
625 return v;
627
628
629template<class Form, class Cmpt, direction Ncmpts>
630inline Form minMod
631(
632 const VectorSpace<Form, Cmpt, Ncmpts>& vs1,
633 const VectorSpace<Form, Cmpt, Ncmpts>& vs2
634)
635{
636 Form v;
637 VectorSpaceOps<Ncmpts,0>::op(v, vs1, vs2, minModOp<Cmpt>());
638 return v;
640
641
642template<class Type>
643inline Type dot(const scalar s, const Type& t)
644{
645 return s * t;
647
648
649template<class Type>
650inline Type dot(const Type& t, const scalar s)
651{
652 return t * s;
653}
654
655
656template
658 class Form1, class Cmpt1, direction Ncmpts1,
659 class Form2, class Cmpt2, direction Ncmpts2
660>
662(
665)
666{
667 return static_cast<const Form1&>(t1) & static_cast<const Form2&>(t2);
668}
669
671// * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
672
673template<class Form, class Cmpt, direction Ncmpts>
674inline Form operator-
675(
677)
678{
679 Form v;
681 return v;
683
684
685template<class Form, class Cmpt, direction Ncmpts>
686inline Form operator+
687(
688 const VectorSpace<Form, Cmpt, Ncmpts>& vs1,
689 const VectorSpace<Form, Cmpt, Ncmpts>& vs2
690)
691{
692 Form v;
693 VectorSpaceOps<Ncmpts,0>::op(v, vs1, vs2, plusOp<Cmpt>());
694 return v;
695}
696
697template<class Form, class Cmpt, direction Ncmpts>
698inline Form operator-
699(
700 const VectorSpace<Form, Cmpt, Ncmpts>& vs1,
701 const VectorSpace<Form, Cmpt, Ncmpts>& vs2
702)
703{
704 Form v;
705 VectorSpaceOps<Ncmpts,0>::op(v, vs1, vs2, minusOp<Cmpt>());
706 return v;
708
709
710template<class Form, class Cmpt, direction Ncmpts>
711inline Form operator*
712(
713 scalar s,
714 const VectorSpace<Form, Cmpt, Ncmpts>& vs
715)
716{
717 Form v;
718 VectorSpaceOps<Ncmpts,0>::opSV(v, s, vs, multiplyOp3<Cmpt, scalar, Cmpt>());
719 return v;
721
722
723template<class Form, class Cmpt, direction Ncmpts>
724inline Form operator*
725(
726 const VectorSpace<Form, Cmpt, Ncmpts>& vs,
727 scalar s
728)
729{
730 Form v;
731 VectorSpaceOps<Ncmpts,0>::opVS(v, vs, s, multiplyOp3<Cmpt, Cmpt, scalar>());
732 return v;
734
735
736template<class Form, class Cmpt, direction Ncmpts>
737inline Form operator/
738(
739 const VectorSpace<Form, Cmpt, Ncmpts>& vs,
740 scalar s
741)
742{
743 Form v;
744 VectorSpaceOps<Ncmpts,0>::opVS(v, vs, s, divideOp3<Cmpt, Cmpt, scalar>());
745 return v;
746}
747
748/*
749template<class Form, class Cmpt, direction Ncmpts>
750inline Form operator/
751(
752 const VectorSpace<Form, Cmpt, Ncmpts>& vs1,
753 const VectorSpace<Form, Cmpt, Ncmpts>& vs2
754)
755{
756 Form v;
757 VectorSpaceOps<Ncmpts,0>::op(v, vs1, vs2, divideOp<Cmpt>());
758 return v;
759}
760
761
762template<class Form, class Cmpt, direction Ncmpts>
763inline Form operator/
764(
765 scalar s,
766 const VectorSpace<Form, Cmpt, Ncmpts>& vs
767)
768{
769 Form v;
770 VectorSpaceOps<Ncmpts,0>::opSV(v, s, vs, divideOp2<scalar, Cmpt>());
771 return v;
772}
774
775
776template<class Form, class Cmpt, direction Ncmpts>
777inline Cmpt operator&&
778(
781)
782{
783 Cmpt ddProd = vs1.v_[0]*vs2.v_[0];
784 for (direction i=1; i<Ncmpts; ++i)
785 {
786 ddProd += vs1.v_[i]*vs2.v_[i];
787 }
788 return ddProd;
790
791
792template<class Form, class Cmpt, direction Ncmpts>
793inline bool operator==
794(
795 const VectorSpace<Form, Cmpt, Ncmpts>& vs1,
796 const VectorSpace<Form, Cmpt, Ncmpts>& vs2
797)
798{
799 for (direction i=0; i<Ncmpts; ++i)
800 {
801 if (!equal(vs1.v_[i], vs2.v_[i])) return false;
802 }
803 return true;
805
806
807template<class Form, class Cmpt, direction Ncmpts>
808inline bool operator!=
809(
810 const VectorSpace<Form, Cmpt, Ncmpts>& vs1,
811 const VectorSpace<Form, Cmpt, Ncmpts>& vs2
812)
813{
814 return !(vs1 == vs2);
816
817
818template<class Form, class Cmpt, direction Ncmpts>
819inline bool operator<
820(
821 const VectorSpace<Form, Cmpt, Ncmpts>& vs1,
822 const VectorSpace<Form, Cmpt, Ncmpts>& vs2
823)
824{
825 // Compare all components, stop at first non less-than component
826 for (direction i=0; i<Ncmpts; ++i)
827 {
828 if (!(vs1.v_[i] < vs2.v_[i])) return false;
829 }
830 return true;
832
833
834template<class Form, class Cmpt, direction Ncmpts>
835inline bool operator<=
836(
837 const VectorSpace<Form, Cmpt, Ncmpts>& vs1,
838 const VectorSpace<Form, Cmpt, Ncmpts>& vs2
839)
840{
841 return !(vs2 < vs1);
843
844
845template<class Form, class Cmpt, direction Ncmpts>
846inline bool operator>
847(
848 const VectorSpace<Form, Cmpt, Ncmpts>& vs1,
849 const VectorSpace<Form, Cmpt, Ncmpts>& vs2
850)
851{
852 return (vs2 < vs1);
854
855
856template<class Form, class Cmpt, direction Ncmpts>
857inline bool operator>=
858(
859 const VectorSpace<Form, Cmpt, Ncmpts>& vs1,
860 const VectorSpace<Form, Cmpt, Ncmpts>& vs2
861)
862{
863 return !(vs1 < vs2);
864}
865
866
867// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
868
869} // End namespace Foam
870
871// ************************************************************************* //
static const direction nComponents
Number of components in this vector space.
Templated vector space.
Definition VectorSpace.H:75
void fill(const Cmpt &s)
Assign all components to given value.
const Cmpt & component(const direction) const
void operator=(const VectorSpace< Form, Cmpt, Ncmpts > &)
void replace(const direction, const Cmpt &)
const ConstBlock< SubVector, BStart > block() const
static constexpr direction nComponents
Number of components in this vector space.
iterator begin() noexcept
Return an iterator (pointer) to begin of VectorSpace.
VectorSpace< Form, Cmpt, Ncmpts > vsType
VectorSpace type.
Definition VectorSpace.H:86
const_iterator cbegin() const noexcept
Return const_iterator (const pointer) to begin of VectorSpace.
Cmpt v_[Ncmpts]
The components of this vector space.
Definition VectorSpace.H:81
static Form uniform(const Cmpt &s)
Return a VectorSpace with all elements = s.
friend Ostream & operator(Ostream &, const VectorSpace< Form, Cmpt, Ncmpts > &)
VectorSpace()=default
Default construct.
typeOfRank< typenamepTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) -2 >::type type
Definition products.H:155
A traits class, which is primarily used for primitives and vector-space.
Definition pTraits.H:64
symmTypeOfRank< typenamepTraits< arg1 >::cmptType, arg2 *direction(pTraits< arg1 >::rank)>::type type
Definition products.H:176
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.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition hashSets.C:40
dimensionedSymmTensor sqr(const dimensionedVector &dv)
quaternion normalised(const quaternion &q)
Return the normalised (unit) quaternion of the given quaternion.
Scalar minMod(const Scalar s1, const Scalar s2)
Definition scalarImpl.H:378
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
Scalar cmptPow(const Scalar s1, const Scalar s2)
Definition scalarImpl.H:456
bool equal(const T &a, const T &b)
Compare two values for equality.
Definition label.H:180
label & setComponent(label &val, const direction) noexcept
Non-const access to integer-type (has no components).
Definition label.H:160
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
Scalar cmptSqr(const Scalar s)
Definition scalarImpl.H:486
Cmpt cmptProduct(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
Cmpt cmptSum(const SphericalTensor< Cmpt > &st)
Return the sum of components of a SphericalTensor.
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh >::cmptType, GeoMesh > > cmptAv(const DimensionedField< Type, GeoMesh > &f1)
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition hashSets.C:26
void cmptMagSqr(Field< Type > &result, const UList< Type > &f1)
errorManip< error > abort(error &err)
Definition errorManip.H:139
uint8_t direction
Definition direction.H:49
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
dimensionedScalar stabilise(const dimensionedScalar &x, const dimensionedScalar &y)
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &f1, const label comm)
static constexpr const zero Zero
Global zero (0).
Definition zero.H:127
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
Various functors for unary and binary operations. Can be used for parallel combine-reduce operations ...
Traits classes for inner and outer products of primitives.
static void opSV(V &vs, const S &s, const V1 &vs1, BinaryOp bop)
Apply the binary operation between scalar and vector-space data and assign the result.
static void fill_n(Output result, const T &val)
Somewhat equivalent to std::fill_n() but with templated loops.
static void SeqOp(S &s, const V &vs, EqOp eo)
Apply the inplace binary reduction operation.
static void eqOpS(V &vs, const S &s, EqOp eo)
Apply the binary assignment operation to each vector-space component.
static void copy_n(Input input, Output result)
Somewhat equivalent to std::copy_n() but with templated loops.
static void op(V &vs, const V1 &vs1, const V1 &vs2, BinaryOp bop)
Apply the binary operation between two vector-space data and assign the result.
static void eqOp(V1 &vs1, const V2 &vs2, EqOp eo)
Apply the inplace binary assignment operation to the components.
static void opVS(V &vs, const V1 &vs1, const S &s, BinaryOp bop)
Apply the binary operation between vector-space and scalar data and assign the result.