mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
extrapolate to any non-constraint patch
This commit is contained in:
@ -30,16 +30,16 @@
|
|||||||
|
|
||||||
<!-- Global settings -->
|
<!-- Global settings -->
|
||||||
|
|
||||||
<!-- Extrapolate Walls check-box -->
|
<!-- Extrapolate Patches check-box -->
|
||||||
<IntVectorProperty
|
<IntVectorProperty
|
||||||
name="ExtrapolateWalls"
|
name="ExtrapolatePatches"
|
||||||
command="SetExtrapolateWalls"
|
command="SetExtrapolatePatches"
|
||||||
number_of_elements="1"
|
number_of_elements="1"
|
||||||
default_values="0"
|
default_values="0"
|
||||||
animateable="0">
|
animateable="0">
|
||||||
<BooleanDomain name="bool"/>
|
<BooleanDomain name="bool"/>
|
||||||
<Documentation>
|
<Documentation>
|
||||||
Extrapolate internalField to wall and empty patches
|
Extrapolate internalField to non-constraint patches
|
||||||
</Documentation>
|
</Documentation>
|
||||||
</IntVectorProperty>
|
</IntVectorProperty>
|
||||||
|
|
||||||
|
|||||||
@ -64,7 +64,7 @@ vtkPV3FoamReader::vtkPV3FoamReader()
|
|||||||
|
|
||||||
CacheMesh = 1;
|
CacheMesh = 1;
|
||||||
|
|
||||||
ExtrapolateWalls = 0;
|
ExtrapolatePatches = 0;
|
||||||
IncludeSets = 0;
|
IncludeSets = 0;
|
||||||
IncludeZones = 0;
|
IncludeZones = 0;
|
||||||
ShowPatchNames = 0;
|
ShowPatchNames = 0;
|
||||||
|
|||||||
@ -65,9 +65,9 @@ public:
|
|||||||
vtkGetMacro(CacheMesh, int);
|
vtkGetMacro(CacheMesh, int);
|
||||||
|
|
||||||
// Description:
|
// Description:
|
||||||
// FOAM extrapolate internal values onto the walls
|
// FOAM extrapolate internal values onto the patches
|
||||||
vtkSetMacro(ExtrapolateWalls, int);
|
vtkSetMacro(ExtrapolatePatches, int);
|
||||||
vtkGetMacro(ExtrapolateWalls, int);
|
vtkGetMacro(ExtrapolatePatches, int);
|
||||||
|
|
||||||
// FOAM read sets control
|
// FOAM read sets control
|
||||||
vtkSetMacro(IncludeSets, int);
|
vtkSetMacro(IncludeSets, int);
|
||||||
@ -183,7 +183,7 @@ private:
|
|||||||
int TimeStepRange[2];
|
int TimeStepRange[2];
|
||||||
int CacheMesh;
|
int CacheMesh;
|
||||||
|
|
||||||
int ExtrapolateWalls;
|
int ExtrapolatePatches;
|
||||||
int IncludeSets;
|
int IncludeSets;
|
||||||
int IncludeZones;
|
int IncludeZones;
|
||||||
int ShowPatchNames;
|
int ShowPatchNames;
|
||||||
|
|||||||
@ -659,29 +659,55 @@ void Foam::vtkPV3Foam::addPatchNames(vtkRenderer* renderer)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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();
|
zoneCentre.shrink();
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "patch zone centres = " << zoneCentre << nl
|
Info<< "patch zone centres = " << zoneCentre << nl
|
||||||
|
<< "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
|
||||||
patchTextActorsPtrs_.setSize(zoneCentre.size());
|
patchTextActorsPtrs_.setSize(displayZoneI);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "constructing patch labels" << endl;
|
Info<< "constructing patch labels" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Actor index
|
||||||
|
displayZoneI = 0;
|
||||||
|
|
||||||
|
// Index in zone centres
|
||||||
label globalZoneI = 0;
|
label globalZoneI = 0;
|
||||||
|
|
||||||
forAll(pbMesh, patchI)
|
forAll(pbMesh, patchI)
|
||||||
{
|
{
|
||||||
const polyPatch& pp = pbMesh[patchI];
|
const polyPatch& pp = pbMesh[patchI];
|
||||||
|
|
||||||
// Only selected patches will have a non-zero number of zones
|
// Only selected patches will have a non-zero number of zones
|
||||||
for (label i=0; i<nZones[patchI]; i++)
|
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)
|
if (debug)
|
||||||
{
|
{
|
||||||
@ -719,14 +745,15 @@ void Foam::vtkPV3Foam::addPatchNames(vtkRenderer* renderer)
|
|||||||
|
|
||||||
// Maintain a list of text labels added so that they can be
|
// Maintain a list of text labels added so that they can be
|
||||||
// removed later
|
// removed later
|
||||||
patchTextActorsPtrs_[globalZoneI] = txt;
|
patchTextActorsPtrs_[displayZoneI] = txt;
|
||||||
|
|
||||||
globalZoneI++;
|
globalZoneI += increment;
|
||||||
|
displayZoneI++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Resize the patch names list to the actual number of patch names added
|
// Resize the patch names list to the actual number of patch names added
|
||||||
patchTextActorsPtrs_.setSize(globalZoneI);
|
patchTextActorsPtrs_.setSize(displayZoneI);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -132,8 +132,8 @@ void Foam::vtkPV3Foam::convertVolFields
|
|||||||
isType<emptyFvPatchField<Type> >(ptf)
|
isType<emptyFvPatchField<Type> >(ptf)
|
||||||
||
|
||
|
||||||
(
|
(
|
||||||
typeid(patches[patchId]) == typeid(wallPolyPatch)
|
reader_->GetExtrapolatePatches()
|
||||||
&& reader_->GetExtrapolateWalls()
|
&& !polyPatch::constraintType(patches[patchId].type())
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user