mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: additional vtk::Tools methods for handling faces, points etc.
- includes initial relocation of low-level vtu handling. Extracted, refactored from the Catalyst function object.
This commit is contained in:
committed by
Andrew Heather
parent
966fc4c503
commit
ff54ef8299
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2005-2010, 2017 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
@ -251,13 +251,11 @@ int Foam::vtkPVFoam::setTime(const std::vector<double>& requestTimes)
|
||||
updateInfo();
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> setTime() - selectedTime="
|
||||
<< Times[nearestIndex].name() << " index=" << timeIndex_
|
||||
<< "/" << Times.size()
|
||||
<< " meshUpdateState=" << updateStateName(meshState_) << nl;
|
||||
}
|
||||
DebugInfo
|
||||
<< "<end> setTime() - selectedTime="
|
||||
<< Times[nearestIndex].name() << " index=" << timeIndex_
|
||||
<< "/" << Times.size()
|
||||
<< " meshUpdateState=" << updateStateName(meshState_) << nl;
|
||||
|
||||
return nearestIndex;
|
||||
}
|
||||
@ -376,13 +374,11 @@ Foam::vtkPVFoam::vtkPVFoam
|
||||
}
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "fullCasePath=" << fullCasePath << nl
|
||||
<< "FOAM_CASE=" << getEnv("FOAM_CASE") << nl
|
||||
<< "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << nl
|
||||
<< "region=" << meshRegion_ << nl;
|
||||
}
|
||||
DebugInfo
|
||||
<< "fullCasePath=" << fullCasePath << nl
|
||||
<< "FOAM_CASE=" << getEnv("FOAM_CASE") << nl
|
||||
<< "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << nl
|
||||
<< "region=" << meshRegion_ << nl;
|
||||
|
||||
// Create time object
|
||||
dbPtr_.reset
|
||||
@ -405,10 +401,7 @@ Foam::vtkPVFoam::vtkPVFoam
|
||||
|
||||
Foam::vtkPVFoam::~vtkPVFoam()
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "~vtkPVFoam" << nl;
|
||||
}
|
||||
DebugInfo << "~vtkPVFoam" << nl;
|
||||
|
||||
delete volMeshPtr_;
|
||||
delete areaMeshPtr_;
|
||||
@ -419,13 +412,11 @@ Foam::vtkPVFoam::~vtkPVFoam()
|
||||
|
||||
void Foam::vtkPVFoam::updateInfo()
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> updateInfo"
|
||||
<< " [volMeshPtr=" << (volMeshPtr_ ? "set" : "nullptr")
|
||||
<< "] timeIndex="
|
||||
<< timeIndex_ << nl;
|
||||
}
|
||||
DebugInfo
|
||||
<< "<beg> updateInfo"
|
||||
<< " [volMeshPtr=" << (volMeshPtr_ ? "set" : "nullptr")
|
||||
<< "] timeIndex="
|
||||
<< timeIndex_ << nl;
|
||||
|
||||
resetCounters();
|
||||
|
||||
@ -475,10 +466,7 @@ void Foam::vtkPVFoam::updateInfo()
|
||||
// Lagrangian fields - includes save/restore of selected
|
||||
updateInfoLagrangianFields(reader_->GetLagrangianFieldSelection());
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> updateInfo" << nl;
|
||||
}
|
||||
DebugInfo << "<end> updateInfo" << nl;
|
||||
}
|
||||
|
||||
|
||||
@ -584,11 +572,9 @@ void Foam::vtkPVFoam::Update
|
||||
// Check to see if the OpenFOAM mesh has been created
|
||||
if (!volMeshPtr_)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Creating OpenFOAM mesh for region " << meshRegion_
|
||||
<< " at time=" << dbPtr_().timeName() << nl;
|
||||
}
|
||||
DebugInfo
|
||||
<< "Creating OpenFOAM mesh for region " << meshRegion_
|
||||
<< " at time=" << dbPtr_().timeName() << nl;
|
||||
|
||||
volMeshPtr_ = new fvMesh
|
||||
(
|
||||
@ -605,10 +591,7 @@ void Foam::vtkPVFoam::Update
|
||||
}
|
||||
else
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Using existing OpenFOAM mesh" << nl;
|
||||
}
|
||||
DebugInfo << "Using existing OpenFOAM mesh" << nl;
|
||||
}
|
||||
|
||||
if (rangeArea_.intersects(selectedPartIds_))
|
||||
@ -684,10 +667,7 @@ void Foam::vtkPVFoam::Update
|
||||
rangeClouds_
|
||||
);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "done reader part" << nl << nl;
|
||||
}
|
||||
DebugInfo << "done reader part" << nl << nl;
|
||||
reader_->UpdateProgress(0.95);
|
||||
|
||||
meshState_ = polyMesh::UNCHANGED;
|
||||
@ -902,19 +882,14 @@ void Foam::vtkPVFoam::renderPatchNames
|
||||
displayZoneI += min(MAXPATCHZONES, nZones[patchi]);
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "displayed zone centres = " << displayZoneI << nl
|
||||
<< "zones per patch = " << nZones << nl;
|
||||
}
|
||||
DebugInfo
|
||||
<< "displayed zone centres = " << displayZoneI << nl
|
||||
<< "zones per patch = " << nZones << nl;
|
||||
|
||||
// Set the size of the patch labels to max number of zones
|
||||
patchTextActors_.setSize(displayZoneI);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "constructing patch labels" << nl;
|
||||
}
|
||||
DebugInfo << "constructing patch labels" << nl;
|
||||
|
||||
// Actor index
|
||||
displayZoneI = 0;
|
||||
@ -934,12 +909,10 @@ void Foam::vtkPVFoam::renderPatchNames
|
||||
label globalZoneI = 0;
|
||||
for (label i = 0; i < nDisplayZones; ++i, globalZoneI += increment)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "patch name = " << pp.name() << nl
|
||||
<< "anchor = " << zoneCentre[patchi][globalZoneI] << nl
|
||||
<< "globalZoneI = " << globalZoneI << nl;
|
||||
}
|
||||
DebugInfo
|
||||
<< "patch name = " << pp.name() << nl
|
||||
<< "anchor = " << zoneCentre[patchi][globalZoneI] << nl
|
||||
<< "globalZoneI = " << globalZoneI << nl;
|
||||
|
||||
// Into a list for later removal
|
||||
patchTextActors_[displayZoneI++] = createTextActor
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2005-2010, 2017-2019 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
@ -74,13 +74,7 @@ SourceFiles
|
||||
#include "PrimitivePatchInterpolation.H"
|
||||
#include "volPointInterpolation.H"
|
||||
#include "foamPvCore.H"
|
||||
#include "foamVtkTools.H"
|
||||
#include "foamVtkMeshMaps.H"
|
||||
|
||||
#include "vtkPoints.h"
|
||||
#include "vtkPolyData.h"
|
||||
#include "vtkSmartPointer.h"
|
||||
#include "vtkUnstructuredGrid.h"
|
||||
#include "foamVtkVtuAdaptor.H"
|
||||
|
||||
// * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * //
|
||||
|
||||
@ -89,7 +83,6 @@ class vtkDataArraySelection;
|
||||
class vtkDataSet;
|
||||
class vtkFloatArray;
|
||||
class vtkIndent;
|
||||
class vtkMultiBlockDataSet;
|
||||
class vtkPVFoamReader;
|
||||
class vtkRenderer;
|
||||
class vtkTextActor;
|
||||
@ -99,7 +92,7 @@ class vtkTextActor;
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// OpenFOAM class forward declarations
|
||||
// Forward declarations (OpenFOAM)
|
||||
class argList;
|
||||
class Time;
|
||||
class faMesh;
|
||||
@ -133,35 +126,13 @@ class vtkPVFoam
|
||||
//- Bookkeeping for vtkUnstructuredGrid
|
||||
struct foamVtuData
|
||||
:
|
||||
public vtk::Caching<vtkUnstructuredGrid>,
|
||||
public foamVtkMeshMaps
|
||||
public vtk::vtuAdaptor
|
||||
{
|
||||
//- The vtk points for the mesh (and decomposition)
|
||||
vtkSmartPointer<vtkPoints> points
|
||||
(
|
||||
const fvMesh& mesh
|
||||
) const;
|
||||
|
||||
//- The vtk points for the mesh (and decomposition),
|
||||
//- using the provided pointMap
|
||||
vtkSmartPointer<vtkPoints> points
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const labelUList& pointMap
|
||||
) const;
|
||||
|
||||
//- Internal mesh as vtkUnstructuredGrid
|
||||
vtkSmartPointer<vtkUnstructuredGrid> internal
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const bool decompPoly
|
||||
);
|
||||
|
||||
//- Subsetted mesh as vtkUnstructuredGrid
|
||||
vtkSmartPointer<vtkUnstructuredGrid> subset
|
||||
(
|
||||
const fvMeshSubset& subsetter,
|
||||
const bool decompPoly
|
||||
bool decompPoly = false
|
||||
);
|
||||
};
|
||||
|
||||
@ -348,14 +319,6 @@ class vtkPVFoam
|
||||
const labelUList& faceLabels
|
||||
) const;
|
||||
|
||||
//- Volume field
|
||||
template<class Type>
|
||||
vtkSmartPointer<vtkFloatArray> convertVolFieldToVTK
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& fld,
|
||||
const foamVtuData& vtuData
|
||||
) const;
|
||||
|
||||
|
||||
//- Convert finite volume fields
|
||||
void convertVolFields();
|
||||
|
||||
@ -68,8 +68,7 @@ void Foam::vtkPVFoam::convertVolField
|
||||
autoPtr<GeometricField<Type, pointPatchField, pointMesh>> ptfPtr;
|
||||
if (interpField)
|
||||
{
|
||||
DebugInfo
|
||||
<< "convertVolField interpolating:" << fld.name() << nl;
|
||||
DebugInfo << "convertVolField interpolating:" << fld.name() << nl;
|
||||
|
||||
ptfPtr.reset
|
||||
(
|
||||
@ -415,22 +414,17 @@ void Foam::vtkPVFoam::convertVolFieldBlock
|
||||
foamVtuData& vtuData = iter.val();
|
||||
auto dataset = vtuData.dataset;
|
||||
|
||||
vtkSmartPointer<vtkFloatArray> cdata = convertVolFieldToVTK
|
||||
dataset->GetCellData()->AddArray
|
||||
(
|
||||
fld,
|
||||
vtuData
|
||||
vtuData.convertField(fld)
|
||||
);
|
||||
dataset->GetCellData()->AddArray(cdata);
|
||||
|
||||
if (ptfPtr.valid())
|
||||
{
|
||||
vtkSmartPointer<vtkFloatArray> pdata = convertPointField
|
||||
dataset->GetPointData()->AddArray
|
||||
(
|
||||
ptfPtr(),
|
||||
fld,
|
||||
vtuData
|
||||
convertPointField(*ptfPtr, fld, vtuData)
|
||||
);
|
||||
dataset->GetPointData()->AddArray(pdata);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -547,8 +541,7 @@ void Foam::vtkPVFoam::convertPointFields
|
||||
continue;
|
||||
}
|
||||
|
||||
DebugInfo
|
||||
<< "convertPointFields : " << fieldName << nl;
|
||||
DebugInfo << "convertPointFields : " << fieldName << nl;
|
||||
|
||||
// Throw FatalError, FatalIOError as exceptions
|
||||
const bool throwingError = FatalError.throwExceptions();
|
||||
@ -899,40 +892,6 @@ Foam::vtkPVFoam::convertFaceFieldToVTK
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
vtkSmartPointer<vtkFloatArray>
|
||||
Foam::vtkPVFoam::convertVolFieldToVTK
|
||||
(
|
||||
const GeometricField<Type, fvPatchField, volMesh>& fld,
|
||||
const foamVtuData& vtuData
|
||||
) const
|
||||
{
|
||||
const labelUList& cellMap = vtuData.cellMap();
|
||||
|
||||
auto data = vtkSmartPointer<vtkFloatArray>::New();
|
||||
data->SetName(fld.name().c_str());
|
||||
data->SetNumberOfComponents(static_cast<int>(pTraits<Type>::nComponents));
|
||||
data->SetNumberOfTuples(cellMap.size());
|
||||
|
||||
DebugInfo
|
||||
<< "Convert volField: " << fld.name() << " size="
|
||||
<< cellMap.size() << " (field "
|
||||
<< fld.size() << ") nComp="
|
||||
<< static_cast<int>(pTraits<Type>::nComponents) << nl;
|
||||
|
||||
float scratch[pTraits<Type>::nComponents];
|
||||
|
||||
vtkIdType celli = 0;
|
||||
for (const label meshCelli : cellMap)
|
||||
{
|
||||
vtk::Tools::foamToVtkTuple(scratch, fld[meshCelli]);
|
||||
data->SetTuple(celli++, scratch);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2005-2010, 2017-2019 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
@ -130,10 +130,7 @@ void Foam::vtkPVFoam::convertPointFields()
|
||||
|
||||
if (selectedFields.empty())
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "no point fields selected" << nl;
|
||||
}
|
||||
DebugInfo << "no point fields selected" << nl;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2005-2010, 2017-2018 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
@ -69,19 +69,13 @@ void Foam::vtkPVFoam::convertMeshVolume()
|
||||
{
|
||||
if (meshState_ == polyMesh::UNCHANGED)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "reuse " << longName << nl;
|
||||
}
|
||||
DebugInfo << "reuse " << longName << nl;
|
||||
vtuData.reuse(); // reuse
|
||||
continue;
|
||||
}
|
||||
else if (meshState_ == polyMesh::POINTS_MOVED)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "move points " << longName << nl;
|
||||
}
|
||||
DebugInfo << "move points " << longName << nl;
|
||||
vtkgeom = vtuData.getCopy();
|
||||
vtkgeom->SetPoints(vtuData.points(mesh));
|
||||
}
|
||||
@ -163,10 +157,7 @@ void Foam::vtkPVFoam::convertMeshPatches()
|
||||
if (meshState_ == polyMesh::UNCHANGED)
|
||||
{
|
||||
// Without movement is easy.
|
||||
if (debug)
|
||||
{
|
||||
Info<< "reuse " << longName << nl;
|
||||
}
|
||||
DebugInfo << "reuse " << longName << nl;
|
||||
vtpData.reuse();
|
||||
continue;
|
||||
}
|
||||
@ -196,11 +187,9 @@ void Foam::vtkPVFoam::convertMeshPatches()
|
||||
const labelList& patchIds =
|
||||
patches.groupPatchIDs().lookup(partName, labelList());
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Creating VTK mesh for patches [" << patchIds <<"] "
|
||||
<< longName << nl;
|
||||
}
|
||||
DebugInfo
|
||||
<< "Creating VTK mesh for patches [" << patchIds <<"] "
|
||||
<< longName << nl;
|
||||
|
||||
// Store good patch ids as additionalIds
|
||||
vtpData.additionalIds().reserve(patchIds.size());
|
||||
@ -250,11 +239,9 @@ void Foam::vtkPVFoam::convertMeshPatches()
|
||||
|
||||
const label patchId = patches.findPatchID(partName);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Creating VTK mesh for patch [" << patchId <<"] "
|
||||
<< partName << nl;
|
||||
}
|
||||
DebugInfo
|
||||
<< "Creating VTK mesh for patch [" << patchId <<"] "
|
||||
<< partName << nl;
|
||||
|
||||
if (patchId >= 0)
|
||||
{
|
||||
@ -324,19 +311,13 @@ void Foam::vtkPVFoam::convertMeshArea()
|
||||
// {
|
||||
// if (meshState_ == polyMesh::UNCHANGED)
|
||||
// {
|
||||
// if (debug)
|
||||
// {
|
||||
// Info<< "reuse " << longName << nl;
|
||||
// }
|
||||
// DebugInfo << "reuse " << longName << nl;
|
||||
// vtpData.reuse(); // reuse
|
||||
// continue;
|
||||
// }
|
||||
// else if (meshState_ == polyMesh::POINTS_MOVED)
|
||||
// {
|
||||
// if (debug)
|
||||
// {
|
||||
// Info<< "move points " << longName << nl;
|
||||
// }
|
||||
// DebugInfo << "move points " << longName << nl;
|
||||
// vtkgeom = vtpData.getCopy();
|
||||
// vtkgeom->SetPoints(movePoints(mesh, vtpData));
|
||||
// }
|
||||
@ -392,11 +373,9 @@ void Foam::vtkPVFoam::convertMeshCellZones()
|
||||
continue;
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Creating VTK mesh for cellZone[" << zoneId << "] "
|
||||
<< zoneName << nl;
|
||||
}
|
||||
DebugInfo
|
||||
<< "Creating VTK mesh for cellZone[" << zoneId << "] "
|
||||
<< zoneName << nl;
|
||||
|
||||
foamVtuData& vtuData = cachedVtu_(longName);
|
||||
|
||||
@ -405,19 +384,13 @@ void Foam::vtkPVFoam::convertMeshCellZones()
|
||||
{
|
||||
if (meshState_ == polyMesh::UNCHANGED)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "reuse " << longName << nl;
|
||||
}
|
||||
DebugInfo << "reuse " << longName << nl;
|
||||
vtuData.reuse();
|
||||
continue;
|
||||
}
|
||||
else if (meshState_ == polyMesh::POINTS_MOVED)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "move points " << longName << nl;
|
||||
}
|
||||
DebugInfo << "move points " << longName << nl;
|
||||
vtkgeom = vtuData.getCopy();
|
||||
vtkgeom->SetPoints(vtuData.points(mesh, vtuData.pointMap()));
|
||||
}
|
||||
@ -459,10 +432,7 @@ void Foam::vtkPVFoam::convertMeshCellSets()
|
||||
const auto& longName = selectedPartIds_[partId];
|
||||
const word partName = getFoamName(longName);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Creating VTK mesh for cellSet=" << partName << nl;
|
||||
}
|
||||
DebugInfo << "Creating VTK mesh for cellSet=" << partName << nl;
|
||||
|
||||
foamVtuData& vtuData = cachedVtu_(longName);
|
||||
|
||||
@ -471,19 +441,13 @@ void Foam::vtkPVFoam::convertMeshCellSets()
|
||||
{
|
||||
if (meshState_ == polyMesh::UNCHANGED)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "reuse " << longName << nl;
|
||||
}
|
||||
DebugInfo << "reuse " << longName << nl;
|
||||
vtuData.reuse();
|
||||
continue;
|
||||
}
|
||||
else if (meshState_ == polyMesh::POINTS_MOVED)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "move points " << longName << nl;
|
||||
}
|
||||
DebugInfo << "move points " << longName << nl;
|
||||
vtkgeom = vtuData.getCopy();
|
||||
vtkgeom->SetPoints(vtuData.points(mesh, vtuData.pointMap()));
|
||||
}
|
||||
@ -536,11 +500,9 @@ void Foam::vtkPVFoam::convertMeshFaceZones()
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Creating VTKmesh for faceZone[" << zoneId << "] "
|
||||
<< zoneName << nl;
|
||||
}
|
||||
DebugInfo
|
||||
<< "Creating VTKmesh for faceZone[" << zoneId << "] "
|
||||
<< zoneName << nl;
|
||||
|
||||
foamVtpData& vtpData = cachedVtp_(longName);
|
||||
|
||||
@ -550,10 +512,7 @@ void Foam::vtkPVFoam::convertMeshFaceZones()
|
||||
if (meshState_ == polyMesh::UNCHANGED)
|
||||
{
|
||||
// Without movement is easy.
|
||||
if (debug)
|
||||
{
|
||||
Info<<"reuse " << longName << nl;
|
||||
}
|
||||
DebugInfo <<"reuse " << longName << nl;
|
||||
vtpData.reuse();
|
||||
continue;
|
||||
}
|
||||
@ -600,10 +559,7 @@ void Foam::vtkPVFoam::convertMeshFaceSets()
|
||||
const auto& longName = selectedPartIds_[partId];
|
||||
const word partName = getFoamName(longName);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Creating VTK mesh for faceSet=" << partName << nl;
|
||||
}
|
||||
DebugInfo << "Creating VTK mesh for faceSet=" << partName << nl;
|
||||
|
||||
foamVtpData& vtpData = cachedVtp_(longName);
|
||||
|
||||
@ -613,10 +569,7 @@ void Foam::vtkPVFoam::convertMeshFaceSets()
|
||||
if (meshState_ == polyMesh::UNCHANGED)
|
||||
{
|
||||
// Without movement is easy.
|
||||
if (debug)
|
||||
{
|
||||
Info<<"reuse " << longName << nl;
|
||||
}
|
||||
DebugInfo <<"reuse " << longName << nl;
|
||||
vtpData.reuse();
|
||||
continue;
|
||||
}
|
||||
@ -700,19 +653,13 @@ void Foam::vtkPVFoam::convertMeshPointZones()
|
||||
{
|
||||
if (meshState_ == polyMesh::UNCHANGED)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "reusing " << longName << nl;
|
||||
}
|
||||
DebugInfo << "reusing " << longName << nl;
|
||||
vtpData.reuse();
|
||||
continue;
|
||||
}
|
||||
else if (meshState_ == polyMesh::POINTS_MOVED)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "move points " << longName << nl;
|
||||
}
|
||||
DebugInfo << "move points " << longName << nl;
|
||||
vtkgeom = vtpData.getCopy();
|
||||
}
|
||||
}
|
||||
@ -772,19 +719,13 @@ void Foam::vtkPVFoam::convertMeshPointSets()
|
||||
{
|
||||
if (meshState_ == polyMesh::UNCHANGED)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "reusing " << longName << nl;
|
||||
}
|
||||
DebugInfo << "reusing " << longName << nl;
|
||||
vtpData.reuse();
|
||||
continue;
|
||||
}
|
||||
else if (meshState_ == polyMesh::POINTS_MOVED)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "move points " << longName << nl;
|
||||
}
|
||||
DebugInfo << "move points " << longName << nl;
|
||||
vtkgeom = vtpData.getCopy();
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2017-2018 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2008-2011, 2017-2018 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
@ -73,10 +73,7 @@ vtkSmartPointer<vtkPolyData> Foam::vtkPVFoam::lagrangianVTKMesh
|
||||
{
|
||||
Cloud<passiveParticle> parcels(mesh, cloudName, false);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "cloud with " << parcels.size() << " parcels" << nl;
|
||||
}
|
||||
DebugInfo << "cloud with " << parcels.size() << " parcels" << nl;
|
||||
|
||||
auto vtkpoints = vtkSmartPointer<vtkPoints>::New();
|
||||
vtkpoints->SetNumberOfPoints(parcels.size());
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016-2018 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -24,198 +24,23 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "vtkPVFoam.H"
|
||||
#include "vtkPVFoamReader.h"
|
||||
|
||||
// OpenFOAM includes
|
||||
#include "fvMesh.H"
|
||||
#include "fvMeshSubset.H"
|
||||
#include "foamVtkTools.H"
|
||||
#include "foamVtuSizing.H"
|
||||
|
||||
// VTK includes
|
||||
#include <vtkUnstructuredGrid.h>
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
vtkSmartPointer<vtkPoints> Foam::vtkPVFoam::foamVtuData::points
|
||||
(
|
||||
const fvMesh& mesh
|
||||
) const
|
||||
{
|
||||
// Convert OpenFOAM mesh vertices to VTK
|
||||
auto vtkpoints = vtkSmartPointer<vtkPoints>::New();
|
||||
|
||||
// Normal points
|
||||
const pointField& pts = mesh.points();
|
||||
|
||||
// Additional cell centres
|
||||
const labelUList& addPoints = this->additionalIds();
|
||||
|
||||
vtkpoints->SetNumberOfPoints(pts.size() + addPoints.size());
|
||||
|
||||
// Normal points
|
||||
vtkIdType pointId = 0;
|
||||
for (const point& p : pts)
|
||||
{
|
||||
vtkpoints->SetPoint(pointId++, p.v_);
|
||||
}
|
||||
|
||||
// Cell centres
|
||||
for (const label meshCelli : addPoints)
|
||||
{
|
||||
vtkpoints->SetPoint(pointId++, mesh.cellCentres()[meshCelli].v_);
|
||||
}
|
||||
|
||||
return vtkpoints;
|
||||
}
|
||||
|
||||
|
||||
vtkSmartPointer<vtkPoints> Foam::vtkPVFoam::foamVtuData::points
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const labelUList& pointMap
|
||||
) const
|
||||
{
|
||||
// Convert OpenFOAM mesh vertices to VTK
|
||||
auto vtkpoints = vtkSmartPointer<vtkPoints>::New();
|
||||
|
||||
// Normal points
|
||||
const pointField& pts = mesh.points();
|
||||
|
||||
// Additional cell centres
|
||||
const labelUList& addPoints = this->additionalIds();
|
||||
|
||||
vtkpoints->SetNumberOfPoints(pointMap.size() + addPoints.size());
|
||||
|
||||
// Normal points
|
||||
vtkIdType pointId = 0;
|
||||
for (const label meshPointi : pointMap)
|
||||
{
|
||||
vtkpoints->SetPoint(pointId++, pts[meshPointi].v_);
|
||||
}
|
||||
|
||||
// Cell centres
|
||||
for (const label meshCelli : addPoints)
|
||||
{
|
||||
vtkpoints->SetPoint(pointId++, mesh.cellCentres()[meshCelli].v_);
|
||||
}
|
||||
|
||||
return vtkpoints;
|
||||
}
|
||||
|
||||
|
||||
vtkSmartPointer<vtkUnstructuredGrid> Foam::vtkPVFoam::foamVtuData::internal
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const bool decompPoly
|
||||
)
|
||||
{
|
||||
vtk::vtuSizing sizing(mesh, decompPoly);
|
||||
|
||||
auto cellTypes = vtkSmartPointer<vtkUnsignedCharArray>::New();
|
||||
|
||||
auto cells = vtkSmartPointer<vtkCellArray>::New();
|
||||
auto faces = vtkSmartPointer<vtkIdTypeArray>::New();
|
||||
|
||||
auto cellLocations = vtkSmartPointer<vtkIdTypeArray>::New();
|
||||
auto faceLocations = vtkSmartPointer<vtkIdTypeArray>::New();
|
||||
|
||||
UList<uint8_t> cellTypesUL =
|
||||
vtk::Tools::asUList
|
||||
(
|
||||
cellTypes,
|
||||
sizing.nFieldCells()
|
||||
);
|
||||
|
||||
UList<vtkIdType> cellsUL =
|
||||
vtk::Tools::asUList
|
||||
(
|
||||
cells,
|
||||
sizing.nFieldCells(),
|
||||
sizing.sizeInternal(vtk::vtuSizing::slotType::CELLS)
|
||||
);
|
||||
|
||||
UList<vtkIdType> cellLocationsUL =
|
||||
vtk::Tools::asUList
|
||||
(
|
||||
cellLocations,
|
||||
sizing.sizeInternal(vtk::vtuSizing::slotType::CELLS_OFFSETS)
|
||||
);
|
||||
|
||||
UList<vtkIdType> facesUL =
|
||||
vtk::Tools::asUList
|
||||
(
|
||||
faces,
|
||||
sizing.sizeInternal(vtk::vtuSizing::slotType::FACES)
|
||||
);
|
||||
|
||||
UList<vtkIdType> faceLocationsUL =
|
||||
vtk::Tools::asUList
|
||||
(
|
||||
faceLocations,
|
||||
sizing.sizeInternal(vtk::vtuSizing::slotType::FACES_OFFSETS)
|
||||
);
|
||||
|
||||
|
||||
sizing.populateInternal
|
||||
(
|
||||
mesh,
|
||||
cellTypesUL,
|
||||
cellsUL,
|
||||
cellLocationsUL,
|
||||
facesUL,
|
||||
faceLocationsUL,
|
||||
static_cast<foamVtkMeshMaps&>(*this)
|
||||
);
|
||||
|
||||
auto vtkmesh = vtkSmartPointer<vtkUnstructuredGrid>::New();
|
||||
|
||||
// Convert OpenFOAM mesh vertices to VTK
|
||||
// - can only do this *after* populating the decompInfo with cell-ids
|
||||
// for any additional points (ie, mesh cell-centres)
|
||||
vtkmesh->SetPoints(this->points(mesh));
|
||||
|
||||
if (facesUL.size())
|
||||
{
|
||||
vtkmesh->SetCells
|
||||
(
|
||||
cellTypes,
|
||||
cellLocations,
|
||||
cells,
|
||||
faceLocations,
|
||||
faces
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
vtkmesh->SetCells
|
||||
(
|
||||
cellTypes,
|
||||
cellLocations,
|
||||
cells,
|
||||
nullptr,
|
||||
nullptr
|
||||
);
|
||||
}
|
||||
|
||||
return vtkmesh;
|
||||
}
|
||||
|
||||
|
||||
vtkSmartPointer<vtkUnstructuredGrid> Foam::vtkPVFoam::foamVtuData::subset
|
||||
(
|
||||
const fvMeshSubset& subsetter,
|
||||
const bool decompPoly
|
||||
bool decompPoly
|
||||
)
|
||||
{
|
||||
vtkSmartPointer<vtkUnstructuredGrid> vtkmesh =
|
||||
this->internal(subsetter.subMesh(), decompPoly);
|
||||
auto vtkmesh = internal(subsetter.subMesh(), decompPoly);
|
||||
|
||||
// Convert cellMap, addPointCellLabels to global cell ids
|
||||
this->renumberCells(subsetter.cellMap());
|
||||
renumberCells(subsetter.cellMap());
|
||||
|
||||
// Copy pointMap as well, otherwise pointFields fail
|
||||
this->pointMap() = subsetter.pointMap();
|
||||
pointMap() = subsetter.pointMap();
|
||||
|
||||
return vtkmesh;
|
||||
}
|
||||
|
||||
@ -148,20 +148,14 @@ void Foam::vtkPVFoam::updateInfoInternalMesh
|
||||
vtkDataArraySelection* select
|
||||
)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> " << FUNCTION_NAME << nl;
|
||||
}
|
||||
DebugInfo << "<beg> " << FUNCTION_NAME << nl;
|
||||
|
||||
// Determine mesh parts (internalMesh, patches...)
|
||||
// Add internal mesh as first entry
|
||||
rangeVolume_.reset(select->GetNumberOfArrays(), 1);
|
||||
select->AddArray("internalMesh");
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> " << FUNCTION_NAME << nl;
|
||||
}
|
||||
DebugInfo << "<end> " << FUNCTION_NAME << nl;
|
||||
}
|
||||
|
||||
|
||||
@ -170,10 +164,7 @@ void Foam::vtkPVFoam::updateInfoAreaMesh
|
||||
vtkDataArraySelection* select
|
||||
)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> " << FUNCTION_NAME << nl;
|
||||
}
|
||||
DebugInfo << "<beg> " << FUNCTION_NAME << nl;
|
||||
|
||||
rangeArea_.reset(select->GetNumberOfArrays(), 0);
|
||||
|
||||
@ -198,10 +189,7 @@ void Foam::vtkPVFoam::updateInfoAreaMesh
|
||||
select->AddArray("areaMesh");
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> " << FUNCTION_NAME << nl;
|
||||
}
|
||||
DebugInfo << "<end> " << FUNCTION_NAME << nl;
|
||||
}
|
||||
|
||||
|
||||
@ -210,11 +198,9 @@ void Foam::vtkPVFoam::updateInfoLagrangian
|
||||
vtkDataArraySelection* select
|
||||
)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> " << FUNCTION_NAME << nl
|
||||
<< " " << dbPtr_->timePath()/cloud::prefix << nl;
|
||||
}
|
||||
DebugInfo
|
||||
<< "<beg> " << FUNCTION_NAME << nl
|
||||
<< " " << dbPtr_->timePath()/cloud::prefix << nl;
|
||||
|
||||
// Use the db directly since this might be called without a mesh,
|
||||
// but the region must get added back in
|
||||
@ -245,10 +231,7 @@ void Foam::vtkPVFoam::updateInfoLagrangian
|
||||
rangeClouds_.reset(select->GetNumberOfArrays());
|
||||
rangeClouds_ += addToArray(select, "lagrangian/", names.sortedToc());
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> " << FUNCTION_NAME << nl;
|
||||
}
|
||||
DebugInfo << "<end> " << FUNCTION_NAME << nl;
|
||||
}
|
||||
|
||||
|
||||
@ -258,11 +241,9 @@ void Foam::vtkPVFoam::updateInfoPatches
|
||||
HashSet<string>& enabledEntries
|
||||
)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> " << FUNCTION_NAME
|
||||
<< " [volMeshPtr=" << (volMeshPtr_ ? "set" : "null") << "]" << nl;
|
||||
}
|
||||
DebugInfo
|
||||
<< "<beg> " << FUNCTION_NAME
|
||||
<< " [volMeshPtr=" << (volMeshPtr_ ? "set" : "null") << "]" << nl;
|
||||
|
||||
rangePatches_.reset(select->GetNumberOfArrays());
|
||||
|
||||
@ -436,10 +417,7 @@ void Foam::vtkPVFoam::updateInfoPatches
|
||||
}
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> " << FUNCTION_NAME << nl;
|
||||
}
|
||||
DebugInfo << "<end> " << FUNCTION_NAME << nl;
|
||||
}
|
||||
|
||||
|
||||
@ -453,11 +431,9 @@ void Foam::vtkPVFoam::updateInfoZones
|
||||
return;
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> " << FUNCTION_NAME
|
||||
<< " [volMeshPtr=" << (volMeshPtr_ ? "set" : "null") << "]" << nl;
|
||||
}
|
||||
DebugInfo
|
||||
<< "<beg> " << FUNCTION_NAME
|
||||
<< " [volMeshPtr=" << (volMeshPtr_ ? "set" : "null") << "]" << nl;
|
||||
|
||||
// cellZones
|
||||
{
|
||||
@ -498,10 +474,7 @@ void Foam::vtkPVFoam::updateInfoZones
|
||||
rangePointZones_ += addToArray(select, "pointZone/", names);
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> " << FUNCTION_NAME << nl;
|
||||
}
|
||||
DebugInfo << "<end> " << FUNCTION_NAME << nl;
|
||||
}
|
||||
|
||||
|
||||
@ -515,10 +488,7 @@ void Foam::vtkPVFoam::updateInfoSets
|
||||
return;
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> " << FUNCTION_NAME << nl;
|
||||
}
|
||||
DebugInfo << "<beg> " << FUNCTION_NAME << nl;
|
||||
|
||||
// Add names of sets. Search for last time directory with a sets
|
||||
// subdirectory. Take care not to search beyond the last mesh.
|
||||
@ -540,11 +510,9 @@ void Foam::vtkPVFoam::updateInfoSets
|
||||
|
||||
const IOobjectList objects(dbPtr_(), setsInstance, meshDir_/"sets");
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< " updateInfoSets read "
|
||||
<< objects.names() << " from " << setsInstance << nl;
|
||||
}
|
||||
DebugInfo
|
||||
<< " updateInfoSets read "
|
||||
<< objects.names() << " from " << setsInstance << nl;
|
||||
|
||||
|
||||
rangeCellSets_.reset(select->GetNumberOfArrays());
|
||||
@ -571,10 +539,7 @@ void Foam::vtkPVFoam::updateInfoSets
|
||||
objects
|
||||
);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> " << FUNCTION_NAME << nl;
|
||||
}
|
||||
DebugInfo << "<end> " << FUNCTION_NAME << nl;
|
||||
}
|
||||
|
||||
|
||||
@ -583,10 +548,7 @@ void Foam::vtkPVFoam::updateInfoContinuumFields
|
||||
vtkDataArraySelection* select
|
||||
)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> " << FUNCTION_NAME << nl;
|
||||
}
|
||||
DebugInfo << "<beg> " << FUNCTION_NAME << nl;
|
||||
|
||||
// Preserve the enabled selections
|
||||
HashSet<string> enabled;
|
||||
@ -618,10 +580,7 @@ void Foam::vtkPVFoam::updateInfoContinuumFields
|
||||
|
||||
setSelectedArrayEntries(select, enabled); // Adjust/restore selected
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> " << FUNCTION_NAME << nl;
|
||||
}
|
||||
DebugInfo << "<end> " << FUNCTION_NAME << nl;
|
||||
}
|
||||
|
||||
|
||||
@ -630,10 +589,7 @@ void Foam::vtkPVFoam::updateInfoPointFields
|
||||
vtkDataArraySelection* select
|
||||
)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> " << FUNCTION_NAME << nl;
|
||||
}
|
||||
DebugInfo << "<beg> " << FUNCTION_NAME << nl;
|
||||
|
||||
// Preserve the enabled selections
|
||||
HashSet<string> enabled = getSelectedArraySet(select);
|
||||
@ -655,10 +611,7 @@ void Foam::vtkPVFoam::updateInfoPointFields
|
||||
|
||||
setSelectedArrayEntries(select, enabled); // Adjust/restore selected
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> " << FUNCTION_NAME << nl;
|
||||
}
|
||||
DebugInfo << "<end> " << FUNCTION_NAME << nl;
|
||||
}
|
||||
|
||||
|
||||
@ -667,10 +620,7 @@ void Foam::vtkPVFoam::updateInfoLagrangianFields
|
||||
vtkDataArraySelection* select
|
||||
)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> " << FUNCTION_NAME << nl;
|
||||
}
|
||||
DebugInfo << "<beg> " << FUNCTION_NAME << nl;
|
||||
|
||||
// Preserve the enabled selections
|
||||
HashSet<string> enabled = getSelectedArraySet(select);
|
||||
@ -733,10 +683,7 @@ void Foam::vtkPVFoam::updateInfoLagrangianFields
|
||||
// Restore the enabled selections
|
||||
setSelectedArrayEntries(select, enabled);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> " << FUNCTION_NAME << nl;
|
||||
}
|
||||
DebugInfo << "<end> " << FUNCTION_NAME << nl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2016-2019 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
| Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
@ -40,13 +40,11 @@ void Foam::vtkPVFoam::updateInfoFields
|
||||
const IOobjectList& objects
|
||||
)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> updateInfoFields <"
|
||||
<< meshType::Mesh::typeName
|
||||
<< "> [volMeshPtr=" << (volMeshPtr_ ? "set" : "null") << "]"
|
||||
<< nl;
|
||||
}
|
||||
DebugInfo
|
||||
<< "<beg> updateInfoFields <"
|
||||
<< meshType::Mesh::typeName
|
||||
<< "> [volMeshPtr=" << (volMeshPtr_ ? "set" : "null") << "]"
|
||||
<< nl;
|
||||
|
||||
// Add geometric fields (volume/area) to GUI
|
||||
addToSelection<GeometricField<scalar, patchType, meshType>>
|
||||
@ -102,10 +100,7 @@ void Foam::vtkPVFoam::updateInfoFields
|
||||
objects
|
||||
);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> updateInfoFields" << nl;
|
||||
}
|
||||
DebugInfo << "<end> updateInfoFields" << nl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -101,11 +101,9 @@ void Foam::vtkPVblockMesh::updateInfoBlocks
|
||||
vtkDataArraySelection* select
|
||||
)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> updateInfoBlocks"
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "null") << "]" << endl;
|
||||
}
|
||||
DebugInfo
|
||||
<< "<beg> updateInfoBlocks"
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "null") << "]" << endl;
|
||||
|
||||
rangeBlocks_.reset(select->GetNumberOfArrays());
|
||||
|
||||
@ -132,10 +130,7 @@ void Foam::vtkPVblockMesh::updateInfoBlocks
|
||||
++rangeBlocks_;
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> updateInfoBlocks" << endl;
|
||||
}
|
||||
DebugInfo << "<end> updateInfoBlocks" << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -144,11 +139,9 @@ void Foam::vtkPVblockMesh::updateInfoEdges
|
||||
vtkDataArraySelection* select
|
||||
)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> updateInfoEdges"
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "null") << "]" << endl;
|
||||
}
|
||||
DebugInfo
|
||||
<< "<beg> updateInfoEdges"
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "null") << "]" << endl;
|
||||
|
||||
rangeEdges_.reset(select->GetNumberOfArrays());
|
||||
|
||||
@ -168,10 +161,7 @@ void Foam::vtkPVblockMesh::updateInfoEdges
|
||||
++rangeEdges_;
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> updateInfoEdges" << endl;
|
||||
}
|
||||
DebugInfo << "<end> updateInfoEdges" << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -192,10 +182,7 @@ Foam::vtkPVblockMesh::vtkPVblockMesh
|
||||
rangeEdges_("edges"),
|
||||
rangeCorners_("corners")
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "vtkPVblockMesh - " << FileName << endl;
|
||||
}
|
||||
DebugInfo << "vtkPVblockMesh - " << FileName << endl;
|
||||
|
||||
// avoid argList and get rootPath/caseName directly from the file
|
||||
fileName fullCasePath(fileName(FileName).path());
|
||||
@ -256,12 +243,10 @@ Foam::vtkPVblockMesh::vtkPVblockMesh
|
||||
}
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "fullCasePath=" << fullCasePath << nl
|
||||
<< "FOAM_CASE=" << getEnv("FOAM_CASE") << nl
|
||||
<< "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << endl;
|
||||
}
|
||||
DebugInfo
|
||||
<< "fullCasePath=" << fullCasePath << nl
|
||||
<< "FOAM_CASE=" << getEnv("FOAM_CASE") << nl
|
||||
<< "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << endl;
|
||||
|
||||
// Create time object
|
||||
dbPtr_.reset
|
||||
@ -284,10 +269,7 @@ Foam::vtkPVblockMesh::vtkPVblockMesh
|
||||
|
||||
Foam::vtkPVblockMesh::~vtkPVblockMesh()
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "~vtkPVblockMesh" << endl;
|
||||
}
|
||||
DebugInfo << "~vtkPVblockMesh" << endl;
|
||||
|
||||
delete meshPtr_;
|
||||
}
|
||||
@ -297,11 +279,9 @@ Foam::vtkPVblockMesh::~vtkPVblockMesh()
|
||||
|
||||
void Foam::vtkPVblockMesh::updateInfo()
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> updateInfo"
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "null") << "] " << endl;
|
||||
}
|
||||
DebugInfo
|
||||
<< "<beg> updateInfo"
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "null") << "] " << endl;
|
||||
|
||||
resetCounters();
|
||||
|
||||
@ -339,19 +319,13 @@ void Foam::vtkPVblockMesh::updateInfo()
|
||||
setSelectedArrayEntries(edgeSelection, enabledEdges);
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> updateInfo" << endl;
|
||||
}
|
||||
DebugInfo << "<end> updateInfo" << endl;
|
||||
}
|
||||
|
||||
|
||||
void Foam::vtkPVblockMesh::updateFoamMesh()
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> updateFoamMesh" << endl;
|
||||
}
|
||||
DebugInfo << "<beg> updateFoamMesh" << endl;
|
||||
|
||||
// Check to see if the OpenFOAM mesh has been created
|
||||
if (!meshPtr_)
|
||||
@ -398,10 +372,7 @@ void Foam::vtkPVblockMesh::updateFoamMesh()
|
||||
}
|
||||
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> updateFoamMesh" << endl;
|
||||
}
|
||||
DebugInfo << "<end> updateFoamMesh" << endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -51,10 +51,7 @@ void Foam::vtkPVblockMesh::convertMeshBlocks
|
||||
int& blockNo
|
||||
)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> convertMeshBlocks" << endl;
|
||||
}
|
||||
DebugInfo << "<beg> convertMeshBlocks" << endl;
|
||||
|
||||
const Map<string> blockStatus = getSelectedArrayMap
|
||||
(
|
||||
@ -118,10 +115,7 @@ void Foam::vtkPVblockMesh::convertMeshBlocks
|
||||
++blockNo;
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> convertMeshBlocks" << endl;
|
||||
}
|
||||
DebugInfo << "<end> convertMeshBlocks" << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -220,11 +214,7 @@ void Foam::vtkPVblockMesh::convertMeshEdges
|
||||
++blockNo;
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> convertMeshEdges" << endl;
|
||||
}
|
||||
|
||||
DebugInfo << "<end> convertMeshEdges" << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -240,10 +230,7 @@ void Foam::vtkPVblockMesh::convertMeshCorners
|
||||
|
||||
const pointField blkPoints(meshPtr_->vertices() * meshPtr_->scaleFactor());
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> " << FUNCTION_NAME << endl;
|
||||
}
|
||||
DebugInfo << "<beg> " << FUNCTION_NAME << endl;
|
||||
|
||||
if (true) // Or some flag or other condition
|
||||
{
|
||||
@ -270,10 +257,7 @@ void Foam::vtkPVblockMesh::convertMeshCorners
|
||||
++blockNo;
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> " << FUNCTION_NAME << endl;
|
||||
}
|
||||
DebugInfo << "<end> " << FUNCTION_NAME << endl;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user