ENH: portable scoping char for fieldCoordinateSystemTransform (fixes #1675)

- replace ':' scoping with IOobject::scopedName(), which automatically
  uses '_' for Windows compilations where the ':' is a meta-character
  (drive separator)

- apply similar local change for the momentum function object.

*** This topic will be revisited in the future ***
This commit is contained in:
Mark Olesen
2020-06-10 09:40:27 +02:00
parent b87dd8147a
commit b89e1f025c
3 changed files with 19 additions and 6 deletions

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2017-2019 OpenCFD Ltd.
Copyright (C) 2017-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -80,7 +80,7 @@ Foam::functionObjects::fieldCoordinateSystemTransform::transformFieldName
const word& fieldName
) const
{
return fieldName + ":Transformed";
return IOobject::scopedName(fieldName, "Transformed");
}
@ -90,7 +90,7 @@ Foam::functionObjects::fieldCoordinateSystemTransform::srotTensor() const
typedef surfaceTensorField FieldType;
typedef surfaceTensorField::Boundary BoundaryType;
if (!rotTensorSurface_.valid())
if (!rotTensorSurface_)
{
tensorField rotations(csysPtr_->R(mesh_.faceCentres()));
@ -135,7 +135,7 @@ Foam::functionObjects::fieldCoordinateSystemTransform::vrotTensor() const
typedef volTensorField FieldType;
typedef volTensorField::Boundary BoundaryType;
if (!rotTensorVolume_.valid())
if (!rotTensorVolume_)
{
tensorField rotations(csysPtr_->R(mesh_.cellCentres()));

View File

@ -135,7 +135,7 @@ SourceFiles
namespace Foam
{
// Forward declarations
// Forward Declarations
class dimensionSet;
namespace functionObjects
@ -225,6 +225,15 @@ protected:
//- Write momentum data
void writeValues(Ostream& os);
// Protected Member Functions
//- Return a scoped name
// TODO - revisit issue #1675
word scopedName(const word& base) const
{
return IOobject::scopedName(this->name(), base);
}
public:

View File

@ -1,7 +1,7 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v1912 |
| \\ / O peration | Version: v2006 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
@ -29,12 +29,16 @@ boundaryField
code
#{
// Uncomment for testing on non-windows systems [fragile]
// IOobject::scopeSeparator = '_';
const vector axis(1, 0, 0);
vectorField v(2.0*this->patch().Cf() ^ axis);
v.replace(vector::X, 1.0);
operator==(v);
#};
value $internalField;
}