Commit aec1bace authored by Mark Olesen's avatar Mark Olesen
Browse files

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!
parent 824e5eeb
......@@ -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,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment