mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: use volume field name for interpolated fields
- avoids things like "volPointInterpolate(U)", but will likely cause issues when used together with identically named Lagrangian fields!
This commit is contained in:
@ -594,20 +594,22 @@ class vtkPV3Foam
|
||||
vtkMultiBlockDataSet* output
|
||||
);
|
||||
|
||||
//- Point field - all selected parts
|
||||
//- Point field - all selected parts, use specified display name
|
||||
template<class Type>
|
||||
void convertPointFieldBlock
|
||||
(
|
||||
const word& displayName,
|
||||
const GeometricField<Type, pointPatchField, pointMesh>&,
|
||||
vtkMultiBlockDataSet* output,
|
||||
const arrayRange&,
|
||||
const List<polyDecomp>&
|
||||
);
|
||||
|
||||
//- Point fields
|
||||
//- Point field, use specified display name
|
||||
template<class Type>
|
||||
void convertPointField
|
||||
(
|
||||
const word& displayName,
|
||||
const GeometricField<Type, pointPatchField, pointMesh>&,
|
||||
const GeometricField<Type, fvPatchField, volMesh>&,
|
||||
vtkMultiBlockDataSet* output,
|
||||
@ -616,11 +618,11 @@ class vtkPV3Foam
|
||||
const polyDecomp&
|
||||
);
|
||||
|
||||
//- Patch point field
|
||||
//- Patch point field, use specified display name
|
||||
template<class Type>
|
||||
void convertPatchPointField
|
||||
(
|
||||
const word& name,
|
||||
const word& displayName,
|
||||
const Field<Type>&,
|
||||
vtkMultiBlockDataSet* output,
|
||||
const arrayRange&,
|
||||
|
||||
@ -76,6 +76,7 @@ void Foam::vtkPV3Foam::convertPointFields
|
||||
// Convert activated internalMesh regions
|
||||
convertPointFieldBlock
|
||||
(
|
||||
fieldName,
|
||||
ptf,
|
||||
output,
|
||||
arrayRangeVolume_,
|
||||
@ -85,6 +86,7 @@ void Foam::vtkPV3Foam::convertPointFields
|
||||
// Convert activated cellZones
|
||||
convertPointFieldBlock
|
||||
(
|
||||
fieldName,
|
||||
ptf,
|
||||
output,
|
||||
arrayRangeCellZones_,
|
||||
@ -94,6 +96,7 @@ void Foam::vtkPV3Foam::convertPointFields
|
||||
// Convert activated cellSets
|
||||
convertPointFieldBlock
|
||||
(
|
||||
fieldName,
|
||||
ptf,
|
||||
output,
|
||||
arrayRangeCellSets_,
|
||||
@ -136,6 +139,7 @@ void Foam::vtkPV3Foam::convertPointFields
|
||||
template<class Type>
|
||||
void Foam::vtkPV3Foam::convertPointFieldBlock
|
||||
(
|
||||
const word& displayName,
|
||||
const GeometricField<Type, pointPatchField, pointMesh>& ptf,
|
||||
vtkMultiBlockDataSet* output,
|
||||
const arrayRange& range,
|
||||
@ -150,6 +154,7 @@ void Foam::vtkPV3Foam::convertPointFieldBlock
|
||||
{
|
||||
convertPointField
|
||||
(
|
||||
displayName,
|
||||
ptf,
|
||||
GeometricField<Type, fvPatchField, volMesh>::null(),
|
||||
output,
|
||||
@ -165,6 +170,7 @@ void Foam::vtkPV3Foam::convertPointFieldBlock
|
||||
template<class Type>
|
||||
void Foam::vtkPV3Foam::convertPointField
|
||||
(
|
||||
const word& displayName,
|
||||
const GeometricField<Type, pointPatchField, pointMesh>& ptf,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& tf,
|
||||
vtkMultiBlockDataSet* output,
|
||||
@ -192,7 +198,7 @@ void Foam::vtkPV3Foam::convertPointField
|
||||
pointData->SetNumberOfTuples(nPoints + addPointCellLabels.size());
|
||||
pointData->SetNumberOfComponents(nComp);
|
||||
pointData->Allocate(nComp*(nPoints + addPointCellLabels.size()));
|
||||
pointData->SetName(ptf.name().c_str());
|
||||
pointData->SetName(displayName.c_str());
|
||||
|
||||
if (debug)
|
||||
{
|
||||
|
||||
@ -113,8 +113,7 @@ void Foam::vtkPV3Foam::convertVolFields
|
||||
|
||||
// The name for the interpolated patch point field must be consistent
|
||||
// with the interpolated volume point field.
|
||||
// This could be done better.
|
||||
const word pointFldName = "volPointInterpolate(" + tf.name() + ')';
|
||||
const word& pointFldName = tf.name();
|
||||
|
||||
for
|
||||
(
|
||||
@ -276,21 +275,14 @@ void Foam::vtkPV3Foam::convertVolFieldBlock
|
||||
const List<polyDecomp>& decompLst
|
||||
)
|
||||
{
|
||||
const word& pointFldName = tf.name();
|
||||
|
||||
for (int partId = range.start(); partId < range.end(); ++partId)
|
||||
{
|
||||
const label datasetNo = partDataset_[partId];
|
||||
|
||||
if (datasetNo >= 0 && partStatus_[partId])
|
||||
{
|
||||
convertVolField
|
||||
(
|
||||
tf,
|
||||
output,
|
||||
range,
|
||||
datasetNo,
|
||||
decompLst[datasetNo]
|
||||
);
|
||||
|
||||
if (!ptfPtr.valid())
|
||||
{
|
||||
if (debug)
|
||||
@ -305,8 +297,18 @@ void Foam::vtkPV3Foam::convertVolFieldBlock
|
||||
);
|
||||
}
|
||||
|
||||
convertVolField
|
||||
(
|
||||
tf,
|
||||
output,
|
||||
range,
|
||||
datasetNo,
|
||||
decompLst[datasetNo]
|
||||
);
|
||||
|
||||
convertPointField
|
||||
(
|
||||
pointFldName,
|
||||
ptfPtr(),
|
||||
tf,
|
||||
output,
|
||||
|
||||
Reference in New Issue
Block a user