Skip to content
Snippets Groups Projects
Commit b89e1f02 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

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 ***
parent b87dd814
Branches
Tags
No related merge requests found
......@@ -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()));
......
......@@ -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:
......
/*--------------------------------*- 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;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment