mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
PV3FoamReader - cosmetic changes
This commit is contained in:
@ -106,7 +106,7 @@
|
||||
animateable="0">
|
||||
<BooleanDomain name="bool"/>
|
||||
<Documentation>
|
||||
A simple way cause a reader GUI modification.
|
||||
A simple way to cause a reader GUI modification.
|
||||
</Documentation>
|
||||
</IntVectorProperty>
|
||||
|
||||
|
||||
@ -385,14 +385,7 @@ int vtkPV3FoamReader::RequestData
|
||||
foamData_->Update(output, output);
|
||||
#endif
|
||||
|
||||
if (ShowPatchNames)
|
||||
{
|
||||
addPatchNamesToView();
|
||||
}
|
||||
else
|
||||
{
|
||||
removePatchNamesFromView();
|
||||
}
|
||||
updatePatchNamesView(ShowPatchNames);
|
||||
|
||||
#endif
|
||||
|
||||
@ -403,7 +396,7 @@ int vtkPV3FoamReader::RequestData
|
||||
}
|
||||
|
||||
|
||||
void vtkPV3FoamReader::addPatchNamesToView()
|
||||
void vtkPV3FoamReader::updatePatchNamesView(const bool show)
|
||||
{
|
||||
pqApplicationCore* appCore = pqApplicationCore::instance();
|
||||
|
||||
@ -415,29 +408,10 @@ void vtkPV3FoamReader::addPatchNamesToView()
|
||||
|
||||
for (int viewI=0; viewI<renderViews.size(); viewI++)
|
||||
{
|
||||
foamData_->addPatchNames
|
||||
foamData_->renderPatchNames
|
||||
(
|
||||
renderViews[viewI]->getRenderViewProxy()->GetRenderer()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void vtkPV3FoamReader::removePatchNamesFromView()
|
||||
{
|
||||
pqApplicationCore* appCore = pqApplicationCore::instance();
|
||||
|
||||
// Server manager model for querying items in the server manager
|
||||
pqServerManagerModel* smModel = appCore->getServerManagerModel();
|
||||
|
||||
// Get all the pqRenderView instances
|
||||
QList<pqRenderView*> renderViews = smModel->findItems<pqRenderView*>();
|
||||
|
||||
for (int viewI=0; viewI<renderViews.size(); viewI++)
|
||||
{
|
||||
foamData_->removePatchNames
|
||||
(
|
||||
renderViews[viewI]->getRenderViewProxy()->GetRenderer()
|
||||
renderViews[viewI]->getRenderViewProxy()->GetRenderer(),
|
||||
show
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@ -174,11 +174,8 @@ private:
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const vtkPV3FoamReader&);
|
||||
|
||||
//- Add patch names to the view
|
||||
void addPatchNamesToView();
|
||||
|
||||
//- Remove patch names from the view
|
||||
void removePatchNamesFromView();
|
||||
//- Add/remove patch names to/from the view
|
||||
void updatePatchNamesView(const bool show);
|
||||
|
||||
int TimeStepRange[2];
|
||||
int CacheMesh;
|
||||
|
||||
@ -27,15 +27,15 @@ InClass
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef vtkPV3FoamPoints_H
|
||||
#define vtkPV3FoamPoints_H
|
||||
#ifndef vtkOpenFOAMPoints_H
|
||||
#define vtkOpenFOAMPoints_H
|
||||
|
||||
// VTK includes
|
||||
#include "vtkPoints.h"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
inline void vtkPV3FoamInsertNextPoint
|
||||
inline void vtkInsertNextOpenFOAMPoint
|
||||
(
|
||||
vtkPoints *points,
|
||||
const Foam::point& p
|
||||
@ -46,7 +46,7 @@ inline void vtkPV3FoamInsertNextPoint
|
||||
|
||||
#if 0
|
||||
// this should be faster, but didn't get it working ...
|
||||
inline void vtkPV3FoamSetPoint
|
||||
inline void vtkSetOpenFOAMPoint
|
||||
(
|
||||
vtkPoints *points,
|
||||
const Foam::label id,
|
||||
@ -58,7 +58,7 @@ inline void vtkPV3FoamSetPoint
|
||||
|
||||
|
||||
// Convert Foam mesh vertices to VTK
|
||||
inline vtkPoints* vtkPV3FoamVTKPoints(const Foam::pointField& points)
|
||||
inline vtkPoints* vtkSetOpenFOAMPoints(const Foam::pointField& points)
|
||||
{
|
||||
vtkPoints *vtkpoints = vtkPoints::New();
|
||||
vtkpoints->SetNumberOfPoints(points.size());
|
||||
@ -590,220 +590,204 @@ double* Foam::vtkPV3Foam::findTimes(int& nTimeSteps)
|
||||
}
|
||||
|
||||
|
||||
void Foam::vtkPV3Foam::addPatchNames(vtkRenderer* renderer)
|
||||
void Foam::vtkPV3Foam::renderPatchNames(vtkRenderer* renderer, const bool show)
|
||||
{
|
||||
// Remove any patch names previously added to the renderer
|
||||
removePatchNames(renderer);
|
||||
// always remove old actors first
|
||||
|
||||
// get the display patches, strip off any suffix
|
||||
wordHashSet selectedPatches = getSelected
|
||||
(
|
||||
reader_->GetPartSelection(),
|
||||
partInfoPatches_
|
||||
);
|
||||
|
||||
if (!selectedPatches.size())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3Foam::addPatchNames" << nl
|
||||
<<"... add patches: " << selectedPatches << endl;
|
||||
}
|
||||
|
||||
const polyBoundaryMesh& pbMesh = meshPtr_->boundaryMesh();
|
||||
|
||||
// Find the total number of zones
|
||||
// Each zone will take the patch name
|
||||
// Number of zones per patch ... zero zones should be skipped
|
||||
labelList nZones(pbMesh.size(), 0);
|
||||
|
||||
// Per global zone number the average face centre position
|
||||
DynamicList<point> zoneCentre(pbMesh.size());
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "... determining patch zones" << endl;
|
||||
}
|
||||
|
||||
// Loop through all patches to determine zones, and centre of each zone
|
||||
forAll(pbMesh, patchI)
|
||||
{
|
||||
const polyPatch& pp = pbMesh[patchI];
|
||||
|
||||
// Only include the patch if it is selected
|
||||
if (!selectedPatches.found(pp.name()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const labelListList& edgeFaces = pp.edgeFaces();
|
||||
const vectorField& n = pp.faceNormals();
|
||||
|
||||
boolList featEdge(pp.nEdges(), false);
|
||||
|
||||
forAll(edgeFaces, edgeI)
|
||||
{
|
||||
const labelList& eFaces = edgeFaces[edgeI];
|
||||
|
||||
if (eFaces.size() == 1)
|
||||
{
|
||||
// Note: could also do ones with > 2 faces but this gives
|
||||
// too many zones for baffles
|
||||
featEdge[edgeI] = true;
|
||||
}
|
||||
else if (mag(n[eFaces[0]] & n[eFaces[1]]) < 0.5)
|
||||
{
|
||||
featEdge[edgeI] = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Do topological analysis of patch, find disconnected regions
|
||||
patchZones pZones(pp, featEdge);
|
||||
|
||||
nZones[patchI] = pZones.nZones();
|
||||
|
||||
labelList zoneNFaces(pZones.nZones(), 0);
|
||||
|
||||
// Save start of information for current patch
|
||||
label patchStart = zoneCentre.size();
|
||||
|
||||
// Create storage for additional zone centres
|
||||
forAll(zoneNFaces, zoneI)
|
||||
{
|
||||
zoneCentre.append(vector::zero);
|
||||
}
|
||||
|
||||
// Do averaging per individual zone
|
||||
forAll(pp, faceI)
|
||||
{
|
||||
label zoneI = pZones[faceI];
|
||||
zoneCentre[patchStart+zoneI] += pp[faceI].centre(pp.points());
|
||||
zoneNFaces[zoneI]++;
|
||||
}
|
||||
|
||||
for (label i=0; i<nZones[patchI]; i++)
|
||||
{
|
||||
zoneCentre[patchStart + i] /= zoneNFaces[i];
|
||||
}
|
||||
}
|
||||
|
||||
// Count number of zones we're actually going to display. This is truncated
|
||||
// to a max per patch
|
||||
|
||||
const label MAXPATCHZONES = 20;
|
||||
|
||||
label displayZoneI = 0;
|
||||
|
||||
forAll(pbMesh, patchI)
|
||||
{
|
||||
displayZoneI += min(MAXPATCHZONES, nZones[patchI]);
|
||||
}
|
||||
|
||||
|
||||
zoneCentre.shrink();
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "patch zone centres = " << zoneCentre << nl
|
||||
<< "displayed zone centres = " << displayZoneI << nl
|
||||
<< "zones per patch = " << nZones << endl;
|
||||
}
|
||||
|
||||
// Set the size of the patch labels to max number of zones
|
||||
patchTextActorsPtrs_.setSize(displayZoneI);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "constructing patch labels" << endl;
|
||||
}
|
||||
|
||||
// Actor index
|
||||
displayZoneI = 0;
|
||||
|
||||
// Index in zone centres
|
||||
label globalZoneI = 0;
|
||||
|
||||
forAll(pbMesh, patchI)
|
||||
{
|
||||
const polyPatch& pp = pbMesh[patchI];
|
||||
|
||||
// Only selected patches will have a non-zero number of zones
|
||||
label nDisplayZones = min(MAXPATCHZONES, nZones[patchI]);
|
||||
label increment = 1;
|
||||
if (nZones[patchI] >= MAXPATCHZONES)
|
||||
{
|
||||
increment = nZones[patchI]/MAXPATCHZONES;
|
||||
}
|
||||
|
||||
for (label i = 0; i < nDisplayZones; i++)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "patch name = " << pp.name() << nl
|
||||
<< "anchor = " << zoneCentre[globalZoneI] << nl
|
||||
<< "globalZoneI = " << globalZoneI << endl;
|
||||
}
|
||||
|
||||
vtkTextActor* txt = vtkTextActor::New();
|
||||
|
||||
txt->SetInput(pp.name().c_str());
|
||||
|
||||
// Set text properties
|
||||
vtkTextProperty* tprop = txt->GetTextProperty();
|
||||
tprop->SetFontFamilyToArial();
|
||||
tprop->BoldOff();
|
||||
tprop->ShadowOff();
|
||||
tprop->SetLineSpacing(1.0);
|
||||
tprop->SetFontSize(12);
|
||||
tprop->SetColor(1.0, 0.0, 0.0);
|
||||
tprop->SetJustificationToCentered();
|
||||
|
||||
// Set text to use 3-D world co-ordinates
|
||||
txt->GetPositionCoordinate()->SetCoordinateSystemToWorld();
|
||||
|
||||
txt->GetPositionCoordinate()->SetValue
|
||||
(
|
||||
zoneCentre[globalZoneI].x(),
|
||||
zoneCentre[globalZoneI].y(),
|
||||
zoneCentre[globalZoneI].z()
|
||||
);
|
||||
|
||||
// Add text to each renderer
|
||||
renderer->AddViewProp(txt);
|
||||
|
||||
// Maintain a list of text labels added so that they can be
|
||||
// removed later
|
||||
patchTextActorsPtrs_[displayZoneI] = txt;
|
||||
|
||||
globalZoneI += increment;
|
||||
displayZoneI++;
|
||||
}
|
||||
}
|
||||
|
||||
// Resize the patch names list to the actual number of patch names added
|
||||
patchTextActorsPtrs_.setSize(displayZoneI);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> Foam::vtkPV3Foam::addPatchNames" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::vtkPV3Foam::removePatchNames(vtkRenderer* renderer)
|
||||
{
|
||||
forAll(patchTextActorsPtrs_, patchI)
|
||||
{
|
||||
renderer->RemoveViewProp(patchTextActorsPtrs_[patchI]);
|
||||
patchTextActorsPtrs_[patchI]->Delete();
|
||||
}
|
||||
patchTextActorsPtrs_.clear();
|
||||
|
||||
if (show)
|
||||
{
|
||||
// get the display patches, strip off any suffix
|
||||
wordHashSet selectedPatches = getSelected
|
||||
(
|
||||
reader_->GetPartSelection(),
|
||||
partInfoPatches_
|
||||
);
|
||||
|
||||
if (!selectedPatches.size())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
const polyBoundaryMesh& pbMesh = meshPtr_->boundaryMesh();
|
||||
|
||||
// Find the total number of zones
|
||||
// Each zone will take the patch name
|
||||
// Number of zones per patch ... zero zones should be skipped
|
||||
labelList nZones(pbMesh.size(), 0);
|
||||
|
||||
// Per global zone number the average face centre position
|
||||
DynamicList<point> zoneCentre(pbMesh.size());
|
||||
|
||||
|
||||
// Loop through all patches to determine zones, and centre of each zone
|
||||
forAll(pbMesh, patchI)
|
||||
{
|
||||
const polyPatch& pp = pbMesh[patchI];
|
||||
|
||||
// Only include the patch if it is selected
|
||||
if (!selectedPatches.found(pp.name()))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
const labelListList& edgeFaces = pp.edgeFaces();
|
||||
const vectorField& n = pp.faceNormals();
|
||||
|
||||
boolList featEdge(pp.nEdges(), false);
|
||||
|
||||
forAll(edgeFaces, edgeI)
|
||||
{
|
||||
const labelList& eFaces = edgeFaces[edgeI];
|
||||
|
||||
if (eFaces.size() == 1)
|
||||
{
|
||||
// Note: could also do ones with > 2 faces but this gives
|
||||
// too many zones for baffles
|
||||
featEdge[edgeI] = true;
|
||||
}
|
||||
else if (mag(n[eFaces[0]] & n[eFaces[1]]) < 0.5)
|
||||
{
|
||||
featEdge[edgeI] = true;
|
||||
}
|
||||
}
|
||||
|
||||
// Do topological analysis of patch, find disconnected regions
|
||||
patchZones pZones(pp, featEdge);
|
||||
|
||||
nZones[patchI] = pZones.nZones();
|
||||
|
||||
labelList zoneNFaces(pZones.nZones(), 0);
|
||||
|
||||
// Save start of information for current patch
|
||||
label patchStart = zoneCentre.size();
|
||||
|
||||
// Create storage for additional zone centres
|
||||
forAll(zoneNFaces, zoneI)
|
||||
{
|
||||
zoneCentre.append(vector::zero);
|
||||
}
|
||||
|
||||
// Do averaging per individual zone
|
||||
forAll(pp, faceI)
|
||||
{
|
||||
label zoneI = pZones[faceI];
|
||||
zoneCentre[patchStart+zoneI] += pp[faceI].centre(pp.points());
|
||||
zoneNFaces[zoneI]++;
|
||||
}
|
||||
|
||||
for (label i=0; i<nZones[patchI]; i++)
|
||||
{
|
||||
zoneCentre[patchStart + i] /= zoneNFaces[i];
|
||||
}
|
||||
}
|
||||
|
||||
// Count number of zones we're actually going to display. This is truncated
|
||||
// to a max per patch
|
||||
|
||||
const label MAXPATCHZONES = 20;
|
||||
|
||||
label displayZoneI = 0;
|
||||
|
||||
forAll(pbMesh, patchI)
|
||||
{
|
||||
displayZoneI += min(MAXPATCHZONES, nZones[patchI]);
|
||||
}
|
||||
|
||||
|
||||
zoneCentre.shrink();
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "patch zone centres = " << zoneCentre << nl
|
||||
<< "displayed zone centres = " << displayZoneI << nl
|
||||
<< "zones per patch = " << nZones << endl;
|
||||
}
|
||||
|
||||
// Set the size of the patch labels to max number of zones
|
||||
patchTextActorsPtrs_.setSize(displayZoneI);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "constructing patch labels" << endl;
|
||||
}
|
||||
|
||||
// Actor index
|
||||
displayZoneI = 0;
|
||||
|
||||
// Index in zone centres
|
||||
label globalZoneI = 0;
|
||||
|
||||
forAll(pbMesh, patchI)
|
||||
{
|
||||
const polyPatch& pp = pbMesh[patchI];
|
||||
|
||||
// Only selected patches will have a non-zero number of zones
|
||||
label nDisplayZones = min(MAXPATCHZONES, nZones[patchI]);
|
||||
label increment = 1;
|
||||
if (nZones[patchI] >= MAXPATCHZONES)
|
||||
{
|
||||
increment = nZones[patchI]/MAXPATCHZONES;
|
||||
}
|
||||
|
||||
for (label i = 0; i < nDisplayZones; i++)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "patch name = " << pp.name() << nl
|
||||
<< "anchor = " << zoneCentre[globalZoneI] << nl
|
||||
<< "globalZoneI = " << globalZoneI << endl;
|
||||
}
|
||||
|
||||
vtkTextActor* txt = vtkTextActor::New();
|
||||
|
||||
txt->SetInput(pp.name().c_str());
|
||||
|
||||
// Set text properties
|
||||
vtkTextProperty* tprop = txt->GetTextProperty();
|
||||
tprop->SetFontFamilyToArial();
|
||||
tprop->BoldOff();
|
||||
tprop->ShadowOff();
|
||||
tprop->SetLineSpacing(1.0);
|
||||
tprop->SetFontSize(12);
|
||||
tprop->SetColor(1.0, 0.0, 0.0);
|
||||
tprop->SetJustificationToCentered();
|
||||
|
||||
// Set text to use 3-D world co-ordinates
|
||||
txt->GetPositionCoordinate()->SetCoordinateSystemToWorld();
|
||||
|
||||
txt->GetPositionCoordinate()->SetValue
|
||||
(
|
||||
zoneCentre[globalZoneI].x(),
|
||||
zoneCentre[globalZoneI].y(),
|
||||
zoneCentre[globalZoneI].z()
|
||||
);
|
||||
|
||||
// Add text to each renderer
|
||||
renderer->AddViewProp(txt);
|
||||
|
||||
// Maintain a list of text labels added so that they can be
|
||||
// removed later
|
||||
patchTextActorsPtrs_[displayZoneI] = txt;
|
||||
|
||||
globalZoneI += increment;
|
||||
displayZoneI++;
|
||||
}
|
||||
}
|
||||
|
||||
// Resize the patch names list to the actual number of patch names added
|
||||
patchTextActorsPtrs_.setSize(displayZoneI);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Foam::vtkPV3Foam::PrintSelf(ostream& os, vtkIndent indent) const
|
||||
{
|
||||
os << indent << "Number of nodes: "
|
||||
|
||||
@ -31,7 +31,6 @@ Description
|
||||
SourceFiles
|
||||
vtkPV3Foam.C
|
||||
vtkPV3Foam.H
|
||||
vtkPV3FoamI.H
|
||||
vtkPV3FoamFields.C
|
||||
vtkPV3FoamMesh.C
|
||||
vtkPV3FoamMeshLagrangian.C
|
||||
@ -627,9 +626,6 @@ class vtkPV3Foam
|
||||
|
||||
// GUI selection helper functions
|
||||
|
||||
//- Extract up to the first non-word characters
|
||||
inline static word getFirstWord(const char*);
|
||||
|
||||
//- Only keep what is listed in hashSet
|
||||
static void pruneObjectList
|
||||
(
|
||||
@ -715,11 +711,8 @@ public:
|
||||
// returns the count via the parameter
|
||||
double* findTimes(int& nTimeSteps);
|
||||
|
||||
//- Add patch names to the display
|
||||
void addPatchNames(vtkRenderer* renderer);
|
||||
|
||||
//- Remove patch names from the display
|
||||
void removePatchNames(vtkRenderer* renderer);
|
||||
//- Add/remove patch names to/from the view
|
||||
void renderPatchNames(vtkRenderer*, const bool show);
|
||||
|
||||
//- set the runTime to the first plausible request time,
|
||||
// returns the timeIndex
|
||||
@ -751,8 +744,6 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
# include "vtkPV3FoamI.H"
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -1,48 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2009 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
inline Foam::word Foam::vtkPV3Foam::getFirstWord(const char* str)
|
||||
{
|
||||
if (str)
|
||||
{
|
||||
label n = 0;
|
||||
while (str[n] && word::valid(str[n]))
|
||||
{
|
||||
++n;
|
||||
}
|
||||
return word(str, n, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return word::null;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -33,7 +33,7 @@ Description
|
||||
#include "fvMesh.H"
|
||||
#include "IOobjectList.H"
|
||||
#include "passiveParticle.H"
|
||||
#include "vtkPV3FoamPoints.H"
|
||||
#include "vtkOpenFOAMPoints.H"
|
||||
|
||||
// VTK includes
|
||||
#include "vtkCellArray.h"
|
||||
@ -86,7 +86,7 @@ vtkPolyData* Foam::vtkPV3Foam::lagrangianVTKMesh
|
||||
vtkIdType particleId = 0;
|
||||
forAllConstIter(Cloud<passiveParticle>, parcels, iter)
|
||||
{
|
||||
vtkPV3FoamInsertNextPoint(vtkpoints, iter().position());
|
||||
vtkInsertNextOpenFOAMPoint(vtkpoints, iter().position());
|
||||
|
||||
vtkcells->InsertNextCell(1, &particleId);
|
||||
particleId++;
|
||||
|
||||
@ -31,7 +31,7 @@ Description
|
||||
// Foam includes
|
||||
#include "polyPatch.H"
|
||||
#include "primitivePatch.H"
|
||||
#include "vtkPV3FoamPoints.H"
|
||||
#include "vtkOpenFOAMPoints.H"
|
||||
|
||||
// VTK includes
|
||||
#include "vtkCellArray.h"
|
||||
@ -60,7 +60,7 @@ vtkPolyData* Foam::vtkPV3Foam::patchVTKMesh
|
||||
vtkpoints->Allocate( points.size() );
|
||||
forAll(points, i)
|
||||
{
|
||||
vtkPV3FoamInsertNextPoint(vtkpoints, points[i]);
|
||||
vtkInsertNextOpenFOAMPoint(vtkpoints, points[i]);
|
||||
}
|
||||
|
||||
vtkmesh->SetPoints(vtkpoints);
|
||||
|
||||
@ -31,7 +31,7 @@ Description
|
||||
// Foam includes
|
||||
#include "faceSet.H"
|
||||
#include "pointSet.H"
|
||||
#include "vtkPV3FoamPoints.H"
|
||||
#include "vtkOpenFOAMPoints.H"
|
||||
|
||||
// VTK includes
|
||||
#include "vtkPoints.h"
|
||||
@ -75,7 +75,7 @@ vtkPolyData* Foam::vtkPV3Foam::faceSetVTKMesh
|
||||
vtkpoints->Allocate( points.size() );
|
||||
forAll(points, i)
|
||||
{
|
||||
vtkPV3FoamInsertNextPoint(vtkpoints, points[i]);
|
||||
vtkInsertNextOpenFOAMPoint(vtkpoints, points[i]);
|
||||
}
|
||||
vtkmesh->SetPoints(vtkpoints);
|
||||
vtkpoints->Delete();
|
||||
@ -132,7 +132,7 @@ vtkPolyData* Foam::vtkPV3Foam::pointSetVTKMesh
|
||||
|
||||
forAllConstIter(pointSet, pSet, iter)
|
||||
{
|
||||
vtkPV3FoamInsertNextPoint(vtkpoints, meshPoints[iter.key()]);
|
||||
vtkInsertNextOpenFOAMPoint(vtkpoints, meshPoints[iter.key()]);
|
||||
}
|
||||
|
||||
vtkmesh->SetPoints(vtkpoints);
|
||||
|
||||
@ -31,7 +31,7 @@ Description
|
||||
// Foam includes
|
||||
#include "fvMesh.H"
|
||||
#include "cellModeller.H"
|
||||
#include "vtkPV3FoamPoints.H"
|
||||
#include "vtkOpenFOAMPoints.H"
|
||||
|
||||
// VTK includes
|
||||
#include "vtkCellArray.h"
|
||||
@ -143,7 +143,7 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
|
||||
|
||||
forAll(points, i)
|
||||
{
|
||||
vtkPV3FoamInsertNextPoint(vtkpoints, points[i]);
|
||||
vtkInsertNextOpenFOAMPoint(vtkpoints, points[i]);
|
||||
}
|
||||
|
||||
|
||||
@ -267,7 +267,7 @@ vtkUnstructuredGrid* Foam::vtkPV3Foam::volumeVTKMesh
|
||||
|
||||
// Insert the new vertex from the cell-centre
|
||||
label newVertexLabel = mesh.nPoints() + addPointI;
|
||||
vtkPV3FoamInsertNextPoint(vtkpoints, mesh.C()[cellI]);
|
||||
vtkInsertNextOpenFOAMPoint(vtkpoints, mesh.C()[cellI]);
|
||||
|
||||
// Whether to insert cell in place of original or not.
|
||||
bool substituteCell = true;
|
||||
|
||||
@ -29,7 +29,7 @@ Description
|
||||
#include "vtkPV3Foam.H"
|
||||
|
||||
// Foam includes
|
||||
#include "vtkPV3FoamPoints.H"
|
||||
#include "vtkOpenFOAMPoints.H"
|
||||
|
||||
// VTK includes
|
||||
#include "vtkPoints.h"
|
||||
@ -72,7 +72,7 @@ vtkPolyData* Foam::vtkPV3Foam::faceZoneVTKMesh
|
||||
vtkpoints->Allocate( points.size() );
|
||||
forAll(points, i)
|
||||
{
|
||||
vtkPV3FoamInsertNextPoint(vtkpoints, points[i]);
|
||||
vtkInsertNextOpenFOAMPoint(vtkpoints, points[i]);
|
||||
}
|
||||
|
||||
vtkmesh->SetPoints(vtkpoints);
|
||||
@ -131,7 +131,7 @@ vtkPolyData* Foam::vtkPV3Foam::pointZoneVTKMesh
|
||||
|
||||
forAll(pointLabels, pointI)
|
||||
{
|
||||
vtkPV3FoamInsertNextPoint(vtkpoints, meshPoints[pointLabels[pointI]]);
|
||||
vtkInsertNextOpenFOAMPoint(vtkpoints, meshPoints[pointLabels[pointI]]);
|
||||
}
|
||||
|
||||
vtkmesh->SetPoints(vtkpoints);
|
||||
|
||||
@ -41,6 +41,34 @@ Description
|
||||
#include "vtkMultiBlockDataSet.h"
|
||||
#include "vtkInformation.h"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
//! @cond fileScope
|
||||
// Extract up to the first non-word characters
|
||||
inline word getFirstWord(const char* str)
|
||||
{
|
||||
if (str)
|
||||
{
|
||||
label n = 0;
|
||||
while (str[n] && word::valid(str[n]))
|
||||
{
|
||||
++n;
|
||||
}
|
||||
return word(str, n, true);
|
||||
}
|
||||
else
|
||||
{
|
||||
return word::null;
|
||||
}
|
||||
|
||||
}
|
||||
//! @endcond fileScope
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::vtkPV3Foam::AddToBlock
|
||||
|
||||
Reference in New Issue
Block a user