coordinateSystem.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-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 Namespace
28  Foam::coordSystem
29 
30 Description
31  Namespace for coordinate systems.
32 
33 Class
34  Foam::coordinateSystem
35 
36 Description
37  Base class for coordinate system specification,
38  the default coordinate system type is
39  \link coordSystem::cartesian cartesian \endlink.
40 
41  All systems are defined by an origin point and a coordinate rotation
42  By default, the \link coordinateRotations::axes axes \endlink
43  specification can be used directly as part of the
44  coordinate system specification. For example,
45 
46  \verbatim
47  coordinateSystem
48  {
49  origin (0 0 0);
50  e1 (0 1 0);
51  e3 (1 0 0);
52  }
53  \endverbatim
54 
55  The same, but in more verbose format:
56  \verbatim
57  coordinateSystem
58  {
59  type cartesian;
60  origin (0 0 0);
61  rotation
62  {
63  type axes;
64  e1 (0 1 0);
65  e3 (1 0 0);
66  }
67  }
68  \endverbatim
69 
70  For an identity rotation, can use a slightly more compact format:
71  \verbatim
72  coordinateSystem
73  {
74  type cartesian;
75  origin (0 0 0);
76  rotation none;
77  }
78  \endverbatim
79 
80  Types of coordinateRotation:
81  -# \link coordinateRotations::identity none \endlink
82  -# \link coordinateRotations::axes axes \endlink
83  -# \link coordinateRotations::axisAngle axisAngle \endlink
84  -# \link coordinateRotations::euler euler \endlink
85  -# \link coordinateRotations::starcd starcd \endlink
86 
87  Type of coordinateSystem:
88  -# \link coordSystem::cartesian cartesian \endlink
89  -# \link coordSystem::cylindrical cylindrical \endlink
90  -# \link coordSystem::indirect indirect \endlink (references
91  an entry in coordinateSystems).
92 
93 SourceFiles
94  coordinateSystem.C
95  coordinateSystemNew.C
96  coordinateSystemTransform.C
97 
98 \*---------------------------------------------------------------------------*/
99 
100 #ifndef coordinateSystem_H
101 #define coordinateSystem_H
102 
103 #include "vector.H"
104 #include "point.H"
105 #include "tensor.H"
106 #include "vectorField.H"
107 #include "pointField.H"
108 #include "tensorField.H"
109 #include "pointIndList.H"
110 #include "coordinateRotation.H"
111 #include "autoPtr.H"
112 #include "tmp.H"
113 
114 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
115 
116 namespace Foam
117 {
118 
119 // Forward Declarations
120 class coordinateSystem;
121 class objectRegistry;
122 
123 namespace coordSystem
124 {
125 class indirect;
126 }
127 
128 
129 /*---------------------------------------------------------------------------*\
130  Class coordinateSystem Declaration
131 \*---------------------------------------------------------------------------*/
132 
133 class coordinateSystem
134 {
135  // Private Member Functions
136 
137  //- Use 'coordinateSystem' sub-dictionary if present
138  static const dictionary* subDictCompat(const dictionary* dictPtr);
139 
140 
141 protected:
142 
143  //- Friendship with indirect for dispatching to its underlying system
144  friend coordSystem::indirect;
145 
146 
147  // Protected Data
148 
149  //- User specification of the coordinate rotation
150  // May be invalid after a move assignment or transfer
152 
153  //- The coordinate system origin
154  point origin_;
155 
156  //- The rotation tensor
157  tensor rot_;
158 
159  //- The name of the coordinate system (optional)
160  word name_;
161 
162  //- An optional note describing the coordinate system
163  string note_;
164 
165  //- Dummy coordinate system for suppressed manipulation
166  static coordinateSystem dummy_;
167 
168 
169  // Protected Member Functions
170 
171  //- Implementation for R() methods
172  template<class PointField>
173  tmp<tensorField> rotationsImpl(const PointField& global) const;
174 
175  //- Implementation for transformPoint() methods
176  template<class PointField>
177  tmp<pointField> transformPointImpl(const PointField& localCart) const;
178 
179  //- Implementation for transformPosition() methods
180  template<class PointField>
181  tmp<pointField> invTransformPointImpl(const PointField& global) const;
182 
183  //- Apply single transform tensor for multiple inputs
184  template<class RetType, class Type, class BinaryOp>
186  (
187  const tensor& tt,
188  const UList<Type>& input,
189  const BinaryOp& bop
190  );
191 
192  //- Use position-dependent transform tensors for multiple inputs
193  template<class RetType, class PointField, class Type, class BinaryOp>
195  (
196  const PointField& global,
197  const UList<Type>& input,
198  const BinaryOp& bop
199  ) const;
200 
201  //- Use position-dependent transform tensors for single input
202  template<class RetType, class PointField, class Type, class BinaryOp>
204  (
205  const PointField& global,
206  const Type& input,
207  const BinaryOp& bop
208  ) const;
209 
210 
211  //- From local coordinate system to the global Cartesian system
212  //- with optional translation for the origin
213  virtual vector localToGlobal
214  (
215  const vector& local,
216  bool translate
217  ) const;
218 
219  //- From local coordinate system to the global Cartesian system
220  //- with optional translation for the origin
222  (
223  const vectorField& local,
224  bool translate
225  ) const;
226 
227  //- From global Cartesian system to the local coordinate system
228  //- with optional translation for the origin
229  virtual vector globalToLocal
230  (
231  const vector& global,
232  bool translate
233  ) const;
234 
235  //- From global Cartesian system to the local coordinate system
236  //- with optional translation for the origin
238  (
239  const vectorField& global,
240  bool translate
241  ) const;
242 
243 
244  //- Assign from dictionary content
245  void assign(const dictionary& dict);
246 
247 
248  // Constructors
249 
250  //- Construct null, without allocating a coordinateRotation
251  //- specification.
252  coordinateSystem(std::nullptr_t);
253 
254 
255 public:
256 
257  //- Runtime type information
258  TypeName("coordinateSystem");
259 
260  //- Helper for construction of coordinateSystem PtrList
261  // The Istream contains a word followed by a dictionary
262  struct iNew
263  {
265  {
266  return coordinateSystem::New(is);
267  }
268  };
269 
270 
271  // Constructors
272 
273  //- Default construct. This is an identity coordinate system
275 
276  //- Copy construct from rotation with origin=0
277  explicit coordinateSystem(const coordinateRotation& crot);
278 
279  //- Move construct from rotation with origin=0
280  explicit coordinateSystem(coordinateRotation&& crot);
281 
282  //- Copy construct
283  coordinateSystem(const coordinateSystem& csys);
284 
285  //- Move construct
287 
288  //- Move construct from autoPtr
290 
291  //- Copy construct with a different name
293  (
294  const word& name,
295  const coordinateSystem& csys
296  );
297 
298  //- Construct from origin and rotation
300  (
301  const point& origin,
302  const coordinateRotation& crot
303  );
304 
305  //- Construct from origin and 2 axes
307  (
308  const point& origin,
309  const vector& axis,
310  const vector& dirn
311  );
312 
313  //- Construct from origin and rotation
315  (
316  const word& name,
317  const point& origin,
318  const coordinateRotation& crot
319  );
320 
321  //- Construct from origin and 2 axes
323  (
324  const word& name,
325  const point& origin,
326  const vector& axis,
327  const vector& dirn
328  );
329 
330  //- Construct from dictionary with a given name
331  coordinateSystem(const word& name, const dictionary& dict);
332 
333  //- Construct from dictionary without a name
334  explicit coordinateSystem(const dictionary& dict);
335 
336  //- Construct from dictionary with optional subDict lookup.
337  //
338  // \param dictName If non-empty, the sub-dictionary to use.
339  coordinateSystem(const dictionary& dict, const word& dictName);
340 
341 
342  //- Return clone
343  virtual autoPtr<coordinateSystem> clone() const
344  {
345  return autoPtr<coordinateSystem>::New(*this);
346  }
347 
348 
349  // Declare run-time constructor selection table
351  (
352  autoPtr,
354  dictionary,
355  (
356  const dictionary& dict
357  ),
358  (dict)
359  );
360 
361  // Declare run-time constructor selection table
363  (
364  autoPtr,
366  registry,
367  (
368  const objectRegistry& obr,
369  const dictionary& dict
370  ),
371  (obr, dict)
372  );
373 
374 
375  // Selectors
376 
377  //- Select construct the specified coordinate system type
378  //- with reference to objectRegistry for indirect entries.
379  //
380  // An empty modelType will be treated as "cartesian"
382  (
383  word modelType,
384  const objectRegistry& obr,
385  const dictionary& dict
386  );
387 
388  //- Select construct the specified coordinate system type
389  //
390  // An empty modelType will be treated as "cartesian"
392  (
393  word modelType,
394  const dictionary& dict
395  );
396 
397  //- Select construct from dictionary with reference to objectRegistry
398  //- for indirect entries.
399  //
400  // \param dictName If non-empty, the sub-dictionary name to use
401  // for the coordinate system description.
402  //
403  // \note When the dictName is empty, it includes an implicit search
404  // for a "coordinateSystem" sub-dictionary for convenience and
405  // compatibility with previous versions (1806 and earlier).
407  (
408  const objectRegistry& obr,
409  const dictionary& dict,
410  const word& dictName = ""
411  );
412 
413  //- Select constructed from dictionary
414  // \param dictName If non-empty, the sub-dictionary name to use
415  // for the coordinate system description.
416  //
417  // \note When the dictName is empty, it includes an implicit search
418  // for a "coordinateSystem" sub-dictionary for convenience and
419  // compatibility with previous versions (1806 and earlier).
421  (
422  const dictionary& dict,
423  const word& dictName = ""
424  );
425 
426  //- Select constructed from Istream
427  // Expects a name/dictionary as input
429 
430 
431  //- Destructor
432  virtual ~coordinateSystem() = default;
433 
434 
435  // Member Functions
436 
437  // Access
438 
439  //- Considered valid if it has a specification
440  virtual bool valid() const
441  {
442  return bool(spec_);
443  }
444 
445  //- True if the rotation tensor is uniform for all locations
446  virtual bool uniform() const
447  {
448  return true;
449  }
450 
451  //- The rotation specification
452  virtual const coordinateRotation& rotation() const
453  {
454  return *spec_;
455  }
456 
457  //- Return the name
458  virtual const word& name() const
459  {
460  return name_;
461  }
462 
463  //- Return the optional note
464  virtual const string& note() const
465  {
466  return note_;
467  }
468 
469  //- Return origin
470  virtual const point& origin() const
471  {
472  return origin_;
473  }
474 
475  //- Return const reference to the rotation tensor
476  virtual const tensor& R() const
477  {
478  return rot_;
479  }
480 
481  //- The local Cartesian x-axis in global coordinates
482  virtual const vector e1() const
483  {
484  return rot_.cx();
485  }
486 
487  //- The local Cartesian y-axis in global coordinates
488  virtual const vector e2() const
489  {
490  return rot_.cy();
491  }
492 
493  //- The local Cartesian z-axis in global coordinates
494  virtual const vector e3() const
495  {
496  return rot_.cz();
497  }
498 
499 
500  // Edit
501 
502  //- Rename
503  virtual void rename(const word& newName)
504  {
505  name_ = newName;
506  }
507 
508  //- Edit access to optional note
509  virtual string& note()
510  {
511  return note_;
512  }
513 
514  //- Edit access to origin
515  virtual point& origin()
516  {
517  return origin_;
518  }
519 
520  //- Reset origin and rotation to an identity coordinateSystem
521  // Also resets the note
522  virtual void clear();
523 
524  //- Change the rotation
525  virtual void rotation(autoPtr<coordinateRotation>&& crot);
526 
527 
528  // Write
529 
530  //- Write
531  virtual void write(Ostream& os) const;
532 
533  //- Write dictionary entry
534  virtual void writeEntry(const word& keyword, Ostream& os) const;
535 
536 
537  // Member Operators
538 
539  //- Copy assignment
540  void operator=(const coordinateSystem& csys);
541 
542  //- Move assignment
543  void operator=(coordinateSystem&& csys);
544 
545  //- Copy assignment from autoPtr
546  void operator=(const autoPtr<coordinateSystem>& csys);
547 
548  //- Move assignment from autoPtr
550 
551 
552  // Rotation
553 
554  //- Position-dependent rotation tensor (when uniform = false)
555  //- \return tensor
556  virtual tensor R(const point& global) const;
557 
558  //- Position-dependent rotation tensors (when uniform = false)
559  //- \return tensorField
560  virtual tmp<tensorField> R(const UList<point>& global) const;
561 
562  //- Position-dependent rotation tensors (when uniform = false)
563  //- \return tensorField
564  virtual tmp<tensorField> R(const pointUIndList& global) const;
565 
566 
567  // Position
568 
569  //- Transform point and add origin offset.
570  // Corresponds to a local-to-global transformation using Cartesian
571  // coordinates for both local and global.
572  point transformPoint(const point& localCart) const;
573 
574  //- Transform points and add origin offset.
575  tmp<pointField> transformPoint(const UList<point>& localCart) const;
576 
577  //- Transform points and add origin offset.
578  tmp<pointField> transformPoint(const pointUIndList& localCart) const;
579 
580 
581  //- Remove origin offset and inverse transform point.
582  // Corresponds to a global-to-local transformation using Cartesian
583  // coordinates for both local and global.
584  point invTransformPoint(const point& global) const;
585 
586  //- Remove origin offset and inverse transform points.
587  tmp<pointField> invTransformPoint(const UList<point>& global) const;
588 
589  //- Remove origin offset and inverse transform points.
590  tmp<pointField> invTransformPoint(const pointUIndList& global) const;
591 
592 
593  // Transformations with change of coordinate types
594 
595  //- From local coordinate position to global (cartesian) position
596  point globalPosition(const point& local) const
597  {
598  return localToGlobal(local, true);
599  }
600 
601  //- From local coordinate position to global (cartesian) position
602  tmp<pointField> globalPosition(const pointField& local) const
603  {
604  return localToGlobal(local, true);
605  }
606 
607  //- From global (cartesian) position to local coordinate position
608  point localPosition(const point& global) const
609  {
610  return globalToLocal(global, true);
611  }
612 
613  //- From global (cartesian) position to local coordinate position
614  tmp<pointField> localPosition(const pointField& global) const
615  {
616  return globalToLocal(global, true);
617  }
618 
619 
620 
621  //- From local to global (cartesian) vector components
622  vector globalVector(const vector& local) const
623  {
624  return localToGlobal(local, false);
625  }
626 
627  //- From local to global (cartesian) vector components
628  tmp<vectorField> globalVector(const vectorField& local) const
629  {
630  return localToGlobal(local, false);
631  }
632 
633  //- From global (cartesian) to local vector components
634  vector localVector(const vector& global) const
635  {
636  return globalToLocal(global, false);
637  }
638 
639  //- From global (cartesian) to local vector components
640  tmp<vectorField> localVector(const vectorField& global) const
641  {
642  return globalToLocal(global, false);
643  }
644 
645 
646  // Transformations (input and output are Cartesian)
647 
648 #undef defineCoordinateSystemTransform
649 #define defineCoordinateSystemTransform(Op, RetType, Type) \
650  \
651  \
652  virtual RetType Op(const Type& input) const; \
653  \
654  \
655  virtual tmp<Field<RetType>> Op(const UList<Type>& input) const; \
656  \
657  \
658  virtual RetType Op(const point& global, const Type& input) const; \
659  \
660  \
661  virtual tmp<Field<RetType>> Op \
662  ( \
663  const UList<point>& global, \
664  const Type& input \
665  ) const; \
666  \
667  \
668  virtual tmp<Field<RetType>> Op \
669  ( \
670  const pointUIndList& global, \
671  const Type& input \
672  ) const; \
673  \
674  \
675  virtual tmp<Field<RetType>> Op \
676  ( \
677  const UList<point>& global, \
678  const UList<Type>& input \
679  ) const; \
680  \
681  \
682  virtual tmp<Field<RetType>> Op \
683  ( \
684  const pointUIndList& global, \
685  const UList<Type>& input \
686  ) const;
687 
688 
690 
694  (
695  transform,
698  );
701 
705  (
706  invTransform,
709  );
712 
713  #undef defineCoordinateSystemTransform
714 };
715 
716 
717 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
718 
719 // Global Operators
720 
721 //- Compare inequality
722 bool operator!=(const coordinateSystem& a, const coordinateSystem& b);
723 
724 //- Output operator
725 Ostream& operator<<(Ostream& os, const coordinateSystem& csys);
726 
727 
728 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
729 
730 } // End namespace Foam
731 
732 
733 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
734 
735 #ifdef NoRepository
736  #include "coordinateSystemTemplates.C"
737 #endif
738 
739 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
740 
741 #endif
742 
743 // ************************************************************************* //
Foam::coordinateSystem::globalPosition
point globalPosition(const point &local) const
From local coordinate position to global (cartesian) position.
Definition: coordinateSystem.H:595
Foam::autoPtr::New
static autoPtr< T > New(Args &&... args)
Construct autoPtr of T with forwarding arguments.
Foam::Tensor< scalar >
Foam::coordinateSystem::e3
virtual const vector e3() const
The local Cartesian z-axis in global coordinates.
Definition: coordinateSystem.H:493
Foam::coordinateSystem::note_
string note_
An optional note describing the coordinate system.
Definition: coordinateSystem.H:162
Foam::sphericalTensor
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars, i.e. SphericalTensor<scalar>.
Definition: sphericalTensor.H:54
Foam::coordinateSystem::localVector
vector localVector(const vector &global) const
From global (cartesian) to local vector components.
Definition: coordinateSystem.H:633
Foam::coordinateSystem::transformPrincipal
virtual symmTensor transformPrincipal(const vector &input) const
With constant rotation tensor.
Definition: coordinateSystemTransform.C:202
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::coordinateSystem::clear
virtual void clear()
Reset origin and rotation to an identity coordinateSystem.
Definition: coordinateSystem.C:286
Foam::tmp
A class for managing temporary objects.
Definition: PtrList.H:61
pointIndList.H
point.H
Foam::coordinateSystem::name
virtual const word & name() const
Return the name.
Definition: coordinateSystem.H:457
dictName
const word dictName("faMeshDefinition")
Foam::coordinateSystem::operator=
void operator=(const coordinateSystem &csys)
Copy assignment.
Definition: coordinateSystem.C:468
Foam::coordinateSystem::dummy_
static coordinateSystem dummy_
Dummy coordinate system for suppressed manipulation.
Definition: coordinateSystem.H:165
Foam::coordinateSystem::invTransformPointImpl
tmp< pointField > invTransformPointImpl(const PointField &global) const
Implementation for transformPosition() methods.
Foam::coordinateSystem::oneToOneImpl
tmp< Field< RetType > > oneToOneImpl(const PointField &global, const UList< Type > &input, const BinaryOp &bop) const
Use position-dependent transform tensors for multiple inputs.
Foam::Tensor::cy
Vector< Cmpt > cy() const
Extract vector for column 1.
Definition: TensorI.H:306
coordinateSystemTemplates.C
Foam::coordinateSystem::~coordinateSystem
virtual ~coordinateSystem()=default
Destructor.
tensor.H
Foam::coordinateSystem::rotation
virtual const coordinateRotation & rotation() const
The rotation specification.
Definition: coordinateSystem.H:451
Foam::objectRegistry
Registry of regIOobjects.
Definition: objectRegistry.H:60
Foam::operator!=
bool operator!=(const eddy &a, const eddy &b)
Definition: eddy.H:239
Foam::coordinateSystem::origin
virtual const point & origin() const
Return origin.
Definition: coordinateSystem.H:469
Foam::operator<<
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Foam::coordinateSystem::invTransform
virtual scalar invTransform(const scalar &input) const
With constant rotation tensor.
Definition: coordinateSystemTransform.C:210
Foam::coordinateSystem::uniform
virtual bool uniform() const
True if the rotation tensor is uniform for all locations.
Definition: coordinateSystem.H:445
Foam::coordinateSystem::transformPointImpl
tmp< pointField > transformPointImpl(const PointField &localCart) const
Implementation for transformPoint() methods.
Foam::constant::physicoChemical::b
const dimensionedScalar b
Wien displacement law constant: default SI units: [m.K].
Definition: createFields.H:27
Foam::Field< vector >
Foam::Istream
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:61
Foam::coordinateSystem::e2
virtual const vector e2() const
The local Cartesian y-axis in global coordinates.
Definition: coordinateSystem.H:487
Foam::Tensor::cz
Vector< Cmpt > cz() const
Extract vector for column 2.
Definition: TensorI.H:313
Foam::coordinateRotation
User specification of a coordinate rotation.
Definition: coordinateRotation.H:78
Foam::coordinateSystem::globalVector
vector globalVector(const vector &local) const
From local to global (cartesian) vector components.
Definition: coordinateSystem.H:621
Foam::coordinateSystem::New
static autoPtr< coordinateSystem > New(word modelType, const objectRegistry &obr, const dictionary &dict)
Definition: coordinateSystemNew.C:84
Foam::coordinateSystem::note
virtual string & note()
Edit access to optional note.
Definition: coordinateSystem.H:508
Foam::symmTensor
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
Definition: symmTensor.H:59
Foam::coordinateSystem::valid
virtual bool valid() const
Considered valid if it has a specification.
Definition: coordinateSystem.H:439
Foam::coordinateSystem::name_
word name_
The name of the coordinate system (optional)
Definition: coordinateSystem.H:159
Foam::coordinateSystem::manyTimesImpl
static tmp< Field< RetType > > manyTimesImpl(const tensor &tt, const UList< Type > &input, const BinaryOp &bop)
Apply single transform tensor for multiple inputs.
Foam::coordinateSystem::TypeName
TypeName("coordinateSystem")
Runtime type information.
dict
dictionary dict
Definition: searchingEngine.H:14
Foam::coordinateSystem::globalPosition
tmp< pointField > globalPosition(const pointField &local) const
From local coordinate position to global (cartesian) position.
Definition: coordinateSystem.H:601
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam::coordinateSystem::spec_
autoPtr< coordinateRotation > spec_
User specification of the coordinate rotation.
Definition: coordinateSystem.H:150
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::coordinateSystem::globalToLocal
virtual vector globalToLocal(const vector &global, bool translate) const
Definition: coordinateSystem.C:368
Foam::coordinateSystem::oneToManyImpl
tmp< Field< RetType > > oneToManyImpl(const PointField &global, const Type &input, const BinaryOp &bop) const
Use position-dependent transform tensors for single input.
Foam::vector
Vector< scalar > vector
A scalar version of the templated Vector.
Definition: vector.H:51
defineCoordinateSystemTransform
#define defineCoordinateSystemTransform(Op, RetType, Type)
Definition: coordinateSystem.H:648
tensorField.H
Foam::coordinateSystem::transform
virtual scalar transform(const scalar &input) const
With constant rotation tensor.
Definition: coordinateSystemTransform.C:204
pointField.H
Foam::autoPtr
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: HashPtrTable.H:53
Foam::coordinateSystem::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, coordinateSystem, dictionary,(const dictionary &dict),(dict))
tmp.H
Foam::coordinateSystem::rot_
tensor rot_
The rotation tensor.
Definition: coordinateSystem.H:156
Foam::Tensor::cx
Vector< Cmpt > cx() const
Extract vector for column 0.
Definition: TensorI.H:299
Foam::Vector< scalar >
Foam::coordinateSystem::origin_
point origin_
The coordinate system origin.
Definition: coordinateSystem.H:153
vectorField.H
Foam::coordinateSystem::coordinateSystem
coordinateSystem()
Default construct. This is an identity coordinate system.
Definition: coordinateSystem.C:117
Foam::coordinateSystem::assign
void assign(const dictionary &dict)
Assign from dictionary content.
Definition: coordinateSystem.C:70
Foam::UList< Type >
Foam::coordinateSystem::localPosition
point localPosition(const point &global) const
From global (cartesian) position to local coordinate position.
Definition: coordinateSystem.H:607
bool
bool
Definition: EEqn.H:20
Foam::input
static Istream & input(Istream &is, IntRange< T > &range)
Definition: IntRanges.C:55
Foam::coordinateSystem::globalVector
tmp< vectorField > globalVector(const vectorField &local) const
From local to global (cartesian) vector components.
Definition: coordinateSystem.H:627
Foam::coordinateSystem::write
virtual void write(Ostream &os) const
Write.
Definition: coordinateSystem.C:411
Foam::coordinateSystem::rotationsImpl
tmp< tensorField > rotationsImpl(const PointField &global) const
Implementation for R() methods.
vector.H
Foam::coordinateSystem::localToGlobal
virtual vector localToGlobal(const vector &local, bool translate) const
Definition: coordinateSystem.C:338
Foam::UIndirectList
A List with indirect addressing.
Definition: faMatrix.H:60
Foam::coordinateSystem::e1
virtual const vector e1() const
The local Cartesian x-axis in global coordinates.
Definition: coordinateSystem.H:481
Foam::coordinateSystem::invTransformPoint
point invTransformPoint(const point &global) const
Remove origin offset and inverse transform point.
Definition: coordinateSystem.C:329
Foam::coordinateSystem::rename
virtual void rename(const word &newName)
Rename.
Definition: coordinateSystem.H:502
coordinateRotation.H
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::coordinateSystem::iNew
Helper for construction of coordinateSystem PtrList.
Definition: coordinateSystem.H:261
Foam::coordinateSystem::note
virtual const string & note() const
Return the optional note.
Definition: coordinateSystem.H:463
Foam::coordinateSystem::iNew::operator()
autoPtr< coordinateSystem > operator()(Istream &is) const
Definition: coordinateSystem.H:263
Foam::coordinateSystem::clone
virtual autoPtr< coordinateSystem > clone() const
Return clone.
Definition: coordinateSystem.H:342
Foam::coordSystem::indirect
A coordinate system forward to a global coordinate system that is normally provided by the constant/c...
Definition: indirectCS.H:75
Foam::tensor
Tensor< scalar > tensor
Tensor of scalars, i.e. Tensor<scalar>.
Definition: symmTensor.H:61
Foam::coordinateSystem::localVector
tmp< vectorField > localVector(const vectorField &global) const
From global (cartesian) to local vector components.
Definition: coordinateSystem.H:639
Foam::coordinateSystem::transformPoint
point transformPoint(const point &localCart) const
Transform point and add origin offset.
Definition: coordinateSystem.C:320
Foam::coordinateSystem::writeEntry
virtual void writeEntry(const word &keyword, Ostream &os) const
Write dictionary entry.
Definition: coordinateSystem.C:429
Foam::coordinateSystem::localPosition
tmp< pointField > localPosition(const pointField &global) const
From global (cartesian) position to local coordinate position.
Definition: coordinateSystem.H:613
Foam::coordinateSystem
Base class for coordinate system specification, the default coordinate system type is cartesian .
Definition: coordinateSystem.H:132
Foam::coordinateSystem::origin
virtual point & origin()
Edit access to origin.
Definition: coordinateSystem.H:514
Foam::coordinateSystem::R
virtual const tensor & R() const
Return const reference to the rotation tensor.
Definition: coordinateSystem.H:475
autoPtr.H