BUG: foamToVTK produces invalid files (fixes #154)

- broken by commit 2027059b (2016-03-09) where the pTraits
  nComponents type was changed from int to Foam::direction
This commit is contained in:
Mark Olesen
2016-06-21 10:21:17 +02:00
parent a39ffa66f2
commit db467dbcf8
7 changed files with 31 additions and 19 deletions

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -49,7 +49,8 @@ void Foam::lagrangianWriter::writeIOField(const wordList& objects)
IOField<Type> fld(header);
os_ << object << ' ' << pTraits<Type>::nComponents << ' '
os_ << object << ' '
<< int(pTraits<Type>::nComponents) << ' '
<< fld.size() << " float" << std::endl;
DynamicList<floatScalar> fField(pTraits<Type>::nComponents*fld.size());

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -38,7 +38,8 @@ void Foam::patchWriter::write
{
const GeometricField<Type, fvPatchField, volMesh>& fld = flds[fieldI];
os_ << fld.name() << ' ' << pTraits<Type>::nComponents << ' '
os_ << fld.name() << ' '
<< int(pTraits<Type>::nComponents) << ' '
<< nFaces_ << " float" << std::endl;
DynamicList<floatScalar> fField(pTraits<Type>::nComponents*nFaces_);
@ -74,7 +75,8 @@ void Foam::patchWriter::write
const GeometricField<Type, pointPatchField, pointMesh>& fld =
flds[fieldI];
os_ << fld.name() << ' ' << pTraits<Type>::nComponents << ' '
os_ << fld.name() << ' '
<< int(pTraits<Type>::nComponents) << ' '
<< nPoints_ << " float" << std::endl;
DynamicList<floatScalar> fField(pTraits<Type>::nComponents*nPoints_);
@ -103,7 +105,8 @@ void Foam::patchWriter::write
{
const GeometricField<Type, fvPatchField, volMesh>& fld = flds[fieldI];
os_ << fld.name() << ' ' << pTraits<Type>::nComponents << ' '
os_ << fld.name() << ' '
<< int(pTraits<Type>::nComponents) << ' '
<< nPoints_ << " float" << std::endl;
DynamicList<floatScalar> fField(pTraits<Type>::nComponents*nPoints_);

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -71,7 +71,8 @@ void Foam::surfaceMeshWriter::write
const GeometricField<Type, fvsPatchField, surfaceMesh>& fld =
sflds[fieldI];
os_ << fld.name() << ' ' << pTraits<Type>::nComponents << ' '
os_ << fld.name() << ' '
<< int(pTraits<Type>::nComponents) << ' '
<< pp_.size() << " float" << std::endl;
DynamicList<floatScalar> fField(pTraits<Type>::nComponents*pp_.size());

View File

@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -74,7 +74,8 @@ void Foam::writeFuns::write
label nValues = mesh.nCells() + superCells.size();
os << vvf.name() << ' ' << pTraits<Type>::nComponents << ' '
os << vvf.name() << ' '
<< int(pTraits<Type>::nComponents) << ' '
<< nValues << " float" << std::endl;
DynamicList<floatScalar> fField(pTraits<Type>::nComponents*nValues);
@ -106,7 +107,8 @@ void Foam::writeFuns::write
const labelList& addPointCellLabels = topo.addPointCellLabels();
const label nTotPoints = mesh.nPoints() + addPointCellLabels.size();
os << pvf.name() << ' ' << pTraits<Type>::nComponents << ' '
os << pvf.name() << ' '
<< int(pTraits<Type>::nComponents) << ' '
<< nTotPoints << " float" << std::endl;
DynamicList<floatScalar> fField(pTraits<Type>::nComponents*nTotPoints);
@ -139,7 +141,8 @@ void Foam::writeFuns::write
const labelList& addPointCellLabels = topo.addPointCellLabels();
const label nTotPoints = mesh.nPoints() + addPointCellLabels.size();
os << vvf.name() << ' ' << pTraits<Type>::nComponents << ' '
os << vvf.name() << ' '
<< int(pTraits<Type>::nComponents) << ' '
<< nTotPoints << " float" << std::endl;
DynamicList<floatScalar> fField(pTraits<Type>::nComponents*nTotPoints);