mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: ensight: symmTensor writing
This commit is contained in:
@ -33,6 +33,7 @@ License
|
|||||||
#include "ensightBinaryStream.H"
|
#include "ensightBinaryStream.H"
|
||||||
#include "ensightAsciiStream.H"
|
#include "ensightAsciiStream.H"
|
||||||
#include "globalIndex.H"
|
#include "globalIndex.H"
|
||||||
|
#include "ensightPTraits.H"
|
||||||
|
|
||||||
using namespace Foam;
|
using namespace Foam;
|
||||||
|
|
||||||
@ -198,7 +199,7 @@ void writePatchField
|
|||||||
ensightCaseFile.setf(ios_base::left);
|
ensightCaseFile.setf(ios_base::left);
|
||||||
|
|
||||||
ensightCaseFile
|
ensightCaseFile
|
||||||
<< pTraits<Type>::typeName
|
<< ensightPTraits<Type>::typeName
|
||||||
<< " per element: 1 "
|
<< " per element: 1 "
|
||||||
<< setw(15) << pfName
|
<< setw(15) << pfName
|
||||||
<< (' ' + prepend + "****." + pfName).c_str()
|
<< (' ' + prepend + "****." + pfName).c_str()
|
||||||
@ -230,7 +231,7 @@ void writePatchField
|
|||||||
|
|
||||||
if (Pstream::master())
|
if (Pstream::master())
|
||||||
{
|
{
|
||||||
ensightFile.write(pTraits<Type>::typeName);
|
ensightFile.write(ensightPTraits<Type>::typeName);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (patchi >= 0)
|
if (patchi >= 0)
|
||||||
@ -341,14 +342,14 @@ void ensightField
|
|||||||
ensightCaseFile.setf(ios_base::left);
|
ensightCaseFile.setf(ios_base::left);
|
||||||
|
|
||||||
ensightCaseFile
|
ensightCaseFile
|
||||||
<< pTraits<Type>::typeName
|
<< ensightPTraits<Type>::typeName
|
||||||
<< " per element: 1 "
|
<< " per element: 1 "
|
||||||
<< setw(15) << vf.name()
|
<< setw(15) << vf.name()
|
||||||
<< (' ' + prepend + "****." + vf.name()).c_str()
|
<< (' ' + prepend + "****." + vf.name()).c_str()
|
||||||
<< nl;
|
<< nl;
|
||||||
}
|
}
|
||||||
|
|
||||||
ensightFile.write(pTraits<Type>::typeName);
|
ensightFile.write(ensightPTraits<Type>::typeName);
|
||||||
ensightFile.writePartHeader(1);
|
ensightFile.writePartHeader(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -555,14 +556,14 @@ void ensightPointField
|
|||||||
ensightCaseFile.setf(ios_base::left);
|
ensightCaseFile.setf(ios_base::left);
|
||||||
|
|
||||||
ensightCaseFile
|
ensightCaseFile
|
||||||
<< pTraits<Type>::typeName
|
<< ensightPTraits<Type>::typeName
|
||||||
<< " per node: 1 "
|
<< " per node: 1 "
|
||||||
<< setw(15) << pf.name()
|
<< setw(15) << pf.name()
|
||||||
<< (' ' + prepend + "****." + pf.name()).c_str()
|
<< (' ' + prepend + "****." + pf.name()).c_str()
|
||||||
<< nl;
|
<< nl;
|
||||||
}
|
}
|
||||||
|
|
||||||
ensightFile.write(pTraits<Type>::typeName);
|
ensightFile.write(ensightPTraits<Type>::typeName);
|
||||||
ensightFile.writePartHeader(1);
|
ensightFile.writePartHeader(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
46
src/sampling/sampledSurface/writers/ensight/ensightPTraits.C
Normal file
46
src/sampling/sampledSurface/writers/ensight/ensightPTraits.C
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||||
|
\\/ 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/>.
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#include "ensightPTraits.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
const char* const Foam::ensightPTraits<Foam::scalar>::typeName =
|
||||||
|
Foam::pTraits<Foam::scalar>::typeName;
|
||||||
|
|
||||||
|
const char* const Foam::ensightPTraits<Foam::vector>::typeName =
|
||||||
|
Foam::pTraits<Foam::vector>::typeName;
|
||||||
|
|
||||||
|
const char* const Foam::ensightPTraits<Foam::sphericalTensor>::typeName =
|
||||||
|
Foam::pTraits<Foam::scalar>::typeName;
|
||||||
|
|
||||||
|
const char* const Foam::ensightPTraits<Foam::symmTensor>::typeName =
|
||||||
|
"tensor symm";
|
||||||
|
|
||||||
|
const char* const Foam::ensightPTraits<Foam::tensor>::typeName =
|
||||||
|
Foam::pTraits<Foam::tensor>::typeName;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
108
src/sampling/sampledSurface/writers/ensight/ensightPTraits.H
Normal file
108
src/sampling/sampledSurface/writers/ensight/ensightPTraits.H
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
|
||||||
|
\\/ 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/>.
|
||||||
|
|
||||||
|
Class
|
||||||
|
Foam::ensightPTraits
|
||||||
|
|
||||||
|
Description
|
||||||
|
Conversion of OpenFOAM pTraits into the Ensight equivalent
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef ensightPTraits_H
|
||||||
|
#define ensightPTraits_H
|
||||||
|
|
||||||
|
#include "pTraits.H"
|
||||||
|
#include "fieldTypes.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class ensightPTraits Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
template<class PrimitiveType>
|
||||||
|
class ensightPTraits
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
// Static data members
|
||||||
|
|
||||||
|
static const char* const typeName;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
template<>
|
||||||
|
class ensightPTraits<scalar>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
static const char* const typeName;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
class ensightPTraits<vector>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
static const char* const typeName;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
class ensightPTraits<sphericalTensor>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
static const char* const typeName;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
class ensightPTraits<symmTensor>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
static const char* const typeName;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
class ensightPTraits<tensor>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
|
||||||
|
static const char* const typeName;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -2,7 +2,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 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -29,6 +29,7 @@ License
|
|||||||
#include "OSspecific.H"
|
#include "OSspecific.H"
|
||||||
#include "IOmanip.H"
|
#include "IOmanip.H"
|
||||||
#include "ensightPartFaces.H"
|
#include "ensightPartFaces.H"
|
||||||
|
#include "ensightPTraits.H"
|
||||||
|
|
||||||
#include "makeSurfaceWriterMethods.H"
|
#include "makeSurfaceWriterMethods.H"
|
||||||
|
|
||||||
@ -89,7 +90,7 @@ void Foam::ensightSurfaceWriter::writeTemplate
|
|||||||
<< "model: 1 " << osGeom.name().name() << nl
|
<< "model: 1 " << osGeom.name().name() << nl
|
||||||
<< nl
|
<< nl
|
||||||
<< "VARIABLE" << nl
|
<< "VARIABLE" << nl
|
||||||
<< pTraits<Type>::typeName << " per "
|
<< ensightPTraits<Type>::typeName << " per "
|
||||||
<< word(isNodeValues ? "node:" : "element:") << setw(10) << 1
|
<< word(isNodeValues ? "node:" : "element:") << setw(10) << 1
|
||||||
<< " " << fieldName
|
<< " " << fieldName
|
||||||
<< " " << surfaceName.c_str() << ".***." << fieldName << nl
|
<< " " << surfaceName.c_str() << ".***." << fieldName << nl
|
||||||
@ -107,7 +108,7 @@ void Foam::ensightSurfaceWriter::writeTemplate
|
|||||||
osGeom << ensPart;
|
osGeom << ensPart;
|
||||||
|
|
||||||
// Write field
|
// Write field
|
||||||
osField.writeKeyword(pTraits<Type>::typeName);
|
osField.writeKeyword(ensightPTraits<Type>::typeName);
|
||||||
ensPart.writeField(osField, values, isNodeValues);
|
ensPart.writeField(osField, values, isNodeValues);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user