Skip to content
Snippets Groups Projects
coordinateRotation.H 4.04 KiB
Newer Older
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
OpenFOAM bot's avatar
OpenFOAM bot committed
    \\  /    A nd           | www.openfoam.com
     \\/     M anipulation  |
-------------------------------------------------------------------------------
OpenFOAM bot's avatar
OpenFOAM bot committed
    Copyright (C) 2011-2016 OpenFOAM Foundation
    Copyright (C) 2018-2021 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

    OpenFOAM is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    for more details.

    You should have received a copy of the GNU General Public License
    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
Namespace
    Foam::coordinateRotations

Description
    Namespace for coordinate system rotations.

Class
    Foam::coordinateRotation

Description
    User specification of a coordinate rotation.
    Types of coordinateRotations:
      -# \link coordinateRotations::identity none \endlink
      -# \link coordinateRotations::axes axes \endlink
      -# \link coordinateRotations::axisAngle axisAngle \endlink
      -# \link coordinateRotations::cylindrical cylindrical \endlink
      -# \link coordinateRotations::euler euler \endlink
      -# \link coordinateRotations::starcd starcd \endlink
SourceFiles
    coordinateRotation.C

\*---------------------------------------------------------------------------*/

#ifndef coordinateRotation_H
#define coordinateRotation_H

#include "autoPtr.H"
#include "vector.H"
#include "tensor.H"
Mark Olesen's avatar
Mark Olesen committed
#include "dictionary.H"
#include "runTimeSelectionTables.H"

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

namespace Foam
{

/*---------------------------------------------------------------------------*\
                     Class coordinateRotation Declaration
\*---------------------------------------------------------------------------*/

class coordinateRotation
{
        //- Determine best-guess for an orthogonal axis
        static vector findOrthogonal(const vector& axis);
    //- Runtime type information
    TypeNameNoDebug("coordinateRotation");
    // Declare run-time constructor selection table from dictionary
    declareRunTimeSelectionTable
    (
        autoPtr,
        coordinateRotation,
        dictionary,
        //- Construct and return a clone
        virtual autoPtr<coordinateRotation> clone() const = 0;

        //- Select constructed from dictionary
        static autoPtr<coordinateRotation> New(const dictionary& dict);
    virtual ~coordinateRotation() = default;
        virtual void clear() = 0;
        //- Calculate and return the rotation tensor
        virtual tensor R() const = 0;
        //- Write information
        virtual void write(Ostream& os) const = 0;

        //- Write dictionary entry
        virtual void writeEntry(const word& keyword, Ostream& os) const = 0;
};


// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

} // End namespace Foam

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#endif

// ************************************************************************* //