Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | Friends
coordinateSystem Class Reference

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

Inheritance diagram for coordinateSystem:
Inheritance graph
[legend]
Collaboration diagram for coordinateSystem:
Collaboration graph
[legend]

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 roation 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...
 

Private Attributes

word name_
 Name of coordinate system. More...
 
string note_
 Optional note. More...
 
point origin_
 Origin. More...
 
autoPtr< coordinateRotationR_
 Local-to-Global transformation tensor. 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) cylindrical 4) EulerCoordinateRotation

Type of co-ordinates: 1) cartesian

See also
coordinateSystem and coordinateSystem::New
Source files

Definition at line 85 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().

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.

◆ 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.

◆ 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.

◆ 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 dict.

◆ coordinateSystem() [6/8]

coordinateSystem ( const dictionary dict)

Construct from dictionary with default name.

Definition at line 108 of file coordinateSystem.C.

References coordinateSystem::dict(), 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 dict, Foam::endl(), Foam::exit(), Foam::FatalError, FatalErrorInFunction, coordinateSystems::findIndex(), Foam::Info, entry::isDict(), dictionary::lookupEntryPtr(), coordinateSystems::New(), Foam::nl, entry::stream(), and coordinateSystems::toc().

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 168 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 182 of file coordinateSystem.C.

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 215 of file coordinateSystem.C.

Referenced by cartesianCS::localToGlobal(), and cylindricalCS::localToGlobal().

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 232 of file coordinateSystem.C.

◆ 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 249 of file coordinateSystem.C.

Referenced by cartesianCS::globalToLocal(), and cylindricalCS::globalToLocal().

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 266 of file coordinateSystem.C.

◆ init() [1/2]

void init ( const dictionary rhs)
protected

Init from dict and obr.

Definition at line 326 of file coordinateSystem.C.

References List::clear(), 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 336 of file coordinateSystem.C.

References List::clear(), 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()

autoPtr<coordinateSystem> clone ( ) const
inline

Return clone.

Definition at line 188 of file coordinateSystem.H.

References coordinateSystem::coordinateSystem().

Here is the call graph for this function:

◆ declareRunTimeSelectionTable()

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

◆ 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 dict, Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, dictionary::lookup(), and Foam::nl.

Here is the call 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 dict.

◆ 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 236 of file coordinateSystem.H.

References coordinateSystem::name_.

◆ note() [1/2]

string& note ( )
inline

Return non-constant access to the optional note.

Definition at line 242 of file coordinateSystem.H.

References coordinateSystem::note_.

◆ note() [2/2]

const string& note ( ) const
inline

Return the optional note.

Definition at line 248 of file coordinateSystem.H.

References coordinateSystem::note_.

◆ origin() [1/2]

const point& origin ( ) const
inline

Return origin.

Definition at line 254 of file coordinateSystem.H.

References coordinateSystem::origin_.

◆ R() [1/3]

const coordinateRotation& R ( ) const
inline

Return const reference to co-ordinate rotation.

Definition at line 260 of file coordinateSystem.H.

References coordinateSystem::R_.

◆ R() [2/3]

coordinateRotation& R ( )
inline

Return non const reference to co-ordinate rotation.

Definition at line 266 of file coordinateSystem.H.

References coordinateSystem::R_.

◆ R() [3/3]

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

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

Definition at line 273 of file coordinateSystem.H.

References cells, mesh, and coordinateSystem::R_.

◆ 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 188 of file coordinateSystem.C.

References dictionary::add(), dict, and Foam::type().

Referenced by coordinateSystem::coordinateSystem().

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 291 of file coordinateSystem.H.

References coordinateSystem::name_.

◆ origin() [2/2]

point& origin ( )
inline

Edit access to origin.

Definition at line 297 of file coordinateSystem.H.

References coordinateSystem::origin_.

◆ clear()

void clear ( )
virtual

Reset origin and rotation to an identity coordinateSystem.

Also resets the note

Definition at line 282 of file coordinateSystem.C.

References Vector< scalar >::zero.

◆ write()

void write ( Ostream os) const
virtual

Write.

Definition at line 290 of file coordinateSystem.C.

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

Here is the call graph for this function:

◆ writeDict()

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

Write dictionary.

Definition at line 297 of file coordinateSystem.C.

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

Here is the call 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 320 of file coordinateSystem.H.

Referenced by sampledPlane::sampledPlane().

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 327 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 334 of file coordinateSystem.H.

Referenced by sampledPlane::sampledPlane().

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 341 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 348 of file coordinateSystem.H.

◆ 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 355 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 362 of file coordinateSystem.H.

◆ 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 369 of file coordinateSystem.H.

Friends And Related Function Documentation

◆ operator!=

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

◆ operator<<

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

Field Documentation

◆ name_

word name_
private

Name of coordinate system.

Definition at line 90 of file coordinateSystem.H.

Referenced by coordinateSystem::name(), and coordinateSystem::rename().

◆ note_

string note_
private

Optional note.

Definition at line 93 of file coordinateSystem.H.

Referenced by coordinateSystem::note().

◆ origin_

point origin_
private

Origin.

Definition at line 96 of file coordinateSystem.H.

Referenced by coordinateSystem::origin().

◆ R_

Local-to-Global transformation tensor.

Definition at line 99 of file coordinateSystem.H.

Referenced by coordinateSystem::R().


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