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-2021 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 const noexcept
215 {
216  return v_;
217 }
218 
219 
220 template<class Form, class Cmpt, Foam::direction Ncmpts>
222 const noexcept
223 {
224  return (v_ + Ncmpts);
225 }
226 
227 
228 template<class Form, class Cmpt, Foam::direction Ncmpts>
230 const noexcept
231 {
232  return v_;
233 }
234 
235 
236 template<class Form, class Cmpt, Foam::direction Ncmpts>
238 const noexcept
239 {
240  return (v_ + Ncmpts);
241 }
242 
243 
244 // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
245 
246 template<class Form, class Cmpt, Foam::direction Ncmpts>
248 (
249  const direction d
250 ) const
251 {
252  #ifdef FULLDEBUG
253  if (d >= Ncmpts)
254  {
256  << "index out of range"
257  << abort(FatalError);
258  }
259  #endif
260 
261  return v_[d];
262 }
263 
264 
265 template<class Form, class Cmpt, Foam::direction Ncmpts>
267 (
268  const direction d
269 )
270 {
271  #ifdef FULLDEBUG
272  if (d >= Ncmpts)
273  {
275  << "index out of range"
276  << abort(FatalError);
277  }
278  #endif
279 
280  return v_[d];
281 }
282 
283 
284 template<class Form, class Cmpt, Foam::direction Ncmpts>
285 template<class SubVector, Foam::direction BStart>
286 inline const Cmpt&
288 ConstBlock<SubVector, BStart>::operator[]
289 (
290  const direction d
291 ) const
292 {
293  #ifdef FULLDEBUG
294  if (d >= Ncmpts)
295  {
297  << "index out of range"
298  << abort(FatalError);
299  }
300  #endif
301 
302  return vs_[BStart + d];
303 }
304 
305 
306 template<class Form, class Cmpt, Foam::direction Ncmpts>
307 template<class SubVector, Foam::direction BStart>
308 inline const Cmpt&
311 (
312  const direction i,
313  const direction j
314 ) const
315 {
316  #ifdef FULLDEBUG
317  if (i >= Ncmpts)
318  {
320  << "index " << i << " out of range"
321  << abort(FatalError);
322  }
323 
324  if (j)
325  {
327  << "index " << j << " != 0"
328  << abort(FatalError);
329  }
330  #endif
331 
332  return vs_[BStart + i];
333 }
334 
335 
336 template<class Form, class Cmpt, Foam::direction Ncmpts>
338 (
340 )
341 {
343 }
344 
345 
346 template<class Form, class Cmpt, Foam::direction Ncmpts>
348 (
350 )
351 {
353 }
354 
355 
356 template<class Form, class Cmpt, Foam::direction Ncmpts>
358 (
360 )
361 {
363 }
364 
365 
366 template<class Form, class Cmpt, Foam::direction Ncmpts>
368 {
370 }
371 
372 
373 template<class Form, class Cmpt, Foam::direction Ncmpts>
375 (
376  const scalar s
377 )
378 {
380 }
381 
382 
383 template<class Form, class Cmpt, Foam::direction Ncmpts>
385 (
386  const scalar s
387 )
388 {
390 }
391 
392 
393 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
394 
395 namespace Foam
396 {
397 
398 // * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
399 
400 template<class Form, class Cmpt, direction Ncmpts>
401 inline Cmpt& setComponent
402 (
404  const direction d
405 )
406 {
407  return vs.component(d);
408 }
409 
410 
411 template<class Form, class Cmpt, direction Ncmpts>
412 inline const Cmpt& component
413 (
415  const direction d
416 )
417 {
418  return vs.component(d);
419 }
420 
421 
422 // Powers of a Form
423 // Equivalent to outer-products between the Form and itself
424 // Form^0 = 1.0
425 template<class Form, class Cmpt, direction Ncmpts>
426 inline typename powProduct<Form, 0>::type pow
427 (
431 )
432 {
433  return 1.0;
434 }
435 
436 
437 // Form^1 = Form
438 template<class Form, class Cmpt, direction Ncmpts>
439 inline typename powProduct<Form, 1>::type pow
440 (
444 )
445 {
446  return static_cast<const Form&>(v);
447 }
448 
449 
450 // Form^2 = sqr(Form)
451 template<class Form, class Cmpt, direction Ncmpts>
452 inline typename powProduct<Form, 2>::type pow
453 (
457 )
458 {
459  return sqr(static_cast<const Form&>(v));
460 }
461 
462 
463 template<class Form, class Cmpt, direction Ncmpts>
464 inline scalar magSqr
465 (
467 )
468 {
469  scalar ms = magSqr(vs.v_[0]);
471  return ms;
472 }
473 
474 
475 template<class Form, class Cmpt, direction Ncmpts>
476 inline scalar mag
477 (
479 )
480 {
481  return ::sqrt(magSqr(static_cast<const Form&>(vs)));
482 }
483 
484 
485 template<class Form, class Cmpt, direction Ncmpts>
486 inline VectorSpace<Form, Cmpt, Ncmpts> normalised
487 (
489 )
490 {
491  const scalar s(mag(vs));
492  return s < ROOTVSMALL ? Zero : vs/s;
493 }
494 
495 
496 template<class Form, class Cmpt, direction Ncmpts>
497 inline VectorSpace<Form, Cmpt, Ncmpts> cmptMultiply
498 (
501 )
502 {
503  Form v;
505  return v;
506 }
507 
508 
509 template<class Form, class Cmpt, direction Ncmpts>
510 inline VectorSpace<Form, Cmpt, Ncmpts> cmptPow
511 (
514 )
515 {
516  Form v;
518  return v;
519 }
520 
521 
522 template<class Form, class Cmpt, direction Ncmpts>
523 inline VectorSpace<Form, Cmpt, Ncmpts> cmptDivide
524 (
527 )
528 {
529  Form v;
531  return v;
532 }
533 
534 
535 template<class Form, class Cmpt, direction Ncmpts>
536 inline VectorSpace<Form, Cmpt, Ncmpts> stabilise
537 (
539  const Cmpt& small
540 )
541 {
542  Form v;
544  return v;
545 }
546 
547 
548 template<class Form, class Cmpt, direction Ncmpts>
549 inline Cmpt cmptMax
550 (
552 )
553 {
554  Cmpt cMax = vs.v_[0];
556  return cMax;
557 }
558 
559 
560 template<class Form, class Cmpt, direction Ncmpts>
561 inline Cmpt cmptMin
562 (
564 )
565 {
566  Cmpt cMin = vs.v_[0];
568  return cMin;
569 }
570 
571 
572 template<class Form, class Cmpt, direction Ncmpts>
573 inline Cmpt cmptSum
574 (
576 )
577 {
578  Cmpt sum = vs.v_[0];
580  return sum;
581 }
582 
583 
584 template<class Form, class Cmpt, direction Ncmpts>
585 inline Cmpt cmptAv
586 (
588 )
589 {
590  return cmptSum(vs)/Ncmpts;
591 }
592 
593 
594 template<class Form, class Cmpt, direction Ncmpts>
595 inline Cmpt cmptProduct
596 (
598 )
599 {
600  Cmpt product = vs.v_[0];
602  return product;
603 }
604 
605 
606 template<class Form, class Cmpt, direction Ncmpts>
607 inline Form cmptSqr
608 (
610 )
611 {
612  Form v;
614  return v;
615 }
616 
617 
618 template<class Form, class Cmpt, direction Ncmpts>
619 inline Form cmptMag
620 (
622 )
623 {
624  Form v;
626  return v;
627 }
628 
629 
630 template<class Form, class Cmpt, direction Ncmpts>
631 inline Form cmptMagSqr
632 (
634 )
635 {
636  Form v;
638  return v;
639 }
640 
641 
642 template<class Form, class Cmpt, direction Ncmpts>
643 inline Form max
644 (
647 )
648 {
649  Form v;
651  return v;
652 }
653 
654 
655 template<class Form, class Cmpt, direction Ncmpts>
656 inline Form min
657 (
660 )
661 {
662  Form v;
664  return v;
665 }
666 
667 
668 template<class Form, class Cmpt, direction Ncmpts>
669 inline Form minMod
670 (
673 )
674 {
675  Form v;
677  return v;
678 }
679 
680 
681 template<class Type>
682 inline Type dot(const scalar s, const Type& t)
683 {
684  return s * t;
685 }
686 
687 
688 template<class Type>
689 inline Type dot(const Type& t, const scalar s)
690 {
691  return t * s;
692 }
693 
694 
695 template
696 <
697  class Form1, class Cmpt1, direction Ncmpts1,
698  class Form2, class Cmpt2, direction Ncmpts2
699 >
701 (
704 )
705 {
706  return static_cast<const Form1&>(t1) & static_cast<const Form2&>(t2);
707 }
708 
709 
710 // * * * * * * * * * * * * * * * Global Operators * * * * * * * * * * * * * //
711 
712 template<class Form, class Cmpt, direction Ncmpts>
713 inline Form operator-
714 (
716 )
717 {
718  Form v;
720  return v;
721 }
722 
723 
724 template<class Form, class Cmpt, direction Ncmpts>
725 inline Form operator+
726 (
729 )
730 {
731  Form v;
733  return v;
734 }
735 
736 template<class Form, class Cmpt, direction Ncmpts>
737 inline Form operator-
738 (
741 )
742 {
743  Form v;
745  return v;
746 }
747 
748 
749 template<class Form, class Cmpt, direction Ncmpts>
750 inline Form operator*
751 (
752  scalar s,
754 )
755 {
756  Form v;
758  return v;
759 }
760 
761 
762 template<class Form, class Cmpt, direction Ncmpts>
763 inline Form operator*
764 (
766  scalar s
767 )
768 {
769  Form v;
771  return v;
772 }
773 
774 
775 template<class Form, class Cmpt, direction Ncmpts>
776 inline Form operator/
777 (
779  scalar s
780 )
781 {
782  Form v;
784  return v;
785 }
786 
787 /*
788 template<class Form, class Cmpt, direction Ncmpts>
789 inline Form operator/
790 (
791  const VectorSpace<Form, Cmpt, Ncmpts>& vs1,
792  const VectorSpace<Form, Cmpt, Ncmpts>& vs2
793 )
794 {
795  Form v;
796  VectorSpaceOps<Ncmpts,0>::op(v, vs1, vs2, divideOp<Cmpt>());
797  return v;
798 }
799 
800 
801 template<class Form, class Cmpt, direction Ncmpts>
802 inline Form operator/
803 (
804  scalar s,
805  const VectorSpace<Form, Cmpt, Ncmpts>& vs
806 )
807 {
808  Form v;
809  VectorSpaceOps<Ncmpts,0>::opSV(v, s, vs, divideOp2<scalar, Cmpt>());
810  return v;
811 }
812 */
813 
814 
815 template<class Form, class Cmpt, direction Ncmpts>
816 inline Cmpt operator&&
817 (
820 )
821 {
822  Cmpt ddProd = vs1.v_[0]*vs2.v_[0];
823  for (direction i=1; i<Ncmpts; ++i)
824  {
825  ddProd += vs1.v_[i]*vs2.v_[i];
826  }
827  return ddProd;
828 }
829 
830 
831 template<class Form, class Cmpt, direction Ncmpts>
832 inline bool operator==
833 (
836 )
837 {
838  bool eq = true;
839  for (direction i=0; i<Ncmpts; ++i)
840  {
841  if (!(eq &= (equal(vs1.v_[i], vs2.v_[i])))) break;
842  }
843  return eq;
844 }
845 
846 
847 template<class Form, class Cmpt, direction Ncmpts>
848 inline bool operator!=
849 (
852 )
853 {
854  return !(vs1 == vs2);
855 }
856 
857 
858 template<class Form, class Cmpt, direction Ncmpts>
859 inline bool operator>
860 (
863 )
864 {
865  bool gt = true;
866  for (direction i=0; i<Ncmpts; ++i)
867  {
868  if (!(gt &= vs1.v_[i] > vs2.v_[i])) break;
869  }
870  return gt;
871 }
872 
873 
874 template<class Form, class Cmpt, direction Ncmpts>
875 inline bool operator<
876 (
879 )
880 {
881  bool lt = true;
882  for (direction i=0; i<Ncmpts; ++i)
883  {
884  if (!(lt &= vs1.v_[i] < vs2.v_[i])) break;
885  }
886  return lt;
887 }
888 
889 
890 template<class Form, class Cmpt, direction Ncmpts>
891 inline bool operator>=
892 (
895 )
896 {
897  return !(vs1 < vs2);
898 }
899 
900 
901 template<class Form, class Cmpt, direction Ncmpts>
902 inline bool operator<=
903 (
906 )
907 {
908  return !(vs1 > vs2);
909 }
910 
911 
912 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
913 
914 } // End namespace Foam
915 
916 // ************************************************************************* //
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
VectorSpaceOps.H
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::minOp
Definition: ops.H:224
Foam::VectorSpace::end
iterator end() noexcept
Return an iterator to end of VectorSpace.
Definition: VectorSpaceI.H:206
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:596
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::VectorSpace::begin
iterator begin() noexcept
Return an iterator to begin of VectorSpace.
Definition: VectorSpaceI.H:199
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::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::VectorSpace::cbegin
const_iterator cbegin() const noexcept
Return const_iterator to begin of VectorSpace.
Definition: VectorSpaceI.H:213
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::maxEqOp
Definition: ops.H:80
Foam::cmptMultiplyOp
Definition: ops.H:219
Foam::eqMagOp
Definition: ops.H:77
Foam::VectorSpace::cend
const_iterator cend() const noexcept
Return const_iterator to end of VectorSpace.
Definition: VectorSpaceI.H:221
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:487
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:453
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
A traits class, which is primarily used for primitives.
Definition: pTraits.H:56
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:338
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