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