coordinateSystem Class Reference

Base class for other coordinate system specifications. More...

Inheritance diagram for coordinateSystem:

Public Member Functions

 TypeName ("coordinateSystem")
 Runtime type information. More...
 
 coordinateSystem ()
 Construct null. This is equivalent to an identity coordinateSystem. More...
 
 coordinateSystem (const word &name, const coordinateSystem &)
 Construct copy with a different name. More...
 
 coordinateSystem (const word &name, const point &origin, const coordinateRotation &)
 Construct from origin and rotation. More...
 
 coordinateSystem (const word &name, const point &origin, const vector &axis, const vector &dirn)
 Construct from origin and 2 axes. More...
 
 coordinateSystem (const word &name, const dictionary &)
 Construct from dictionary with a given name. More...
 
 coordinateSystem (const dictionary &)
 Construct from dictionary with default name. More...
 
 coordinateSystem (const objectRegistry &, const dictionary &)
 Construct from dictionary (default name) More...
 
 coordinateSystem (Istream &)
 Construct from Istream. More...
 
autoPtr< coordinateSystemclone () const
 Return clone. More...
 
 declareRunTimeSelectionTable (autoPtr, coordinateSystem, dictionary,(const objectRegistry &obr, const dictionary &dict),(obr, dict))
 
virtual ~coordinateSystem ()
 Destructor. More...
 
const wordname () const
 Return name. More...
 
stringnote ()
 Return non-constant access to the optional note. More...
 
const stringnote () const
 Return the optional note. More...
 
const pointorigin () const
 Return origin. More...
 
const coordinateRotationR () const
 Return const reference to co-ordinate rotation. More...
 
coordinateRotationR ()
 Return non const reference to co-ordinate rotation. More...
 
const coordinateRotationR (const polyMesh &mesh, const labelList &cells)
 Update and return the co-ordinate rotation for a list of cells. More...
 
virtual dictionary dict (bool ignoreType=false) const
 Return as dictionary of entries. More...
 
void rename (const word &newName)
 Rename. More...
 
pointorigin ()
 Edit access to origin. More...
 
virtual void clear ()
 Reset origin and rotation to an identity coordinateSystem. More...
 
virtual void write (Ostream &) const
 Write. More...
 
void writeDict (Ostream &, bool subDict=true) const
 Write dictionary. More...
 
point globalPosition (const point &local) const
 Convert from position in local coordinate system to global. More...
 
tmp< pointFieldglobalPosition (const pointField &local) const
 Convert from position in local coordinate system to global. More...
 
vector globalVector (const vector &local) const
 Convert from vector components in local coordinate system to. More...
 
tmp< vectorFieldglobalVector (const vectorField &local) const
 Convert from vector components in local coordinate system to. More...
 
point localPosition (const point &global) const
 Convert from global Cartesian position to position in local. More...
 
tmp< pointFieldlocalPosition (const pointField &global) const
 Convert from global Cartesian position to position in local. More...
 
vector localVector (const vector &global) const
 Convert from global Cartesian vector to components in local. More...
 
tmp< vectorFieldlocalVector (const vectorField &global) const
 Convert from global Cartesian vector to components in local. More...
 

Static Public Member Functions

static autoPtr< coordinateSystemNew (const objectRegistry &obr, const dictionary &dict)
 Select constructed from dictionary and objectRegistry. More...
 
static autoPtr< coordinateSystemNew (const dictionary &dict)
 Select constructed from dictionary. More...
 
static autoPtr< coordinateSystemNew (Istream &is)
 Select constructed from Istream. More...
 

Protected Member Functions

virtual vector localToGlobal (const vector &, bool translate) const
 Convert from local coordinate system to the global Cartesian system. More...
 
virtual tmp< vectorFieldlocalToGlobal (const vectorField &, bool translate) const
 Convert from local coordinate system to the global Cartesian system. More...
 
virtual vector globalToLocal (const vector &, bool translate) const
 Convert from global Cartesian system to the local coordinate system. More...
 
virtual tmp< vectorFieldglobalToLocal (const vectorField &, bool translate) const
 Convert from global Cartesian system to the local coordinate system. More...
 
void init (const dictionary &)
 Init from dict and obr. More...
 
