Bug fixing in vector transformation using localAxesRotation
Adding constructor for localAxesRotation class.
This commit is contained in:
sergio
2014-05-09 14:59:07 +01:00
committed by Andrew Heather
parent 007c694815
commit 7c28d5fb5d
7 changed files with 87 additions and 27 deletions

View File

@ -113,6 +113,33 @@ Foam::localAxesRotation::localAxesRotation(const dictionary& dict)
}
Foam::localAxesRotation::localAxesRotation
(
const objectRegistry& obr,
const vector& axis,
const point& origin
)
:
Rptr_(),
origin_(origin),
e3_(axis)
{
const polyMesh& mesh = refCast<const polyMesh>(obr);
Rptr_.reset(new tensorField(mesh.nCells()));
init(obr);
}
Foam::localAxesRotation::localAxesRotation(const tensorField& R)
:
Rptr_(),
origin_(vector::zero),
e3_(vector::zero)
{
Rptr_() = R;
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::localAxesRotation::clear()

View File

@ -26,17 +26,22 @@ Class
Description
A local coordinate rotation.
Each rotational tensor is defined with two vectors (dir and e3)
where dir = cellC - origin and e3 is the rotation axis.
Per each cell an axesRotation type of rotation is created
The cell based rotational field can be created in two ways:
\verbatim
localAxesRotation
{
type localAxes;
e3 (0 0 1);
}
\endverbatim
1) Each rotational tensor is defined with two vectors (dir and e3)
where dir = cellC - origin and e3 is the rotation axis.
Per each cell an axesRotation type of rotation is created
(cylindrical coordinates)
\verbatim
localAxesRotation
{
type localAxes;
e3 (0 0 1);
}
\endverbatim
2) The rotational tensor field is provided at construction
\*---------------------------------------------------------------------------*/
@ -88,9 +93,20 @@ public:
//- Construct from dictionary and objectRegistry
localAxesRotation(const dictionary&, const objectRegistry&);
//- Construct from dictionary and objectRegistry
localAxesRotation
(
const objectRegistry&,
const vector& axis,
const point& origin
);
//- Construct from dictionary
localAxesRotation(const dictionary&);
//- Construct from tensor Field
localAxesRotation(const tensorField&);
//- Return clone
autoPtr<localAxesRotation> clone() const
{

View File

@ -50,7 +50,7 @@ Description
Type of co-ordinates:
1) cartesian
2) cylindrical
See Also
coordinateSystem and coordinateSystem::New

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -29,14 +29,6 @@ License
#include "mathematicalConstants.H"
#include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(cylindricalCS, 0);
addToRunTimeSelectionTable(coordinateSystem, cylindricalCS, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -36,7 +36,6 @@ SourceFiles
#define cylindricalCS_H
#include "coordinateSystem.H"
#include "typeInfo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -89,9 +88,6 @@ protected:
public:
//- Runtime type information
TypeName("cylindrical");
// Constructors