OpenFOAM logo
The Open Source CFD Toolbox
  Source Guide OpenCFD Solutions Contact OpenFOAM

coordinateSystem Class Reference

A cartesian coordinate system and the base class for other coordinate system specifications. More...

Inheritance diagram for coordinateSystem:
Collaboration diagram for coordinateSystem:

List of all members.


Public Member Functions

 TypeName ("coordinateSystem")
 Runtime type information.
 coordinateSystem ()
 Construct null. This is equivalent to an identity coordinateSystem.
 coordinateSystem (const word &name, const coordinateSystem &)
 Construct copy with a different name.
 coordinateSystem (const word &name, const point &origin, const coordinateRotation &)
 Construct from origin and rotation.
 coordinateSystem (const word &name, const point &origin, const vector &axis, const vector &dirn)
 Construct from origin and 2 axes.
 coordinateSystem (const word &name, const dictionary &)
 Construct from dictionary with a given name.
 coordinateSystem (const dictionary &)
 Construct from dictionary with default name.
 coordinateSystem (const dictionary &, const objectRegistry &)
 Construct from dictionary (default name).
 coordinateSystem (Istream &)
 Construct from Istream.
autoPtr< coordinateSystem > clone () const
 Return clone.
 declareRunTimeSelectionTable (autoPtr, coordinateSystem, dictionary,(const word &name, const dictionary &dict),(name, dict))
 declareRunTimeSelectionTable (autoPtr, coordinateSystem, origRotation,(const word &name, const point &origin, const coordinateRotation &cr),(name, origin, cr))
virtual ~coordinateSystem ()
const word & name () const
 Return name.
string & note ()
 Return non-constant access to the optional note.
const string & note () const
 Return the optional note.
const point & origin () const
 Return origin.
const coordinateRotation & rotation () const
 Return coordinate rotation.
const tensor & R () const
 Return local-to-global transformation tensor.
const vector & e1 () const
 Return local Cartesian x-axis.
const vector & e2 () const
 Return local Cartesian y-axis.
const vector & e3 () const
 Return local Cartesian z-axis.
const vector & axis () const
 Return axis (e3: local Cartesian z-axis).
const vector & direction () const
 Return direction (e1: local Cartesian x-axis).
virtual dictionary dict (bool ignoreType=false) const
 Return as dictionary of entries.
virtual void rename (const word &newName)
 Rename.
point & origin ()
 Edit access to origin.
virtual void write (Ostream &) const
 Write.
virtual void writeDict (Ostream &, bool subDict=true) const
 Write dictionary.
point globalPosition (const point &local) const
 Convert from position in local coordinate system to global Cartesian position.
tmp< pointField > globalPosition (const pointField &local) const
 Convert from position in local coordinate system to global Cartesian position.
vector globalVector (const vector &local) const
 Convert from vector components in local coordinate system to global Cartesian vector.
tmp< vectorField > globalVector (const vectorField &local) const
 Convert from vector components in local coordinate system to global Cartesian vector.
point localPosition (const point &global) const
 Convert from global Cartesian position to position in local coordinate system.
tmp< pointField > localPosition (const pointField &global) const
 Convert from global Cartesian position to position in local coordinate system.
vector localVector (const vector &global) const
 Convert from global Cartesian vector to components in local coordinate system.
tmp< vectorField > localVector (const vectorField &global) const
 Convert from global Cartesian vector to components in local coordinate system.
void operator= (const dictionary &)
 assign from dictionary

Static Public Member Functions

static autoPtr< coordinateSystem > New (const word &name, const dictionary &)
 Select constructed from dictionary.
static autoPtr< coordinateSystem > New (const word &coordType, const word &name, const point &origin, const coordinateRotation &)
 Select constructed from origin and rotation.
static autoPtr< coordinateSystem > New (Istream &is)
 Select constructed from Istream.

Protected Member Functions