void init (const dictionary &, const objectRegistry &)
 Init from dictionary. More...
 

Friends

bool operator!= (const coordinateSystem &, const coordinateSystem &)
 
Ostreamoperator<< (Ostream &, const coordinateSystem &)
 

Detailed Description

Base class for other coordinate system specifications.

All systems are defined by an origin point and a co-ordinate rotation.

coordinateSystem
{
    type    cartesian;
    origin  (0 0 0);
    coordinateRotation
    {
        type        cylindrical;
        e3          (0 0 1);
    }
}

Types of coordinateRotation:

  1. axesRotation
  2. STARCDRotation
  3. cylindricalCS cylindrical
  4. EulerCoordinateRotation

Type of co-ordinates:

  1. cartesian
Source files

Definition at line 90 of file coordinateSystem.H.

Constructor & Destructor Documentation

◆ coordinateSystem() [1/8]

Construct null. This is equivalent to an identity coordinateSystem.

Definition at line 42 of file coordinateSystem.C.

Referenced by coordinateSystem::clone(), and coordinateSystem::coordinateSystem().

Here is the caller graph for this function:

◆ coordinateSystem() [2/8]

coordinateSystem ( const word name,
const coordinateSystem cs 
)

Construct copy with a different name.

Definition at line 52 of file coordinateSystem.C.

References coordinateSystem::coordinateSystem().

Here is the call graph for this function:

◆ coordinateSystem() [3/8]

coordinateSystem ( const word name,
const point origin,
const coordinateRotation cr 
)

Construct from origin and rotation.

Definition at line 65 of file coordinateSystem.C.

References coordinateSystem::coordinateSystem().

Here is the call graph for this function:

◆ coordinateSystem() [4/8]

coordinateSystem ( const word name,
const point origin,
const vector axis,
const vector dirn 
)

Construct from origin and 2 axes.

Definition at line 79 of file coordinateSystem.C.

References coordinateSystem::coordinateSystem().

Here is the call graph for this function:

◆ coordinateSystem() [5/8]

coordinateSystem ( const word name,
const dictionary dict 
)

Construct from dictionary with a given name.

Definition at line 94 of file coordinateSystem.C.

References coordinateSystem::init().

Here is the call graph for this function:

◆ coordinateSystem() [6/8]

coordinateSystem ( const dictionary dict)

Construct from dictionary with default name.

Definition at line 108 of file coordinateSystem.C.

References coordinateSystem::coordinateSystem(), and coordinateSystem::init().

Here is the call graph for this function:

◆ coordinateSystem() [7/8]

coordinateSystem ( const objectRegistry obr,
const dictionary dict 
)

Construct from dictionary (default name)

With the ability to reference global coordinateSystems

Definition at line 120 of file coordinateSystem.C.

References Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, InfoInFunction, coordinateSystem::init(), entry::isDict(), dictionary::lookupEntryPtr(), coordinateSystems::New(), Foam::nl, and entry::stream().

Here is the call graph for this function:

◆ coordinateSystem() [8/8]

Construct from Istream.

The Istream contains a word followed by a dictionary

Definition at line 167 of file coordinateSystem.C.

References coordinateSystem::dict(), and coordinateSystem::init().

Here is the call graph for this function:

◆ ~coordinateSystem()

~coordinateSystem ( )
virtual

Destructor.

Definition at line 181 of file coordinateSystem.C.

Referenced by coordinateSystem::clone().

Here is the caller graph for this function:

Member Function Documentation

◆ localToGlobal() [1/2]

Foam::vector localToGlobal ( const vector local,
bool  translate 
) const
protectedvirtual

Convert from local coordinate system to the global Cartesian system.

with optional translation for the origin

Reimplemented in cylindricalCS, and cartesianCS.

Definition at line 214 of file coordinateSystem.C.

Referenced by coordinateSystem::dict(), cartesianCS::localToGlobal(), cylindricalCS::localToGlobal(), and coordinateSystem::origin().

Here is the caller graph for this function:

◆ localToGlobal() [2/2]

Foam::tmp< Foam::vectorField > localToGlobal ( const vectorField local,
bool  translate 
) const
protectedvirtual

