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