foamToVTK: Use UPtrList rather than PtrList

This commit is contained in:
Henry Weller
2016-05-06 14:11:38 +01:00
parent 5f95885a1a
commit 28c753f52e
12 changed files with 52 additions and 50 deletions

View File

@ -91,7 +91,7 @@ public:
template<class Type, template<class> class PatchField, class GeoMesh>
void write
(
const PtrList<GeometricField<Type, PatchField, GeoMesh>>&
const UPtrList<const GeometricField<Type, PatchField, GeoMesh>>&
);
//- Interpolate and write volFields
@ -99,7 +99,7 @@ public:
void write
(
const volPointInterpolation&,
const PtrList<GeometricField<Type, fvPatchField, volMesh>>&
const UPtrList<const GeometricField<Type, fvPatchField, volMesh>>&
);
};

View File

@ -31,7 +31,7 @@ License
template<class Type, template<class> class PatchField, class GeoMesh>
void Foam::internalWriter::write
(
const PtrList<GeometricField<Type, PatchField, GeoMesh>>& flds
const UPtrList<const GeometricField<Type, PatchField, GeoMesh>>& flds
)
{
forAll(flds, i)
@ -45,7 +45,7 @@ template<class Type>
void Foam::internalWriter::write
(
const volPointInterpolation& pInterp,
const PtrList<GeometricField<Type, fvPatchField, volMesh>>& flds
const UPtrList<const GeometricField<Type, fvPatchField, volMesh>>& flds
)
{
forAll(flds, i)

View File

@ -114,14 +114,17 @@ public:
template<class Type>
void write
(
const PtrList<GeometricField<Type, fvPatchField, volMesh>>&
const UPtrList<const GeometricField<Type, fvPatchField, volMesh>>&
);
//- Write pointFields
template<class Type>
void write
(
const PtrList<GeometricField<Type, pointPatchField, pointMesh>>&
const UPtrList
<
const GeometricField<Type, pointPatchField, pointMesh>
>&
);
//- Interpolate and write volFields
@ -129,7 +132,7 @@ public:
void write
(
const PrimitivePatchInterpolation<primitivePatch>&,
const PtrList<GeometricField<Type, fvPatchField, volMesh>>&
const UPtrList<const GeometricField<Type, fvPatchField, volMesh>>&
);
};

View File

@ -31,14 +31,14 @@ License
template<class Type>
void Foam::patchWriter::write
(
const PtrList<GeometricField<Type, fvPatchField, volMesh>>& flds
const UPtrList<const GeometricField<Type, fvPatchField, volMesh>>& flds
)
{
forAll(flds, fieldi)
{
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_);
@ -66,7 +66,7 @@ void Foam::patchWriter::write
template<class Type>
void Foam::patchWriter::write
(
const PtrList<GeometricField<Type, pointPatchField, pointMesh>>& flds
const UPtrList<const GeometricField<Type, pointPatchField, pointMesh>>& flds
)
{
forAll(flds, fieldi)
@ -74,7 +74,7 @@ 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_);
@ -96,14 +96,14 @@ template<class Type>
void Foam::patchWriter::write
(
const PrimitivePatchInterpolation<primitivePatch>& pInter,
const PtrList<GeometricField<Type, fvPatchField, volMesh>>& flds
const UPtrList<const GeometricField<Type, fvPatchField, volMesh>>& flds
)
{
forAll(flds, fieldi)
{
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

@ -40,7 +40,7 @@ void readFields
const typename GeoField::Mesh& mesh,
const IOobjectList& objects,
const HashSet<word>& selectedFields,
PtrList<GeoField>& fields
PtrList<const GeoField>& fields
)
{
// Search list of objects for volScalarFields
@ -64,7 +64,7 @@ void readFields
*iter(),
mesh
)
)
).ptr()
);
nFields++;
}

View File

@ -52,7 +52,7 @@ void readFields
const typename GeoField::Mesh& mesh,
const IOobjectList& objects,
const HashSet<word>& selectedFields,
PtrList<GeoField>& fields
PtrList<const GeoField>& fields
);
} // End namespace Foam

View File

@ -99,7 +99,10 @@ public:
template<class Type>
void write
(
const PtrList<GeometricField<Type, fvsPatchField, surfaceMesh>>&
const UPtrList
<
const GeometricField<Type, fvsPatchField, surfaceMesh>
>&
);
};

View File

@ -63,7 +63,10 @@ Foam::tmp<Field<Type>> Foam::surfaceMeshWriter::getFaceField
template<class Type>
void Foam::surfaceMeshWriter::write
(
const PtrList<GeometricField<Type, fvsPatchField, surfaceMesh>>& sflds
const UPtrList
<
const GeometricField<Type, fvsPatchField, surfaceMesh>
>& sflds
)
{
forAll(sflds, fieldi)

View File

@ -74,7 +74,7 @@ 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 +106,7 @@ 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 +139,7 @@ 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);

View File

@ -30,19 +30,14 @@ License
#include "emptyFvsPatchFields.H"
#include "fvsPatchFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
void writeSurfFields
void Foam::writeSurfFields
(
const bool binary,
const vtkMesh& vMesh,
const fileName& fileName,
const PtrList<surfaceVectorField>& surfVectorFields
const UPtrList<const surfaceVectorField>& surfVectorFields
)
{
const fvMesh& mesh = vMesh.mesh();
@ -117,8 +112,4 @@ void writeSurfFields
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View File

@ -50,7 +50,7 @@ void writeSurfFields
const bool binary,
const vtkMesh& vMesh,
const fileName& fileName,
const PtrList<surfaceVectorField>& surfVectorFields
const UPtrList<const surfaceVectorField>& surfVectorFields
);
} // End namespace Foam