Convert from local coordinate system to the global Cartesian system.

with optional translation for the origin

Reimplemented in cylindricalCS, and cartesianCS.

Definition at line 231 of file coordinateSystem.C.

References coordinateSystem::globalToLocal().

Here is the call graph for this function:

◆ globalToLocal() [1/2]

Foam::vector globalToLocal ( const vector global,
bool  translate 
) const
protectedvirtual

Convert from global Cartesian system to the local coordinate system.

with optional translation for the origin

Reimplemented in cylindricalCS, and cartesianCS.

Definition at line 248 of file coordinateSystem.C.

Referenced by cartesianCS::globalToLocal(), cylindricalCS::globalToLocal(), coordinateSystem::localToGlobal(), and coordinateSystem::origin().

Here is the caller graph for this function:

◆ globalToLocal() [2/2]

Foam::tmp< Foam::vectorField > globalToLocal ( const vectorField global,
bool  translate 
) const
protectedvirtual

Convert from global Cartesian system to the local coordinate system.

with optional translation for the origin

Reimplemented in cylindricalCS, and cartesianCS.

Definition at line 265 of file coordinateSystem.C.

◆ init() [1/2]

void init ( const dictionary rhs)
protected

Init from dict and obr.

Definition at line 325 of file coordinateSystem.C.

References dictionary::lookup(), coordinateRotation::New(), dictionary::readIfPresent(), and dictionary::subDict().

Referenced by coordinateSystem::coordinateSystem().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init() [2/2]

void init ( const dictionary rhs,
const objectRegistry obr 
)
protected

Init from dictionary.

Definition at line 335 of file coordinateSystem.C.

References Foam::endl(), dictionary::lookup(), coordinateRotation::New(), Foam::Pout, dictionary::readIfPresent(), and dictionary::subDict().

Here is the call graph for this function:

◆ TypeName()

TypeName ( "coordinateSystem"  )

Runtime type information.

◆ clone()

◆ declareRunTimeSelectionTable()

