Loading...
Searching...
No Matches
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-2024 OpenCFD Ltd.
10-------------------------------------------------------------------------------
11License
12 This file is part of OpenFOAM.
13
14 OpenFOAM is free software: you can redistribute it and/or modify it
15 under the terms of the GNU General Public License as published by
16 the Free Software Foundation, either version 3 of the License, or
17 (at your option) any later version.
18
19 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
21 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 for more details.
23
24 You should have received a copy of the GNU General Public License
25 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
26
27Namespace
28 Foam::coordSystem
29
30Description
31 Namespace for coordinate systems.
32
33Class
34 Foam::coordinateSystem
35
36Description
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 However, a more verbose format with rotation provided as a dictionary entry
56 is possible:
57 \verbatim
58 coordinateSystem
59 {
60 type cartesian;
61 origin (0 0 0);
62 rotation
63 {
64 type axes;
65 e1 (0 1 0);
66 e3 (1 0 0);
67 }
68 }
69 \endverbatim
70
71 It also also possible to use the compact (single-dictionary) form
72 and specific a different type of rotation:
73 \verbatim
74 coordinateSystem
75 {
76 type cartesian;
77 origin (0 0 0);
78 rotation euler;
79 angles (90 0 0);
80 }
81 \endverbatim
82
83 This last form can be particularly readable for an identity rotation:
84 coordinateSystem
85 {
86 type cartesian;
87 origin (0 0 0);
88 rotation none;
89 }
90 \endverbatim
91
92 Types of coordinateRotation:
93 -# \link coordinateRotations::identity none \endlink
94 -# \link coordinateRotations::axes axes \endlink
95 -# \link coordinateRotations::axisAngle axisAngle \endlink
96 -# \link coordinateRotations::euler euler \endlink
97 -# \link coordinateRotations::starcd starcd \endlink
98
99 Type of coordinateSystem:
100 -# \link coordSystem::cartesian cartesian \endlink
101 -# \link coordSystem::cylindrical cylindrical \endlink
102 -# \link coordSystem::indirect indirect \endlink (references
103 an entry in coordinateSystems).
104
105SourceFiles
106 coordinateSystem.C
107 coordinateSystemNew.C
108 coordinateSystemTemplates.C
109 coordinateSystemTransform.C
110
111\*---------------------------------------------------------------------------*/
112
113#ifndef Foam_coordinateSystem_H
114#define Foam_coordinateSystem_H
115
116#include "vector.H"
117#include "point.H"
118#include "tensor.H"
119#include "vectorField.H"
120#include "pointField.H"
121#include "tensorField.H"
122#include "pointIndList.H"
123#include "coordinateRotation.H"
124#include "autoPtr.H"
125#include "tmp.H"
126
127// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
128
129namespace Foam
130{
131
132// Forward Declarations
133class coordinateSystem;
134class objectRegistry;
135
136namespace coordSystem
137{
138class indirect;
139}
140
141
142/*---------------------------------------------------------------------------*\
143 Class coordinateSystem Declaration
144\*---------------------------------------------------------------------------*/
145
147{
148 // Private Member Functions
149
150 //- Select construct specified coordinate system type
151 //
152 // \param modelType Eg, cartesian, cylindrical, indirect
153 // An empty modelType will be treated as "cartesian".
154 // \param dict The specifications
155 // \param readOrigin The preferred handling for reading 'origin'
156 // \param obrPtr Optional reference to an objectRegistry
157 // (for indirect entries).
159 (
160 const word& modelType,
161 const dictionary& dict,
163 const objectRegistry* obrPtr
164 );
165
166 //- Select constructed from dictionary
167 //
168 // \param dict The top-level dictionary contents
169 // \param dictName The sub-dictionary name to use for the
170 // coordinate system specifications. An empty name invokes
171 // an implicit search for a "coordinateSystem" sub-dictionary
172 // which is convenient and provides compatibility with previous
173 // versions (1806 and earlier).
174 // \param readOrigin The preferred handling for reading 'origin'
175 // \param obrPtr The objectRegistry for lookup of indirect entries.
177 (
178 const dictionary& dict,
179 const word& dictName,
181 const objectRegistry* obrPtr
182 );
183
184 //- Optional select construct from dictionary
185 //
186 // \param dict The top-level dictionary to search
187 // \param dictName The sub-dictionary name to select.
188 // Return nullptr if it does not exist.
189 // \param obrPtr The objectRegistry for lookup of indirect entries.
190 //
191 // Since the specifications are isolated within a sub-dictionary,
192 // the 'origin' entry is treated as optional
193 static autoPtr<coordinateSystem> NewIfPresent
194 (
195 const dictionary& dict,
196 const word& dictName,
197 const objectRegistry* obrPtr
198 );
199
200
201protected:
202
203 //- Friendship with indirect for dispatching to its underlying system
205
206
207 // Protected Data
208
209 //- User specification of the coordinate rotation
210 // May be invalid after a move assignment or transfer
212
213 //- The coordinate system origin
215
216 //- The rotation tensor
217 tensor rot_;
218
219 //- The name of the coordinate system (optional)
220 word name_;
222 //- An optional note describing the coordinate system
223 string note_;
224
225 //- Dummy coordinate system for suppressed manipulation
227
228
229 // Protected Member Functions
230
231 //- Implementation for R() methods
232 template<class PointField>
233 tmp<tensorField> rotationsImpl(const PointField& global) const;
234
235 //- Implementation for transformPoint() methods
236 template<class PointField>
237 tmp<pointField> transformPointImpl(const PointField& localCart) const;
238
239 //- Implementation for transformPosition() methods
240 template<class PointField>
242
243 //- Apply single transform tensor for multiple inputs
244 template<class RetType, class Type, class BinaryOp>
247 const tensor& tt,
248 const UList<Type>& input,
249 const BinaryOp& bop
250 );
251
252 //- Use position-dependent transform tensors for multiple inputs
253 template<class RetType, class PointField, class Type, class BinaryOp>
256 const PointField& global,
257 const UList<Type>& input,
258 const BinaryOp& bop
259 ) const;
260
261 //- Use position-dependent transform tensors for single input
262 template<class RetType, class PointField, class Type, class BinaryOp>
264 (
265 const PointField& global,
266 const Type& input,
267 const BinaryOp& bop
268 ) const;
269
270
271 //- From local coordinate system to the global Cartesian system
272 //- with optional translation for the origin
274 (
275 const vector& local,
276 bool translate
277 ) const;
278
279 //- From local coordinate system to the global Cartesian system
280 //- with optional translation for the origin
282 (
283 const vectorField& local,
284 bool translate
285 ) const;
286
287 //- From global Cartesian system to the local coordinate system
288 //- with optional translation for the origin
289 virtual vector globalToLocal
290 (
291 const vector& global,
292 bool translate
293 ) const;
294
295 //- From global Cartesian system to the local coordinate system
296 //- with optional translation for the origin
298 (
299 const vectorField& global,
300 bool translate
301 ) const;
302
303 //- Assign from dictionary content with specified read handling
304 //- of the 'origin' entry
305 void assign
306 (
307 const dictionary& dict,
309 );
310
311
312 // Constructors
313
314 //- Construct null, without allocating a coordinateRotation
315 //- specification.
316 coordinateSystem(std::nullptr_t);
317
318
319public:
320
321 //- Runtime type information
322 TypeName("coordinateSystem");
323
324 //- Helper for construction of coordinateSystem PtrList
325 // The Istream contains a word followed by a dictionary.
326 struct iNew
327 {
329 {
330 return coordinateSystem::New(is);
331 }
332 };
333
334
335 // Constructors
336
337 //- Default construct. This is an identity coordinate system
339
340 //- Copy construct from rotation with origin=0
341 explicit coordinateSystem(const coordinateRotation& crot);
342
343 //- Move construct from rotation with origin=0
344 explicit coordinateSystem(coordinateRotation&& crot);
345
346 //- Copy construct
348
349 //- Move construct
351
352 //- Move construct from autoPtr
353 explicit coordinateSystem(autoPtr<coordinateSystem>&& csys);
354
355 //- Copy construct with a different name
357 (
358 const word& name,
359 const coordinateSystem& csys
360 );
361
362 //- Construct from origin and rotation
364 (
365 const point& origin,
366 const coordinateRotation& crot
367 );
369 //- Construct from origin and 2 axes
371 (
372 const point& origin,
373 const vector& axis,
374 const vector& dirn
375 );
376
377 //- Construct from origin and rotation
379 (
380 const word& name,
381 const point& origin,
382 const coordinateRotation& crot
383 );
384
385 //- Construct named from origin and 2 axes
387 (
388 const word& name,
389 const point& origin,
390 const vector& axis,
391 const vector& dirn
392 );
393
394 //- Construct from dictionary with optional
395 //- read handling for the 'origin' entry (default: MUST_READ).
396 //
397 // \note The readOrigin is downgraded to READ_IF_PRESENT
398 // if the dictionary itself is "coordinateSystem"
399 explicit coordinateSystem
400 (
401 const dictionary& dict,
403 );
404
405 //- Construct from dictionary with optional subDict lookup and optional
406 //- read handling for the 'origin' entry (default: MUST_READ).
407 //
408 // \param dictName If non-empty, mandatory sub-dictionary to use.
409 //
410 // \note The readOrigin is downgraded to READ_IF_PRESENT
411 // if the dictionary itself is "coordinateSystem"
412 // or if a sub-dictionary is being used
414 (
415 const dictionary& dict,
416 const word& dictName,
418 );
419
420
421 //- Return clone
422 virtual autoPtr<coordinateSystem> clone() const
423 {
424 return autoPtr<coordinateSystem>::New(*this);
425 }
426
427
428 // Declare run-time constructor selection table
430 (
431 autoPtr,
434 (
435 const dictionary& dict,
437 ),
438 (dict, readOrigin)
439 );
440
441 // Declare run-time constructor selection table
443 (
444 autoPtr,
446 registry,
447 (
448 const objectRegistry& obr,
449 const dictionary& dict,
451 ),
452 (obr, dict, readOrigin)
453 );
454
455
456 // Factory Methods
457
458 //- Clone a coordinate system
459 template<class Derived>
460 static autoPtr<coordinateSystem> Clone(const Derived& csys)
461 {
462 return autoPtr<coordinateSystem>(new Derived(csys));
463 }
464
465 //- Select construct the specified coordinate system type
466 //- with reference to objectRegistry for indirect entries.
467 //
468 // An empty modelType will be treated as "cartesian"
470 (
471 const word& modelType,
472 const objectRegistry& obr,
473 const dictionary& dict,
475 );
476
477 //- Select construct the specified coordinate system type
478 //- with reference to objectRegistry for indirect entries.
479 //
480 // An empty modelType will be treated as "cartesian"
482 (
483 const word& modelType,
484 const objectRegistry& obr,
485 const dictionary& dict,
487 );
488
489 //- Select construct the specified coordinate system type
490 //
491 // An empty modelType will be treated as "cartesian"
493 (
494 const word& modelType,
495 const dictionary& dict,
497 );
498
499 //- Select construct from dictionary with reference to objectRegistry
500 //- for indirect entries.
501 //
502 // \param dictName If non-empty, the sub-dictionary name to use
503 // for the coordinate system description.
504 //
505 // \note When the dictName is empty, it includes an implicit search
506 // for a "coordinateSystem" sub-dictionary for convenience and
507 // compatibility with previous versions (1806 and earlier).
509 (
510 const objectRegistry& obr,
511 const dictionary& dict,
512 const word& dictName = word::null,
514 );
515
516 //- Select constructed from dictionary
517 // \param dictName If non-empty, the sub-dictionary name to use
518 // for the coordinate system description.
519 //
520 // \note When the dictName is empty, it includes an implicit search
521 // for a "coordinateSystem" sub-dictionary for convenience and
522 // compatibility with previous versions (1806 and earlier).
524 (
525 const dictionary& dict,
526 const word& dictName = word::null,
528 );
529
530 //- Select constructed from Istream
531 // Expects a name/dictionary as input
533 (
534 Istream& is,
536 );
537
538
539 //- Optional select construct from dictionary, with registry reference
540 //
541 // \param obr The objectRegistry (for lookup of indirect entries)
542 // \param dict The top-level dictionary to search
543 // \param dictName The sub-dictionary name to select the
544 // for coordinate system specification
545 // (default is 'coordinateSystem').
546 //
547 // Since the specifications are isolated within a sub-dictionary,
548 // the 'origin' entry is treated as optional
549 static autoPtr<coordinateSystem> NewIfPresent
550 (
551 const objectRegistry& obr,
552 const dictionary& dict,
553 const word& dictName = coordinateSystem::typeName
554 );
555
556 //- Optional select construct from dictionary
557 //
558 // \param dict The top-level dictionary to search
559 // \param dictName The sub-dictionary name to select the
560 // for coordinate system specification
561 // (default is 'coordinateSystem').
562 //
563 // Since the specifications are isolated within a sub-dictionary,
564 // the 'origin' entry is treated as optional
565 static autoPtr<coordinateSystem> NewIfPresent
566 (
567 const dictionary& dict,
568 const word& dictName = coordinateSystem::typeName
569 );
570
571
572 //- Destructor
573 virtual ~coordinateSystem() = default;
574
575
576 // Member Functions
577
578 // Characteristics
579
580 //- Consider good if it has a specification
581 virtual bool good() const { return bool(spec_); }
582
583 //- True if the rotation tensor is uniform for all locations
584 virtual bool uniform() const { return true; }
585
586 //- Same as good() - 2023-07
587 virtual bool valid() const { return this->good(); }
588
589
590 // Access
591
592 //- Return origin
593 virtual const point& origin() const
594 {
595 return origin_;
596 }
597
598 //- The rotation specification
599 virtual const coordinateRotation& rotation() const
600 {
601 return *spec_;
602 }
603
604 //- Return the name
605 virtual const word& name() const
606 {
607 return name_;
608 }
609
610 //- Return the optional note
611 virtual const string& note() const
612 {
613 return note_;
614 }
615
616 //- Return const reference to the rotation tensor
617 virtual const tensor& R() const
618 {
619 return rot_;
620 }
621
622 //- The local Cartesian x-axis in global coordinates
623 virtual const vector e1() const
624 {
625 return rot_.cx();
626 }
627
628 //- The local Cartesian y-axis in global coordinates
629 virtual const vector e2() const
630 {
631 return rot_.cy();
632 }
633
634 //- The local Cartesian z-axis in global coordinates
635 virtual const vector e3() const
636 {
637 return rot_.cz();
638 }
639
640
641 // Edit
642
643 //- Rename
644 virtual void rename(const word& newName)
645 {
646 name_ = newName;
647 }
648
649 //- Edit access to optional note
650 virtual string& note()
651 {
652 return note_;
653 }
654
655 //- Edit access to origin
656 virtual point& origin()
657 {
658 return origin_;
659 }
660
661 //- Reset origin and rotation to an identity coordinateSystem
662 // Also resets the note
663 virtual void clear();
664
665 //- Change the rotation
666 virtual void rotation(autoPtr<coordinateRotation>&& crot);
667
668
669 // Write
670
671 //- Write
672 virtual void write(Ostream& os) const;
673
674 //- Write 'coordinateSystem' dictionary entry
675 virtual void writeEntry(Ostream& os) const;
676
677 //- Write dictionary entry
678 virtual void writeEntry(const word& keyword, Ostream& os) const;
679
681 // Member Operators
682
683 //- Copy assignment
684 void operator=(const coordinateSystem& csys);
685
686 //- Move assignment
687 void operator=(coordinateSystem&& csys);
688
689 //- Copy assignment from autoPtr
691
692 //- Move assignment from autoPtr
694
696 // Rotation
697
698 //- Position-dependent rotation tensor (when uniform = false)
699 //- \return tensor
700 virtual tensor R(const point& global) const;
701
702 //- Position-dependent rotation tensors (when uniform = false)
703 //- \return tensorField
704 virtual tmp<tensorField> R(const UList<point>& global) const;
705
706 //- Position-dependent rotation tensors (when uniform = false)
707 //- \return tensorField
708 virtual tmp<tensorField> R(const pointUIndList& global) const;
709
710
711 // Position
712
713 //- Transform point and add origin offset.
714 // Corresponds to a local-to-global transformation using Cartesian
715 // coordinates for both local and global.
716 point transformPoint(const point& localCart) const;
717
718 //- Transform points and add origin offset.
719 tmp<pointField> transformPoint(const UList<point>& localCart) const;
720
721 //- Transform points and add origin offset.
722 tmp<pointField> transformPoint(const pointUIndList& localCart) const;
723
725 //- Remove origin offset and inverse transform point.
726 // Corresponds to a global-to-local transformation using Cartesian
727 // coordinates for both local and global.
728 point invTransformPoint(const point& global) const;
729
730 //- Remove origin offset and inverse transform points.
733 //- Remove origin offset and inverse transform points.
735
736
737 // Transformations with change of coordinate types
738
739 //- From local coordinate position to global (cartesian) position
741 {
742 return localToGlobal(local, true);
743 }
744
745 //- From local coordinate position to global (cartesian) position
747 {
748 return localToGlobal(local, true);
749 }
750
751 //- From global (cartesian) position to local coordinate position
752 point localPosition(const point& global) const
753 {
754 return globalToLocal(global, true);
755 }
757 //- From global (cartesian) position to local coordinate position
758 tmp<pointField> localPosition(const pointField& global) const
759 {
760 return globalToLocal(global, true);
761 }
762
763
765 //- From local to global (cartesian) vector components
766 vector globalVector(const vector& local) const
767 {
768 return localToGlobal(local, false);
769 }
770
771 //- From local to global (cartesian) vector components
773 {
774 return localToGlobal(local, false);
776
777 //- From global (cartesian) to local vector components
778 vector localVector(const vector& global) const
779 {
780 return globalToLocal(global, false);
781 }
782
783 //- From global (cartesian) to local vector components
784 tmp<vectorField> localVector(const vectorField& global) const
785 {
786 return globalToLocal(global, false);
787 }
788
789
790 // Transformations (input and output are Cartesian)
792#undef defineCoordinateSystemTransform
793#define defineCoordinateSystemTransform(Op, RetType, Type) \
794 \
795 \
796 virtual RetType Op(const Type& input) const; \
797 \
798 \
799 virtual tmp<Field<RetType>> Op(const UList<Type>& input) const; \
800 \
801 \
802 virtual RetType Op(const point& global, const Type& input) const; \
803 \
804 \
805 virtual tmp<Field<RetType>> Op \
806 ( \
807 const UList<point>& global, \
808 const Type& input \
809 ) const; \
810 \
811 \
812 virtual tmp<Field<RetType>> Op \
813 ( \
814 const pointUIndList& global, \
815 const Type& input \
816 ) const; \
817 \
818 \
819 virtual tmp<Field<RetType>> Op \
820 ( \
821 const UList<point>& global, \
822 const UList<Type>& input \
823 ) const; \
824 \
825 \
826 virtual tmp<Field<RetType>> Op \
827 ( \
828 const pointUIndList& global, \
829 const UList<Type>& input \
830 ) const;
831
832
834
838 (
839 transform,
842 );
845
849 (
853 );
856
857 #undef defineCoordinateSystemTransform
858};
859
860
861// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
862
863// Global Operators
864
865//- Compare inequality
866bool operator!=(const coordinateSystem& a, const coordinateSystem& b);
867
868//- Output operator
870
871
872// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
873
874} // End namespace Foam
875
876
877// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
878
879#ifdef NoRepository
881#endif
882
883// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
884
885#endif
886
887// ************************************************************************* //
readOption
Enumeration defining read preferences.
@ MUST_READ
Reading required.
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition Istream.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition Ostream.H:59
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
Definition UList.H:89
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition autoPtr.H:65
static autoPtr< T > New(Args &&... args)
Construct autoPtr with forwarding arguments.
Definition autoPtr.H:178
A coordinate system forward to a global coordinate system that is normally provided by the constant/c...
Definition indirectCS.H:74
User specification of a coordinate rotation.
Base class for coordinate system specification, the default coordinate system type is cartesian .
static autoPtr< coordinateSystem > Clone(const Derived &csys)
Clone a coordinate system.
virtual const word & name() const
Return the name.
vector globalVector(const vector &local) const
From local to global (cartesian) vector components.
virtual bool uniform() const
True if the rotation tensor is uniform for all locations.
virtual const coordinateRotation & rotation() const
The rotation specification.
coordinateSystem(std::nullptr_t)
Construct null, without allocating a coordinateRotation specification.
tmp< pointField > globalPosition(const pointField &local) const
From local coordinate position to global (cartesian) position.
virtual const vector e2() const
The local Cartesian y-axis in global coordinates.
tmp< tensorField > rotationsImpl(const PointField &global) const
Implementation for R() methods.
string note_
An optional note describing the coordinate system.
void operator=(const coordinateSystem &csys)
Copy assignment.
virtual string & note()
Edit access to optional note.
virtual bool valid() const
Same as good() - 2023-07.
tmp< pointField > invTransformPointImpl(const PointField &global) const
Implementation for transformPosition() methods.
virtual vector globalToLocal(const vector &global, bool translate) const
From global Cartesian system to the local coordinate system with optional translation for the origin.
point globalPosition(const point &local) const
From local coordinate position to global (cartesian) position.
point invTransformPoint(const point &global) const
Remove origin offset and inverse transform point.
virtual vector localToGlobal(const vector &local, bool translate) const
From local coordinate system to the global Cartesian system with optional translation for the origin.
word name_
The name of the coordinate system (optional).
declareRunTimeSelectionTable(autoPtr, coordinateSystem, dictionary,(const dictionary &dict, IOobjectOption::readOption readOrigin),(dict, readOrigin))
point localPosition(const point &global) const
From global (cartesian) position to local coordinate position.
virtual scalar invTransform(const scalar &input) const
With constant rotation tensor.
tmp< Field< RetType > > oneToOneImpl(const PointField &global, const UList< Type > &input, const BinaryOp &bop) const
Use position-dependent transform tensors for multiple inputs.
static coordinateSystem dummy_
Dummy coordinate system for suppressed manipulation.
tensor rot_
The rotation tensor.
virtual scalar transform(const scalar &input) const
With constant rotation tensor.
virtual const point & origin() const
Return origin.
virtual ~coordinateSystem()=default
Destructor.
static tmp< Field< RetType > > manyTimesImpl(const tensor &tt, const UList< Type > &input, const BinaryOp &bop)
Apply single transform tensor for multiple inputs.
TypeName("coordinateSystem")
Runtime type information.
virtual bool good() const
Consider good if it has a specification.
autoPtr< coordinateRotation > spec_
User specification of the coordinate rotation.
virtual const string & note() const
Return the optional note.
tmp< vectorField > globalVector(const vectorField &local) const
From local to global (cartesian) vector components.
vector localVector(const vector &global) const
From global (cartesian) to local vector components.
tmp< Field< RetType > > oneToManyImpl(const PointField &global, const Type &input, const BinaryOp &bop) const
Use position-dependent transform tensors for single input.
virtual const tensor & R() const
Return const reference to the rotation tensor.
virtual point & origin()
Edit access to origin.
coordinateSystem()
Default construct. This is an identity coordinate system.
declareRunTimeSelectionTable(autoPtr, coordinateSystem, registry,(const objectRegistry &obr, const dictionary &dict, IOobjectOption::readOption readOrigin),(obr, dict, readOrigin))
virtual void writeEntry(Ostream &os) const
Write 'coordinateSystem' dictionary entry.
virtual symmTensor transformPrincipal(const vector &input) const
With constant rotation tensor.
virtual void rename(const word &newName)
Rename.
static autoPtr< coordinateSystem > Clone(const word &modelType, const objectRegistry &obr, const dictionary &dict, IOobjectOption::readOption readOrigin=IOobjectOption::MUST_READ)
Select construct the specified coordinate system type with reference to objectRegistry for indirect e...
virtual const vector e1() const
The local Cartesian x-axis in global coordinates.
tmp< vectorField > localVector(const vectorField &global) const
From global (cartesian) to local vector components.
virtual const vector e3() const
The local Cartesian z-axis in global coordinates.
void assign(const dictionary &dict, IOobjectOption::readOption readOrigin=IOobjectOption::MUST_READ)
Assign from dictionary content with specified read handling of the 'origin' entry.
tmp< pointField > localPosition(const pointField &global) const
From global (cartesian) position to local coordinate position.
virtual void clear()
Reset origin and rotation to an identity coordinateSystem.
virtual autoPtr< coordinateSystem > clone() const
Return clone.
point transformPoint(const point &localCart) const
Transform point and add origin offset.
point origin_
The coordinate system origin.
tmp< pointField > transformPointImpl(const PointField &localCart) const
Implementation for transformPoint() methods.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition dictionary.H:133
Registry of regIOobjects.
Tensor of scalars, i.e. Tensor<scalar>.
A class for managing temporary objects.
Definition tmp.H:75
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
A class for handling words, derived from Foam::string.
Definition word.H:66
static const word null
An empty word.
Definition word.H:84
bool local
Definition EEqn.H:20
#define defineCoordinateSystemTransform(Op, RetType, Type)
OBJstream os(runTime.globalPath()/outputName)
const word dictName("faMeshDefinition")
auto & name
Namespace for coordinate systems.
Definition cartesianCS.C:30
Namespace for OpenFOAM.
bool operator!=(const eddy &a, const eddy &b)
Definition eddy.H:297
tmp< DimensionedField< TypeR, GeoMesh > > New(const tmp< DimensionedField< TypeR, GeoMesh > > &tf1, const word &name, const dimensionSet &dimensions, const bool initCopy=false)
Global function forwards to reuseTmpDimensionedField::New.
UIndirectList< point > pointUIndList
UIndirectList of point.
Tensor< scalar > tensor
Definition symmTensor.H:57
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces).
Field< vector > vectorField
Specialisation of Field<T> for vector.
vector point
Point is a vector.
Definition point.H:37
GeometricField< Type, pointPatchField, pointMesh > PointField
A point field for a given type.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for expressions::valueTypeCode::INVALID.
Definition exprTraits.C:127
vectorField pointField
pointField is a vectorField.
Vector< scalar > vector
Definition vector.H:57
SphericalTensor< scalar > sphericalTensor
SphericalTensor of scalars, i.e. SphericalTensor<scalar>.
SymmTensor< scalar > symmTensor
SymmTensor of scalars, i.e. SymmTensor<scalar>.
Definition symmTensor.H:55
runTime write()
#define declareRunTimeSelectionTable(ptrWrapper, baseType, argNames, argList, parList)
Declare a run-time selection (variables and adder classes).
dictionary dict
volScalarField & b
Helper for construction of coordinateSystem PtrList.
autoPtr< coordinateSystem > operator()(Istream &is) const
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition typeInfo.H:68