paraFoam: Added support to read vol internal fields
This is useful to visualise sources which are created as volScalarField::Internal, e.g. the turbulence generation term for models like kEpsilon in which it is named kEpsilon:G.
This commit is contained in:
@ -118,7 +118,7 @@ int Foam::vtkPVFoam::setTime(int nRequest, const double requestTimes[])
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::setTime(";
|
InfoInFunction<< endl << " (";
|
||||||
for (int requestI = 0; requestI < nRequest; ++requestI)
|
for (int requestI = 0; requestI < nRequest; ++requestI)
|
||||||
{
|
{
|
||||||
if (requestI)
|
if (requestI)
|
||||||
@ -133,13 +133,13 @@ int Foam::vtkPVFoam::setTime(int nRequest, const double requestTimes[])
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// see what has changed
|
// See what has changed
|
||||||
if (timeIndex_ != nearestIndex)
|
if (timeIndex_ != nearestIndex)
|
||||||
{
|
{
|
||||||
timeIndex_ = nearestIndex;
|
timeIndex_ = nearestIndex;
|
||||||
runTime.setTime(Times[nearestIndex], nearestIndex);
|
runTime.setTime(Times[nearestIndex], nearestIndex);
|
||||||
|
|
||||||
// the fields change each time
|
// The fields change each time
|
||||||
fieldsChanged_ = true;
|
fieldsChanged_ = true;
|
||||||
|
|
||||||
if (meshPtr_)
|
if (meshPtr_)
|
||||||
@ -157,7 +157,7 @@ int Foam::vtkPVFoam::setTime(int nRequest, const double requestTimes[])
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<end> Foam::vtkPVFoam::setTime() - selectedTime="
|
Info<< " selectedTime="
|
||||||
<< Times[nearestIndex].name() << " index=" << timeIndex_
|
<< Times[nearestIndex].name() << " index=" << timeIndex_
|
||||||
<< "/" << Times.size()
|
<< "/" << Times.size()
|
||||||
<< " meshChanged=" << Switch(meshChanged_)
|
<< " meshChanged=" << Switch(meshChanged_)
|
||||||
@ -172,7 +172,7 @@ void Foam::vtkPVFoam::updateMeshPartsStatus()
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::updateMeshPartsStatus" << endl;
|
InfoInFunction << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
vtkDataArraySelection* selection = reader_->GetPartSelection();
|
vtkDataArraySelection* selection = reader_->GetPartSelection();
|
||||||
@ -185,7 +185,7 @@ void Foam::vtkPVFoam::updateMeshPartsStatus()
|
|||||||
meshChanged_ = true;
|
meshChanged_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// this needs fixing if we wish to re-use the datasets
|
// This needs fixing if we wish to re-use the datasets
|
||||||
partDataset_.setSize(nElem);
|
partDataset_.setSize(nElem);
|
||||||
partDataset_ = -1;
|
partDataset_ = -1;
|
||||||
|
|
||||||
@ -202,15 +202,11 @@ void Foam::vtkPVFoam::updateMeshPartsStatus()
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< " part[" << partId << "] = "
|
Info<< " part[" << partId << "] = "
|
||||||
<< partStatus_[partId]
|
<< partStatus_[partId]
|
||||||
<< " : " << selection->GetArrayName(partId) << endl;
|
<< " : " << selection->GetArrayName(partId) << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Info<< "<end> Foam::vtkPVFoam::updateMeshPartsStatus" << endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -242,13 +238,13 @@ Foam::vtkPVFoam::vtkPVFoam
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "Foam::vtkPVFoam::vtkPVFoam - " << vtkFileName << endl;
|
InfoInFunction << vtkFileName << endl;
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
fileName FileName(vtkFileName);
|
fileName FileName(vtkFileName);
|
||||||
|
|
||||||
// avoid argList and get rootPath/caseName directly from the file
|
// Avoid argList and get rootPath/caseName directly from the file
|
||||||
fileName fullCasePath(FileName.path());
|
fileName fullCasePath(FileName.path());
|
||||||
|
|
||||||
if (!isDir(fullCasePath))
|
if (!isDir(fullCasePath))
|
||||||
@ -286,7 +282,7 @@ Foam::vtkPVFoam::vtkPVFoam
|
|||||||
setEnv("FOAM_CASENAME", fullCasePath.name(), true);
|
setEnv("FOAM_CASENAME", fullCasePath.name(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// look for 'case{region}.OpenFOAM'
|
// Look for 'case{region}.OpenFOAM'
|
||||||
// could be stringent and insist the prefix match the directory name...
|
// could be stringent and insist the prefix match the directory name...
|
||||||
// Note: cannot use fileName::name() due to the embedded '{}'
|
// Note: cannot use fileName::name() due to the embedded '{}'
|
||||||
string caseName(FileName.lessExt());
|
string caseName(FileName.lessExt());
|
||||||
@ -301,7 +297,7 @@ Foam::vtkPVFoam::vtkPVFoam
|
|||||||
{
|
{
|
||||||
meshRegion_ = caseName.substr(beg+1, end-beg-1);
|
meshRegion_ = caseName.substr(beg+1, end-beg-1);
|
||||||
|
|
||||||
// some safety
|
// Some safety
|
||||||
if (meshRegion_.empty())
|
if (meshRegion_.empty())
|
||||||
{
|
{
|
||||||
meshRegion_ = polyMesh::defaultRegion;
|
meshRegion_ = polyMesh::defaultRegion;
|
||||||
@ -315,10 +311,10 @@ Foam::vtkPVFoam::vtkPVFoam
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "fullCasePath=" << fullCasePath << nl
|
Info<< " fullCasePath=" << fullCasePath << nl
|
||||||
<< "FOAM_CASE=" << getEnv("FOAM_CASE") << nl
|
<< " FOAM_CASE=" << getEnv("FOAM_CASE") << nl
|
||||||
<< "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << nl
|
<< " FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << nl
|
||||||
<< "region=" << meshRegion_ << endl;
|
<< " region=" << meshRegion_ << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pre-load any libraries
|
// Pre-load any libraries
|
||||||
@ -364,7 +360,7 @@ Foam::vtkPVFoam::~vtkPVFoam()
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<end> Foam::vtkPVFoam::~vtkPVFoam" << endl;
|
InfoInFunction << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
delete meshPtr_;
|
delete meshPtr_;
|
||||||
@ -377,16 +373,17 @@ void Foam::vtkPVFoam::updateInfo()
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::updateInfo"
|
InfoInFunction << endl
|
||||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "] timeIndex="
|
<< " [meshPtr="
|
||||||
<< timeIndex_ << endl;
|
<< (meshPtr_ ? "set" : "nullptr")
|
||||||
|
<< "] timeIndex=" << timeIndex_ << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
resetCounters();
|
resetCounters();
|
||||||
|
|
||||||
vtkDataArraySelection* partSelection = reader_->GetPartSelection();
|
vtkDataArraySelection* partSelection = reader_->GetPartSelection();
|
||||||
|
|
||||||
// there are two ways to ensure we have the correct list of parts:
|
// There are two ways to ensure we have the correct list of parts:
|
||||||
// 1. remove everything and then set particular entries 'on'
|
// 1. remove everything and then set particular entries 'on'
|
||||||
// 2. build a 'char **' list and call SetArraysWithDefault()
|
// 2. build a 'char **' list and call SetArraysWithDefault()
|
||||||
//
|
//
|
||||||
@ -394,7 +391,7 @@ void Foam::vtkPVFoam::updateInfo()
|
|||||||
// time of the vtkDataArraySelection, but the qt/paraview proxy
|
// time of the vtkDataArraySelection, but the qt/paraview proxy
|
||||||
// layer doesn't care about that anyhow.
|
// layer doesn't care about that anyhow.
|
||||||
|
|
||||||
// enable 'internalMesh' on the first call
|
// Enable 'internalMesh' on the first call
|
||||||
// or preserve the enabled selections
|
// or preserve the enabled selections
|
||||||
stringList enabledEntries;
|
stringList enabledEntries;
|
||||||
bool first = !partSelection->GetNumberOfArrays() && !meshPtr_;
|
bool first = !partSelection->GetNumberOfArrays() && !meshPtr_;
|
||||||
@ -418,7 +415,7 @@ void Foam::vtkPVFoam::updateInfo()
|
|||||||
updateInfoZones(partSelection);
|
updateInfoZones(partSelection);
|
||||||
updateInfoLagrangian(partSelection);
|
updateInfoLagrangian(partSelection);
|
||||||
|
|
||||||
// restore the enabled selections
|
// Restore the enabled selections
|
||||||
setSelectedArrayEntries(partSelection, enabledEntries);
|
setSelectedArrayEntries(partSelection, enabledEntries);
|
||||||
|
|
||||||
if (meshChanged_)
|
if (meshChanged_)
|
||||||
@ -426,61 +423,15 @@ void Foam::vtkPVFoam::updateInfo()
|
|||||||
fieldsChanged_ = true;
|
fieldsChanged_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update volume, point and lagrangian fields
|
// Update fields
|
||||||
updateInfoFields();
|
updateInfoFields();
|
||||||
updateInfoLagrangianFields();
|
updateInfoLagrangianFields();
|
||||||
|
|
||||||
{
|
|
||||||
// Use the db directly since this might be called without a mesh,
|
|
||||||
// but the region must get added back in
|
|
||||||
word regionPrefix;
|
|
||||||
if (meshRegion_ != polyMesh::defaultRegion)
|
|
||||||
{
|
|
||||||
regionPrefix = meshRegion_;
|
|
||||||
}
|
|
||||||
|
|
||||||
vtkDataArraySelection* select = reader_->GetFieldSelection();
|
|
||||||
|
|
||||||
stringList enabledEntries(getSelectedArrayEntries(select));
|
|
||||||
select->RemoveAllArrays();
|
|
||||||
|
|
||||||
const Time& runTime = dbPtr_();
|
|
||||||
const instantList times = runTime.times();
|
|
||||||
addToSelection<fvPatchField, volMesh>
|
|
||||||
(
|
|
||||||
select,
|
|
||||||
runTime,
|
|
||||||
times,
|
|
||||||
regionPrefix
|
|
||||||
);
|
|
||||||
addToSelection<fvsPatchField, surfaceMesh>
|
|
||||||
(
|
|
||||||
select,
|
|
||||||
runTime,
|
|
||||||
times,
|
|
||||||
regionPrefix
|
|
||||||
);
|
|
||||||
addToSelection<pointPatchField, pointMesh>
|
|
||||||
(
|
|
||||||
select,
|
|
||||||
runTime,
|
|
||||||
times,
|
|
||||||
regionPrefix
|
|
||||||
);
|
|
||||||
|
|
||||||
// Restore the enabled selections
|
|
||||||
setSelectedArrayEntries(select, enabledEntries);
|
|
||||||
}
|
|
||||||
|
|
||||||
updateInfoLagrangianFields();
|
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
// just for debug info
|
// For debug info
|
||||||
getSelectedArrayEntries(partSelection);
|
getSelectedArrayEntries(partSelection);
|
||||||
Info<< "<end> Foam::vtkPVFoam::updateInfo" << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -488,7 +439,7 @@ void Foam::vtkPVFoam::updateFoamMesh()
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::updateFoamMesh" << endl;
|
InfoInFunction<< endl;
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -503,7 +454,8 @@ void Foam::vtkPVFoam::updateFoamMesh()
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "Creating OpenFOAM mesh for region " << meshRegion_
|
InfoInFunction << endl
|
||||||
|
<< " Creating OpenFOAM mesh for region " << meshRegion_
|
||||||
<< " at time=" << dbPtr_().timeName()
|
<< " at time=" << dbPtr_().timeName()
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
@ -526,13 +478,12 @@ void Foam::vtkPVFoam::updateFoamMesh()
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "Using existing OpenFOAM mesh" << endl;
|
Info<< " Using existing OpenFOAM mesh" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<end> Foam::vtkPVFoam::updateFoamMesh" << endl;
|
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -546,9 +497,10 @@ void Foam::vtkPVFoam::Update
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
cout<< "<beg> Foam::vtkPVFoam::Update - output with "
|
InfoInFunction << "Output with "
|
||||||
<< output->GetNumberOfBlocks() << " and "
|
<< output->GetNumberOfBlocks() << " and "
|
||||||
<< lagrangianOutput->GetNumberOfBlocks() << " blocks\n";
|
<< lagrangianOutput->GetNumberOfBlocks() << " blocks" << endl;
|
||||||
|
|
||||||
output->Print(cout);
|
output->Print(cout);
|
||||||
lagrangianOutput->Print(cout);
|
lagrangianOutput->Print(cout);
|
||||||
printMemory();
|
printMemory();
|
||||||
@ -597,7 +549,7 @@ void Foam::vtkPVFoam::Update
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "done reader part" << endl;
|
Info<< " done reader part" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
reader_->UpdateProgress(0.95);
|
reader_->UpdateProgress(0.95);
|
||||||
@ -608,7 +560,7 @@ void Foam::vtkPVFoam::Update
|
|||||||
|
|
||||||
void Foam::vtkPVFoam::CleanUp()
|
void Foam::vtkPVFoam::CleanUp()
|
||||||
{
|
{
|
||||||
// reclaim some memory
|
// Reclaim some memory
|
||||||
reduceMemory();
|
reduceMemory();
|
||||||
reader_->UpdateProgress(1.0);
|
reader_->UpdateProgress(1.0);
|
||||||
}
|
}
|
||||||
@ -626,7 +578,7 @@ double* Foam::vtkPVFoam::findTimes(int& nTimeSteps)
|
|||||||
fileHandler().flush();
|
fileHandler().flush();
|
||||||
instantList timeLst = runTime.times();
|
instantList timeLst = runTime.times();
|
||||||
|
|
||||||
// find the first time for which this mesh appears to exist
|
// Find the first time for which this mesh appears to exist
|
||||||
label timeI = 0;
|
label timeI = 0;
|
||||||
for (; timeI < timeLst.size(); ++timeI)
|
for (; timeI < timeLst.size(); ++timeI)
|
||||||
{
|
{
|
||||||
@ -649,7 +601,7 @@ double* Foam::vtkPVFoam::findTimes(int& nTimeSteps)
|
|||||||
|
|
||||||
nTimes = timeLst.size() - timeI;
|
nTimes = timeLst.size() - timeI;
|
||||||
|
|
||||||
// skip "constant" time whenever possible
|
// Skip "constant" time whenever possible
|
||||||
if (timeI == 0 && nTimes > 1)
|
if (timeI == 0 && nTimes > 1)
|
||||||
{
|
{
|
||||||
if (timeLst[timeI].name() == runTime.constant())
|
if (timeLst[timeI].name() == runTime.constant())
|
||||||
@ -660,7 +612,7 @@ double* Foam::vtkPVFoam::findTimes(int& nTimeSteps)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// skip "0/" time if requested and possible
|
// Skip "0/" time if requested and possible
|
||||||
if (nTimes > 1 && reader_->GetSkipZeroTime())
|
if (nTimes > 1 && reader_->GetSkipZeroTime())
|
||||||
{
|
{
|
||||||
if (mag(timeLst[timeI].value()) < small)
|
if (mag(timeLst[timeI].value()) < small)
|
||||||
@ -687,7 +639,7 @@ double* Foam::vtkPVFoam::findTimes(int& nTimeSteps)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// vector length returned via the parameter
|
// Vector length returned via the parameter
|
||||||
nTimeSteps = nTimes;
|
nTimeSteps = nTimes;
|
||||||
|
|
||||||
return tsteps;
|
return tsteps;
|
||||||
@ -705,7 +657,7 @@ void Foam::vtkPVFoam::renderPatchNames
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// always remove old actors first
|
// Always remove old actors first
|
||||||
|
|
||||||
forAll(patchTextActorsPtrs_, patchi)
|
forAll(patchTextActorsPtrs_, patchi)
|
||||||
{
|
{
|
||||||
@ -716,7 +668,7 @@ void Foam::vtkPVFoam::renderPatchNames
|
|||||||
|
|
||||||
if (show)
|
if (show)
|
||||||
{
|
{
|
||||||
// get the display patches, strip off any suffix
|
// Get the display patches, strip off any suffix
|
||||||
wordHashSet selectedPatches = getSelected
|
wordHashSet selectedPatches = getSelected
|
||||||
(
|
(
|
||||||
reader_->GetPartSelection(),
|
reader_->GetPartSelection(),
|
||||||
@ -812,8 +764,8 @@ void Foam::vtkPVFoam::renderPatchNames
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "displayed zone centres = " << displayZoneI << nl
|
Info<< " displayed zone centres = " << displayZoneI << nl
|
||||||
<< "zones per patch = " << nZones << endl;
|
<< " zones per patch = " << nZones << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set the size of the patch labels to max number of zones
|
// Set the size of the patch labels to max number of zones
|
||||||
@ -821,7 +773,7 @@ void Foam::vtkPVFoam::renderPatchNames
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "constructing patch labels" << endl;
|
Info<< " constructing patch labels" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Actor index
|
// Actor index
|
||||||
@ -845,9 +797,10 @@ void Foam::vtkPVFoam::renderPatchNames
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "patch name = " << pp.name() << nl
|
Info<< " patch name = " << pp.name() << nl
|
||||||
<< "anchor = " << zoneCentre[patchi][globalZoneI] << nl
|
<< " anchor = " << zoneCentre[patchi][globalZoneI]
|
||||||
<< "globalZoneI = " << globalZoneI << endl;
|
<< nl
|
||||||
|
<< " globalZoneI = " << globalZoneI << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
vtkTextActor* txt = vtkTextActor::New();
|
vtkTextActor* txt = vtkTextActor::New();
|
||||||
|
|||||||
@ -383,12 +383,19 @@ class vtkPVFoam
|
|||||||
|
|
||||||
//- Add objects of Type to paraview array selection
|
//- Add objects of Type to paraview array selection
|
||||||
template<template<class> class patchType, class meshType>
|
template<template<class> class patchType, class meshType>
|
||||||
void addToSelection
|
void addFieldsToSelection
|
||||||
(
|
(
|
||||||
vtkDataArraySelection *select,
|
vtkDataArraySelection *select,
|
||||||
const Time& runTime,
|
const IOobjectList& objects,
|
||||||
const instantList& times,
|
const string& suffix=string::null
|
||||||
const word& regionPrefix,
|
);
|
||||||
|
|
||||||
|
//- Add objects of Type to paraview array selection
|
||||||
|
template<template<class> class patchType, class meshType>
|
||||||
|
void addInternalFieldsToSelection
|
||||||
|
(
|
||||||
|
vtkDataArraySelection *select,
|
||||||
|
const IOobjectList& objects,
|
||||||
const string& suffix=string::null
|
const string& suffix=string::null
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -517,6 +524,15 @@ class vtkPVFoam
|
|||||||
vtkMultiBlockDataSet* output
|
vtkMultiBlockDataSet* output
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Volume internal fields - all types
|
||||||
|
template<class Type>
|
||||||
|
void convertVolInternalFields
|
||||||
|
(
|
||||||
|
const fvMesh&,
|
||||||
|
const IOobjectList&,
|
||||||
|
vtkMultiBlockDataSet* output
|
||||||
|
);
|
||||||
|
|
||||||
//- Volume field - all selected parts
|
//- Volume field - all selected parts
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void convertVolFieldBlock
|
void convertVolFieldBlock
|
||||||
@ -528,11 +544,23 @@ class vtkPVFoam
|
|||||||
const List<polyDecomp>& decompLst
|
const List<polyDecomp>& decompLst
|
||||||
);
|
);
|
||||||
|
|
||||||
|
//- Volume internal field - all selected parts
|
||||||
|
template<class Type>
|
||||||
|
void convertVolInternalFieldBlock
|
||||||
|
(
|
||||||
|
const typename GeometricField<Type, fvPatchField, volMesh>
|
||||||
|
::Internal&,
|
||||||
|
vtkMultiBlockDataSet* output,
|
||||||
|
const arrayRange&,
|
||||||
|
const List<polyDecomp>& decompLst
|
||||||
|
);
|
||||||
|
|
||||||
//- Volume field
|
//- Volume field
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void convertVolField
|
void convertVolInternalField
|
||||||
(
|
(
|
||||||
const GeometricField<Type, fvPatchField, volMesh>&,
|
const typename GeometricField<Type, fvPatchField, volMesh>
|
||||||
|
::Internal&,
|
||||||
vtkMultiBlockDataSet* output,
|
vtkMultiBlockDataSet* output,
|
||||||
const arrayRange&,
|
const arrayRange&,
|
||||||
const label datasetNo,
|
const label datasetNo,
|
||||||
|
|||||||
@ -69,52 +69,112 @@ Foam::label Foam::vtkPVFoam::addToSelection
|
|||||||
|
|
||||||
|
|
||||||
template<template<class> class patchType, class meshType>
|
template<template<class> class patchType, class meshType>
|
||||||
void Foam::vtkPVFoam::addToSelection
|
void Foam::vtkPVFoam::addFieldsToSelection
|
||||||
(
|
(
|
||||||
vtkDataArraySelection *select,
|
vtkDataArraySelection *select,
|
||||||
const Time& runTime,
|
const IOobjectList& objects,
|
||||||
const instantList& times,
|
|
||||||
const word& regionPrefix,
|
|
||||||
const string& suffix
|
const string& suffix
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
forAll(times, timei)
|
addToSelection<GeometricField<scalar, patchType, meshType>>
|
||||||
{
|
(
|
||||||
// Search for list of objects for this time and mesh region
|
select,
|
||||||
IOobjectList objects(runTime, times[timei].name(), regionPrefix);
|
objects,
|
||||||
|
suffix
|
||||||
|
);
|
||||||
|
|
||||||
//- Add volume fields to GUI
|
addToSelection<GeometricField<vector, patchType, meshType>>
|
||||||
addToSelection<GeometricField<scalar, patchType, meshType>>
|
(
|
||||||
(
|
select,
|
||||||
select,
|
objects,
|
||||||
objects,
|
suffix
|
||||||
suffix
|
);
|
||||||
);
|
|
||||||
addToSelection<GeometricField<vector, patchType, meshType>>
|
addToSelection<GeometricField<sphericalTensor, patchType, meshType>>
|
||||||
(
|
(
|
||||||
select,
|
select,
|
||||||
objects,
|
objects,
|
||||||
suffix
|
suffix
|
||||||
);
|
);
|
||||||
addToSelection<GeometricField<sphericalTensor, patchType, meshType>>
|
|
||||||
(
|
addToSelection<GeometricField<symmTensor, patchType, meshType>>
|
||||||
select,
|
(
|
||||||
objects,
|
select,
|
||||||
suffix
|
objects,
|
||||||
);
|
suffix
|
||||||
addToSelection<GeometricField<symmTensor, patchType, meshType>>
|
);
|
||||||
(
|
|
||||||
select,
|
addToSelection<GeometricField<tensor, patchType, meshType>>
|
||||||
objects,
|
(
|
||||||
suffix
|
select,
|
||||||
);
|
objects,
|
||||||
addToSelection<GeometricField<tensor, patchType, meshType>>
|
suffix
|
||||||
(
|
);
|
||||||
select,
|
}
|
||||||
objects,
|
|
||||||
suffix
|
|
||||||
);
|
template<template<class> class patchType, class meshType>
|
||||||
}
|
void Foam::vtkPVFoam::addInternalFieldsToSelection
|
||||||
|
(
|
||||||
|
vtkDataArraySelection *select,
|
||||||
|
const IOobjectList& objects,
|
||||||
|
const string& suffix
|
||||||
|
)
|
||||||
|
{
|
||||||
|
addToSelection
|
||||||
|
<
|
||||||
|
typename
|
||||||
|
GeometricField<scalar, patchType, meshType>::Internal
|
||||||
|
>
|
||||||
|
(
|
||||||
|
select,
|
||||||
|
objects,
|
||||||
|
suffix
|
||||||
|
);
|
||||||
|
|
||||||
|
addToSelection
|
||||||
|
<
|
||||||
|
typename
|
||||||
|
GeometricField<vector, patchType, meshType>::Internal
|
||||||
|
>
|
||||||
|
(
|
||||||
|
select,
|
||||||
|
objects,
|
||||||
|
suffix
|
||||||
|
);
|
||||||
|
|
||||||
|
addToSelection
|
||||||
|
<
|
||||||
|
typename
|
||||||
|
GeometricField<sphericalTensor, patchType, meshType>::Internal
|
||||||
|
>
|
||||||
|
(
|
||||||
|
select,
|
||||||
|
objects,
|
||||||
|
suffix
|
||||||
|
);
|
||||||
|
|
||||||
|
addToSelection
|
||||||
|
<
|
||||||
|
typename
|
||||||
|
GeometricField<symmTensor, patchType, meshType>::Internal
|
||||||
|
>
|
||||||
|
(
|
||||||
|
select,
|
||||||
|
objects,
|
||||||
|
suffix
|
||||||
|
);
|
||||||
|
|
||||||
|
addToSelection
|
||||||
|
<
|
||||||
|
typename
|
||||||
|
GeometricField<tensor, patchType, meshType>::Internal
|
||||||
|
>
|
||||||
|
(
|
||||||
|
select,
|
||||||
|
objects,
|
||||||
|
suffix
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -82,10 +82,7 @@ Foam::IOobjectList Foam::vtkPVFoam::getObjects
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::vtkPVFoam::convertFields
|
void Foam::vtkPVFoam::convertFields(vtkMultiBlockDataSet* output)
|
||||||
(
|
|
||||||
vtkMultiBlockDataSet* output
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
|
|
||||||
@ -118,8 +115,8 @@ void Foam::vtkPVFoam::convertFields
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::convertVolFields" << nl
|
InfoInFunction<< nl
|
||||||
<< "converting OpenFOAM volume fields" << endl;
|
<< " converting OpenFOAM volume fields" << endl;
|
||||||
forAllConstIter(IOobjectList, objects, iter)
|
forAllConstIter(IOobjectList, objects, iter)
|
||||||
{
|
{
|
||||||
Info<< " " << iter()->name()
|
Info<< " " << iter()->name()
|
||||||
@ -168,6 +165,27 @@ void Foam::vtkPVFoam::convertFields
|
|||||||
mesh, ppInterpList, objects, interpFields, output
|
mesh, ppInterpList, objects, interpFields, output
|
||||||
);
|
);
|
||||||
|
|
||||||
|
convertVolInternalFields<scalar>
|
||||||
|
(
|
||||||
|
mesh, objects, output
|
||||||
|
);
|
||||||
|
convertVolInternalFields<vector>
|
||||||
|
(
|
||||||
|
mesh, objects, output
|
||||||
|
);
|
||||||
|
convertVolInternalFields<sphericalTensor>
|
||||||
|
(
|
||||||
|
mesh, objects, output
|
||||||
|
);
|
||||||
|
convertVolInternalFields<symmTensor>
|
||||||
|
(
|
||||||
|
mesh, objects, output
|
||||||
|
);
|
||||||
|
convertVolInternalFields<tensor>
|
||||||
|
(
|
||||||
|
mesh, objects, output
|
||||||
|
);
|
||||||
|
|
||||||
convertSurfaceFields<scalar>(mesh, objects, output);
|
convertSurfaceFields<scalar>(mesh, objects, output);
|
||||||
convertSurfaceFields<vector>(mesh, objects, output);
|
convertSurfaceFields<vector>(mesh, objects, output);
|
||||||
convertSurfaceFields<sphericalTensor>(mesh, objects, output);
|
convertSurfaceFields<sphericalTensor>(mesh, objects, output);
|
||||||
@ -185,16 +203,12 @@ void Foam::vtkPVFoam::convertFields
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<end> Foam::vtkPVFoam::convertVolFields" << endl;
|
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::vtkPVFoam::convertLagrangianFields
|
void Foam::vtkPVFoam::convertLagrangianFields(vtkMultiBlockDataSet* output)
|
||||||
(
|
|
||||||
vtkMultiBlockDataSet* output
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
arrayRange& range = arrayRangeLagrangian_;
|
arrayRange& range = arrayRangeLagrangian_;
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
@ -211,7 +225,7 @@ void Foam::vtkPVFoam::convertLagrangianFields
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::convertLagrangianFields" << endl;
|
InfoInFunction << endl;
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -247,7 +261,8 @@ void Foam::vtkPVFoam::convertLagrangianFields
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "converting OpenFOAM lagrangian fields" << nl;
|
InfoInFunction
|
||||||
|
<< "converting OpenFOAM lagrangian fields" << nl << " ";
|
||||||
forAllConstIter(IOobjectList, objects, iter)
|
forAllConstIter(IOobjectList, objects, iter)
|
||||||
{
|
{
|
||||||
Info<< " " << iter()->name()
|
Info<< " " << iter()->name()
|
||||||
@ -283,7 +298,6 @@ void Foam::vtkPVFoam::convertLagrangianFields
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<end> Foam::vtkPVFoam::convertLagrangianFields" << endl;
|
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -48,21 +48,21 @@ void Foam::vtkPVFoam::convertMeshVolume
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
arrayRange& range = arrayRangeVolume_;
|
arrayRange& range = arrayRangeVolume_;
|
||||||
range.block(blockNo); // set output block
|
range.block(blockNo); // Set output block
|
||||||
label datasetNo = 0; // restart at dataset 0
|
label datasetNo = 0; // Restart at dataset 0
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
|
|
||||||
// resize for decomposed polyhedra
|
// Resize for decomposed polyhedra
|
||||||
regionPolyDecomp_.setSize(range.size());
|
regionPolyDecomp_.setSize(range.size());
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::convertMeshVolume" << endl;
|
InfoInFunction << endl;
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert the internalMesh
|
// Convert the internalMesh
|
||||||
// this looks like more than one part, but it isn't
|
// This looks like more than one part, but it isn't
|
||||||
for (int partId = range.start(); partId < range.end(); ++partId)
|
for (int partId = range.start(); partId < range.end(); ++partId)
|
||||||
{
|
{
|
||||||
const word partName = "internalMesh";
|
const word partName = "internalMesh";
|
||||||
@ -87,7 +87,7 @@ void Foam::vtkPVFoam::convertMeshVolume
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// anything added?
|
// Anything added?
|
||||||
if (datasetNo)
|
if (datasetNo)
|
||||||
{
|
{
|
||||||
++blockNo;
|
++blockNo;
|
||||||
@ -95,7 +95,6 @@ void Foam::vtkPVFoam::convertMeshVolume
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<end> Foam::vtkPVFoam::convertMeshVolume" << endl;
|
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -108,13 +107,13 @@ void Foam::vtkPVFoam::convertMeshLagrangian
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
arrayRange& range = arrayRangeLagrangian_;
|
arrayRange& range = arrayRangeLagrangian_;
|
||||||
range.block(blockNo); // set output block
|
range.block(blockNo); // Set output block
|
||||||
label datasetNo = 0; // restart at dataset 0
|
label datasetNo = 0; // Restart at dataset 0
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::convertMeshLagrangian" << endl;
|
InfoInFunction << endl;
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,7 +137,7 @@ void Foam::vtkPVFoam::convertMeshLagrangian
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// anything added?
|
// Anything added?
|
||||||
if (datasetNo)
|
if (datasetNo)
|
||||||
{
|
{
|
||||||
++blockNo;
|
++blockNo;
|
||||||
@ -146,7 +145,6 @@ void Foam::vtkPVFoam::convertMeshLagrangian
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<end> Foam::vtkPVFoam::convertMeshLagrangian" << endl;
|
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -159,14 +157,14 @@ void Foam::vtkPVFoam::convertMeshPatches
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
arrayRange& range = arrayRangePatches_;
|
arrayRange& range = arrayRangePatches_;
|
||||||
range.block(blockNo); // set output block
|
range.block(blockNo); // Set output block
|
||||||
label datasetNo = 0; // restart at dataset 0
|
label datasetNo = 0; // Restart at dataset 0
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh.boundaryMesh();
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::convertMeshPatches" << endl;
|
InfoInFunction << endl;
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -184,7 +182,8 @@ void Foam::vtkPVFoam::convertMeshPatches
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "Creating VTK mesh for patches [" << patchIds <<"] "
|
InfoInFunction
|
||||||
|
<< "Creating VTK mesh for patches [" << patchIds <<"] "
|
||||||
<< patchName << endl;
|
<< patchName << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -227,7 +226,7 @@ void Foam::vtkPVFoam::convertMeshPatches
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// anything added?
|
// Anything added?
|
||||||
if (datasetNo)
|
if (datasetNo)
|
||||||
{
|
{
|
||||||
++blockNo;
|
++blockNo;
|
||||||
@ -235,7 +234,6 @@ void Foam::vtkPVFoam::convertMeshPatches
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<end> Foam::vtkPVFoam::convertMeshPatches" << endl;
|
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -248,11 +246,11 @@ void Foam::vtkPVFoam::convertMeshCellZones
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
arrayRange& range = arrayRangeCellZones_;
|
arrayRange& range = arrayRangeCellZones_;
|
||||||
range.block(blockNo); // set output block
|
range.block(blockNo); // Set output block
|
||||||
label datasetNo = 0; // restart at dataset 0
|
label datasetNo = 0; // Restart at dataset 0
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
|
|
||||||
// resize for decomposed polyhedra
|
// Resize for decomposed polyhedra
|
||||||
zonePolyDecomp_.setSize(range.size());
|
zonePolyDecomp_.setSize(range.size());
|
||||||
|
|
||||||
if (range.empty())
|
if (range.empty())
|
||||||
@ -262,7 +260,7 @@ void Foam::vtkPVFoam::convertMeshCellZones
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::convertMeshCellZones" << endl;
|
InfoInFunction << endl;
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -279,7 +277,8 @@ void Foam::vtkPVFoam::convertMeshCellZones
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "Creating VTK mesh for cellZone[" << zoneId << "] "
|
InfoInFunction
|
||||||
|
<< "Creating VTK mesh for cellZone[" << zoneId << "] "
|
||||||
<< zoneName << endl;
|
<< zoneName << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -306,7 +305,7 @@ void Foam::vtkPVFoam::convertMeshCellZones
|
|||||||
zonePolyDecomp_[datasetNo].addPointCellLabels()
|
zonePolyDecomp_[datasetNo].addPointCellLabels()
|
||||||
);
|
);
|
||||||
|
|
||||||
// copy pointMap as well, otherwise pointFields fail
|
// Copy pointMap as well, otherwise pointFields fail
|
||||||
zonePolyDecomp_[datasetNo].pointMap() = subsetter.pointMap();
|
zonePolyDecomp_[datasetNo].pointMap() = subsetter.pointMap();
|
||||||
|
|
||||||
AddToBlock(output, vtkmesh, range, datasetNo, zoneName);
|
AddToBlock(output, vtkmesh, range, datasetNo, zoneName);
|
||||||
@ -316,7 +315,7 @@ void Foam::vtkPVFoam::convertMeshCellZones
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// anything added?
|
// Anything added?
|
||||||
if (datasetNo)
|
if (datasetNo)
|
||||||
{
|
{
|
||||||
++blockNo;
|
++blockNo;
|
||||||
@ -324,7 +323,6 @@ void Foam::vtkPVFoam::convertMeshCellZones
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<end> Foam::vtkPVFoam::convertMeshCellZones" << endl;
|
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -337,16 +335,16 @@ void Foam::vtkPVFoam::convertMeshCellSets
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
arrayRange& range = arrayRangeCellSets_;
|
arrayRange& range = arrayRangeCellSets_;
|
||||||
range.block(blockNo); // set output block
|
range.block(blockNo); // Set output block
|
||||||
label datasetNo = 0; // restart at dataset 0
|
label datasetNo = 0; // Restart at dataset 0
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
|
|
||||||
// resize for decomposed polyhedra
|
// Resize for decomposed polyhedra
|
||||||
csetPolyDecomp_.setSize(range.size());
|
csetPolyDecomp_.setSize(range.size());
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::convertMeshCellSets" << endl;
|
InfoInFunction << endl;
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -361,7 +359,8 @@ void Foam::vtkPVFoam::convertMeshCellSets
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "Creating VTK mesh for cellSet=" << partName << endl;
|
InfoInFunction
|
||||||
|
<< "Creating VTK mesh for cellSet=" << partName << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const cellSet cSet(mesh, partName);
|
const cellSet cSet(mesh, partName);
|
||||||
@ -388,7 +387,7 @@ void Foam::vtkPVFoam::convertMeshCellSets
|
|||||||
csetPolyDecomp_[datasetNo].addPointCellLabels()
|
csetPolyDecomp_[datasetNo].addPointCellLabels()
|
||||||
);
|
);
|
||||||
|
|
||||||
// copy pointMap as well, otherwise pointFields fail
|
// Copy pointMap as well, otherwise pointFields fail
|
||||||
csetPolyDecomp_[datasetNo].pointMap() = subsetter.pointMap();
|
csetPolyDecomp_[datasetNo].pointMap() = subsetter.pointMap();
|
||||||
|
|
||||||
AddToBlock(output, vtkmesh, range, datasetNo, partName);
|
AddToBlock(output, vtkmesh, range, datasetNo, partName);
|
||||||
@ -398,7 +397,7 @@ void Foam::vtkPVFoam::convertMeshCellSets
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// anything added?
|
// Anything added?
|
||||||
if (datasetNo)
|
if (datasetNo)
|
||||||
{
|
{
|
||||||
++blockNo;
|
++blockNo;
|
||||||
@ -406,7 +405,6 @@ void Foam::vtkPVFoam::convertMeshCellSets
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<end> Foam::vtkPVFoam::convertMeshCellSets" << endl;
|
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -419,8 +417,8 @@ void Foam::vtkPVFoam::convertMeshFaceZones
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
arrayRange& range = arrayRangeFaceZones_;
|
arrayRange& range = arrayRangeFaceZones_;
|
||||||
range.block(blockNo); // set output block
|
range.block(blockNo); // Set output block
|
||||||
label datasetNo = 0; // restart at dataset 0
|
label datasetNo = 0; // Restart at dataset 0
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
|
|
||||||
if (range.empty())
|
if (range.empty())
|
||||||
@ -430,7 +428,7 @@ void Foam::vtkPVFoam::convertMeshFaceZones
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::convertMeshFaceZones" << endl;
|
InfoInFunction << endl;
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -447,7 +445,8 @@ void Foam::vtkPVFoam::convertMeshFaceZones
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "Creating VTKmesh for faceZone[" << zoneId << "] "
|
InfoInFunction
|
||||||
|
<< "Creating VTKmesh for faceZone[" << zoneId << "] "
|
||||||
<< zoneName << endl;
|
<< zoneName << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -462,7 +461,7 @@ void Foam::vtkPVFoam::convertMeshFaceZones
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// anything added?
|
// Anything added?
|
||||||
if (datasetNo)
|
if (datasetNo)
|
||||||
{
|
{
|
||||||
++blockNo;
|
++blockNo;
|
||||||
@ -470,7 +469,6 @@ void Foam::vtkPVFoam::convertMeshFaceZones
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<end> Foam::vtkPVFoam::convertMeshFaceZones" << endl;
|
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -483,13 +481,13 @@ void Foam::vtkPVFoam::convertMeshFaceSets
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
arrayRange& range = arrayRangeFaceSets_;
|
arrayRange& range = arrayRangeFaceSets_;
|
||||||
range.block(blockNo); // set output block
|
range.block(blockNo); // Set output block
|
||||||
label datasetNo = 0; // restart at dataset 0
|
label datasetNo = 0; // Restart at dataset 0
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::convertMeshFaceSets" << endl;
|
InfoInFunction << endl;
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -504,7 +502,8 @@ void Foam::vtkPVFoam::convertMeshFaceSets
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "Creating VTK mesh for faceSet=" << partName << endl;
|
InfoInFunction
|
||||||
|
<< "Creating VTK mesh for faceSet=" << partName << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const faceSet fSet(mesh, partName);
|
const faceSet fSet(mesh, partName);
|
||||||
@ -519,7 +518,7 @@ void Foam::vtkPVFoam::convertMeshFaceSets
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// anything added?
|
// Anything added?
|
||||||
if (datasetNo)
|
if (datasetNo)
|
||||||
{
|
{
|
||||||
++blockNo;
|
++blockNo;
|
||||||
@ -527,7 +526,6 @@ void Foam::vtkPVFoam::convertMeshFaceSets
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<end> Foam::vtkPVFoam::convertMeshFaceSets" << endl;
|
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -540,13 +538,13 @@ void Foam::vtkPVFoam::convertMeshPointZones
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
arrayRange& range = arrayRangePointZones_;
|
arrayRange& range = arrayRangePointZones_;
|
||||||
range.block(blockNo); // set output block
|
range.block(blockNo); // Set output block
|
||||||
label datasetNo = 0; // restart at dataset 0
|
label datasetNo = 0; // Restart at dataset 0
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::convertMeshPointZones" << endl;
|
InfoInFunction << endl;
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -574,7 +572,7 @@ void Foam::vtkPVFoam::convertMeshPointZones
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// anything added?
|
// Anything added?
|
||||||
if (datasetNo)
|
if (datasetNo)
|
||||||
{
|
{
|
||||||
++blockNo;
|
++blockNo;
|
||||||
@ -582,7 +580,6 @@ void Foam::vtkPVFoam::convertMeshPointZones
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<end> Foam::vtkPVFoam::convertMeshPointZones" << endl;
|
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -596,13 +593,13 @@ void Foam::vtkPVFoam::convertMeshPointSets
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
arrayRange& range = arrayRangePointSets_;
|
arrayRange& range = arrayRangePointSets_;
|
||||||
range.block(blockNo); // set output block
|
range.block(blockNo); // Set output block
|
||||||
label datasetNo = 0; // restart at dataset 0
|
label datasetNo = 0; // Restart at dataset 0
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::convertMeshPointSets" << endl;
|
InfoInFunction << endl;
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -617,7 +614,8 @@ void Foam::vtkPVFoam::convertMeshPointSets
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "Creating VTK mesh for pointSet=" << partName << endl;
|
InfoInFunction
|
||||||
|
<< "Creating VTK mesh for pointSet=" << partName << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const pointSet pSet(mesh, partName);
|
const pointSet pSet(mesh, partName);
|
||||||
@ -632,7 +630,7 @@ void Foam::vtkPVFoam::convertMeshPointSets
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// anything added?
|
// Anything added?
|
||||||
if (datasetNo)
|
if (datasetNo)
|
||||||
{
|
{
|
||||||
++blockNo;
|
++blockNo;
|
||||||
@ -640,7 +638,6 @@ void Foam::vtkPVFoam::convertMeshPointSets
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<end> Foam::vtkPVFoam::convertMeshPointSets" << endl;
|
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -49,13 +49,13 @@ vtkPolyData* Foam::vtkPVFoam::lagrangianVTKMesh
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::lagrangianVTKMesh - timePath "
|
InfoInFunction<< "timePath "
|
||||||
<< mesh.time().timePath()/cloud::prefix/cloudName << endl;
|
<< mesh.time().timePath()/cloud::prefix/cloudName << endl;
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// the region name is already in the mesh db
|
// The region name is already in the mesh db
|
||||||
IOobjectList sprayObjs
|
IOobjectList sprayObjs
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
@ -70,7 +70,8 @@ vtkPolyData* Foam::vtkPVFoam::lagrangianVTKMesh
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "cloud with " << parcels.size() << " parcels" << endl;
|
Info<< " cloud with " << parcels.size()
|
||||||
|
<< " parcels" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
vtkmesh = vtkPolyData::New();
|
vtkmesh = vtkPolyData::New();
|
||||||
@ -98,7 +99,6 @@ vtkPolyData* Foam::vtkPVFoam::lagrangianVTKMesh
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<end> Foam::vtkPVFoam::lagrangianVTKMesh" << endl;
|
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -47,7 +47,7 @@ vtkPolyData* Foam::vtkPVFoam::faceSetVTKMesh
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::faceSetVTKMesh" << endl;
|
InfoInFunction << endl;
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,7 +100,6 @@ vtkPolyData* Foam::vtkPVFoam::faceSetVTKMesh
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<end> Foam::vtkPVFoam::faceSetVTKMesh" << endl;
|
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,7 +117,7 @@ vtkPolyData* Foam::vtkPVFoam::pointSetVTKMesh
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::pointSetVTKMesh" << endl;
|
InfoInFunction << endl;
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -137,7 +136,6 @@ vtkPolyData* Foam::vtkPVFoam::pointSetVTKMesh
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<end> Foam::vtkPVFoam::pointSetVTKMesh" << endl;
|
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -56,7 +56,7 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::volumeVTKMesh" << endl;
|
InfoInFunction << endl;
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,7 +80,8 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "... scanning for polyhedra" << endl;
|
InfoInFunction
|
||||||
|
<< "... scanning for polyhedra" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
forAll(cellShapes, celli)
|
forAll(cellShapes, celli)
|
||||||
@ -125,17 +126,17 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<<" mesh nCells = " << mesh.nCells() << nl
|
Info<< " mesh nCells = " << mesh.nCells() << nl
|
||||||
<<" nPoints = " << mesh.nPoints() << nl
|
<< " nPoints = " << mesh.nPoints() << nl
|
||||||
<<" nAddCells = " << nAddCells << nl
|
<< " nAddCells = " << nAddCells << nl
|
||||||
<<" nAddPoints = " << nAddPoints << endl;
|
<< " nAddPoints = " << nAddPoints << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
superCells.setSize(mesh.nCells() + nAddCells);
|
superCells.setSize(mesh.nCells() + nAddCells);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "... converting points" << endl;
|
Info<< " ... converting points" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert OpenFOAM mesh vertices to VTK
|
// Convert OpenFOAM mesh vertices to VTK
|
||||||
@ -152,7 +153,7 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "... converting cells" << endl;
|
Info<< " ... converting cells" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
vtkmesh->Allocate(mesh.nCells() + nAddCells);
|
vtkmesh->Allocate(mesh.nCells() + nAddCells);
|
||||||
@ -310,7 +311,7 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// fairly immaterial if we reverse the list
|
// Fairly immaterial if we reverse the list
|
||||||
// or use face::reverseFace()
|
// or use face::reverseFace()
|
||||||
forAllReverse(f, fp)
|
forAllReverse(f, fp)
|
||||||
{
|
{
|
||||||
@ -321,10 +322,10 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
|
|||||||
|
|
||||||
vtkmesh->InsertNextCell(VTK_POLYHEDRON, nFaces, faceStream.data());
|
vtkmesh->InsertNextCell(VTK_POLYHEDRON, nFaces, faceStream.data());
|
||||||
#else
|
#else
|
||||||
// this is a horrible substitute
|
// This is a horrible substitute
|
||||||
// but avoids crashes when there is no vtkPolyhedron support
|
// but avoids crashes when there is no vtkPolyhedron support
|
||||||
|
|
||||||
// establish unique node ids used
|
// Establish unique node ids used
|
||||||
HashSet<vtkIdType, Hash<label>> hashUniqId(2*256);
|
HashSet<vtkIdType, Hash<label>> hashUniqId(2*256);
|
||||||
|
|
||||||
forAll(cFaces, cFacei)
|
forAll(cFaces, cFacei)
|
||||||
@ -337,7 +338,7 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// use face stream to store unique node ids:
|
// Use face stream to store unique node ids:
|
||||||
faceStream = hashUniqId.sortedToc();
|
faceStream = hashUniqId.sortedToc();
|
||||||
|
|
||||||
vtkmesh->InsertNextCell
|
vtkmesh->InsertNextCell
|
||||||
@ -469,7 +470,6 @@ vtkUnstructuredGrid* Foam::vtkPVFoam::volumeVTKMesh
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<end> Foam::vtkPVFoam::volumeVTKMesh" << endl;
|
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -45,7 +45,7 @@ vtkPolyData* Foam::vtkPVFoam::pointZoneVTKMesh
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::pointZoneVTKMesh" << endl;
|
InfoInFunction << endl;
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ vtkPolyData* Foam::vtkPVFoam::pointZoneVTKMesh
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::pointZoneVTKMesh" << endl;
|
InfoInFunction << endl;
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -48,7 +48,7 @@ vtkPolyData* Foam::vtkPVFoam::patchVTKMesh
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::patchVTKMesh - " << name << endl;
|
InfoInFunction << " - " << name << endl;
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,7 +88,6 @@ vtkPolyData* Foam::vtkPVFoam::patchVTKMesh
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<end> Foam::vtkPVFoam::patchVTKMesh - " << name << endl;
|
|
||||||
printMemory();
|
printMemory();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -107,7 +107,7 @@ Foam::wordList Foam::vtkPVFoam::getZoneNames(const word& zoneType) const
|
|||||||
{
|
{
|
||||||
wordList names;
|
wordList names;
|
||||||
|
|
||||||
// mesh not loaded - read from file
|
// Mesh not loaded - read from file
|
||||||
IOobject ioObj
|
IOobject ioObj
|
||||||
(
|
(
|
||||||
zoneType,
|
zoneType,
|
||||||
@ -146,7 +146,7 @@ void Foam::vtkPVFoam::updateInfoInternalMesh
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::updateInfoInternalMesh" << endl;
|
InfoInFunction << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Determine mesh parts (internalMesh, patches...)
|
// Determine mesh parts (internalMesh, patches...)
|
||||||
@ -160,10 +160,8 @@ void Foam::vtkPVFoam::updateInfoInternalMesh
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
// just for debug info
|
// Just for debug info
|
||||||
getSelectedArrayEntries(arraySelection);
|
getSelectedArrayEntries(arraySelection);
|
||||||
|
|
||||||
Info<< "<end> Foam::vtkPVFoam::updateInfoInternalMesh" << endl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,12 +173,12 @@ void Foam::vtkPVFoam::updateInfoLagrangian
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::updateInfoLagrangian" << nl
|
InfoInFunction << nl
|
||||||
<< " " << dbPtr_->timePath()/cloud::prefix << endl;
|
<< " " << dbPtr_->timePath()/cloud::prefix << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// use the db directly since this might be called without a mesh,
|
// Use the db directly since this might be called without a mesh,
|
||||||
// but the region must get added back in
|
// but the region must get added back in
|
||||||
fileName lagrangianPrefix(cloud::prefix);
|
fileName lagrangianPrefix(cloud::prefix);
|
||||||
if (meshRegion_ != polyMesh::defaultRegion)
|
if (meshRegion_ != polyMesh::defaultRegion)
|
||||||
@ -218,10 +216,8 @@ void Foam::vtkPVFoam::updateInfoLagrangian
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
// just for debug info
|
// Just for debug info
|
||||||
getSelectedArrayEntries(arraySelection);
|
getSelectedArrayEntries(arraySelection);
|
||||||
|
|
||||||
Info<< "<end> Foam::vtkPVFoam::updateInfoLagrangian" << endl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,7 +231,7 @@ void Foam::vtkPVFoam::updateInfoPatches
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::updateInfoPatches"
|
InfoInFunction
|
||||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
|
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -323,7 +319,7 @@ void Foam::vtkPVFoam::updateInfoPatches
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// mesh not loaded - read from file
|
// Mesh not loaded - read from file
|
||||||
// but this could fail if we've supplied a bad region name
|
// but this could fail if we've supplied a bad region name
|
||||||
IOobject ioObj
|
IOobject ioObj
|
||||||
(
|
(
|
||||||
@ -341,7 +337,7 @@ void Foam::vtkPVFoam::updateInfoPatches
|
|||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
|
||||||
// this should only ever fail if the mesh region doesn't exist
|
// This should only ever fail if the mesh region doesn't exist
|
||||||
if (ioObj.typeHeaderOk<polyBoundaryMesh>(true))
|
if (ioObj.typeHeaderOk<polyBoundaryMesh>(true))
|
||||||
{
|
{
|
||||||
polyBoundaryMeshEntries patchEntries(ioObj);
|
polyBoundaryMeshEntries patchEntries(ioObj);
|
||||||
@ -496,10 +492,8 @@ void Foam::vtkPVFoam::updateInfoPatches
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
// just for debug info
|
// Just for debug info
|
||||||
getSelectedArrayEntries(arraySelection);
|
getSelectedArrayEntries(arraySelection);
|
||||||
|
|
||||||
Info<< "<end> Foam::vtkPVFoam::updateInfoPatches" << endl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -516,7 +510,7 @@ void Foam::vtkPVFoam::updateInfoZones
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::updateInfoZones"
|
InfoInFunction
|
||||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
|
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -586,10 +580,8 @@ void Foam::vtkPVFoam::updateInfoZones
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
// just for debug info
|
// Just for debug info
|
||||||
getSelectedArrayEntries(arraySelection);
|
getSelectedArrayEntries(arraySelection);
|
||||||
|
|
||||||
Info<< "<end> Foam::vtkPVFoam::updateInfoZones" << endl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -606,7 +598,7 @@ void Foam::vtkPVFoam::updateInfoSets
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::updateInfoSets" << endl;
|
InfoInFunction << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add names of sets. Search for last time directory with a sets
|
// Add names of sets. Search for last time directory with a sets
|
||||||
@ -662,10 +654,8 @@ void Foam::vtkPVFoam::updateInfoSets
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
// just for debug info
|
// Just for debug info
|
||||||
getSelectedArrayEntries(arraySelection);
|
getSelectedArrayEntries(arraySelection);
|
||||||
|
|
||||||
Info<< "<end> Foam::vtkPVFoam::updateInfoSets" << endl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -674,8 +664,8 @@ void Foam::vtkPVFoam::updateInfoFields()
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::updateInfoFields "
|
InfoInFunction
|
||||||
" [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]"
|
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]"
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -737,35 +727,38 @@ void Foam::vtkPVFoam::updateInfoFields()
|
|||||||
|
|
||||||
fieldSelection->RemoveAllArrays();
|
fieldSelection->RemoveAllArrays();
|
||||||
|
|
||||||
addToSelection<fvPatchField, volMesh>
|
forAll(times, timei)
|
||||||
(
|
{
|
||||||
fieldSelection,
|
// Search for list of objects for this time and mesh region
|
||||||
runTime,
|
IOobjectList objects(runTime, times[timei].name(), regionPrefix);
|
||||||
times,
|
|
||||||
regionPrefix
|
addFieldsToSelection<fvPatchField, volMesh>
|
||||||
);
|
(
|
||||||
addToSelection<fvsPatchField, surfaceMesh>
|
fieldSelection,
|
||||||
(
|
objects
|
||||||
fieldSelection,
|
);
|
||||||
runTime,
|
|
||||||
times,
|
addInternalFieldsToSelection<fvPatchField, volMesh>
|
||||||
regionPrefix
|
(
|
||||||
);
|
fieldSelection,
|
||||||
addToSelection<pointPatchField, pointMesh>
|
objects
|
||||||
(
|
);
|
||||||
fieldSelection,
|
|
||||||
runTime,
|
addFieldsToSelection<fvsPatchField, surfaceMesh>
|
||||||
times,
|
(
|
||||||
regionPrefix
|
fieldSelection,
|
||||||
);
|
objects
|
||||||
|
);
|
||||||
|
|
||||||
|
addFieldsToSelection<pointPatchField, pointMesh>
|
||||||
|
(
|
||||||
|
fieldSelection,
|
||||||
|
objects
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Restore the enabled selections
|
// Restore the enabled selections
|
||||||
setSelectedArrayEntries(fieldSelection, enabledEntries);
|
setSelectedArrayEntries(fieldSelection, enabledEntries);
|
||||||
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Info<< "<end> Foam::vtkPVFoam::updateInfoFields" << endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -773,18 +766,17 @@ void Foam::vtkPVFoam::updateInfoLagrangianFields()
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVFoam::updateInfoLagrangianFields"
|
InfoInFunction << endl;
|
||||||
<< endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vtkDataArraySelection* fieldSelection =
|
vtkDataArraySelection* fieldSelection =
|
||||||
reader_->GetLagrangianFieldSelection();
|
reader_->GetLagrangianFieldSelection();
|
||||||
|
|
||||||
// preserve the enabled selections
|
// Preserve the enabled selections
|
||||||
stringList enabledEntries = getSelectedArrayEntries(fieldSelection);
|
stringList enabledEntries = getSelectedArrayEntries(fieldSelection);
|
||||||
fieldSelection->RemoveAllArrays();
|
fieldSelection->RemoveAllArrays();
|
||||||
|
|
||||||
// use the db directly since this might be called without a mesh,
|
// Use the db directly since this might be called without a mesh,
|
||||||
// but the region must get added back in
|
// but the region must get added back in
|
||||||
fileName lagrangianPrefix(cloud::prefix);
|
fileName lagrangianPrefix(cloud::prefix);
|
||||||
if (meshRegion_ != polyMesh::defaultRegion)
|
if (meshRegion_ != polyMesh::defaultRegion)
|
||||||
@ -820,13 +812,8 @@ void Foam::vtkPVFoam::updateInfoLagrangianFields()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// restore the enabled selections
|
// Restore the enabled selections
|
||||||
setSelectedArrayEntries(fieldSelection, enabledEntries);
|
setSelectedArrayEntries(fieldSelection, enabledEntries);
|
||||||
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Info<< "<end> Foam::vtkPVFoam::updateInfoLagrangianFields" << endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,6 @@ InClass
|
|||||||
|
|
||||||
#include "vtkPVFoamSurfaceField.H"
|
#include "vtkPVFoamSurfaceField.H"
|
||||||
#include "vtkPVFoamPatchField.H"
|
#include "vtkPVFoamPatchField.H"
|
||||||
|
|
||||||
#include "vtkOpenFOAMTupleRemap.H"
|
#include "vtkOpenFOAMTupleRemap.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -56,7 +55,7 @@ void Foam::vtkPVFoam::convertVolFields
|
|||||||
|
|
||||||
forAllConstIter(IOobjectList, objects, iter)
|
forAllConstIter(IOobjectList, objects, iter)
|
||||||
{
|
{
|
||||||
// restrict to GeometricField<Type, ...>
|
// Restrict to GeometricField<Type, ...>
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
iter()->headerClassName()
|
iter()->headerClassName()
|
||||||
@ -79,8 +78,7 @@ void Foam::vtkPVFoam::convertVolFields
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "convertVolFieldBlock interpolating:" << tf.name()
|
InfoInFunction<< "interpolating:" << tf.name() << endl;
|
||||||
<< endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ptfPtr.reset
|
ptfPtr.reset
|
||||||
@ -270,6 +268,63 @@ void Foam::vtkPVFoam::convertVolFields
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::vtkPVFoam::convertVolInternalFields
|
||||||
|
(
|
||||||
|
const fvMesh& mesh,
|
||||||
|
const IOobjectList& objects,
|
||||||
|
vtkMultiBlockDataSet* output
|
||||||
|
)
|
||||||
|
{
|
||||||
|
forAllConstIter(IOobjectList, objects, iter)
|
||||||
|
{
|
||||||
|
// Restrict to GeometricField<Type, ...>::Internal
|
||||||
|
if
|
||||||
|
(
|
||||||
|
iter()->headerClassName()
|
||||||
|
!= GeometricField<Type, fvPatchField, volMesh>::Internal::typeName
|
||||||
|
)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Load field
|
||||||
|
typename GeometricField<Type, fvPatchField, volMesh>::Internal tf
|
||||||
|
(
|
||||||
|
*iter(),
|
||||||
|
mesh
|
||||||
|
);
|
||||||
|
|
||||||
|
// Convert activated internalMesh regions
|
||||||
|
convertVolInternalFieldBlock<Type>
|
||||||
|
(
|
||||||
|
tf,
|
||||||
|
output,
|
||||||
|
arrayRangeVolume_,
|
||||||
|
regionPolyDecomp_
|
||||||
|
);
|
||||||
|
|
||||||
|
// Convert activated cellZones
|
||||||
|
convertVolInternalFieldBlock<Type>
|
||||||
|
(
|
||||||
|
tf,
|
||||||
|
output,
|
||||||
|
arrayRangeCellZones_,
|
||||||
|
zonePolyDecomp_
|
||||||
|
);
|
||||||
|
|
||||||
|
// Convert activated cellSets
|
||||||
|
convertVolInternalFieldBlock<Type>
|
||||||
|
(
|
||||||
|
tf,
|
||||||
|
output,
|
||||||
|
arrayRangeCellSets_,
|
||||||
|
csetPolyDecomp_
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::vtkPVFoam::convertVolFieldBlock
|
void Foam::vtkPVFoam::convertVolFieldBlock
|
||||||
(
|
(
|
||||||
@ -286,7 +341,7 @@ void Foam::vtkPVFoam::convertVolFieldBlock
|
|||||||
|
|
||||||
if (datasetNo >= 0 && partStatus_[partId])
|
if (datasetNo >= 0 && partStatus_[partId])
|
||||||
{
|
{
|
||||||
convertVolField
|
convertVolInternalField<Type>
|
||||||
(
|
(
|
||||||
tf,
|
tf,
|
||||||
output,
|
output,
|
||||||
@ -313,9 +368,37 @@ void Foam::vtkPVFoam::convertVolFieldBlock
|
|||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
void Foam::vtkPVFoam::convertVolField
|
void Foam::vtkPVFoam::convertVolInternalFieldBlock
|
||||||
(
|
(
|
||||||
const GeometricField<Type, fvPatchField, volMesh>& tf,
|
const typename GeometricField<Type, fvPatchField, volMesh>::Internal& tf,
|
||||||
|
vtkMultiBlockDataSet* output,
|
||||||
|
const arrayRange& range,
|
||||||
|
const List<polyDecomp>& decompLst
|
||||||
|
)
|
||||||
|
{
|
||||||
|
for (int partId = range.start(); partId < range.end(); ++partId)
|
||||||
|
{
|
||||||
|
const label datasetNo = partDataset_[partId];
|
||||||
|
|
||||||
|
if (datasetNo >= 0 && partStatus_[partId])
|
||||||
|
{
|
||||||
|
convertVolInternalField<Type>
|
||||||
|
(
|
||||||
|
tf,
|
||||||
|
output,
|
||||||
|
range,
|
||||||
|
datasetNo,
|
||||||
|
decompLst[datasetNo]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
template<class Type>
|
||||||
|
void Foam::vtkPVFoam::convertVolInternalField
|
||||||
|
(
|
||||||
|
const typename GeometricField<Type, fvPatchField, volMesh>::Internal& tf,
|
||||||
vtkMultiBlockDataSet* output,
|
vtkMultiBlockDataSet* output,
|
||||||
const arrayRange& range,
|
const arrayRange& range,
|
||||||
const label datasetNo,
|
const label datasetNo,
|
||||||
@ -333,8 +416,8 @@ void Foam::vtkPVFoam::convertVolField
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "convert volField: "
|
InfoInFunction
|
||||||
<< tf.name()
|
<< "converting volField::Internal: " << tf.name()
|
||||||
<< " size = " << tf.size()
|
<< " size = " << tf.size()
|
||||||
<< " nComp=" << nComp
|
<< " nComp=" << nComp
|
||||||
<< " nTuples = " << superCells.size() << endl;
|
<< " nTuples = " << superCells.size() << endl;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -65,7 +65,7 @@ void Foam::vtkPVblockMesh::updateInfoBlocks
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVblockMesh::updateInfoBlocks"
|
InfoInFunction << nl
|
||||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
|
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -98,10 +98,8 @@ void Foam::vtkPVblockMesh::updateInfoBlocks
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
// just for debug info
|
// Just for debug info
|
||||||
getSelectedArrayEntries(arraySelection);
|
getSelectedArrayEntries(arraySelection);
|
||||||
|
|
||||||
Info<< "<end> Foam::vtkPVblockMesh::updateInfoBlocks" << endl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -113,7 +111,7 @@ void Foam::vtkPVblockMesh::updateInfoEdges
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVblockMesh::updateInfoEdges"
|
InfoInFunction
|
||||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
|
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "]" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,10 +137,8 @@ void Foam::vtkPVblockMesh::updateInfoEdges
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
// just for debug info
|
// Just for debug info
|
||||||
getSelectedArrayEntries(arraySelection);
|
getSelectedArrayEntries(arraySelection);
|
||||||
|
|
||||||
Info<< "<end> Foam::vtkPVblockMesh::updateInfoEdges" << endl;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -166,11 +162,10 @@ Foam::vtkPVblockMesh::vtkPVblockMesh
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "Foam::vtkPVblockMesh::vtkPVblockMesh - "
|
InfoInFunction<< " - " << FileName << endl;
|
||||||
<< FileName << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// avoid argList and get rootPath/caseName directly from the file
|
// Avoid argList and get rootPath/caseName directly from the file
|
||||||
fileName fullCasePath(fileName(FileName).path());
|
fileName fullCasePath(fileName(FileName).path());
|
||||||
|
|
||||||
if (!isDir(fullCasePath))
|
if (!isDir(fullCasePath))
|
||||||
@ -196,7 +191,7 @@ Foam::vtkPVblockMesh::vtkPVblockMesh
|
|||||||
setEnv("FOAM_CASENAME", fullCasePath.name(), true);
|
setEnv("FOAM_CASENAME", fullCasePath.name(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// look for 'case{region}.OpenFOAM'
|
// Look for 'case{region}.OpenFOAM'
|
||||||
// could be stringent and insist the prefix match the directory name...
|
// could be stringent and insist the prefix match the directory name...
|
||||||
// Note: cannot use fileName::name() due to the embedded '{}'
|
// Note: cannot use fileName::name() due to the embedded '{}'
|
||||||
string caseName(fileName(FileName).lessExt());
|
string caseName(fileName(FileName).lessExt());
|
||||||
@ -211,7 +206,7 @@ Foam::vtkPVblockMesh::vtkPVblockMesh
|
|||||||
{
|
{
|
||||||
meshRegion_ = caseName.substr(beg+1, end-beg-1);
|
meshRegion_ = caseName.substr(beg+1, end-beg-1);
|
||||||
|
|
||||||
// some safety
|
// Some safety
|
||||||
if (meshRegion_.empty())
|
if (meshRegion_.empty())
|
||||||
{
|
{
|
||||||
meshRegion_ = polyMesh::defaultRegion;
|
meshRegion_ = polyMesh::defaultRegion;
|
||||||
@ -225,9 +220,9 @@ Foam::vtkPVblockMesh::vtkPVblockMesh
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "fullCasePath=" << fullCasePath << nl
|
Info<< " fullCasePath=" << fullCasePath << nl
|
||||||
<< "FOAM_CASE=" << getEnv("FOAM_CASE") << nl
|
<< " FOAM_CASE=" << getEnv("FOAM_CASE") << nl
|
||||||
<< "FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << endl;
|
<< " FOAM_CASENAME=" << getEnv("FOAM_CASENAME") << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create time object
|
// Create time object
|
||||||
@ -253,7 +248,7 @@ Foam::vtkPVblockMesh::~vtkPVblockMesh()
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<end> Foam::vtkPVblockMesh::~vtkPVblockMesh" << endl;
|
InfoInFunction << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hmm. pointNumberTextActors are not getting removed
|
// Hmm. pointNumberTextActors are not getting removed
|
||||||
@ -274,7 +269,7 @@ void Foam::vtkPVblockMesh::updateInfo()
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVblockMesh::updateInfo"
|
InfoInFunction
|
||||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "] " << endl;
|
<< " [meshPtr=" << (meshPtr_ ? "set" : "nullptr") << "] " << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -283,7 +278,7 @@ void Foam::vtkPVblockMesh::updateInfo()
|
|||||||
vtkDataArraySelection* blockSelection = reader_->GetBlockSelection();
|
vtkDataArraySelection* blockSelection = reader_->GetBlockSelection();
|
||||||
vtkDataArraySelection* edgeSelection = reader_->GetCurvedEdgesSelection();
|
vtkDataArraySelection* edgeSelection = reader_->GetCurvedEdgesSelection();
|
||||||
|
|
||||||
// enable 'internalMesh' on the first call
|
// Enable 'internalMesh' on the first call
|
||||||
// or preserve the enabled selections
|
// or preserve the enabled selections
|
||||||
stringList enabledParts;
|
stringList enabledParts;
|
||||||
stringList enabledEdges;
|
stringList enabledEdges;
|
||||||
@ -302,7 +297,7 @@ void Foam::vtkPVblockMesh::updateInfo()
|
|||||||
blockSelection->RemoveAllArrays();
|
blockSelection->RemoveAllArrays();
|
||||||
edgeSelection->RemoveAllArrays();
|
edgeSelection->RemoveAllArrays();
|
||||||
|
|
||||||
// need a blockMesh
|
// Need a blockMesh
|
||||||
updateFoamMesh();
|
updateFoamMesh();
|
||||||
|
|
||||||
// Update mesh parts list
|
// Update mesh parts list
|
||||||
@ -311,17 +306,12 @@ void Foam::vtkPVblockMesh::updateInfo()
|
|||||||
// Update curved edges list
|
// Update curved edges list
|
||||||
updateInfoEdges( edgeSelection );
|
updateInfoEdges( edgeSelection );
|
||||||
|
|
||||||
// restore the enabled selections
|
// Restore the enabled selections
|
||||||
if (!firstTime)
|
if (!firstTime)
|
||||||
{
|
{
|
||||||
setSelectedArrayEntries(blockSelection, enabledParts);
|
setSelectedArrayEntries(blockSelection, enabledParts);
|
||||||
setSelectedArrayEntries(edgeSelection, enabledEdges);
|
setSelectedArrayEntries(edgeSelection, enabledEdges);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Info<< "<end> Foam::vtkPVblockMesh::updateInfo" << endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -329,7 +319,7 @@ void Foam::vtkPVblockMesh::updateFoamMesh()
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVblockMesh::updateFoamMesh" << endl;
|
InfoInFunction << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check to see if the OpenFOAM mesh has been created
|
// Check to see if the OpenFOAM mesh has been created
|
||||||
@ -337,8 +327,8 @@ void Foam::vtkPVblockMesh::updateFoamMesh()
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "Creating blockMesh at time=" << dbPtr_().timeName()
|
InfoInFunction
|
||||||
<< endl;
|
<< "Creating blockMesh at time=" << dbPtr_().timeName() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set path for the blockMeshDict
|
// Set path for the blockMeshDict
|
||||||
@ -375,12 +365,6 @@ void Foam::vtkPVblockMesh::updateFoamMesh()
|
|||||||
|
|
||||||
meshPtr_ = new blockMesh(*meshDictPtr, meshRegion_);
|
meshPtr_ = new blockMesh(*meshDictPtr, meshRegion_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Info<< "<end> Foam::vtkPVblockMesh::updateFoamMesh" << endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -427,7 +411,7 @@ void Foam::vtkPVblockMesh::renderPointNumbers
|
|||||||
const bool show
|
const bool show
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// always remove old actors first
|
// Always remove old actors first
|
||||||
|
|
||||||
forAll(pointNumberTextActorsPtrs_, pointi)
|
forAll(pointNumberTextActorsPtrs_, pointi)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -51,15 +51,15 @@ void Foam::vtkPVblockMesh::convertMeshBlocks
|
|||||||
{
|
{
|
||||||
vtkDataArraySelection* selection = reader_->GetBlockSelection();
|
vtkDataArraySelection* selection = reader_->GetBlockSelection();
|
||||||
arrayRange& range = arrayRangeBlocks_;
|
arrayRange& range = arrayRangeBlocks_;
|
||||||
range.block(blockNo); // set output block
|
range.block(blockNo); // Set output block
|
||||||
label datasetNo = 0; // restart at dataset 0
|
label datasetNo = 0; // Restart at dataset 0
|
||||||
|
|
||||||
const blockMesh& blkMesh = *meshPtr_;
|
const blockMesh& blkMesh = *meshPtr_;
|
||||||
const Foam::pointField& blockPoints = blkMesh.vertices();
|
const Foam::pointField& blockPoints = blkMesh.vertices();
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVblockMesh::convertMeshBlocks" << endl;
|
InfoInFunction << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
int blockI = 0;
|
int blockI = 0;
|
||||||
@ -122,16 +122,11 @@ void Foam::vtkPVblockMesh::convertMeshBlocks
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// anything added?
|
// Anything added?
|
||||||
if (datasetNo)
|
if (datasetNo)
|
||||||
{
|
{
|
||||||
++blockNo;
|
++blockNo;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Info<< "<end> Foam::vtkPVblockMesh::convertMeshBlocks" << endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -144,8 +139,8 @@ void Foam::vtkPVblockMesh::convertMeshEdges
|
|||||||
vtkDataArraySelection* selection = reader_->GetCurvedEdgesSelection();
|
vtkDataArraySelection* selection = reader_->GetCurvedEdgesSelection();
|
||||||
arrayRange& range = arrayRangeEdges_;
|
arrayRange& range = arrayRangeEdges_;
|
||||||
|
|
||||||
range.block(blockNo); // set output block
|
range.block(blockNo); // Set output block
|
||||||
label datasetNo = 0; // restart at dataset 0
|
label datasetNo = 0; // Restart at dataset 0
|
||||||
|
|
||||||
const blockMesh& blkMesh = *meshPtr_;
|
const blockMesh& blkMesh = *meshPtr_;
|
||||||
const blockEdgeList& edges = blkMesh.edges();
|
const blockEdgeList& edges = blkMesh.edges();
|
||||||
@ -165,7 +160,7 @@ void Foam::vtkPVblockMesh::convertMeshEdges
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// search each block
|
// Search each block
|
||||||
forAll(blkMesh, blockI)
|
forAll(blkMesh, blockI)
|
||||||
{
|
{
|
||||||
const blockDescriptor& blockDef = blkMesh[blockI];
|
const blockDescriptor& blockDef = blkMesh[blockI];
|
||||||
@ -177,7 +172,7 @@ void Foam::vtkPVblockMesh::convertMeshEdges
|
|||||||
scalarList edgesWeights[12];
|
scalarList edgesWeights[12];
|
||||||
blockDef.edgesPointsWeights(edgesPoints, edgesWeights);
|
blockDef.edgesPointsWeights(edgesPoints, edgesWeights);
|
||||||
|
|
||||||
// find the corresponding edge within the block
|
// Find the corresponding edge within the block
|
||||||
label foundEdgeI = -1;
|
label foundEdgeI = -1;
|
||||||
forAll(blkEdges, blkEdgeI)
|
forAll(blkEdges, blkEdgeI)
|
||||||
{
|
{
|
||||||
@ -235,17 +230,11 @@ void Foam::vtkPVblockMesh::convertMeshEdges
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// anything added?
|
// Anything added?
|
||||||
if (datasetNo)
|
if (datasetNo)
|
||||||
{
|
{
|
||||||
++blockNo;
|
++blockNo;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Info<< "<end> Foam::vtkPVblockMesh::convertMeshEdges" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -256,18 +245,18 @@ void Foam::vtkPVblockMesh::convertMeshCorners
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
arrayRange& range = arrayRangeCorners_;
|
arrayRange& range = arrayRangeCorners_;
|
||||||
range.block(blockNo); // set output block
|
range.block(blockNo); // Set output block
|
||||||
label datasetNo = 0; // restart at dataset 0
|
label datasetNo = 0; // Restart at dataset 0
|
||||||
|
|
||||||
const pointField& blockPoints = meshPtr_->vertices();
|
const pointField& blockPoints = meshPtr_->vertices();
|
||||||
const scalar& scaleFactor = meshPtr_->scaleFactor();
|
const scalar& scaleFactor = meshPtr_->scaleFactor();
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVblockMesh::convertMeshCorners" << endl;
|
InfoInFunction << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (true) // or some flag or other condition
|
if (true) // Or some flag or other condition
|
||||||
{
|
{
|
||||||
vtkPolyData* vtkmesh = vtkPolyData::New();
|
vtkPolyData* vtkmesh = vtkPolyData::New();
|
||||||
vtkPoints* vtkpoints = vtkPoints::New();
|
vtkPoints* vtkpoints = vtkPoints::New();
|
||||||
@ -306,16 +295,11 @@ void Foam::vtkPVblockMesh::convertMeshCorners
|
|||||||
datasetNo++;
|
datasetNo++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// anything added?
|
// Anything added?
|
||||||
if (datasetNo)
|
if (datasetNo)
|
||||||
{
|
{
|
||||||
++blockNo;
|
++blockNo;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Info<< "<end> Foam::vtkPVblockMesh::convertMeshCorners" << endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration | Website: https://openfoam.org
|
\\ / O peration | Website: https://openfoam.org
|
||||||
\\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -97,7 +97,8 @@ void Foam::vtkPVblockMesh::AddToBlock
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "block[" << blockNo << "] has "
|
InfoInFunction
|
||||||
|
<< "block[" << blockNo << "] has "
|
||||||
<< block->GetNumberOfBlocks()
|
<< block->GetNumberOfBlocks()
|
||||||
<< " datasets prior to adding set " << datasetNo
|
<< " datasets prior to adding set " << datasetNo
|
||||||
<< " with name: " << datasetName << endl;
|
<< " with name: " << datasetName << endl;
|
||||||
@ -228,7 +229,8 @@ Foam::stringList Foam::vtkPVblockMesh::getSelectedArrayEntries
|
|||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
label nElem = select->GetNumberOfArrays();
|
label nElem = select->GetNumberOfArrays();
|
||||||
Info<< "available(";
|
InfoInFunction
|
||||||
|
<< "available(";
|
||||||
for (int elemI = 0; elemI < nElem; ++elemI)
|
for (int elemI = 0; elemI < nElem; ++elemI)
|
||||||
{
|
{
|
||||||
Info<< " \"" << select->GetArrayName(elemI) << "\"";
|
Info<< " \"" << select->GetArrayName(elemI) << "\"";
|
||||||
@ -267,7 +269,8 @@ Foam::stringList Foam::vtkPVblockMesh::getSelectedArrayEntries
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "available(";
|
InfoInFunction
|
||||||
|
<< "available(";
|
||||||
for (int elemI = range.start(); elemI < range.end(); ++elemI)
|
for (int elemI = range.start(); elemI < range.end(); ++elemI)
|
||||||
{
|
{
|
||||||
Info<< " \"" << select->GetArrayName(elemI) << "\"";
|
Info<< " \"" << select->GetArrayName(elemI) << "\"";
|
||||||
@ -319,7 +322,7 @@ void Foam::vtkPVblockMesh::updateBoolListStatus
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "<beg> Foam::vtkPVblockMesh::updateBoolListStatus" << endl;
|
InfoInFunction << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const label nElem = selection->GetNumberOfArrays();
|
const label nElem = selection->GetNumberOfArrays();
|
||||||
@ -337,20 +340,12 @@ void Foam::vtkPVblockMesh::updateBoolListStatus
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< " part[" << elemI << "] = "
|
Info<< " part[" << elemI << "] = "
|
||||||
<< status[elemI]
|
<< status[elemI]
|
||||||
<< " : " << selection->GetArrayName(elemI) << endl;
|
<< " : " << selection->GetArrayName(elemI) << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Info<< "<end> Foam::vtkPVblockMesh::updateBoolListStatus" << endl;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
Reference in New Issue
Block a user