mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
demand driven volPointInterpolation
This commit is contained in:
@ -60,10 +60,12 @@ SourceFiles
|
||||
|
||||
#include "className.H"
|
||||
#include "fileName.H"
|
||||
#include "volPointInterpolation.H"
|
||||
#include "stringList.H"
|
||||
#include "wordList.H"
|
||||
#include "primitivePatch.H"
|
||||
#include "PrimitivePatchInterpolation.H"
|
||||
#include "volFields.H"
|
||||
#include "pointFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * //
|
||||
|
||||
@ -491,7 +493,6 @@ class vtkPV3Foam
|
||||
void convertVolFields
|
||||
(
|
||||
const fvMesh&,
|
||||
const volPointInterpolation&,
|
||||
const PtrList<PrimitivePatchInterpolation<primitivePatch> >&,
|
||||
const IOobjectList&,
|
||||
vtkMultiBlockDataSet* output
|
||||
@ -502,7 +503,7 @@ class vtkPV3Foam
|
||||
void convertVolFieldBlock
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>&,
|
||||
const GeometricField<Type, pointPatchField, pointMesh>&,
|
||||
autoPtr<GeometricField<Type, pointPatchField, pointMesh> >&,
|
||||
vtkMultiBlockDataSet* output,
|
||||
const partInfo& selector,
|
||||
const List<polyDecomp>& decompLst
|
||||
|
||||
@ -106,8 +106,6 @@ void Foam::vtkPV3Foam::convertVolFields
|
||||
printMemory();
|
||||
}
|
||||
|
||||
// Construct interpolation on the raw mesh
|
||||
volPointInterpolation pInterp(mesh);
|
||||
|
||||
PtrList<PrimitivePatchInterpolation<primitivePatch> >
|
||||
ppInterpList(mesh.boundaryMesh().size());
|
||||
@ -127,23 +125,23 @@ void Foam::vtkPV3Foam::convertVolFields
|
||||
|
||||
convertVolFields<scalar>
|
||||
(
|
||||
mesh, pInterp, ppInterpList, objects, output
|
||||
mesh, ppInterpList, objects, output
|
||||
);
|
||||
convertVolFields<vector>
|
||||
(
|
||||
mesh, pInterp, ppInterpList, objects, output
|
||||
mesh, ppInterpList, objects, output
|
||||
);
|
||||
convertVolFields<sphericalTensor>
|
||||
(
|
||||
mesh, pInterp, ppInterpList, objects, output
|
||||
mesh, ppInterpList, objects, output
|
||||
);
|
||||
convertVolFields<symmTensor>
|
||||
(
|
||||
mesh, pInterp, ppInterpList, objects, output
|
||||
mesh, ppInterpList, objects, output
|
||||
);
|
||||
convertVolFields<tensor>
|
||||
(
|
||||
mesh, pInterp, ppInterpList, objects, output
|
||||
mesh, ppInterpList, objects, output
|
||||
);
|
||||
|
||||
if (debug)
|
||||
|
||||
@ -34,6 +34,8 @@ InClass
|
||||
#include "emptyFvPatchField.H"
|
||||
#include "wallPolyPatch.H"
|
||||
#include "faceSet.H"
|
||||
#include "volPointInterpolation.H"
|
||||
|
||||
#include "vtkPV3FoamFaceField.H"
|
||||
#include "vtkPV3FoamPatchField.H"
|
||||
|
||||
@ -43,7 +45,6 @@ template<class Type>
|
||||
void Foam::vtkPV3Foam::convertVolFields
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const volPointInterpolation& pInterp,
|
||||
const PtrList<PrimitivePatchInterpolation<primitivePatch> >& ppInterpList,
|
||||
const IOobjectList& objects,
|
||||
vtkMultiBlockDataSet* output
|
||||
@ -63,23 +64,22 @@ void Foam::vtkPV3Foam::convertVolFields
|
||||
continue;
|
||||
}
|
||||
|
||||
// Load field
|
||||
GeometricField<Type, fvPatchField, volMesh> tf
|
||||
(
|
||||
*iter(),
|
||||
mesh
|
||||
);
|
||||
|
||||
tmp<GeometricField<Type, pointPatchField, pointMesh> > tptf
|
||||
(
|
||||
pInterp.interpolate(tf)
|
||||
);
|
||||
// Interpolated field (demand driven)
|
||||
autoPtr<GeometricField<Type, pointPatchField, pointMesh> > ptfPtr;
|
||||
|
||||
|
||||
// Convert activated internalMesh regions
|
||||
convertVolFieldBlock
|
||||
(
|
||||
tf,
|
||||
tptf(),
|
||||
ptfPtr,
|
||||
output,
|
||||
partInfoVolume_,
|
||||
regionPolyDecomp_
|
||||
@ -89,7 +89,7 @@ void Foam::vtkPV3Foam::convertVolFields
|
||||
convertVolFieldBlock
|
||||
(
|
||||
tf,
|
||||
tptf(),
|
||||
ptfPtr,
|
||||
output,
|
||||
partInfoCellZones_,
|
||||
zonePolyDecomp_
|
||||
@ -99,7 +99,7 @@ void Foam::vtkPV3Foam::convertVolFields
|
||||
convertVolFieldBlock
|
||||
(
|
||||
tf,
|
||||
tptf(),
|
||||
ptfPtr,
|
||||
output,
|
||||
partInfoCellSets_,
|
||||
csetPolyDecomp_
|
||||
@ -258,46 +258,60 @@ void Foam::vtkPV3Foam::convertVolFields
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::vtkPV3Foam::convertVolFieldBlock
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& tf,
|
||||
const GeometricField<Type, pointPatchField, pointMesh>& ptf,
|
||||
autoPtr<GeometricField<Type, pointPatchField, pointMesh> >& ptfPtr,
|
||||
vtkMultiBlockDataSet* output,
|
||||
const partInfo& selector,
|
||||
const List<polyDecomp>& decompLst
|
||||
)
|
||||
{
|
||||
for (int partId = selector.start(); partId < selector.end(); ++partId)
|
||||
{
|
||||
const label datasetNo = partDataset_[partId];
|
||||
for (int partId = selector.start(); partId < selector.end(); ++partId)
|
||||
{
|
||||
const label datasetNo = partDataset_[partId];
|
||||
|
||||
if (datasetNo >= 0 && partStatus_[partId])
|
||||
{
|
||||
convertVolField
|
||||
(
|
||||
tf,
|
||||
output,
|
||||
selector,
|
||||
datasetNo,
|
||||
decompLst[datasetNo]
|
||||
);
|
||||
if (datasetNo >= 0 && partStatus_[partId])
|
||||
{
|
||||
convertVolField
|
||||
(
|
||||
tf,
|
||||
output,
|
||||
selector,
|
||||
datasetNo,
|
||||
decompLst[datasetNo]
|
||||
);
|
||||
|
||||
convertPointField
|
||||
(
|
||||
ptf,
|
||||
tf,
|
||||
output,
|
||||
selector,
|
||||
datasetNo,
|
||||
decompLst[datasetNo]
|
||||
);
|
||||
}
|
||||
}
|
||||
if (!ptfPtr.valid())
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "convertVolFieldBlock interpolating:" << tf.name()
|
||||
<< endl;
|
||||
}
|
||||
|
||||
ptfPtr.reset
|
||||
(
|
||||
volPointInterpolation::New(tf.mesh()).interpolate(tf).ptr()
|
||||
);
|
||||
}
|
||||
|
||||
convertPointField
|
||||
(
|
||||
ptfPtr(),
|
||||
tf,
|
||||
output,
|
||||
selector,
|
||||
datasetNo,
|
||||
decompLst[datasetNo]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
template<class Type>
|
||||
void Foam::vtkPV3Foam::convertVolField
|
||||
(
|
||||
|
||||
Reference in New Issue
Block a user