virtual vector localToGlobal (const vector &, bool translate) const
 Convert from local coordinate system to the global Cartesian system.
virtual tmp< vectorField > localToGlobal (const vectorField &, bool translate) const
 Convert from local coordinate system to the global Cartesian system.
virtual vector globalToLocal (const vector &, bool translate) const
 Convert from global Cartesian system to the local coordinate system.
virtual tmp< vectorField > globalToLocal (const vectorField &, bool translate) const
 Convert from global Cartesian system to the local coordinate system.

Friends

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

Detailed Description

A cartesian coordinate system and the base class for other coordinate system specifications.

All systems are defined by an origin point and a coordinateRotation. For convenience, the dictionary constructor forms allow a few shortcuts:

  • the default origin corresponds to (0 0 0)
  • if the type is not otherwise specified, a Cartesian coordinateSystem is implicit

    flipped
    {
        origin  (0 0 0);
        coordinateRotation
        {
            type        STARCDRotation;
            rotation    (0 0 90);
        }
    }

  • if an axes specification (eg, e3/e1) is used, the coordinateRotation sub-dictionary can be dropped.

    flipped     // the same, specified as axes
    {
        origin  (0 0 0);
        coordinateRotation
        {
            type    axes;
            e3      (1 0 0);
            e1      (0 0 -1);
        }
    }
    flipped     // the same, using all the shortcuts
    {
        e3      (1 0 0);
        e1      (0 0 -1);
    }

    1
    (
    cat1
    {
        coordinateSystem
        {
            origin  (0 0 0);
            coordinateRotation
            {
                type        STARCDRotation;
                rotation    (0 0 90);
            }
        }
        porosity        0.781;
        Darcy
        {
            d   d [0 -2 0 0 0]  (-1000 -1000 0.50753e+08);
            f   f [0 -1 0 0 0]  (-1000 -1000 12.83);
        }
    }
    )

    1
    (
    cat1
    {
        coordinateSystem  system_10;
        porosity        0.781;
        Darcy
        {
            d   d [0 -2 0 0 0]  (-1000 -1000 0.50753e+08);
            f   f [0 -1 0 0 0]  (-1000 -1000 12.83);
        }
    }
    )
For this to work correctly, the coordinateSystem constructor must be supplied with both a dictionary and an objectRegistry.

See also:
coordinateSystems and coordinateSystems::New
Source files

Definition at line 143 of file coordinateSystem.H.


Constructor & Destructor Documentation

Construct null. This is equivalent to an identity coordinateSystem.

Definition at line 34 of file coordinateSystem.C.

References Foam::defineRunTimeSelectionTable(), and Foam::defineTypeNameAndDebug().

Referenced by coordinateSystem::New().

Here is the call graph for this function:

Here is the caller graph for this function:

coordinateSystem ( const word &  name,
const coordinateSystem &  cs 
)

Construct copy with a different name.

Definition at line 45 of file coordinateSystem.C.

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

Construct from origin and rotation.

Definition at line 59 of file coordinateSystem.C.

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

Construct from origin and 2 axes.

Definition at line 74 of file coordinateSystem.C.

coordinateSystem ( const word &  name,
const dictionary &  dict 
)

Construct from dictionary with a given name.

Definition at line 90 of file coordinateSystem.C.

coordinateSystem ( const dictionary &  dict  ) 

Construct from dictionary with default name.

Definition at line 106 of file coordinateSystem.C.

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

Construct from dictionary (default name).

With the ability to reference global coordinateSystems

Definition at line 121 of file coordinateSystem.C.

coordinateSystem ( Istream &  is  ) 

Construct from Istream.

The Istream contains a word followed by a dictionary

Definition at line 174 of file coordinateSystem.C.

~coordinateSystem (  )  [virtual]

Definition at line 189 of file coordinateSystem.C.


Member Function Documentation

Foam::vector localToGlobal ( const vector &  local,
bool  translate 
) const [protected, virtual]

Convert from local coordinate system to the global Cartesian system.

