BUG: cached ensight type not a word (fixes #3133)

- the type/name for field caching were saved as word, but ensight has
  things like "tensor symm" etc, which do not parse very well as
  'word'. Now save as 'string' type.

  Backwards compatibility is OK since a word token will also be
  readable as string etc.
This commit is contained in:
Mark Olesen
2024-04-05 12:14:49 +02:00
parent 2d61127606
commit 0ef981adbc
4 changed files with 14 additions and 10 deletions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2023 OpenCFD Ltd.
Copyright (C) 2016-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -203,7 +203,7 @@ bool Foam::ensightOutput::writerCaching::update
const scalar timeValue,
const bool geomChanged,
const word& fieldName,
const word& fieldType,
const string& fieldType, // May contain spaces (eg, "tensor symm")
const word& varName
)
{

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2016-2022 OpenCFD Ltd.
Copyright (C) 2016-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -139,6 +139,10 @@ public:
//- Update time/geometry information and file cache.
//- This routine should only be called from the master process
//
// Note that the ensight field type may contain spaces
// (eg, "tensor symm")
//
// \return True if there is a state change, which is either a
// geometry change or a new time interval
bool update
@ -147,7 +151,7 @@ public:
const scalar timeValue, //!< The current time value
const bool geomChanged, //!< Monitored geometry changed
const word& fieldName, //!< Name of field
const word& fieldType, //!< Type of field
const string& fieldType, //!< Ensight type of field
const word& varName = word::null //!< Alternative field name
);
};

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2022-2023 OpenCFD Ltd.
Copyright (C) 2022-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -222,7 +222,7 @@ Foam::fileName Foam::coordSetWriters::ensightWriter::writeCollated
{
const dictionary& subDict = dEntry.dict();
const word varType(subDict.get<word>("type"));
const string varType(subDict.get<string>("type"));
const word varName
(
subDict.getOrDefault<word>
@ -233,7 +233,7 @@ Foam::fileName Foam::coordSetWriters::ensightWriter::writeCollated
);
osCase
<< varType
<< varType.c_str()
<<
(
true // this->isPointData()

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2014 OpenFOAM Foundation
Copyright (C) 2015-2023 OpenCFD Ltd.
Copyright (C) 2015-2024 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -236,7 +236,7 @@ Foam::fileName Foam::surfaceWriters::ensightWriter::writeCollated
{
const dictionary& subDict = dEntry.dict();
const word varType(subDict.get<word>("type"));
const string varType(subDict.get<string>("type"));
const word varName
(
subDict.getOrDefault<word>
@ -247,7 +247,7 @@ Foam::fileName Foam::surfaceWriters::ensightWriter::writeCollated
);
osCase
<< varType
<< varType.c_str()
<<
(
this->isPointData()