ENH: add clear() method to coordinateSystem, coordinateRotation

This commit is contained in:
Mark Olesen
2011-01-11 13:09:41 +01:00
parent 81c385e51b
commit 305bdb5978
4 changed files with 28 additions and 4 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -167,6 +167,14 @@ Foam::autoPtr<Foam::coordinateRotation> Foam::coordinateRotation::New
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::coordinateRotation::clear()
{
this->tensor::operator=(sphericalTensor::I);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
void Foam::coordinateRotation::operator=(const dictionary& rhs)

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -165,6 +165,9 @@ public:
// Member Functions
//- Reset rotation to an identity rotation
virtual void clear();
//- Return local-to-global transformation tensor
const tensor& R() const
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -290,6 +290,15 @@ Foam::tmp<Foam::vectorField> Foam::coordinateSystem::globalToLocal
}
void Foam::coordinateSystem::clear()
{
note_.clear();
origin_ = point::zero;
R_.clear();
Rtr_ = sphericalTensor::I;
}
void Foam::coordinateSystem::write(Ostream& os) const
{
os << type()

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2011 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -397,6 +397,10 @@ public:
return origin_;
}
//- Reset origin and rotation to an identity coordinateSystem
// Also resets the note
virtual void clear();
// Write