declareRunTimeSelectionTable ( autoPtr  ,
coordinateSystem  ,
dictionary  ,
(const objectRegistry &obr, const dictionary &dict ,
(obr, dict  
)

Referenced by coordinateSystem::clone().

Here is the caller graph for this function:

◆ New() [1/3]

Foam::autoPtr< Foam::coordinateSystem > New ( const objectRegistry obr,
const dictionary dict 
)
static

Select constructed from dictionary and objectRegistry.

Definition at line 32 of file coordinateSystemNew.C.

References Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, dictionary::lookup(), Foam::nl, and dictionary::subDict().

Referenced by coordinateSystem::clone(), coordinateSystem::New(), and searchableSurfaceCollection::searchableSurfaceCollection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ New() [2/3]

Foam::autoPtr< Foam::coordinateSystem > New ( const dictionary dict)
static

Select constructed from dictionary.

Definition at line 60 of file coordinateSystemNew.C.

References coordinateSystem::New(), and dictionary::subDict().

Here is the call graph for this function:

◆ New() [3/3]

Foam::autoPtr< Foam::coordinateSystem > New ( Istream is)
static

Select constructed from Istream.

Definition at line 71 of file coordinateSystemNew.C.

References dict, and Foam::name().

Here is the call graph for this function:

◆ name()

const word& name ( ) const
inline

Return name.

Definition at line 241 of file coordinateSystem.H.

◆ note() [1/2]

string& note ( )
inline

Return non-constant access to the optional note.

Definition at line 247 of file coordinateSystem.H.

◆ note() [2/2]

const string& note ( ) const
inline

Return the optional note.

Definition at line 253 of file coordinateSystem.H.

◆ origin() [1/2]

const point& origin ( ) const
inline

Return origin.

Definition at line 259 of file coordinateSystem.H.

Referenced by Foam::operator!=(), and coordinateSystem::write().

Here is the caller graph for this function:

◆ R() [1/3]

const coordinateRotation& R ( ) const
inline

Return const reference to co-ordinate rotation.

Definition at line 265 of file coordinateSystem.H.

Referenced by Foam::operator!=(), and coordinateSystem::R().

Here is the caller graph for this function:

◆ R() [2/3]

coordinateRotation& R ( )
inline

Return non const reference to co-ordinate rotation.

Definition at line 271 of file coordinateSystem.H.

References coordinateSystem::R().

Here is the call graph for this function:

◆ R() [3/3]

const coordinateRotation& R ( const polyMesh mesh,
const labelList cells 
)
inline

Update and return the co-ordinate rotation for a list of cells.

Definition at line 278 of file coordinateSystem.H.

References coordinateSystem::dict().

Here is the call graph for this function:

◆ dict()

Foam::dictionary dict ( bool  ignoreType = false) const
virtual

Return as dictionary of entries.

Parameters
[in]ignoreTypedrop type (cartesian, cylindrical, etc) when generating the dictionary

Definition at line 187 of file coordinateSystem.C.

References dictionary::add(), coordinateSystem::localToGlobal(), and Foam::type().

Referenced by coordinateSystem::clone(), coordinateSystem::coordinateSystem(), and coordinateSystem::R().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ rename()

void rename ( const word newName)
inline

Rename.

Definition at line 296 of file coordinateSystem.H.

◆ origin() [2/2]

◆ clear()

void clear ( )
virtual

Reset origin and rotation to an identity coordinateSystem.

Also resets the note

Definition at line 281 of file coordinateSystem.C.

References Foam::Zero.

Referenced by coordinateSystem::origin().

Here is the caller graph for this function:

◆ write()

void write ( Ostream os) const
virtual

Write.

Definition at line 289 of file coordinateSystem.C.

References Foam::nl, coordinateSystem::origin(), and Foam::type().

Referenced by Foam::operator<<(), and coordinateSystem::origin().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeDict()

void writeDict ( Ostream os,
bool  subDict = true 
) const

Write dictionary.

Definition at line 296 of file coordinateSystem.C.

References token::BEGIN_BLOCK, Foam::decrIndent(), token::END_BLOCK, Foam::endl(), Foam::incrIndent(), Foam::indent(), Foam::nl, Foam::type(), and Foam::writeEntry().

Referenced by coordinateSystem::origin(), and engineValve::writeDict().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ globalPosition() [1/2]

point globalPosition ( const point local) const
inline

Convert from position in local coordinate system to global.

Cartesian position

Definition at line 325 of file coordinateSystem.H.

Referenced by coordinateSystem::origin().

Here is the caller graph for this function:

◆ globalPosition() [2/2]

tmp<pointField> globalPosition ( const pointField local) const
inline

Convert from position in local coordinate system to global.

Cartesian position

Definition at line 332 of file coordinateSystem.H.

◆ globalVector() [1/2]

vector globalVector ( const vector local) const
inline

Convert from vector components in local coordinate system to.

global Cartesian vector

Definition at line 339 of file coordinateSystem.H.

Referenced by coordinateSystem::origin().

Here is the caller graph for this function:

◆ globalVector() [2/2]

tmp<vectorField> globalVector ( const vectorField local) const
inline

Convert from vector components in local coordinate system to.

global Cartesian vector

Definition at line 346 of file coordinateSystem.H.

◆ localPosition() [1/2]

point localPosition ( const point global) const
inline

Convert from global Cartesian position to position in local.

coordinate system

Definition at line 353 of file coordinateSystem.H.

Referenced by coordinateSystem::origin().

Here is the caller graph for this function:

◆ localPosition() [2/2]

tmp<pointField> localPosition ( const pointField global) const
inline

Convert from global Cartesian position to position in local.

coordinate system

Definition at line 360 of file coordinateSystem.H.

◆ localVector() [1/2]

vector localVector ( const vector global) const
inline

Convert from global Cartesian vector to components in local.

coordinate system

Definition at line 367 of file coordinateSystem.H.

Referenced by coordinateSystem::origin().

Here is the caller graph for this function:

◆ localVector() [2/2]

tmp<vectorField> localVector ( const vectorField global) const
inline

Convert from global Cartesian vector to components in local.

coordinate system

Definition at line 374 of file coordinateSystem.H.

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const coordinateSystem ,
const coordinateSystem  
)
friend

◆ operator<<

Ostream& operator<< ( Ostream ,
const coordinateSystem  
)
friend

The documentation for this class was generated from the following files: