mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge remote-tracking branch 'origin/develop' into develop-pre-release
This commit is contained in:
3
applications/test/coordinateSystem/Make/files
Normal file
3
applications/test/coordinateSystem/Make/files
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
Test-coordinateSystem.C
|
||||||
|
|
||||||
|
EXE = $(FOAM_USER_APPBIN)/Test-coordinateSystem
|
||||||
5
applications/test/coordinateSystem/Make/options
Normal file
5
applications/test/coordinateSystem/Make/options
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
EXE_INC = \
|
||||||
|
-I$(LIB_SRC)/meshTools/lnInclude
|
||||||
|
|
||||||
|
EXE_LIBS = \
|
||||||
|
-lmeshTools
|
||||||
108
applications/test/coordinateSystem/Test-coordinateSystem.C
Normal file
108
applications/test/coordinateSystem/Test-coordinateSystem.C
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
||||||
|
\\/ M anipulation |
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
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/>.
|
||||||
|
|
||||||
|
Application
|
||||||
|
Test-coordinateSystem
|
||||||
|
|
||||||
|
Description
|
||||||
|
Expand coordinate system definitions
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "argList.H"
|
||||||
|
#include "coordinateSystem.H"
|
||||||
|
#include "Fstream.H"
|
||||||
|
#include "IOstreams.H"
|
||||||
|
|
||||||
|
using namespace Foam;
|
||||||
|
|
||||||
|
void doTest(const dictionary& dict)
|
||||||
|
{
|
||||||
|
Info<< dict.dictName() << dict << nl;
|
||||||
|
|
||||||
|
// Could fail?
|
||||||
|
const bool throwingIOError = FatalIOError.throwExceptions();
|
||||||
|
const bool throwingError = FatalError.throwExceptions();
|
||||||
|
try
|
||||||
|
{
|
||||||
|
coordinateSystem cs1(dict.dictName(), dict);
|
||||||
|
|
||||||
|
coordinateSystem cs2;
|
||||||
|
|
||||||
|
// Move assign
|
||||||
|
cs2 = std::move(cs1);
|
||||||
|
|
||||||
|
// Info<<cs2 << nl;
|
||||||
|
cs2.writeDict(Info, true);
|
||||||
|
Info<< nl;
|
||||||
|
}
|
||||||
|
catch (Foam::IOerror& err)
|
||||||
|
{
|
||||||
|
Info<< "Caught FatalIOError " << err << nl << endl;
|
||||||
|
}
|
||||||
|
catch (Foam::error& err)
|
||||||
|
{
|
||||||
|
Info<< "Caught FatalError " << err << nl << endl;
|
||||||
|
}
|
||||||
|
FatalError.throwExceptions(throwingError);
|
||||||
|
FatalIOError.throwExceptions(throwingIOError);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
// Main program:
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
argList::noParallel();
|
||||||
|
argList::addArgument("dict .. dictN");
|
||||||
|
argList args(argc, argv, false, true);
|
||||||
|
|
||||||
|
if (args.size() <= 1)
|
||||||
|
{
|
||||||
|
Info<<"no coordinateSystem dictionaries to expand" << nl;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (label argi=1; argi < args.size(); ++argi)
|
||||||
|
{
|
||||||
|
const string& dictFile = args[argi];
|
||||||
|
IFstream is(dictFile);
|
||||||
|
|
||||||
|
dictionary inputDict(is);
|
||||||
|
|
||||||
|
forAllConstIters(inputDict, iter)
|
||||||
|
{
|
||||||
|
if (iter().isDict())
|
||||||
|
{
|
||||||
|
doTest(iter().dict());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
112
applications/test/coordinateSystem/testDict1
Normal file
112
applications/test/coordinateSystem/testDict1
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: plus |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object testDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
// Rotate 90 deg around x: y -> z, z -> -y
|
||||||
|
|
||||||
|
rot_x90_axesRotation
|
||||||
|
{
|
||||||
|
origin (0 0 0);
|
||||||
|
coordinateRotation
|
||||||
|
{
|
||||||
|
type axesRotation;
|
||||||
|
e1 (1 0 0);
|
||||||
|
e3 (0 -1 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rot_x90_euler
|
||||||
|
{
|
||||||
|
origin (0 0 0);
|
||||||
|
coordinateRotation
|
||||||
|
{
|
||||||
|
type EulerRotation;
|
||||||
|
rotation (0 90 0); // z-x'-z''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Rotate 45 deg around z: x -> (1 1 0), y = (-1 1 0)
|
||||||
|
|
||||||
|
rot_z45_axesRotation
|
||||||
|
{
|
||||||
|
origin (0 0 0);
|
||||||
|
coordinateRotation
|
||||||
|
{
|
||||||
|
type axesRotation;
|
||||||
|
e1 (1 1 0);
|
||||||
|
e3 (0 0 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rot_z45_euler
|
||||||
|
{
|
||||||
|
origin (0 0 0);
|
||||||
|
coordinateRotation
|
||||||
|
{
|
||||||
|
type EulerRotation;
|
||||||
|
rotation (45 0 0); // z-x'-z''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Rotate -45 deg around z: x -> (1 -1 0), y = (1 1 0)
|
||||||
|
rot_zm45_axesRotation
|
||||||
|
{
|
||||||
|
origin (0 0 0);
|
||||||
|
coordinateRotation
|
||||||
|
{
|
||||||
|
type axesRotation;
|
||||||
|
e1 (1 -1 0);
|
||||||
|
e3 (0 0 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rot_zm45_euler
|
||||||
|
{
|
||||||
|
origin (0 0 0);
|
||||||
|
coordinateRotation
|
||||||
|
{
|
||||||
|
type EulerRotation;
|
||||||
|
rotation (-45 0 0); // z-x'-z''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Null transforms
|
||||||
|
|
||||||
|
null_axesRotation
|
||||||
|
{
|
||||||
|
origin (0 0 0);
|
||||||
|
coordinateRotation
|
||||||
|
{
|
||||||
|
type axesRotation;
|
||||||
|
e1 (1 0 0);
|
||||||
|
e3 (0 0 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
null_euler
|
||||||
|
{
|
||||||
|
origin (0 0 0);
|
||||||
|
coordinateRotation
|
||||||
|
{
|
||||||
|
type EulerRotation;
|
||||||
|
rotation (0 0 0); // z-x'-z''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -829,7 +829,9 @@ bool Foam::functionObjectList::read()
|
|||||||
{
|
{
|
||||||
// Bit of trickery to get the original message
|
// Bit of trickery to get the original message
|
||||||
err.write(Warning, false);
|
err.write(Warning, false);
|
||||||
InfoInFunction << nl << endl;
|
InfoInFunction << nl
|
||||||
|
<< "--> while loading function object '" << key << "'"
|
||||||
|
<< nl << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Restore previous exception throwing state
|
// Restore previous exception throwing state
|
||||||
|
|||||||
@ -876,6 +876,7 @@ bool Foam::functionObjects::forces::read(const dictionary& dict)
|
|||||||
}
|
}
|
||||||
|
|
||||||
coordSys_.clear();
|
coordSys_.clear();
|
||||||
|
localSystem_ = false;
|
||||||
|
|
||||||
// Centre of rotation for moment calculations
|
// Centre of rotation for moment calculations
|
||||||
// specified directly, from coordinate system, or implicitly (0 0 0)
|
// specified directly, from coordinate system, or implicitly (0 0 0)
|
||||||
|
|||||||
@ -111,9 +111,13 @@ Note
|
|||||||
coordinateSystem
|
coordinateSystem
|
||||||
{
|
{
|
||||||
origin (0 0 0);
|
origin (0 0 0);
|
||||||
|
coordinateRotation
|
||||||
|
{
|
||||||
|
type axesRotation;
|
||||||
e3 (0 0 1);
|
e3 (0 0 1);
|
||||||
e1 (1 0 0);
|
e1 (1 0 0);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
\endverbatim
|
\endverbatim
|
||||||
|
|
||||||
See also
|
See also
|
||||||
|
|||||||
@ -43,11 +43,16 @@ Description
|
|||||||
|
|
||||||
coordinateSystem
|
coordinateSystem
|
||||||
{
|
{
|
||||||
|
origin (0 0 0);
|
||||||
|
coordinateRotation
|
||||||
|
{
|
||||||
|
type axesRotation;
|
||||||
e1 (0.70710678 0.70710678 0);
|
e1 (0.70710678 0.70710678 0);
|
||||||
e2 (0 0 1);
|
e2 (0 0 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
\endverbatim
|
\endverbatim
|
||||||
|
|
||||||
Note
|
Note
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -34,16 +34,16 @@ Foam::autoPtr<Foam::coordinateRotation> Foam::coordinateRotation::New
|
|||||||
const objectRegistry& obr
|
const objectRegistry& obr
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const word rotType = dict.lookup("type");
|
const word modelType(dict.get<word>("type"));
|
||||||
|
|
||||||
auto cstrIter = objectRegistryConstructorTablePtr_->cfind(rotType);
|
auto cstrIter = objectRegistryConstructorTablePtr_->cfind(modelType);
|
||||||
|
|
||||||
if (!cstrIter.found())
|
if (!cstrIter.found())
|
||||||
{
|
{
|
||||||
FatalIOErrorInFunction(dict)
|
FatalIOErrorInFunction(dict)
|
||||||
<< "Unknown coordinateRotation type " << rotType << nl << nl
|
<< "Unknown coordinateRotation type " << modelType << nl << nl
|
||||||
<< "Valid coordinateRotation types :" << nl
|
<< "Valid types: "
|
||||||
<< objectRegistryConstructorTablePtr_->sortedToc()
|
<< flatOutput(objectRegistryConstructorTablePtr_->sortedToc())
|
||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,16 +56,16 @@ Foam::autoPtr<Foam::coordinateRotation> Foam::coordinateRotation::New
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const word rotType = dict.lookup("type");
|
const word modelType(dict.get<word>("type"));
|
||||||
|
|
||||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(rotType);
|
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||||
|
|
||||||
if (!cstrIter.found())
|
if (!cstrIter.found())
|
||||||
{
|
{
|
||||||
FatalIOErrorInFunction(dict)
|
FatalIOErrorInFunction(dict)
|
||||||
<< "Unknown coordinateRotation type " << rotType << nl << nl
|
<< "Unknown coordinateRotation type " << modelType << nl << nl
|
||||||
<< "Valid coordinateRotation types :" << nl
|
<< "Valid types: "
|
||||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
<< flatOutput(dictionaryConstructorTablePtr_->sortedToc())
|
||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -147,9 +147,21 @@ Foam::coordinateSystem::coordinateSystem
|
|||||||
{
|
{
|
||||||
const entry* entryPtr = dict.lookupEntryPtr(typeName_(), false, false);
|
const entry* entryPtr = dict.lookupEntryPtr(typeName_(), false, false);
|
||||||
|
|
||||||
// non-dictionary entry is a lookup into global coordinateSystems
|
if (!entryPtr)
|
||||||
if (entryPtr && !entryPtr->isDict())
|
|
||||||
{
|
{
|
||||||
|
// No 'coordinateSystem' entry
|
||||||
|
init(dict, obr);
|
||||||
|
}
|
||||||
|
else if (entryPtr->isDict())
|
||||||
|
{
|
||||||
|
// 'coordinateSystem' as dictionary entry - use it
|
||||||
|
init(entryPtr->dict(), obr);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// 'coordinateSystem' as non-dictionary entry
|
||||||
|
// - this is a lookup into global coordinateSystems
|
||||||
|
|
||||||
keyType key(entryPtr->stream());
|
keyType key(entryPtr->stream());
|
||||||
|
|
||||||
const coordinateSystems& lst = coordinateSystems::New(obr);
|
const coordinateSystems& lst = coordinateSystems::New(obr);
|
||||||
@ -170,15 +182,11 @@ Foam::coordinateSystem::coordinateSystem
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
// copy coordinateSystem, but assign the name as the typeName
|
// Copy from coordinateSystem, but assign the name as the typeName
|
||||||
// to avoid strange things in writeDict()
|
// to avoid strange things in writeDict()
|
||||||
operator=(lst[index]);
|
operator=(lst[index]);
|
||||||
name_ = typeName_();
|
name_ = typeName_();
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
init(dict, obr);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -202,7 +210,7 @@ Foam::dictionary Foam::coordinateSystem::dict(bool ignoreType) const
|
|||||||
|
|
||||||
dict.add("name", name_);
|
dict.add("name", name_);
|
||||||
|
|
||||||
// only write type for derived types
|
// Only write type for derived types
|
||||||
if (!ignoreType && type() != typeName_())
|
if (!ignoreType && type() != typeName_())
|
||||||
{
|
{
|
||||||
dict.add("type", type());
|
dict.add("type", type());
|
||||||
@ -296,8 +304,6 @@ void Foam::coordinateSystem::transfer(coordinateSystem& cs)
|
|||||||
note_ = std::move(cs.note_);
|
note_ = std::move(cs.note_);
|
||||||
origin_ = std::move(cs.origin_);
|
origin_ = std::move(cs.origin_);
|
||||||
R_ = std::move(cs.R_);
|
R_ = std::move(cs.R_);
|
||||||
|
|
||||||
cs.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -340,8 +346,17 @@ void Foam::coordinateSystem::operator=(const coordinateSystem& cs)
|
|||||||
name_ = cs.name_;
|
name_ = cs.name_;
|
||||||
note_ = cs.note_;
|
note_ = cs.note_;
|
||||||
origin_ = cs.origin_;
|
origin_ = cs.origin_;
|
||||||
|
|
||||||
|
// Some extra safety
|
||||||
|
if (cs.R_.valid())
|
||||||
|
{
|
||||||
R_ = cs.R_.clone();
|
R_ = cs.R_.clone();
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
R_.reset(new axesRotation(sphericalTensor::I));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Foam::coordinateSystem::operator=(coordinateSystem&& cs)
|
void Foam::coordinateSystem::operator=(coordinateSystem&& cs)
|
||||||
{
|
{
|
||||||
@ -349,38 +364,27 @@ void Foam::coordinateSystem::operator=(coordinateSystem&& cs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::coordinateSystem::init(const dictionary& rhs)
|
void Foam::coordinateSystem::init(const dictionary& dict)
|
||||||
{
|
{
|
||||||
rhs.lookup("origin") >> origin_;
|
dict.lookup("origin") >> origin_;
|
||||||
note_.clear();
|
note_.clear();
|
||||||
rhs.readIfPresent("note", note_);
|
dict.readIfPresent("note", note_);
|
||||||
R_ = coordinateRotation::New(rhs.subDict("coordinateRotation"));
|
R_ = coordinateRotation::New(dict.subDict("coordinateRotation"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::coordinateSystem::init
|
void Foam::coordinateSystem::init
|
||||||
(
|
(
|
||||||
const dictionary& rhs,
|
const dictionary& dict,
|
||||||
const objectRegistry& obr
|
const objectRegistry& obr
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (debug)
|
dict.lookup("origin") >> origin_;
|
||||||
{
|
|
||||||
Pout<< "coordinateSystem::operator="
|
|
||||||
"("
|
|
||||||
"const dictionary&, "
|
|
||||||
"const objectRegistry&"
|
|
||||||
") : "
|
|
||||||
<< "assign from " << rhs << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
rhs.lookup("origin") >> origin_;
|
|
||||||
|
|
||||||
// The 'note' entry is optional
|
// The 'note' entry is optional
|
||||||
note_.clear();
|
note_.clear();
|
||||||
rhs.readIfPresent("note", note_);
|
dict.readIfPresent("note", note_);
|
||||||
|
R_ = coordinateRotation::New(dict.subDict("coordinateRotation"), obr);
|
||||||
R_ = coordinateRotation::New(rhs.subDict("coordinateRotation"), obr);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -76,7 +76,7 @@ SourceFiles
|
|||||||
namespace Foam
|
namespace Foam
|
||||||
{
|
{
|
||||||
|
|
||||||
// Forward declaration of friend functions and operators
|
// Forward declarations
|
||||||
|
|
||||||
class coordinateSystem;
|
class coordinateSystem;
|
||||||
|
|
||||||
@ -101,7 +101,8 @@ class coordinateSystem
|
|||||||
//- Origin
|
//- Origin
|
||||||
point origin_;
|
point origin_;
|
||||||
|
|
||||||
//- Local-to-Global transformation tensor
|
//- Local-to-Global transformation tensor.
|
||||||
|
// May be invalid after a move assignment or transfer
|
||||||
autoPtr<coordinateRotation> R_;
|
autoPtr<coordinateRotation> R_;
|
||||||
|
|
||||||
|
|
||||||
@ -110,11 +111,11 @@ protected:
|
|||||||
// Protected Member Functions
|
// Protected Member Functions
|
||||||
|
|
||||||
//- Convert from local coordinate system to the global Cartesian system
|
//- Convert from local coordinate system to the global Cartesian system
|
||||||
// with optional translation for the origin
|
//- with optional translation for the origin
|
||||||
virtual vector localToGlobal(const vector&, bool translate) const;
|
virtual vector localToGlobal(const vector&, bool translate) const;
|
||||||
|
|
||||||
//- Convert from local coordinate system to the global Cartesian system
|
//- Convert from local coordinate system to the global Cartesian system
|
||||||
// with optional translation for the origin
|
//- with optional translation for the origin
|
||||||
virtual tmp<vectorField> localToGlobal
|
virtual tmp<vectorField> localToGlobal
|
||||||
(
|
(
|
||||||
const vectorField&,
|
const vectorField&,
|
||||||
@ -122,11 +123,11 @@ protected:
|
|||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Convert from global Cartesian system to the local coordinate system
|
//- Convert from global Cartesian system to the local coordinate system
|
||||||
// with optional translation for the origin
|
//- with optional translation for the origin
|
||||||
virtual vector globalToLocal(const vector&, bool translate) const;
|
virtual vector globalToLocal(const vector&, bool translate) const;
|
||||||
|
|
||||||
//- Convert from global Cartesian system to the local coordinate system
|
//- Convert from global Cartesian system to the local coordinate system
|
||||||
// with optional translation for the origin
|
//- with optional translation for the origin
|
||||||
virtual tmp<vectorField> globalToLocal
|
virtual tmp<vectorField> globalToLocal
|
||||||
(
|
(
|
||||||
const vectorField&,
|
const vectorField&,
|
||||||
@ -134,10 +135,10 @@ protected:
|
|||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Init from dict and obr
|
//- Init from dict and obr
|
||||||
void init(const dictionary&);
|
void init(const dictionary& dict);
|
||||||
|
|
||||||
//- Init from dictionary
|
//- Init from dictionary
|
||||||
void init(const dictionary&, const objectRegistry&);
|
void init(const dictionary& dict, const objectRegistry& obr);
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@ -182,18 +183,18 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//- Construct from dictionary with a given name
|
//- Construct from dictionary with a given name
|
||||||
coordinateSystem(const word& name, const dictionary&);
|
coordinateSystem(const word& name, const dictionary& dict);
|
||||||
|
|
||||||
//- Construct from dictionary with default name
|
//- Construct from dictionary with default name
|
||||||
coordinateSystem(const dictionary&);
|
explicit coordinateSystem(const dictionary& dict);
|
||||||
|
|
||||||
//- Construct from dictionary (default name)
|
//- Construct from dictionary (default name)
|
||||||
// With the ability to reference global coordinateSystems
|
// With the ability to reference global coordinateSystems
|
||||||
coordinateSystem(const objectRegistry&, const dictionary&);
|
coordinateSystem(const objectRegistry& obr, const dictionary& dict);
|
||||||
|
|
||||||
//- Construct from Istream
|
//- Construct from Istream
|
||||||
// The Istream contains a word followed by a dictionary
|
// The Istream contains a word followed by a dictionary
|
||||||
coordinateSystem(Istream&);
|
coordinateSystem(Istream& is);
|
||||||
|
|
||||||
|
|
||||||
//- Return clone
|
//- Return clone
|
||||||
@ -322,10 +323,10 @@ public:
|
|||||||
// Write
|
// Write
|
||||||
|
|
||||||
//- Write
|
//- Write
|
||||||
virtual void write(Ostream&) const;
|
virtual void write(Ostream& os) const;
|
||||||
|
|
||||||
//- Write dictionary
|
//- Write dictionary
|
||||||
void writeDict(Ostream&, bool subDict=true) const;
|
void writeDict(Ostream& os, bool subDict=true) const;
|
||||||
|
|
||||||
|
|
||||||
// Transformations
|
// Transformations
|
||||||
@ -396,7 +397,7 @@ public:
|
|||||||
void operator=(coordinateSystem&& cs);
|
void operator=(coordinateSystem&& cs);
|
||||||
|
|
||||||
|
|
||||||
// friend Operators
|
// Friend Operators
|
||||||
|
|
||||||
friend bool operator!=
|
friend bool operator!=
|
||||||
(
|
(
|
||||||
@ -407,7 +408,11 @@ public:
|
|||||||
|
|
||||||
// IOstream Operators
|
// IOstream Operators
|
||||||
|
|
||||||
friend Ostream& operator<<(Ostream&, const coordinateSystem&);
|
friend Ostream& operator<<
|
||||||
|
(
|
||||||
|
Ostream& os,
|
||||||
|
const coordinateSystem& cs
|
||||||
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -35,9 +35,9 @@ Foam::autoPtr<Foam::coordinateSystem> Foam::coordinateSystem::New
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
const dictionary& coordDict = dict.subDict(typeName_());
|
const dictionary& coordDict = dict.subDict(typeName_());
|
||||||
const word coordType = coordDict.lookup("type");
|
const word modelType(coordDict.get<word>("type"));
|
||||||
|
|
||||||
auto cstrIter = dictionaryConstructorTablePtr_->cfind(coordType);
|
auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
|
||||||
|
|
||||||
if (!cstrIter.found())
|
if (!cstrIter.found())
|
||||||
{
|
{
|
||||||
@ -45,9 +45,9 @@ Foam::autoPtr<Foam::coordinateSystem> Foam::coordinateSystem::New
|
|||||||
(
|
(
|
||||||
dict
|
dict
|
||||||
) << "Unknown coordinateSystem type "
|
) << "Unknown coordinateSystem type "
|
||||||
<< coordType << nl << nl
|
<< modelType << nl << nl
|
||||||
<< "Valid coordinateSystem types :" << nl
|
<< "Valid types: "
|
||||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
<< flatOutput(dictionaryConstructorTablePtr_->sortedToc())
|
||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user