with optional translation for the origin

Reimplemented in cylindricalCS, parabolicCylindricalCS, and sphericalCS.

Definition at line 222 of file coordinateSystem.C.

Referenced by coordinateSystem::globalPosition().

Here is the caller graph for this function:

Foam::tmp< Foam::vectorField > localToGlobal ( const vectorField &  local,
bool  translate 
) const [protected, virtual]

Convert from local coordinate system to the global Cartesian system.

with optional translation for the origin

Reimplemented in cylindricalCS, parabolicCylindricalCS, and sphericalCS.

Definition at line 239 of file coordinateSystem.C.

Foam::vector globalToLocal ( const vector &  global,
bool  translate 
) const [protected, virtual]

Convert from global Cartesian system to the local coordinate system.

with optional translation for the origin

Reimplemented in cylindricalCS, parabolicCylindricalCS, and sphericalCS.

Definition at line 256 of file coordinateSystem.C.

Referenced by coordinateSystem::globalVector(), and coordinateSystem::localPosition().

Here is the caller graph for this function:

Foam::tmp< Foam::vectorField > globalToLocal ( const vectorField &  global,
bool  translate 
) const [protected, virtual]

Convert from global Cartesian system to the local coordinate system.

with optional translation for the origin

Reimplemented in cylindricalCS, parabolicCylindricalCS, and sphericalCS.

Definition at line 273 of file coordinateSystem.C.

TypeName ( "coordinateSystem"   ) 

Runtime type information.

autoPtr<coordinateSystem> clone (  )  const [inline]

Return clone.

Definition at line 252 of file coordinateSystem.H.

declareRunTimeSelectionTable ( autoPtr  ,
coordinateSystem  ,
dictionary  ,
(const word &name, const dictionary &dict)  ,
(name, dict)   
)

declareRunTimeSelectionTable ( autoPtr  ,
coordinateSystem  ,
origRotation  ,
(const word &name, const point &origin, const coordinateRotation &cr)  ,
(name, origin, cr)   
)

Foam::autoPtr< Foam::coordinateSystem > New ( const word &  name,
const dictionary &  dict 
) [static]

Select constructed from dictionary.

Definition at line 24 of file coordinateSystemNew.C.

References coordinateSystem::coordinateSystem(), Foam::endl(), FatalIOErrorIn, Foam::nl, Foam::Pout, and dictionary::readIfPresent().

Here is the call graph for this function:

Foam::autoPtr< Foam::coordinateSystem > New ( const word &  coordType,
const word &  name,
const point &  origin,
const coordinateRotation &  cr 
) [static]

Select constructed from origin and rotation.

Definition at line 69 of file coordinateSystemNew.C.

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

Select constructed from Istream.

Definition at line 105 of file coordinateSystemNew.C.

const word& name (  )  const [inline]

Return name.

Definition at line 315 of file coordinateSystem.H.

Referenced by coordinateSystems::writeData().

Here is the caller graph for this function:

string& note (  )  [inline]

Return non-constant access to the optional note.

Definition at line 321 of file coordinateSystem.H.

const string& note (  )  const [inline]

Return the optional note.

Definition at line 327 of file coordinateSystem.H.

const point& origin (  )  const [inline]

Return origin.

Definition at line 333 of file coordinateSystem.H.

Referenced by coordinateSystem::writeDict().

Here is the caller graph for this function:

const coordinateRotation& rotation (  )  const [inline]

Return coordinate rotation.

Definition at line 339 of file coordinateSystem.H.

const tensor& R (  )  const [inline]

Return local-to-global transformation tensor.

Definition at line 345 of file coordinateSystem.H.

const vector& e1 (  )  const [inline]

Return local Cartesian x-axis.

Definition at line 351 of file coordinateSystem.H.

Referenced by coordinateSystem::writeDict().

Here is the caller graph for this function:

const vector& e2 (  )  const [inline]

Return local Cartesian y-axis.

