Merge branch 'olesenm'

This commit is contained in:
andy
2010-03-01 15:55:30 +00:00
79 changed files with 495 additions and 274 deletions

View File

@ -91,23 +91,20 @@ cspace ","{space}
alpha [_A-Za-z]
digit [0-9]
dec_digit [0-9]
octal_digit [0-7]
hex_digit [0-9a-fA-F]
identifier {alpha}({alpha}|{digit})*
integer {dec_digit}+
label [1-9]{dec_digit}*
integer {digit}+
label [1-9]{digit}*
exponent_part [eE][-+]?{digit}+
fractional_constant [-+]?(({digit}*"."{digit}+)|({digit}+"."?))
double (({fractional_constant}{exponent_part}?)|({digit}+{exponent_part}))
floatNum (({fractional_constant}{exponent_part}?)|({digit}+{exponent_part}))
x {double}
y {double}
z {double}
value {double}
x {floatNum}
y {floatNum}
z {floatNum}
value {floatNum}
node ^{space}"N"{cspace}
element ^{space}"EN"{cspace}

View File

@ -1,6 +1,7 @@
EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/conversion/lnInclude
-I$(LIB_SRC)/conversion/lnInclude \
-I$(LIB_SRC)/fileFormats/lnInclude
EXE_LIBS = \
-lconversion

View File

@ -95,24 +95,14 @@ int yyFlexLexer::yywrap()
one_space [ \t\f\r]
space {one_space}*
some_space {one_space}+
cspace ","{space}
spaceNl ({space}|\n)*
alpha [_[:alpha:]]
digit [[:digit:]]
dec_digit [[:digit:]]
octal_digit [0-7]
hex_digit [[:xdigit:]]
lbrac "("
rbrac ")"
quote \"
dash "-"
dotColonDash [.:-]
dotColonDash [.:-]
identifier {alpha}({alpha}|{digit})*
integer {dec_digit}+
label [0-9]{dec_digit}*
label [0-9]{digit}*
zeroLabel {digit}*
word ({alpha}|{digit}|{dotColonDash})*
@ -120,14 +110,14 @@ word ({alpha}|{digit}|{dotColonDash})*
exponent_part [eE][-+]?{digit}+
fractional_constant [-+]?(({digit}*"."{digit}+)|({digit}+"."?))
double ((({fractional_constant}{exponent_part}?)|({digit}+{exponent_part}))|0)
floatNum ((({fractional_constant}{exponent_part}?)|({digit}+{exponent_part}))|0)
x {floatNum}
y {floatNum}
z {floatNum}
x {double}
y {double}
z {double}
scalar {double}
labelListElement {space}{zeroLabel}
scalarListElement {space}{double}
scalarListElement {space}{floatNum}
labelList ({labelListElement}+{space})
scalarList ({scalarListElement}+{space})

View File

@ -1,6 +1,7 @@
EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/conversion/lnInclude
-I$(LIB_SRC)/conversion/lnInclude \
-I$(LIB_SRC)/fileFormats/lnInclude
EXE_LIBS = \
-lconversion

View File

@ -1,15 +1,17 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
READLINE=0
if [ -f /usr/include/readline/readline.h ]
then
echo "Found readline/readline.h -- enabling readline support."
READLINE=1
export READLINE=1
export READLINELINK="-lreadline -lncurses"
break
else
# no readline/readline.h -- disabling readline support
export READLINE=0
unset READLINELINK
fi
export READLINE
wmake
# ----------------------------------------------------------------- end-of-file

View File

@ -1,5 +1,7 @@
/* NB: trailing zero after define improves robustness */
EXE_INC = \
-DREADLINE=$(READLINE) \
-DREADLINE=$(READLINE)0 \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \

View File

@ -440,7 +440,7 @@ int main(int argc, char *argv[])
(
databases[procI].findInstance
(
regionDir / polyMesh::meshSubDir,
regionDir/polyMesh::meshSubDir,
"points"
)
);
@ -469,10 +469,10 @@ int main(int argc, char *argv[])
"points",
databases[procI].findInstance
(
regionDir / polyMesh::meshSubDir,
regionDir/polyMesh::meshSubDir,
"points"
),
regionDir / polyMesh::meshSubDir,
regionDir/polyMesh::meshSubDir,
databases[procI],
IOobject::MUST_READ,
IOobject::NO_WRITE,

View File

