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 OpenCFD Ltd.
10 -------------------------------------------------------------------------------
11 License
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"
31 #include "VectorSpaceOps.H"
32 #include "ops.H"
33 #include <type_traits>
34 
35 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
36 
37 template<class Form, class Cmpt, Foam::direction Ncmpts>
39 {
41 }
42 
43 
44 template<class Form, class Cmpt, Foam::direction Ncmpts>
46 (
48 )
49 {
51 }
52 
53 
54 template<class Form, class Cmpt, Foam::direction Ncmpts>
55 template<class Form2, class Cmpt2>
57 (
59 )
60 {
62 }
63 
64 
65 template<class Form, class Cmpt, Foam::direction Ncmpts>
66 template<class SubVector, Foam::direction BStart>
69 (
70  const vsType& vs
71 )
72 :
73  vs_(vs)
74 {
75  static_assert
76  (
77  vsType::nComponents >= BStart + nComponents,
78  "Requested block size > VectorSpace size"
79  );
80 }
81 
82 
83 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
84 
85 template<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 
104 template<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 
123 template<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 
143 template<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);
156  }
157  #endif
158 
159  v_[d] = c;
160 }
161 
162 
163 template<class Form, class Cmpt, Foam::direction Ncmpts>
165 {
166  Form v;
168  return v;
169 }
170 
171 
172 template<class Form, class Cmpt, Foam::direction Ncmpts>
173 template<class SubVector, Foam::direction BStart>
175  ConstBlock<SubVector, BStart>
177 {
178  return *this;
179 }
180 
181 
182 // * * * * * * * * * * * * * * * * Iterator * * * * * * * * * * * * * * * * //
183 
184 template<class Form, class Cmpt, Foam::direction Ncmpts>
186 {
187  return v_;
188 }
189 
190 
191 template<class Form, class Cmpt, Foam::direction Ncmpts>
192 inline const Cmpt* Foam::VectorSpace<Form, Cmpt, Ncmpts>::cdata() const noexcept
193 {
194  return v_;
195 }
196 
197 
198 template<class Form, class Cmpt, Foam::direction Ncmpts>
200 {
201  return v_;
202 }
203 
204 
205 template<class Form, class Cmpt, Foam::direction Ncmpts>
207 {
208  return (v_ + Ncmpts);
209 }
210 
211 
212 template<class Form, class Cmpt, Foam::direction Ncmpts>
214 {
215  return v_;
216 }
217 
218 
219 template<class Form, class Cmpt, Foam::direction Ncmpts>
221 {
222  return (v_ + Ncmpts);
223 }
224 
225 
226 template<class Form, class Cmpt, Foam::direction Ncmpts>
228 {
229  return v_;
230 }
231 
232 
233 template<class Form, class Cmpt, Foam::direction Ncmpts>
235 {
236  return (v_ + Ncmpts);
237 }
238 
239 
240 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
241 
242 template<class Form, class Cmpt, Foam::direction Ncmpts>
244 (
245  const direction d
246 ) const
247 {
248  #ifdef FULLDEBUG
249  if (d >= Ncmpts)
250  {
252  << "index out of range"
253  << abort(FatalError);
254  }
255  #endif
256 
257  return v_[d];
258 }
259 
260 
261 template<class Form, class Cmpt, Foam::direction Ncmpts>
263 (
264  const direction d
265 )
266 {
267  #ifdef FULLDEBUG
268  if (d >= Ncmpts)
269  {
271  << "index out of range"
272  << abort(FatalError);
273  }
274  #endif
275 
276  return v_[d];
277 }
278 
279 
280 template<class Form, class Cmpt, Foam::direction Ncmpts>
281 template<class SubVector, Foam::direction BStart>
282 inline const Cmpt&
284 ConstBlock<SubVector, BStart>::operator[]
285 (
286  const direction d
287 ) const
288 {
289  #ifdef FULLDEBUG
290  if (d >= Ncmpts)
291  {
293  << "index out of range"
294  << abort(FatalError);
295  }
296  #endif
297 
298  return vs_[BStart + d];
299 }
300 
301 
302 template<class Form, class Cmpt, Foam::direction Ncmpts>
303 template<class SubVector, Foam::direction BStart>
304 inline const Cmpt&
307 (
308  const direction i,
309  const direction j
310 ) const
311 {
312  #ifdef FULLDEBUG
313  if (i >= Ncmpts)
314  {
316  << "index " << i << " out of range"
317  << abort(FatalError);
318  }
319 
320  if (j)
321  {
323  << "index " << j << " != 0"
324  << abort(FatalError);
325  }
326  #endif
327 
328  return vs_[BStart + i];
329 }
330 
331 
332 template<class Form, class Cmpt, Foam::direction Ncmpts>
334 (
336 )
337 {
339 }
340 
341 
342 template<class Form, class Cmpt, Foam::direction Ncmpts>
344 (
346 )
347 {
349 }
350 
351 
352 template<class Form, class Cmpt, Foam::direction Ncmpts>
354 (
356 )
357 {
359 }
360 
361 
362 template<class Form, class Cmpt, Foam::direction Ncmpts>
364 {
366 }
367 
368 
369 template<class Form, class Cmpt, Foam::direction Ncmpts>
371 (
372  const scalar s
373 )
374 {
376 }
377 
378 
379 template<class Form, class Cmpt, Foam::direction Ncmpts>
381 (
382  const scalar s
383 )
384 {
386 }
387 
388 
389 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
390 
391 namespace Foam
392 {
393 
394 // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
395 
396 template<class Form, class Cmpt, direction Ncmpts>
397 inline Cmpt& setComponent
398 (
400  const direction d
401 )
402 {
403  return vs.component(d);
404 }
405 
406 
407 template<class Form, class Cmpt, direction Ncmpts>
408 inline const Cmpt& component
409 (
411  const direction d
412 )
413 {
414  return vs.component(d);
415 }
416 
417 
418 // Powers of a Form
419 // Equivalent to outer-products between the Form and itself
420 // Form^0 = 1.0
421 template<class Form, class Cmpt, direction Ncmpts>
422 inline typename powProduct<Form, 0>::type pow
423 (
427 )
428 {
429  return 1.0;
430 }
431 
432 
433 // Form^1 = Form
434 template<class Form, class Cmpt, direction Ncmpts>
435 inline typename powProduct<Form, 1>::type pow
436 (
440 )
441 {
442  return static_cast<const Form&>(v);
443 }
444 
445 
446 // Form^2 = sqr(Form)
447 template<class Form, class Cmpt, direction Ncmpts>
448 inline typename powProduct<Form, 2>::type pow
449 (
453 )
454 {
455  return sqr(static_cast<const Form&>(v));
456 }
457 
458 
459 template<class Form, class Cmpt, direction Ncmpts>
460 inline scalar magSqr
461 (
463 )
464 {
465  scalar ms = magSqr(vs.v_[0]);
467  return ms;
468 }
469 
470 
471 template<class Form, class Cmpt, direction Ncmpts>
472 inline scalar mag
473 (
475 )
476 {
477  return ::sqrt(magSqr(static_cast<const Form&>(vs)));
478 }
479 
480 
481 template<class Form, class Cmpt, direction Ncmpts>
482 inline VectorSpace<Form, Cmpt, Ncmpts> normalised
483 (
485 )
486 {
487  const scalar s(mag(vs));
488  return s < ROOTVSMALL ? Zero : vs/s;
489 }
490 
491 
492 template<class Form, class Cmpt, direction Ncmpts>
493 inline VectorSpace<Form, Cmpt, Ncmpts> cmptMultiply
494 (
497 )
498 {
499  Form v;
501  return v;
502 }
503 
504 
505 template<class Form, class Cmpt, direction Ncmpts>
506 inline VectorSpace<Form, Cmpt, Ncmpts> cmptPow
507 (
510 )
511 {
512  Form v;
514  return v;
515 }
516 
517 
518 template<class Form, class Cmpt, direction Ncmpts>
519 inline VectorSpace<Form, Cmpt, Ncmpts> cmptDivide
520 (
523 )
524 {
525  Form v;
527  return v;
528 }
529 
530 
531 template<class Form, class Cmpt, direction Ncmpts>
532 inline VectorSpace<Form, Cmpt, Ncmpts> stabilise
533 (
535  const Cmpt& small
536 )
537 {
538  Form v;
540  return v;
541 }
542 
543 
544 template<class Form, class Cmpt, direction Ncmpts>
545 inline Cmpt cmptMax
546 (
548 )
549 {
550  Cmpt cMax = vs.v_[0];
552  return cMax;
553 }
554 
555 
556 template<class Form, class Cmpt, direction Ncmpts>
557 inline Cmpt cmptMin
558 (
560 )
561 {
562  Cmpt cMin = vs.v_[0];
564  return cMin;
565 }
566 
567 
568 template<class Form, class Cmpt, direction Ncmpts>
569 inline Cmpt cmptSum
570 (
572 )
573 {
574  Cmpt sum = vs.v_[0];
576  return sum;
577 }
578 
579 
580 template<class Form, class Cmpt, direction Ncmpts>
581 inline Cmpt cmptAv
582 (
584 )
585 {
586  return cmptSum(vs)/Ncmpts;
587 }
588 
589 
590 template<class Form, class Cmpt, direction Ncmpts>
591 inline Cmpt cmptProduct
592 (
594 )
595 {
596  Cmpt product = vs.v_[0];
598  return product;
599 }
600 
601 
602 template<class Form, class Cmpt, direction Ncmpts>
603 inline Form cmptSqr
604 (
606 )
607 {
608  Form v;
610  return v;
611 }
612 
613 
614 template<class Form, class Cmpt, direction Ncmpts>
615 inline Form cmptMag
616 (
618 )
619 {
620  Form v;
622  return v;
623 }
624 
625 
626 template<class Form, class Cmpt, direction Ncmpts>
627 inline Form cmptMagSqr
628 (
630 )
631 {
632  Form v;
634  return v;
635 }
636 
637 
638 template<class Form, class Cmpt, direction Ncmpts>
639 inline Form max
640 (
643 )
644 {
645  Form v;
647  return v;
648 }
649 
650 
651 template<class Form, class Cmpt, direction Ncmpts>
652 inline Form min
653 (
656 )
657 {
658  Form v;
660  return v;
661 }
662 
663 
664 template<class Form, class Cmpt, direction Ncmpts>
665 inline Form minMod
666 (
669 )
670 {
671  Form v;
673  return v;
674 }
675 
676 
677 template<class Type>
678 inline Type dot(const scalar s, const Type& t)
679 {
680  return s * t;
681 }
682 
683 
684 template<class Type>
685 inline Type dot(const Type& t, const scalar s)
686 {
687  return t * s;
688 }
689 
690 
691 template
692 <
693  class Form1, class Cmpt1, direction Ncmpts1,
694  class Form2, class Cmpt2, direction Ncmpts2
695 >
697 (
700 )
701 {
702  return static_cast<const Form1&>(t1) & static_cast<const Form2&>(t2);
703 }
704 
705 
706 // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
707 
708 template<class Form, class Cmpt, direction Ncmpts>
709 inline Form operator-
710 (
712 )
713 {
714  Form v;
716  return v;
717 }
718 
719 
720 template<class Form, class Cmpt, direction Ncmpts>
721 inline Form operator+
722 (
725 )
726 {
727  Form v;
729  return v;
730 }
731 
732 template<class Form, class Cmpt, direction Ncmpts>
733 inline Form operator-
734 (
737 )
738 {
739  Form v;
741  return v;
742 }
743 
744 
745 template<class Form, class Cmpt, direction Ncmpts>
746 inline Form operator*
747 (
748  scalar s,
750 )
751 {
752  Form v;
754  return v;
755 }
756 
757 
758 template<class Form, class Cmpt, direction Ncmpts>
759 inline Form operator*
760 (
762  scalar s
763 )
764 {
765  Form v;
767  return v;
768 }
769 
770 
771 template<class Form, class Cmpt, direction Ncmpts>
772 inline Form operator/
773 (
775  scalar s
776 )
777 {
778  Form v;
780  return v;
781 }
782 
783 /*
784 template<class Form, class Cmpt, direction Ncmpts>
785 inline Form operator/
786 (
787  const VectorSpace<Form, Cmpt, Ncmpts>& vs1,
788  const VectorSpace<Form, Cmpt, Ncmpts>& vs2
789 )
790 {
791  Form v;
792  VectorSpaceOps<Ncmpts,0>::op(v, vs1, vs2, divideOp<Cmpt>());
793  return v;
794 }
795 
796 
797 template<class Form, class Cmpt, direction Ncmpts>
798 inline Form operator/
799 (
800  scalar s,
801  const VectorSpace<Form, Cmpt, Ncmpts>& vs
802 )
803 {
804  Form v;
805  VectorSpaceOps<Ncmpts,0>::opSV(v, s, vs, divideOp2<scalar, Cmpt>());
806  return v;
807 }
808 */
809 
810 
811 template<class Form, class Cmpt, direction Ncmpts>
812 inline Cmpt operator&&
813 (
816 )
817 {
818  Cmpt ddProd = vs1.v_[0]*vs2.v_[0];
819  for (direction i=1; i<Ncmpts; ++i)
820  {
821  ddProd += vs1.v_[i]*vs2.v_[i];
822  }
823  return ddProd;
824 }
825 
826 
827 template<class Form, class Cmpt, direction Ncmpts>
828 inline bool operator==
829 (
832 )
833 {
834  bool eq = true;
835  for (direction i=0; i<Ncmpts; ++i)
836  {
837  if (!(eq &= (equal(vs1.v_[i], vs2.v_[i])))) break;
838  }
839  return eq;
840 }
841 
842 
843 template<class Form, class Cmpt, direction Ncmpts>
844 inline bool operator!=
845 (
848 )
849 {
850  return !(vs1 == vs2);
851 }
852 
853 
854 template<class Form, class Cmpt, direction Ncmpts>
855 inline bool operator>
856 (
859 )
860 {
861  bool gt = true;
862  for (direction i=0; i<Ncmpts; ++i)
863  {
864  if (!(gt &= vs1.v_[i] > vs2.v_[i])) break;
865  }
866  return gt;
867 }
868 
869 
870 template<class Form, class Cmpt, direction Ncmpts>
871 inline bool operator<
872 (
875 )
876 {
877  bool lt = true;
878  for (direction i=0; i<Ncmpts; ++i)
879  {
880  if (!(lt &= vs1.v_[i] < vs2.v_[i])) break;
881  }
882  return lt;
883 }
884 
885 
886 template<class Form, class Cmpt, direction Ncmpts>
887 inline bool operator>=
888 (
891 )
892 {
893  return !(vs1 < vs2);
894 }
895 
896 
897 template<class Form, class Cmpt, direction Ncmpts>
898 inline bool operator<=
899 (
902 )
903 {
904  return !(vs1 > vs2);
905 }
906 
907 
908 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
909 
910 } // End namespace Foam
911 
912 // ************************************************************************* //
Foam::divideOp3
Definition: ops.H:218
Foam::maxOp
Definition: ops.H:223
Foam::cmptMagSqr
void cmptMagSqr(Field< Type > &res, const UList< Type > &f)
Definition: FieldFunctions.C:327
Foam::setComponent
label & setComponent(label &l, const direction)
Definition: label.H:123
Foam::component
void component(FieldField< Field, typename FieldField< Field, Type >::cmptType > &sf, const FieldField< Field, Type > &f, const direction d)
Definition: FieldFieldFunctions.C:44
Foam::VectorSpaceOps::opVS
static void opVS(V &vs, const V1 &vs1, const S &s, Op o)
Definition: VectorSpaceOps.H:70
Foam::cmptPow
Scalar cmptPow(const Scalar s1, const Scalar s2)
Definition: Scalar.H:364
Foam::VectorSpace::component
const Cmpt & component(const direction) const
Definition: VectorSpaceI.H:87
Foam::VectorSpace::uniform
static Form uniform(const Cmpt &s)
Return a VectorSpace with all elements = s.
Definition: VectorSpaceI.H:164
s
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))
Definition: gmvOutputSpray.H:25
Foam::cmptMultiply
dimensioned< Type > cmptMultiply(const dimensioned< Type > &, const dimensioned< Type > &)
Foam::minusEqOp
Definition: ops.H:73
Foam::VectorSpace::cend
const_iterator cend() const
Return const_iterator to end of VectorSpace.
Definition: VectorSpaceI.H:220
VectorSpaceOps.H
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::minOp
Definition: ops.H:224
Foam::multiplyEqOp
Definition: ops.H:74
Foam::VectorSpace::VectorSpace
VectorSpace()=default
Default construct.
Foam::cmptDivideOp
Definition: ops.H:221
Foam::dot
void dot(FieldField< Field1, typename innerProduct< Type1, Type2 >::type > &f, const FieldField< Field1, Type1 > &f1, const FieldField< Field2, Type2 > &f2)
Definition: FieldFieldFunctions.C:944
Foam::plusEqMagSqrOp2
Definition: ops.H:79
ops.H
Various functors for unary and binary operations. Can be used for parallel combine-reduce operations ...
Foam::cmptProduct
Cmpt cmptProduct(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
Definition: VectorSpaceI.H:592
Foam::powProduct::type
symmTypeOfRank< typename pTraits< arg1 >::cmptType, arg2 *direction(pTraits< arg1 >::rank) >::type type
Definition: products.H:170
Foam::multiplyOp3
Definition: ops.H:217
Foam::VectorSpace::data
Cmpt * data() noexcept
Return pointer to the first data element.
Definition: VectorSpaceI.H:185
Foam::VectorSpaceOps::SeqOp
static void SeqOp(S &s, const V &vs, EqOp eo)
Definition: VectorSpaceOps.H:55
Foam::cmptPowOp
Definition: ops.H:220
Foam::VectorSpace::v_
Cmpt v_[Ncmpts]
The components of this vector space.
Definition: VectorSpace.H:83
Foam::VectorSpace::cbegin
const_iterator cbegin() const
Return const_iterator to begin of VectorSpace.
Definition: VectorSpaceI.H:213
Foam::VectorSpace::block
const ConstBlock< SubVector, BStart > block() const
Foam::eqSqrOp
Definition: ops.H:76
Foam::min
label min(const labelHashSet &set, label minValue=labelMax)
Find the min value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:33
Foam::minEqOp
Definition: ops.H:81
Foam::magSqr
dimensioned< typename typeOfMag< Type >::type > magSqr(const dimensioned< Type > &dt)
Foam::VectorSpace
Templated vector space.
Definition: VectorSpace.H:56
Foam::cmptMin
void cmptMin(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:302
Foam::cmptMag
void cmptMag(FieldField< Field, Type > &cf, const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:400
Foam::cmptMax
void cmptMax(FieldField< Field, typename FieldField< Field, Type >::cmptType > &cf, const FieldField< Field, Type > &f)
Definition: FieldFieldFunctions.C:253
Foam::minModOp
Definition: ops.H:227
Foam::eqMagSqrOp
Definition: ops.H:78
error.H
Foam::stabilise
tmp< DimensionedField< scalar, GeoMesh > > stabilise(const DimensionedField< scalar, GeoMesh > &dsf, const dimensioned< scalar > &ds)
Definition: DimensionedScalarField.C:43
Foam::cmptAv
tmp< DimensionedField< typename DimensionedField< Type, GeoMesh >::cmptType, GeoMesh >> cmptAv(const DimensionedField< Type, GeoMesh > &df)
Definition: DimensionedFieldFunctions.C:246
Foam::eqMinusOp
Definition: ops.H:92
Foam::pow
dimensionedScalar pow(const dimensionedScalar &ds, const dimensionedScalar &expt)
Definition: dimensionedScalar.C:75
Foam::max
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
Definition: hashSets.C:47
Foam::VectorSpace::replace
void replace(const direction, const Cmpt &)
Definition: VectorSpaceI.H:145
Foam::FatalError
error FatalError
Foam::eqOp
Definition: ops.H:71
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::cmptSum
Cmpt cmptSum(const SphericalTensor< Cmpt > &st)
Return the sum of components of a SphericalTensor.
Definition: SphericalTensorI.H:164
Foam::abort
errorManip< error > abort(error &err)
Definition: errorManip.H:144
Foam::multiplyEqOp2
Definition: ops.H:74
Foam::VectorSpace::begin
iterator begin()
Return an iterator to begin of VectorSpace.
Definition: VectorSpaceI.H:199
Foam::maxEqOp
Definition: ops.H:80
Foam::cmptMultiplyOp
Definition: ops.H:219
Foam::VectorSpace::end
iterator end()
Return an iterator to end of VectorSpace.
Definition: VectorSpaceI.H:206
Foam::eqMagOp
Definition: ops.H:77
Foam::cmptSqr
Scalar cmptSqr(const Scalar s)
Definition: Scalar.H:394
Foam::normalised
VectorSpace< Form, Cmpt, Ncmpts > normalised(const VectorSpace< Form, Cmpt, Ncmpts > &vs)
Definition: VectorSpaceI.H:483
Foam::cmptDivide
dimensioned< Type > cmptDivide(const dimensioned< Type > &, const dimensioned< Type > &)
Foam::VectorSpaceOps::eqOp
static void eqOp(V1 &vs1, const V2 &vs2, EqOp eo)
Definition: VectorSpaceOps.H:62
Foam::plusOp
Definition: ops.H:215
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:381
Foam::sqr
dimensionedSymmTensor sqr(const dimensionedVector &dv)
Definition: dimensionedSymmTensor.C:51
Foam::minusOp
Definition: ops.H:216
Foam::minMod
Scalar minMod(const Scalar s1, const Scalar s2)
Definition: Scalar.H:298
Foam::divideEqOp2
Definition: ops.H:75
Foam::VectorSpaceOps::op
static void op(V &vs, const V1 &vs1, const V1 &vs2, Op o)
Definition: VectorSpaceOps.H:84
Foam::sqrt
dimensionedScalar sqrt(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:144
Foam::pTraits
Traits class for primitives.
Definition: pTraits.H:54
Foam::mag
dimensioned< typename typeOfMag< Type >::type > mag(const dimensioned< Type > &dt)
Foam::VectorSpaceOps::opSV
static void opSV(V &vs, const S &s, const V1 &vs1, Op o)
Definition: VectorSpaceOps.H:77
Foam::sum
dimensioned< Type > sum(const DimensionedField< Type, GeoMesh > &df)
Definition: DimensionedFieldFunctions.C:327
Foam::direction
uint8_t direction
Definition: direction.H:52
Foam::constant::universal::c
const dimensionedScalar c
Speed of light in a vacuum.
Foam::VectorSpaceOps
General looping form. Executing at index <I> with termination at <N>
Definition: VectorSpaceOps.H:45
Foam::plusEqOp
Definition: ops.H:72
Foam::VectorSpace::operator=
void operator=(const VectorSpace< Form, Cmpt, Ncmpts > &)
Definition: VectorSpaceI.H:334
Foam::stabiliseOp
Definition: ops.H:222
Foam::equal
bool equal(const T &s1, const T &s2)
Compare two values for equality.
Definition: doubleFloat.H:46
products.H
Traits classes for inner and outer products of primitives.
Foam::VectorSpace::operator
friend Ostream & operator(Ostream &, const VectorSpace< Form, Cmpt, Ncmpts > &)
Foam::innerProduct::type
typeOfRank< typename pTraits< arg1 >::cmptType, direction(pTraits< arg1 >::rank)+direction(pTraits< arg2 >::rank) - 2 >::type type
Definition: products.H:149
Foam::VectorSpace::cdata
const Cmpt * cdata() const noexcept
Return const pointer to the first data element.
Definition: VectorSpaceI.H:192
Foam::zero
A class representing the concept of 0 (zero) that can be used to avoid manipulating objects known to ...
Definition: zero.H:62