Definition at line 357 of file coordinateSystem.H.

const vector& e3 (  )  const [inline]

Return local Cartesian z-axis.

Definition at line 363 of file coordinateSystem.H.

Referenced by coordinateSystem::writeDict().

Here is the caller graph for this function:

const vector& axis (  )  const [inline]

Return axis (e3: local Cartesian z-axis).

Deprecated:
method e3 is preferred

Definition at line 372 of file coordinateSystem.H.

const vector& direction (  )  const [inline]

Return direction (e1: local Cartesian x-axis).

Deprecated:
method e1 is preferred

Definition at line 381 of file coordinateSystem.H.

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

Return as dictionary of entries.

Parameters:
[in] ignoreType drop type (cartesian, cylindrical, etc) when generating the dictionary

Definition at line 195 of file coordinateSystem.C.

virtual void rename ( const word &  newName  )  [inline, virtual]

Rename.

Definition at line 397 of file coordinateSystem.H.

point& origin (  )  [inline]

Edit access to origin.

Definition at line 403 of file coordinateSystem.H.

void write ( Ostream &  os  )  const [virtual]

Write.

Reimplemented in toroidalCS.

Definition at line 289 of file coordinateSystem.C.

void writeDict ( Ostream &  os,
bool  subDict = true 
) const [virtual]

Write dictionary.

Reimplemented in toroidalCS.

Definition at line 296 of file coordinateSystem.C.

References coordinateSystem::e1(), coordinateSystem::e3(), coordinateSystem::origin(), and Foam::type().

Here is the call graph for this function:

point globalPosition ( const point &  local  )  const [inline]

Convert from position in local coordinate system to global Cartesian position.

Definition at line 419 of file coordinateSystem.H.

References coordinateSystem::localToGlobal().

Here is the call graph for this function:

tmp<pointField> globalPosition ( const pointField &  local  )  const [inline]

Convert from position in local coordinate system to global Cartesian position.

Definition at line 425 of file coordinateSystem.H.

References coordinateSystem::localToGlobal().

Here is the call graph for this function:

vector globalVector ( const vector &  local  )  const [inline]

Convert from vector components in local coordinate system to global Cartesian vector.

Definition at line 431 of file coordinateSystem.H.

References coordinateSystem::globalToLocal().

Here is the call graph for this function:

tmp<vectorField> globalVector ( const vectorField &  local  )  const [inline]

Convert from vector components in local coordinate system to global Cartesian vector.

Definition at line 437 of file coordinateSystem.H.

References coordinateSystem::globalToLocal().

Here is the call graph for this function:

point localPosition ( const point &  global  )  const [inline]

Convert from global Cartesian position to position in local coordinate system.

Definition at line 443 of file coordinateSystem.H.

References coordinateSystem::globalToLocal().

Here is the call graph for this function:

tmp<pointField> localPosition ( const pointField &  global  )  const [inline]

Convert from global Cartesian position to position in local coordinate system.

Definition at line 449 of file coordinateSystem.H.

References coordinateSystem::globalToLocal().

Here is the call graph for this function:

vector localVector ( const vector &  global  )  const [inline]

Convert from global Cartesian vector to components in local coordinate system.

Definition at line 455 of file coordinateSystem.H.

tmp<vectorField> localVector ( const vectorField &  global  )  const [inline]

Convert from global Cartesian vector to components in local coordinate system.

Definition at line 461 of file coordinateSystem.H.

void operator= ( const dictionary &  rhs  ) 

assign from dictionary

Definition at line 328 of file coordinateSystem.C.

References Foam::decrIndent(), token::END_BLOCK, Foam::endl(), and Foam::indent().

Here is the call graph for this function:


Friends And Related Function Documentation

bool operator!= ( const coordinateSystem &  ,
const coordinateSystem &   
) [friend]

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


The documentation for this class was generated from the following files:
Copyright © 2000-2009 OpenCFD Ltd