@ -82,6 +82,19 @@
</Documentation>
</IntVectorProperty>
<!-- Use VTK Polyhedron check-box -->
<IntVectorProperty
name="UseVTKPolyhedron"
command="SetUseVTKPolyhedron"
number_of_elements="1"
default_values="0"
animateable="0">
<BooleanDomain name="bool"/>
<Documentation>
Use vtkPolyhedron instead of decomposing polyhedra
</Documentation>
</IntVectorProperty>
<!-- Include Sets check-box -->
<IntVectorProperty
name="UiIncludeSets"

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2009-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2010-2009 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -83,6 +83,7 @@ vtkPV3FoamReader::vtkPV3FoamReader()
SkipZeroTime = 0;
ExtrapolatePatches = 0;
UseVTKPolyhedron = 0;
IncludeSets = 0;
IncludeZones = 0;
ShowPatchNames = 0;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2008-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -102,6 +102,11 @@ public:
vtkSetMacro(ExtrapolatePatches, int);
vtkGetMacro(ExtrapolatePatches, int);
// Description:
// FOAM use vtkPolyhedron instead of decomposing polyhedra
vtkSetMacro(UseVTKPolyhedron, int);
vtkGetMacro(UseVTKPolyhedron, int);
// Description:
// FOAM read sets control
virtual void SetIncludeSets(int);
@ -217,6 +222,7 @@ private:
int SkipZeroTime;
int ExtrapolatePatches;
int UseVTKPolyhedron;
int IncludeSets;
int IncludeZones;
int ShowPatchNames;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -0,0 +1,72 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd.
\\/ 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 2 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, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
InClass
vtkPV3Foam
\*---------------------------------------------------------------------------*/
#ifndef vtkOpenFOAMTupleRemap_H
#define vtkOpenFOAMTupleRemap_H
// OpenFOAM includes
#include "StaticAssert.H"
#include "Swap.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
inline void vtkOpenFOAMTupleRemap(float vec[]);
// a symmTensor specialization to remap OpenFOAM -> ParaView naming order
// Qt/Core/pqScalarBarRepresentation.cxx defines this order
// { "XX", "YY", "ZZ", "XY", "YZ", "XZ" }
// in pqScalarBarRepresentation::getDefaultComponentLabel()
// whereas OpenFOAM uses this order
// { XX, XY, XZ, YY, YZ, ZZ }
//
// for extra safety, assert that symmTensor indeed has 6 components
StaticAssert(Foam::symmTensor::nComponents == 6);
// Template specialization for symmTensor
template<>
inline void vtkOpenFOAMTupleRemap<Foam::symmTensor>(float vec[])
{
Foam::Swap(vec[1], vec[3]); // swap XY <-> YY
Foam::Swap(vec[2], vec[5]); // swap XZ <-> ZZ
}
template<class Type>
inline void vtkOpenFOAMTupleRemap(float vec[])
{}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -36,6 +36,8 @@ InClass
#include "vtkMultiBlockDataSet.h"
#include "vtkPolyData.h"
#include "vtkOpenFOAMTupleRemap.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
@ -80,7 +82,7 @@ void Foam::vtkPV3Foam::convertFaceField
{
Type t = 0.5*(tf[faceOwner[faceNo]] + tf[faceNeigh[faceNo]]);
for (direction d=0; d<nComp; d++)
for (direction d=0; d<nComp; ++d)
{
vec[d] = component(t, d);
}
@ -88,11 +90,12 @@ void Foam::vtkPV3Foam::convertFaceField
else
{
const Type& t = tf[faceOwner[faceNo]];
for (direction d=0; d<nComp; d++)
for (direction d=0; d<nComp; ++d)
{
vec[d] = component(t, d);
}
}
vtkOpenFOAMTupleRemap<Type>(vec);
cellData->InsertTuple(faceI, vec);
}
@ -152,7 +155,7 @@ void Foam::vtkPV3Foam::convertFaceField
{
Type t = 0.5*(tf[faceOwner[faceNo]] + tf[faceNeigh[faceNo]]);
for (direction d=0; d<nComp; d++)
for (direction d=0; d<nComp; ++d)
{
vec[d] = component(t, d);
}
@ -160,11 +163,12 @@ void Foam::vtkPV3Foam::convertFaceField
else
{
const Type& t = tf[faceOwner[faceNo]];
for (direction d=0; d<nComp; d++)
for (direction d=0; d<nComp; ++d)
{
vec[d] = component(t, d);
}
}
vtkOpenFOAMTupleRemap<Type>(vec);
cellData->InsertTuple(faceI, vec);
++faceI;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -32,6 +32,8 @@ InClass
#include "Cloud.H"
#include "vtkOpenFOAMTupleRemap.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
@ -86,10 +88,11 @@ void Foam::vtkPV3Foam::convertLagrangianField
forAll(tf, i)
{
const Type& t = tf[i];
for (direction d=0; d<nComp; d++)
for (direction d=0; d<nComp; ++d)
{
vec[d] = component(t, d);
}
vtkOpenFOAMTupleRemap<Type>(vec);
pointData->InsertTuple(i, vec);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,6 +25,7 @@ License
\*---------------------------------------------------------------------------*/
#include "vtkPV3Foam.H"
#include "vtkPV3FoamReader.h"
// Foam includes
#include "fvMesh.H"
@ -33,6 +34,7 @@ License
// VTK includes
#include "vtkCellArray.h"
#include "vtkIdTypeArray.h"
#include "vtkUnstructuredGrid.h"
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
@ -79,35 +81,40 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
{
Info<< "... scanning" << endl;
}
forAll(cellShapes, cellI)
// count number of cells to decompose
if (!reader_->GetUseVTKPolyhedron())
{
const cellModel& model = cellShapes[cellI].model();
if
(
model != hex
&& model != wedge
&& model != prism
&& model != pyr
&& model != tet
&& model != tetWedge
)
forAll(cellShapes, cellI)
{
const cell& cFaces = mesh.cells()[cellI];
const cellModel& model = cellShapes[cellI].model();
forAll(cFaces, cFaceI)
if
(
model != hex
&& model != wedge
&& model != prism
&& model != pyr
&& model != tet
&& model != tetWedge
)
{
const face& f = mesh.faces()[cFaces[cFaceI]];
const cell& cFaces = mesh.cells()[cellI];
label nFacePoints = f.size();
forAll(cFaces, cFaceI)
{
const face& f = mesh.faces()[cFaces[cFaceI]];
label nQuads = (nFacePoints - 2)/2;
label nTris = (nFacePoints - 2)%2;
nAddCells += nQuads + nTris;
label nFacePoints = f.size();
label nQuads = (nFacePoints - 2)/2;
label nTris = (nFacePoints - 2)%2;
nAddCells += nQuads + nTris;
}
nAddCells--;
nAddPoints++;
}
nAddCells--;
nAddPoints++;
}
}
@ -155,7 +162,7 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
// Set counters for additional points and additional cells
label addPointI = 0, addCellI = 0;
// Create storage for points - needed for mapping from Foam to VTK
// Create storage for points - needed for mapping from OpenFOAM to VTK
// data types - max 'order' = hex = 8 points
vtkIdType nodeIds[8];
@ -194,10 +201,15 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
}
else if (cellModel == prism)
{
for (int j = 0; j < 6; j++)
{
nodeIds[j] = cellShape[j];
}
// VTK has a different node order - their triangles point outwards!
nodeIds[0] = cellShape[0];
nodeIds[1] = cellShape[2];
nodeIds[2] = cellShape[1];
nodeIds[3] = cellShape[3];
nodeIds[4] = cellShape[5];
nodeIds[5] = cellShape[4];
vtkmesh->InsertNextCell
(
VTK_WEDGE,
@ -256,6 +268,80 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
nodeIds
);
}
else if (reader_->GetUseVTKPolyhedron())
{
// Polyhedral cell - use VTK_POLYHEDRON
const labelList& cFaces = mesh.cells()[cellI];
vtkIdType nFaces = cFaces.size();
vtkIdType nodeCount = 0;
vtkIdType nLabels = nFaces;
// count size for face stream
forAll(cFaces, cFaceI)
{
const face& f = mesh.faces()[cFaces[cFaceI]];
nLabels += f.size();
}
// unique node ids - approximately equal to the number of point ids
DynamicList<vtkIdType> uniqueNodeIds(nLabels-nFaces);
// zero-based index into uniqueNodeIds
DynamicList<vtkIdType> faceLabels(nLabels);
// localized point id within the cell
Map<label> mapLocalId(2*nLabels);
// establish the unique point ids,
// record the local mapping ids,
// create new face list
forAll(cFaces, cFaceI)
{
const face& f = mesh.faces()[cFaces[cFaceI]];
const label nFacePoints = f.size();
// number of labels for this face
faceLabels.append(nFacePoints);
forAll(f, fp)
{
const label nodeId = f[fp];
if (mapLocalId.insert(nodeId, nodeCount))
{
// insertion was successful (node Id was unique)
uniqueNodeIds.append(nodeId);
// map orig vertex id -> localized point label
faceLabels.append(nodeCount);
++nodeCount;
}
else
{
// map orig vertex id -> localized point label
faceLabels.append(mapLocalId[nodeId]);
}
}
}
#ifdef HAS_VTK_POLYHEDRON
vtkmesh->InsertNextCell
(
VTK_POLYHEDRON,
nodeCount,
uniqueNodeIds.data(),
faceCount,
faceLabels.data()
);
#else
vtkmesh->InsertNextCell
(
VTK_CONVEX_POINT_SET,
nodeCount,
uniqueNodeIds.data()
);
#endif
}
else
{
// Polyhedral cell. Decompose into tets + prisms.

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -37,6 +37,8 @@ InClass
#include "vtkPointData.h"
#include "vtkPolyData.h"
#include "vtkOpenFOAMTupleRemap.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
@ -61,10 +63,12 @@ void Foam::vtkPV3Foam::convertPatchField
forAll(ptf, i)
{
const Type& t = ptf[i];
for (direction d=0; d<nComp; d++)
for (direction d=0; d<nComp; ++d)
{
vec[d] = component(t, d);
}
vtkOpenFOAMTupleRemap<Type>(vec);
cellData->InsertTuple(i, vec);
}
@ -101,10 +105,11 @@ void Foam::vtkPV3Foam::convertPatchPointField
forAll(pptf, i)
{
const Type& t = pptf[i];
for (direction d=0; d<nComp; d++)
for (direction d=0; d<nComp; ++d)
{
vec[d] = component(t, d);
}
vtkOpenFOAMTupleRemap<Type>(vec);
pointData->InsertTuple(i, vec);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,6 +33,8 @@ InClass
// Foam includes
#include "interpolatePointToCell.H"
#include "vtkOpenFOAMTupleRemap.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
@ -210,10 +212,12 @@ void Foam::vtkPV3Foam::convertPointField
forAll(pointMap, i)
{
const Type& t = ptf[pointMap[i]];
for (direction d=0; d<nComp; d++)
for (direction d=0; d<nComp; ++d)
{
vec[d] = component(t, d);
}
vtkOpenFOAMTupleRemap<Type>(vec);
pointData->InsertTuple(i, vec);
}
}
@ -222,10 +226,12 @@ void Foam::vtkPV3Foam::convertPointField
forAll(ptf, i)
{
const Type& t = ptf[i];
for (direction d=0; d<nComp; d++)
for (direction d=0; d<nComp; ++d)
{
vec[d] = component(t, d);
}
vtkOpenFOAMTupleRemap<Type>(vec);
pointData->InsertTuple(i, vec);
}
}
@ -238,10 +244,12 @@ void Foam::vtkPV3Foam::convertPointField
forAll(addPointCellLabels, apI)
{
const Type& t = tf[addPointCellLabels[apI]];
for (direction d=0; d<nComp; d++)
for (direction d=0; d<nComp; ++d)
{
vec[d] = component(t, d);
}
vtkOpenFOAMTupleRemap<Type>(vec);
pointData->InsertTuple(i++, vec);
}
}
@ -250,10 +258,12 @@ void Foam::vtkPV3Foam::convertPointField
forAll(addPointCellLabels, apI)
{
Type t = interpolatePointToCell(ptf, addPointCellLabels[apI]);
for (direction d=0; d<nComp; d++)
for (direction d=0; d<nComp; ++d)
{
vec[d] = component(t, d);
}
vtkOpenFOAMTupleRemap<Type>(vec);
pointData->InsertTuple(i++, vec);
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
\\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -39,6 +39,8 @@ InClass
#include "vtkPV3FoamFaceField.H"
#include "vtkPV3FoamPatchField.H"
#include "vtkOpenFOAMTupleRemap.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
@ -350,10 +352,12 @@ void Foam::vtkPV3Foam::convertVolField
forAll(superCells, i)
{
const Type& t = tf[superCells[i]];
for (direction d=0; d<nComp; d++)
for (direction d=0; d<nComp; ++d)
{
vec[d] = component(t, d);
}
vtkOpenFOAMTupleRemap<Type>(vec);
celldata->InsertTuple(i, vec);
}