mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of ssh://noisy/home/noisy2/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
/*---------------------------------------------------------------------------* \
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
@ -71,7 +71,7 @@ int main(int argc, char *argv[])
|
||||
volScalarField rUA = 1.0/UEqn.A();
|
||||
|
||||
U = rUA*UEqn.H();
|
||||
phi = (fvc::interpolate(U) & mesh.Sf())
|
||||
phi = (fvc::interpolate(U) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rUA, U, phi);
|
||||
|
||||
adjustPhi(phi, U, p);
|
||||
|
||||
@ -5,15 +5,12 @@ set -x
|
||||
# run from this directory only
|
||||
cd ${0%/*} || exit 1
|
||||
|
||||
# build libccmio if required
|
||||
if [ ! -e $FOAM_LIBBIN/libccmio.so ]
|
||||
then
|
||||
# build libccmio and create lnInclude directory
|
||||
(
|
||||
cd $WM_THIRD_PARTY_DIR && ./AllwmakeLibccmio
|
||||
)
|
||||
fi
|
||||
|
||||
# if the library built okay, the headers must exist too
|
||||
# if the library built okay, the headers should exist too
|
||||
if [ -e $FOAM_LIBBIN/libccmio.so ]
|
||||
then
|
||||
wmake ccm26ToFoam
|
||||
|
||||
@ -22,9 +22,29 @@ License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Application
|
||||
blockMesh
|
||||
|
||||
Description
|
||||
A multi-block mesh generator.
|
||||
|
||||
Uses the block mesh description found in
|
||||
@a constant/polyMesh/blockMeshDict
|
||||
(or @a constant/\<region\>/polyMesh/blockMeshDict).
|
||||
|
||||
Usage
|
||||
|
||||
- blockMesh [OPTION]
|
||||
|
||||
@param -blockTopology \n
|
||||
Write the topology as a set of edges in OBJ format.
|
||||
|
||||
@param -region \<name\> \n
|
||||
Specify an alternative mesh region.
|
||||
|
||||
@param -dict \<dictionary\> \n
|
||||
Specify an alternative dictionary for the block mesh description.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "Time.H"
|
||||
@ -60,59 +80,70 @@ int main(int argc, char *argv[])
|
||||
|
||||
word regionName;
|
||||
fileName polyMeshDir;
|
||||
word dictName("blockMeshDict");
|
||||
fileName dictPath(runTime.constant());
|
||||
|
||||
if (args.options().found("region"))
|
||||
{
|
||||
regionName = args.options()["region"];
|
||||
// constant/<region>/polyMesh/blockMeshDict
|
||||
regionName = args.options()["region"];
|
||||
polyMeshDir = regionName/polyMesh::meshSubDir;
|
||||
|
||||
Info<< nl << "Generating mesh for region " << regionName << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
regionName = polyMesh::defaultRegion;
|
||||
// constant/polyMesh/blockMeshDict
|
||||
regionName = polyMesh::defaultRegion;
|
||||
polyMeshDir = polyMesh::meshSubDir;
|
||||
}
|
||||
|
||||
|
||||
Info<< nl << "Reading block mesh description dictionary" << endl;
|
||||
|
||||
word dictName("blockMeshDict");
|
||||
fileName dictPath(runTime.constant()/polyMeshDir);
|
||||
fileName dictLocal = polyMeshDir;
|
||||
|
||||
if (args.options().found("dict"))
|
||||
{
|
||||
fileName userDict(args.options()["dict"]);
|
||||
wordList elems(fileName(args.options()["dict"]).components());
|
||||
dictName = elems[elems.size()-1];
|
||||
dictPath = elems[0];
|
||||
dictLocal = "";
|
||||
|
||||
dictName = userDict.name();
|
||||
dictPath = userDict.path();
|
||||
if (elems.size() == 1)
|
||||
{
|
||||
dictPath = ".";
|
||||
}
|
||||
else if (elems.size() > 2)
|
||||
{
|
||||
dictLocal = fileName(SubList<word>(elems, elems.size()-2, 1));
|
||||
}
|
||||
}
|
||||
|
||||
IOobject meshDescriptionIOobject
|
||||
|
||||
IOobject meshDictIo
|
||||
(
|
||||
dictName,
|
||||
dictPath,
|
||||
dictLocal,
|
||||
runTime,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
);
|
||||
|
||||
if (!meshDescriptionIOobject.headerOk())
|
||||
if (!meshDictIo.headerOk())
|
||||
{
|
||||
FatalErrorIn(args.executable())
|
||||
<< "Cannot open mesh description file: " << nl
|
||||
<< dictPath/dictName << nl
|
||||
<< "Cannot open mesh description file\n "
|
||||
<< meshDictIo.objectPath()
|
||||
<< nl
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
IOdictionary meshDescription(meshDescriptionIOobject);
|
||||
Info<< nl << "Creating block mesh from\n "
|
||||
<< meshDictIo.objectPath() << endl;
|
||||
|
||||
IOdictionary meshDict(meshDictIo);
|
||||
|
||||
Info<< nl << "Creating block mesh" << endl;
|
||||
|
||||
blockMesh blocks(meshDescription);
|
||||
|
||||
blockMesh blocks(meshDict);
|
||||
|
||||
if (writeTopo)
|
||||
{
|
||||
@ -169,7 +200,7 @@ int main(int argc, char *argv[])
|
||||
(
|
||||
runTime,
|
||||
runTime.constant(),
|
||||
polyMeshDir, //polyMesh::meshSubDir
|
||||
polyMeshDir,
|
||||
patchNames,
|
||||
patchTypes,
|
||||
defaultFacesName,
|
||||
@ -197,11 +228,11 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
// Read in a list of dictionaries for the merge patch pairs
|
||||
if (meshDescription.found("mergePatchPairs"))
|
||||
if (meshDict.found("mergePatchPairs"))
|
||||
{
|
||||
List<Pair<word> > mergePatchPairs
|
||||
(
|
||||
meshDescription.lookup("mergePatchPairs")
|
||||
meshDict.lookup("mergePatchPairs")
|
||||
);
|
||||
|
||||
if (mergePatchPairs.size())
|
||||
|
||||
@ -275,6 +275,12 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
||||
patchIndices[patchI] = patchIndex(bm[patchI]);
|
||||
}
|
||||
|
||||
// Temporary: update number of allowable patches. This should be
|
||||
// determined at the top - before adding anything.
|
||||
meshMod_.setNumPatches(patchNames_.size());
|
||||
|
||||
|
||||
|
||||
const faceZoneMesh& fz = m.faceZones();
|
||||
labelList faceZoneIndices(fz.size());
|
||||
|
||||
@ -315,12 +321,6 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
||||
}
|
||||
}
|
||||
|
||||
newOwn = own[faceI];
|
||||
if (newOwn > -1) newOwn = renumberCells[newOwn];
|
||||
|
||||
newNei = nei[faceI];
|
||||
if (newNei > -1) newNei = renumberCells[newNei];
|
||||
|
||||
if (faceI < m.nInternalFaces() || faceI >= m.nFaces())
|
||||
{
|
||||
newPatch = -1;
|
||||
@ -330,6 +330,20 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
|
||||
newPatch = patchIndices[bm.whichPatch(faceI)];
|
||||
}
|
||||
|
||||
newOwn = own[faceI];
|
||||
if (newOwn > -1) newOwn = renumberCells[newOwn];
|
||||
|
||||
if (newPatch > -1)
|
||||
{
|
||||
newNei = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
newNei = nei[faceI];
|
||||
newNei = renumberCells[newNei];
|
||||
}
|
||||
|
||||
|
||||
newZone = fz.whichZone(faceI);
|
||||
newZoneFlip = false;
|
||||
|
||||
|
||||
@ -58,4 +58,15 @@ manualCoeffs
|
||||
dataFile "decompositionData";
|
||||
}
|
||||
|
||||
|
||||
//// Is the case distributred
|
||||
//distributed yes;
|
||||
//// Per slave (so nProcs-1 entries) the directory above the case.
|
||||
//roots
|
||||
//(
|
||||
// "/tmp"
|
||||
// "/tmp"
|
||||
//);
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
#!/bin/sh
|
||||
set -x
|
||||
|
||||
rm -r PV3FoamReader/Make
|
||||
|
||||
rm -rf PV3FoamReader/Make
|
||||
wclean libso vtkPV3Foam
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<ParaViewReaders>
|
||||
<Reader name="PV3FoamReader"
|
||||
extensions="OpenFOAM"
|
||||
file_description="OpenFOAM">
|
||||
file_description="OpenFOAM Reader">
|
||||
</Reader>
|
||||
</ParaViewReaders>
|
||||
|
||||
@ -31,26 +31,6 @@
|
||||
<TimeRangeInformationHelper/>
|
||||
</DoubleVectorProperty>
|
||||
|
||||
<!-- Update GUI check box -->
|
||||
<IntVectorProperty
|
||||
name="UpdateGUI"
|
||||
command="SetUpdateGUI"
|
||||
number_of_elements="1"
|
||||
default_values="0">
|
||||
<BooleanDomain
|
||||
name="bool"/>
|
||||
</IntVectorProperty>
|
||||
|
||||
<!-- Cache mesh check box -->
|
||||
<IntVectorProperty
|
||||
name="CacheMesh"
|
||||
command="SetCacheMesh"
|
||||
number_of_elements="1"
|
||||
default_values="1">
|
||||
<BooleanDomain
|
||||
name="bool"/>
|
||||
</IntVectorProperty>
|
||||
|
||||
<!-- ExtrapolateWalls check box -->
|
||||
<IntVectorProperty
|
||||
name="ExtrapolateWalls"
|
||||
@ -186,34 +166,25 @@
|
||||
</ArraySelectionDomain>
|
||||
</StringVectorProperty>
|
||||
|
||||
<!-- Available times array -->
|
||||
<!-- PV3FOAM_TIMESELECTION must be defined when compiling vtkPV3Foam
|
||||
might discard this in the future
|
||||
<StringVectorProperty
|
||||
name="TimeArrayInfo"
|
||||
information_only="1">
|
||||
<ArraySelectionInformationHelper
|
||||
attribute_name="Time"/>
|
||||
</StringVectorProperty>
|
||||
<StringVectorProperty
|
||||
name="TimeStatus"
|
||||
command="SetTimeArrayStatus"
|
||||
number_of_elements="0"
|
||||
repeat_command="1"
|
||||
number_of_elements_per_command="2"
|
||||
element_types="2 0"
|
||||
information_property="TimeArrayInfo">
|
||||
<ArraySelectionDomain
|
||||
name="array_list">
|
||||
<RequiredProperties>
|
||||
<Property name="TimeArrayInfo"
|
||||
function="ArrayList"/>
|
||||
</RequiredProperties>
|
||||
</ArraySelectionDomain>
|
||||
</StringVectorProperty>
|
||||
<!-- Cache mesh check box -->
|
||||
<IntVectorProperty
|
||||
name="CacheMesh"
|
||||
command="SetCacheMesh"
|
||||
number_of_elements="1"
|
||||
default_values="1">
|
||||
<BooleanDomain
|
||||
name="bool"/>
|
||||
</IntVectorProperty>
|
||||
|
||||
PV3FOAM_TIMESELECTION
|
||||
-->
|
||||
<!-- Update GUI check box -->
|
||||
<IntVectorProperty
|
||||
name="UpdateGUI"
|
||||
command="SetUpdateGUI"
|
||||
number_of_elements="1"
|
||||
default_values="0">
|
||||
<BooleanDomain
|
||||
name="bool"/>
|
||||
</IntVectorProperty>
|
||||
|
||||
</SourceProxy>
|
||||
</ProxyGroup>
|
||||
|
||||
@ -21,32 +21,19 @@
|
||||
|
||||
// VTK includes
|
||||
#include "vtkCallbackCommand.h"
|
||||
#include "vtkCellArray.h"
|
||||
#include "vtkCellData.h"
|
||||
#include "vtkDataArraySelection.h"
|
||||
#include "vtkDirectory.h"
|
||||
#include "vtkDoubleArray.h"
|
||||
#include "vtkErrorCode.h"
|
||||
#include "vtkFloatArray.h"
|
||||
#include "vtkInformation.h"
|
||||
#include "vtkInformationVector.h"
|
||||
#include "vtkIntArray.h"
|
||||
#include "vtkMultiBlockDataSet.h"
|
||||
#include "vtkObjectFactory.h"
|
||||
#include "vtkPoints.h"
|
||||
#include "vtkRenderer.h"
|
||||
#include "vtkSMRenderViewProxy.h"
|
||||
#include "vtkStreamingDemandDrivenPipeline.h"
|
||||
#include "vtkStringArray.h"
|
||||
#include "vtkUnstructuredGrid.h"
|
||||
#include "vtkUnstructuredGridAlgorithm.h"
|
||||
#include "vtkAlgorithmOutput.h"
|
||||
#include "vtkMultiBlockDataSet.h"
|
||||
|
||||
// Foam includes
|
||||
#include "vtkPV3Foam.H"
|
||||
|
||||
vtkCxxRevisionMacro(vtkPV3FoamReader, "$Revision: 1.2$");
|
||||
vtkCxxRevisionMacro(vtkPV3FoamReader, "$Revision: 1.5$");
|
||||
vtkStandardNewMacro(vtkPV3FoamReader);
|
||||
|
||||
|
||||
@ -60,17 +47,22 @@ vtkPV3FoamReader::vtkPV3FoamReader()
|
||||
FileName = NULL;
|
||||
foamData_ = NULL;
|
||||
|
||||
CacheMesh = 0;
|
||||
output1_ = NULL;
|
||||
|
||||
UpdateGUI = 1;
|
||||
UpdateGUIOld = 1;
|
||||
TimeStep = 0;
|
||||
TimeStepRange[0] = 0;
|
||||
TimeStepRange[1] = 0;
|
||||
|
||||
CacheMesh = 0;
|
||||
|
||||
ExtrapolateWalls = 0;
|
||||
IncludeSets = 0;
|
||||
IncludeZones = 0;
|
||||
ShowPatchNames = 0;
|
||||
|
||||
TimeSelection = vtkDataArraySelection::New();
|
||||
UpdateGUI = 1;
|
||||
UpdateGUIOld = 1;
|
||||
|
||||
RegionSelection = vtkDataArraySelection::New();
|
||||
VolFieldSelection = vtkDataArraySelection::New();
|
||||
PointFieldSelection = vtkDataArraySelection::New();
|
||||
@ -85,11 +77,6 @@ vtkPV3FoamReader::vtkPV3FoamReader()
|
||||
);
|
||||
SelectionObserver->SetClientData(this);
|
||||
|
||||
TimeSelection->AddObserver
|
||||
(
|
||||
vtkCommand::ModifiedEvent,
|
||||
this->SelectionObserver
|
||||
);
|
||||
RegionSelection->AddObserver
|
||||
(
|
||||
vtkCommand::ModifiedEvent,
|
||||
@ -112,6 +99,7 @@ vtkPV3FoamReader::vtkPV3FoamReader()
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
vtkPV3FoamReader::~vtkPV3FoamReader()
|
||||
{
|
||||
vtkDebugMacro(<<"Deconstructor");
|
||||
@ -126,7 +114,6 @@ vtkPV3FoamReader::~vtkPV3FoamReader()
|
||||
delete [] FileName;
|
||||
}
|
||||
|
||||
TimeSelection->RemoveObserver(this->SelectionObserver);
|
||||
RegionSelection->RemoveObserver(this->SelectionObserver);
|
||||
VolFieldSelection->RemoveObserver(this->SelectionObserver);
|
||||
PointFieldSelection->RemoveObserver(this->SelectionObserver);
|
||||
@ -134,7 +121,6 @@ vtkPV3FoamReader::~vtkPV3FoamReader()
|
||||
|
||||
SelectionObserver->Delete();
|
||||
|
||||
TimeSelection->Delete();
|
||||
RegionSelection->Delete();
|
||||
VolFieldSelection->Delete();
|
||||
PointFieldSelection->Delete();
|
||||
@ -152,7 +138,6 @@ int vtkPV3FoamReader::RequestInformation
|
||||
{
|
||||
vtkDebugMacro(<<"RequestInformation");
|
||||
|
||||
|
||||
if (Foam::vtkPV3Foam::debug)
|
||||
{
|
||||
cout<<"REQUEST_INFORMATION\n";
|
||||
@ -164,38 +149,6 @@ int vtkPV3FoamReader::RequestInformation
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (Foam::vtkPV3Foam::debug)
|
||||
{
|
||||
vtkInformation* outputInfo = this->GetOutputPortInformation(0);
|
||||
|
||||
vtkMultiBlockDataSet* output = vtkMultiBlockDataSet::SafeDownCast
|
||||
(
|
||||
outputInfo->Get(vtkMultiBlockDataSet::DATA_OBJECT())
|
||||
);
|
||||
|
||||
outputInfo->Print(cout);
|
||||
if (output)
|
||||
{
|
||||
output->Print(cout);
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << "no output\n";
|
||||
}
|
||||
|
||||
this->GetExecutive()->GetOutputInformation(0)->Print(cout);
|
||||
|
||||
int nInfo = outputVector->GetNumberOfInformationObjects();
|
||||
|
||||
cout<< "requestInfo with " << nInfo << " items:\n";
|
||||
|
||||
for (int i=0; i<nInfo; i++)
|
||||
{
|
||||
vtkInformation *info = outputVector->GetInformationObject(i);
|
||||
info->Print(cout);
|
||||
}
|
||||
}
|
||||
|
||||
vtkInformation *outInfo = outputVector->GetInformationObject(0);
|
||||
|
||||
if (!foamData_)
|
||||
@ -205,17 +158,22 @@ int vtkPV3FoamReader::RequestInformation
|
||||
(
|
||||
outInfo->Get(vtkMultiBlockDataSet::DATA_OBJECT())
|
||||
);
|
||||
foamData_ = new Foam::vtkPV3Foam(FileName, this, output);
|
||||
foamData_->UpdateInformation();
|
||||
|
||||
if (Foam::vtkPV3Foam::debug)
|
||||
{
|
||||
cout<< "constructed vtkPV3Foam with output: ";
|
||||
output->Print(cout);
|
||||
}
|
||||
|
||||
foamData_ = new Foam::vtkPV3Foam(FileName, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
vtkDebugMacro("RequestInformation: updating information");
|
||||
foamData_->UpdateInformation();
|
||||
}
|
||||
|
||||
int nTimeSteps = 0;
|
||||
double* timeSteps = foamData_->timeSteps(nTimeSteps);
|
||||
double* timeSteps = foamData_->findTimes(nTimeSteps);
|
||||
|
||||
outInfo->Set
|
||||
(
|
||||
@ -230,7 +188,7 @@ int vtkPV3FoamReader::RequestInformation
|
||||
timeRange[0] = timeSteps[0];
|
||||
timeRange[1] = timeSteps[nTimeSteps-1];
|
||||
|
||||
if (Foam::vtkPV3Foam::debug)
|
||||
if (Foam::vtkPV3Foam::debug > 1)
|
||||
{
|
||||
cout<<"nTimeSteps " << nTimeSteps << "\n";
|
||||
cout<<"timeRange " << timeRange[0] << " to " << timeRange[1] << "\n";
|
||||
@ -271,20 +229,15 @@ int vtkPV3FoamReader::RequestData
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (Foam::vtkPV3Foam::debug)
|
||||
{
|
||||
int nInfo = outputVector->GetNumberOfInformationObjects();
|
||||
if (Foam::vtkPV3Foam::debug)
|
||||
{
|
||||
cout<<"requestData with " << nInfo << " items\n";
|
||||
}
|
||||
for (int i=0; i<nInfo; i++)
|
||||
cout<<"requestData with " << nInfo << " items\n";
|
||||
|
||||
for (int i = 0; i < nInfo; ++i)
|
||||
{
|
||||
vtkInformation *info = outputVector->GetInformationObject(i);
|
||||
|
||||
if (Foam::vtkPV3Foam::debug)
|
||||
{
|
||||
info->Print(cout);
|
||||
}
|
||||
info->Print(cout);
|
||||
}
|
||||
}
|
||||
|
||||
@ -330,7 +283,7 @@ int vtkPV3FoamReader::RequestData
|
||||
}
|
||||
else
|
||||
{
|
||||
cout << "no data_object\n";
|
||||
cout<< "no data_object\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -423,91 +376,29 @@ void vtkPV3FoamReader::removePatchNamesFromView()
|
||||
}
|
||||
|
||||
|
||||
void vtkPV3FoamReader::PrintSelf
|
||||
(
|
||||
ostream& os,
|
||||
vtkIndent indent
|
||||
)
|
||||
void vtkPV3FoamReader::PrintSelf(ostream& os, vtkIndent indent)
|
||||
{
|
||||
vtkDebugMacro(<<"PrintSelf");
|
||||
|
||||
this->Superclass::PrintSelf(os,indent);
|
||||
os<< indent << "File name: "
|
||||
<< (this->FileName ? this->FileName : "(none)") << "\n";
|
||||
os<< indent << "Number of meshes: " << foamData_->numberOfMeshes() << "\n";
|
||||
os<< indent << "Number of nodes: " << foamData_->numberOfPoints() << "\n";
|
||||
os<< indent << "Number of cells: " << foamData_->numberOfCells() << "\n";
|
||||
os<< indent << "Number of available time steps: " << foamData_->numberOfAvailableTimes()
|
||||
<< endl;
|
||||
|
||||
foamData_->PrintSelf(os, indent);
|
||||
|
||||
os<< indent << "Time step range: "
|
||||
<< this->TimeStepRange[0] << " - " << this->TimeStepRange[1]
|
||||
<< endl;
|
||||
<< "\n";
|
||||
os<< indent << "Time step: " << this->TimeStep << endl;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
vtkDataArraySelection* vtkPV3FoamReader::GetTimeSelection()
|
||||
{
|
||||
vtkDebugMacro(<<"GetTimeSelection");
|
||||
|
||||
return TimeSelection;
|
||||
}
|
||||
|
||||
|
||||
int vtkPV3FoamReader::GetNumberOfTimeArrays()
|
||||
{
|
||||
vtkDebugMacro(<<"GetNumberOf TimeArrays");
|
||||
|
||||
return TimeSelection->GetNumberOfArrays();
|
||||
}
|
||||
|
||||
|
||||
const char* vtkPV3FoamReader::GetTimeArrayName
|
||||
(
|
||||
int index
|
||||
)
|
||||
{
|
||||
vtkDebugMacro(<<"GetTimeArrayName");
|
||||
|
||||
return TimeSelection->GetArrayName(index);
|
||||
}
|
||||
|
||||
|
||||
int vtkPV3FoamReader::GetTimeArrayStatus
|
||||
(
|
||||
const char* name
|
||||
)
|
||||
{
|
||||
vtkDebugMacro(<<"GetTimeArrayStatus");
|
||||
|
||||
return TimeSelection->ArrayIsEnabled(name);
|
||||
}
|
||||
|
||||
|
||||
void vtkPV3FoamReader::SetTimeArrayStatus
|
||||
(
|
||||
const char* name,
|
||||
int status
|
||||
)
|
||||
{
|
||||
vtkDebugMacro(<<"SetTimeArrayStatus");
|
||||
|
||||
if (status)
|
||||
{
|
||||
TimeSelection->EnableArray(name);
|
||||
}
|
||||
else
|
||||
{
|
||||
TimeSelection->DisableArray(name);
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// Region selection list control
|
||||
|
||||
vtkDataArraySelection* vtkPV3FoamReader::GetRegionSelection()
|
||||
{
|
||||
vtkDebugMacro(<<"GetRegionSelection");
|
||||
|
||||
return RegionSelection;
|
||||
}
|
||||
|
||||
@ -515,42 +406,29 @@ vtkDataArraySelection* vtkPV3FoamReader::GetRegionSelection()
|
||||
int vtkPV3FoamReader::GetNumberOfRegionArrays()
|
||||
{
|
||||
vtkDebugMacro(<<"GetNumberOfRegionArrays");
|
||||
|
||||
return RegionSelection->GetNumberOfArrays();
|
||||
}
|
||||
|
||||
|
||||
const char* vtkPV3FoamReader::GetRegionArrayName
|
||||
(
|
||||
int index
|
||||
)
|
||||
const char* vtkPV3FoamReader::GetRegionArrayName(int index)
|
||||
{
|
||||
vtkDebugMacro(<<"GetRegionArrayName");
|
||||
|
||||
return RegionSelection->GetArrayName(index);
|
||||
}
|
||||
|
||||
|
||||
int vtkPV3FoamReader::GetRegionArrayStatus
|
||||
(
|
||||
const char* name
|
||||
)
|
||||
int vtkPV3FoamReader::GetRegionArrayStatus(const char* name)
|
||||
{
|
||||
vtkDebugMacro(<<"GetRegionArrayStatus");
|
||||
|
||||
return RegionSelection->ArrayIsEnabled(name);
|
||||
}
|
||||
|
||||
|
||||
void vtkPV3FoamReader::SetRegionArrayStatus
|
||||
(
|
||||
const char* name,
|
||||
int status
|
||||
)
|
||||
void vtkPV3FoamReader::SetRegionArrayStatus(const char* name, int status)
|
||||
{
|
||||
vtkDebugMacro(<<"SetRegionArrayStatus");
|
||||
|
||||
if(status)
|
||||
if (status)
|
||||
{
|
||||
RegionSelection->EnableArray(name);
|
||||
}
|
||||
@ -561,10 +439,12 @@ void vtkPV3FoamReader::SetRegionArrayStatus
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// volField selection list control
|
||||
|
||||
vtkDataArraySelection* vtkPV3FoamReader::GetVolFieldSelection()
|
||||
{
|
||||
vtkDebugMacro(<<"GetVolFieldSelection");
|
||||
|
||||
return VolFieldSelection;
|
||||
}
|
||||
|
||||
@ -572,41 +452,27 @@ vtkDataArraySelection* vtkPV3FoamReader::GetVolFieldSelection()
|
||||
int vtkPV3FoamReader::GetNumberOfVolFieldArrays()
|
||||
{
|
||||
vtkDebugMacro(<<"GetNumberOfVolFieldArrays");
|
||||
|
||||
return VolFieldSelection->GetNumberOfArrays();
|
||||
}
|
||||
|
||||
|
||||
const char* vtkPV3FoamReader::GetVolFieldArrayName
|
||||
(
|
||||
int index
|
||||
)
|
||||
const char* vtkPV3FoamReader::GetVolFieldArrayName(int index)
|
||||
{
|
||||
vtkDebugMacro(<<"GetVolFieldArrayName");
|
||||
|
||||
return VolFieldSelection->GetArrayName(index);
|
||||
}
|
||||
|
||||
|
||||
int vtkPV3FoamReader::GetVolFieldArrayStatus
|
||||
(
|
||||
const char* name
|
||||
)
|
||||
int vtkPV3FoamReader::GetVolFieldArrayStatus(const char* name)
|
||||
{
|
||||
vtkDebugMacro(<<"GetVolFieldArrayStatus");
|
||||
|
||||
return VolFieldSelection->ArrayIsEnabled(name);
|
||||
}
|
||||
|
||||
|
||||
void vtkPV3FoamReader::SetVolFieldArrayStatus
|
||||
(
|
||||
const char* name,
|
||||
int status
|
||||
)
|
||||
void vtkPV3FoamReader::SetVolFieldArrayStatus(const char* name, int status)
|
||||
{
|
||||
vtkDebugMacro(<<"SetVolFieldArrayStatus");
|
||||
|
||||
if (status)
|
||||
{
|
||||
VolFieldSelection->EnableArray(name);
|
||||
@ -618,10 +484,12 @@ void vtkPV3FoamReader::SetVolFieldArrayStatus
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// pointField selection list control
|
||||
|
||||
vtkDataArraySelection* vtkPV3FoamReader::GetPointFieldSelection()
|
||||
{
|
||||
vtkDebugMacro(<<"GetPointFieldSelection");
|
||||
|
||||
return PointFieldSelection;
|
||||
}
|
||||
|
||||
@ -629,41 +497,27 @@ vtkDataArraySelection* vtkPV3FoamReader::GetPointFieldSelection()
|
||||
int vtkPV3FoamReader::GetNumberOfPointFieldArrays()
|
||||
{
|
||||
vtkDebugMacro(<<"GetNumberOfPointFieldArrays");
|
||||
|
||||
return PointFieldSelection->GetNumberOfArrays();
|
||||
}
|
||||
|
||||
|
||||
const char* vtkPV3FoamReader::GetPointFieldArrayName
|
||||
(
|
||||
int index
|
||||
)
|
||||
const char* vtkPV3FoamReader::GetPointFieldArrayName(int index)
|
||||
{
|
||||
vtkDebugMacro(<<"GetPointFieldArrayName");
|
||||
|
||||
return PointFieldSelection->GetArrayName(index);
|
||||
}
|
||||
|
||||
|
||||
int vtkPV3FoamReader::GetPointFieldArrayStatus
|
||||
(
|
||||
const char* name
|
||||
)
|
||||
int vtkPV3FoamReader::GetPointFieldArrayStatus(const char* name)
|
||||
{
|
||||
vtkDebugMacro(<<"GetPointFieldArrayStatus");
|
||||
|
||||
return PointFieldSelection->ArrayIsEnabled(name);
|
||||
}
|
||||
|
||||
|
||||
void vtkPV3FoamReader::SetPointFieldArrayStatus
|
||||
(
|
||||
const char* name,
|
||||
int status
|
||||
)
|
||||
void vtkPV3FoamReader::SetPointFieldArrayStatus(const char* name, int status)
|
||||
{
|
||||
vtkDebugMacro(<<"SetPointFieldArrayStatus");
|
||||
|
||||
if (status)
|
||||
{
|
||||
PointFieldSelection->EnableArray(name);
|
||||
@ -675,10 +529,12 @@ void vtkPV3FoamReader::SetPointFieldArrayStatus
|
||||
}
|
||||
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
// lagrangianField selection list control
|
||||
|
||||
vtkDataArraySelection* vtkPV3FoamReader::GetLagrangianFieldSelection()
|
||||
{
|
||||
vtkDebugMacro(<<"GetLagrangianFieldSelection");
|
||||
|
||||
return LagrangianFieldSelection;
|
||||
}
|
||||
|
||||
@ -686,29 +542,20 @@ vtkDataArraySelection* vtkPV3FoamReader::GetLagrangianFieldSelection()
|
||||
int vtkPV3FoamReader::GetNumberOfLagrangianFieldArrays()
|
||||
{
|
||||
vtkDebugMacro(<<"GetNumberOfLagrangianFieldArrays");
|
||||
|
||||
return LagrangianFieldSelection->GetNumberOfArrays();
|
||||
}
|
||||
|
||||
|
||||
const char* vtkPV3FoamReader::GetLagrangianFieldArrayName
|
||||
(
|
||||
int index
|
||||
)
|
||||
const char* vtkPV3FoamReader::GetLagrangianFieldArrayName(int index)
|
||||
{
|
||||
vtkDebugMacro(<<"GetLagrangianFieldArrayName");
|
||||
|
||||
return LagrangianFieldSelection->GetArrayName(index);
|
||||
}
|
||||
|
||||
|
||||
int vtkPV3FoamReader::GetLagrangianFieldArrayStatus
|
||||
(
|
||||
const char* name
|
||||
)
|
||||
int vtkPV3FoamReader::GetLagrangianFieldArrayStatus(const char* name)
|
||||
{
|
||||
vtkDebugMacro(<<"GetLagrangianFieldArrayStatus");
|
||||
|
||||
return LagrangianFieldSelection->ArrayIsEnabled(name);
|
||||
}
|
||||
|
||||
@ -720,7 +567,6 @@ void vtkPV3FoamReader::SetLagrangianFieldArrayStatus
|
||||
)
|
||||
{
|
||||
vtkDebugMacro(<<"SetLagrangianFieldArrayStatus");
|
||||
|
||||
if (status)
|
||||
{
|
||||
LagrangianFieldSelection->EnableArray(name);
|
||||
@ -731,6 +577,7 @@ void vtkPV3FoamReader::SetLagrangianFieldArrayStatus
|
||||
}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------
|
||||
|
||||
void vtkPV3FoamReader::SelectionModifiedCallback
|
||||
(
|
||||
@ -747,7 +594,7 @@ void vtkPV3FoamReader::SelectionModifiedCallback
|
||||
void vtkPV3FoamReader::SelectionModified()
|
||||
{
|
||||
vtkDebugMacro(<<"SelectionModified");
|
||||
|
||||
Modified();
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -14,11 +14,9 @@
|
||||
=========================================================================*/
|
||||
// .NAME vtkPV3FoamReader - reads a dataset in OpenFOAM format
|
||||
// .SECTION Description
|
||||
// vtkPV3FoamReader creates an multiblock dataset. It reads a controlDict
|
||||
// file, mesh information, and time dependent data. The controlDict file
|
||||
// contains timestep information. The polyMesh folders contain mesh information
|
||||
// The time folders contain transient data for the cells Each folder can
|
||||
// contain any number of data files.
|
||||
// vtkPV3FoamReader creates an multiblock dataset.
|
||||
// It uses the OpenFOAM infrastructure (fvMesh, etc) to
|
||||
// handle mesh and field data.
|
||||
|
||||
#ifndef __vtkPV3FoamReader_h
|
||||
#define __vtkPV3FoamReader_h
|
||||
@ -66,6 +64,13 @@ public:
|
||||
vtkSetStringMacro(FileName);
|
||||
vtkGetStringMacro(FileName);
|
||||
|
||||
// Time control
|
||||
// Set/Get the timestep and the timestep range
|
||||
vtkSetMacro(TimeStep, int);
|
||||
vtkGetMacro(TimeStep, int);
|
||||
vtkSetVector2Macro(TimeStepRange, int);
|
||||
vtkGetVector2Macro(TimeStepRange, int);
|
||||
|
||||
// GUI update control
|
||||
vtkSetMacro(UpdateGUI, int);
|
||||
vtkGetMacro(UpdateGUI, int);
|
||||
@ -86,24 +91,10 @@ public:
|
||||
vtkSetMacro(IncludeZones, int);
|
||||
vtkGetMacro(IncludeZones, int);
|
||||
|
||||
// FOAM patch names control
|
||||
// FOAM display patch names control
|
||||
vtkSetMacro(ShowPatchNames, int);
|
||||
vtkGetMacro(ShowPatchNames, int);
|
||||
|
||||
// Time-step slider control
|
||||
vtkSetMacro(TimeStep, int);
|
||||
vtkGetMacro(TimeStep, int);
|
||||
vtkSetVector2Macro(TimeStepRange, int);
|
||||
vtkGetVector2Macro(TimeStepRange, int);
|
||||
|
||||
// Time selection list control
|
||||
vtkDataArraySelection* GetTimeSelection();
|
||||
int GetNumberOfTimeArrays();
|
||||
const char* GetTimeArrayName(int index);
|
||||
int GetTimeArrayStatus(const char* name);
|
||||
void SetTimeArrayStatus(const char* name, int status);
|
||||
|
||||
|
||||
// Region selection list control
|
||||
vtkDataArraySelection* GetRegionSelection();
|
||||
int GetNumberOfRegionArrays();
|
||||
@ -121,16 +112,16 @@ public:
|
||||
// pointField selection list control
|
||||
vtkDataArraySelection* GetPointFieldSelection();
|
||||
int GetNumberOfPointFieldArrays();
|
||||
const char* GetPointFieldArrayName(int index);
|
||||
int GetPointFieldArrayStatus(const char* name);
|
||||
void SetPointFieldArrayStatus(const char* name, int status);
|
||||
const char* GetPointFieldArrayName(int index);
|
||||
|
||||
// lagrangianField selection list control
|
||||
vtkDataArraySelection* GetLagrangianFieldSelection();
|
||||
int GetNumberOfLagrangianFieldArrays();
|
||||
const char* GetLagrangianFieldArrayName(int index);
|
||||
int GetLagrangianFieldArrayStatus(const char* name);
|
||||
void SetLagrangianFieldArrayStatus(const char* name, int status);
|
||||
const char* GetLagrangianFieldArrayName(int index);
|
||||
|
||||
// Callback registered with the SelectionObserver
|
||||
// for all the selection lists
|
||||
@ -182,7 +173,11 @@ private:
|
||||
//- Remove patch names from the view
|
||||
void removePatchNamesFromView();
|
||||
|
||||
int TimeStep;
|
||||
int TimeStepRange[2];
|
||||
|
||||
int CacheMesh;
|
||||
|
||||
int ExtrapolateWalls;
|
||||
int IncludeSets;
|
||||
int IncludeZones;
|
||||
@ -190,18 +185,22 @@ private:
|
||||
|
||||
int UpdateGUI;
|
||||
int UpdateGUIOld;
|
||||
int TimeStep;
|
||||
int TimeStepRange[2];
|
||||
|
||||
vtkDataArraySelection* TimeSelection;
|
||||
vtkDataArraySelection* RegionSelection;
|
||||
vtkDataArraySelection* VolFieldSelection;
|
||||
vtkDataArraySelection* PointFieldSelection;
|
||||
vtkDataArraySelection* LagrangianFieldSelection;
|
||||
|
||||
//- Access to the output port1
|
||||
vtkMultiBlockDataSet* output1_;
|
||||
|
||||
//BTX
|
||||
Foam::vtkPV3Foam* foamData_;
|
||||
//ETX
|
||||
};
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -2,10 +2,8 @@ vtkPV3Foam.C
|
||||
vtkPV3FoamAddVolumeMesh.C
|
||||
vtkPV3FoamAddLagrangianMesh.C
|
||||
vtkPV3FoamAddPatchMesh.C
|
||||
vtkPV3FoamAddFaceZoneMesh.C
|
||||
vtkPV3FoamAddPointZoneMesh.C
|
||||
vtkPV3FoamAddFaceSetMesh.C
|
||||
vtkPV3FoamAddPointSetMesh.C
|
||||
vtkPV3FoamAddZoneMesh.C
|
||||
vtkPV3FoamAddSetMesh.C
|
||||
vtkPV3FoamUpdate.C
|
||||
vtkPV3FoamUpdateInformation.C
|
||||
vtkPV3FoamConvertMesh.C
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
EXE_INC = \
|
||||
/* -DPV3FOAM_TIMESELECTION */ \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||
|
||||
@ -52,7 +52,7 @@ defineTypeNameAndDebug(Foam::vtkPV3Foam, 0);
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
#include "vtkPV3FoamAddFields.H"
|
||||
#include "vtkPV3FoamAddToSelection.H"
|
||||
#include "vtkPV3FoamUpdateInformationFields.H"
|
||||
|
||||
|
||||
@ -172,38 +172,6 @@ void Foam::vtkPV3Foam::resetCounters()
|
||||
}
|
||||
|
||||
|
||||
void Foam::vtkPV3Foam::initializeTime()
|
||||
{
|
||||
#ifdef PV3FOAM_TIMESELECTION
|
||||
Time& runTime = dbPtr_();
|
||||
|
||||
// Get times list
|
||||
instantList times = runTime.times();
|
||||
|
||||
vtkDataArraySelection* arraySelection = reader_->GetTimeSelection();
|
||||
|
||||
// only execute this if there is a mismatch between
|
||||
// the times available according to FOAM and according to VTK
|
||||
int nArrays = arraySelection->GetNumberOfArrays();
|
||||
|
||||
if (nArrays && nArrays == times.size() - 1)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// "constant" is implicit - skip it
|
||||
// All the time selections are enabled by default
|
||||
for (label timeI = 1; timeI < times.size(); ++timeI)
|
||||
{
|
||||
arraySelection->AddArray
|
||||
(
|
||||
times[timeI].name().c_str()
|
||||
);
|
||||
}
|
||||
#endif /* PV3FOAM_TIMESELECTION */
|
||||
}
|
||||
|
||||
|
||||
bool Foam::vtkPV3Foam::setTime(const double& requestedTime)
|
||||
{
|
||||
if (debug)
|
||||
@ -215,24 +183,10 @@ bool Foam::vtkPV3Foam::setTime(const double& requestedTime)
|
||||
Time& runTime = dbPtr_();
|
||||
|
||||
// Get times list
|
||||
instantList times = runTime.times();
|
||||
instantList Times = runTime.times();
|
||||
|
||||
// logic as per "checkTimeOption.H"
|
||||
bool found = false;
|
||||
int nearestIndex = -1;
|
||||
scalar nearestDiff = Foam::GREAT;
|
||||
|
||||
forAll (times, timeIndex)
|
||||
{
|
||||
if (times[timeIndex].name() == "constant") continue;
|
||||
|
||||
scalar diff = fabs(times[timeIndex].value() - requestedTime);
|
||||
if (diff < nearestDiff)
|
||||
{
|
||||
nearestDiff = diff;
|
||||
nearestIndex = timeIndex;
|
||||
}
|
||||
}
|
||||
int nearestIndex = Time::findClosestTimeIndex(Times, requestedTime);
|
||||
|
||||
if (nearestIndex == -1)
|
||||
{
|
||||
@ -244,12 +198,34 @@ bool Foam::vtkPV3Foam::setTime(const double& requestedTime)
|
||||
found = true;
|
||||
}
|
||||
|
||||
runTime.setTime(times[nearestIndex], nearestIndex);
|
||||
// see what has changed
|
||||
if (timeIndex_ != nearestIndex)
|
||||
{
|
||||
timeIndex_ = nearestIndex;
|
||||
runTime.setTime(Times[nearestIndex], nearestIndex);
|
||||
|
||||
// the fields change each time
|
||||
fieldsChanged_ = true;
|
||||
|
||||
if (meshPtr_)
|
||||
{
|
||||
if (meshPtr_->readUpdate() != polyMesh::UNCHANGED)
|
||||
{
|
||||
meshChanged_ = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
meshChanged_ = true;
|
||||
}
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> Foam::vtkPV3Foam::setTime() - selected time "
|
||||
<< times[nearestIndex].name() << endl;
|
||||
<< Times[nearestIndex].name() << " index=" << nearestIndex
|
||||
<< " meshChanged=" << meshChanged_
|
||||
<< " fieldsChanged=" << fieldsChanged_ << endl;
|
||||
}
|
||||
|
||||
return found;
|
||||
@ -265,15 +241,28 @@ void Foam::vtkPV3Foam::updateSelectedRegions()
|
||||
|
||||
vtkDataArraySelection* arraySelection = reader_->GetRegionSelection();
|
||||
|
||||
const label nRegions = arraySelection->GetNumberOfArrays();
|
||||
const label nSelect = arraySelection->GetNumberOfArrays();
|
||||
|
||||
selectedRegions_.setSize(nRegions);
|
||||
selectedRegionDatasetIds_.setSize(nRegions);
|
||||
|
||||
// Read the selected patches and add to the region list
|
||||
for (int regionId=0; regionId < nRegions; ++regionId)
|
||||
if (selectedRegions_.size() != nSelect)
|
||||
{
|
||||
selectedRegions_[regionId] = arraySelection->GetArraySetting(regionId);
|
||||
selectedRegions_.setSize(nSelect);
|
||||
selectedRegions_ = 0;
|
||||
meshChanged_ = true;
|
||||
}
|
||||
|
||||
selectedRegionDatasetIds_.setSize(nSelect);
|
||||
|
||||
// Read the selected cell regions, zones, patches and add to region list
|
||||
forAll (selectedRegions_, regionId)
|
||||
{
|
||||
int setting = arraySelection->GetArraySetting(regionId);
|
||||
|
||||
if (selectedRegions_[regionId] != setting)
|
||||
{
|
||||
selectedRegions_[regionId] = setting;
|
||||
meshChanged_ = true;
|
||||
}
|
||||
|
||||
selectedRegionDatasetIds_[regionId] = -1;
|
||||
|
||||
if (debug)
|
||||
@ -301,7 +290,13 @@ Foam::stringList Foam::vtkPV3Foam::getSelectedArrayEntries
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info << "selections(";
|
||||
Info<< "available(";
|
||||
forAll (selections, elemI)
|
||||
{
|
||||
Info<< " \"" << arraySelection->GetArrayName(elemI) << "\"";
|
||||
}
|
||||
Info<< " )\n"
|
||||
<< "selected(";
|
||||
}
|
||||
|
||||
forAll (selections, elemI)
|
||||
@ -322,7 +317,7 @@ Foam::stringList Foam::vtkPV3Foam::getSelectedArrayEntries
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info << " " << selections[nElem];
|
||||
Info<< " " << selections[nElem];
|
||||
}
|
||||
|
||||
++nElem;
|
||||
@ -331,7 +326,7 @@ Foam::stringList Foam::vtkPV3Foam::getSelectedArrayEntries
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info << " )" << endl;
|
||||
Info<< " )" << endl;
|
||||
}
|
||||
|
||||
selections.setSize(nElem);
|
||||
@ -351,33 +346,45 @@ Foam::stringList Foam::vtkPV3Foam::getSelectedArrayEntries
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info << "selections(";
|
||||
Info<< "available(";
|
||||
for
|
||||
(
|
||||
int elemI = selector.start();
|
||||
elemI < selector.end();
|
||||
++elemI
|
||||
)
|
||||
{
|
||||
Info<< " \"" << arraySelection->GetArrayName(elemI) << "\"";
|
||||
}
|
||||
|
||||
Info<< " )\n"
|
||||
<< "selected(";
|
||||
}
|
||||
|
||||
for
|
||||
(
|
||||
int regionId = selector.start();
|
||||
regionId < selector.end();
|
||||
++regionId
|
||||
int elemI = selector.start();
|
||||
elemI < selector.end();
|
||||
++elemI
|
||||
)
|
||||
{
|
||||
if (arraySelection->GetArraySetting(regionId))
|
||||
if (arraySelection->GetArraySetting(elemI))
|
||||
{
|
||||
if (firstWord)
|
||||
{
|
||||
selections[nElem] = getFirstWord
|
||||
(
|
||||
arraySelection->GetArrayName(regionId)
|
||||
arraySelection->GetArrayName(elemI)
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
selections[nElem] = arraySelection->GetArrayName(regionId);
|
||||
selections[nElem] = arraySelection->GetArrayName(elemI);
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info << " " << selections[nElem];
|
||||
Info<< " " << selections[nElem];
|
||||
}
|
||||
|
||||
++nElem;
|
||||
@ -386,7 +393,7 @@ Foam::stringList Foam::vtkPV3Foam::getSelectedArrayEntries
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info << " )" << endl;
|
||||
Info<< " )" << endl;
|
||||
}
|
||||
|
||||
|
||||
@ -432,10 +439,7 @@ void Foam::vtkPV3Foam::setSelectedArrayEntries
|
||||
<< endl;
|
||||
}
|
||||
|
||||
arraySelection->EnableArray
|
||||
(
|
||||
arrayName.c_str()
|
||||
);
|
||||
arraySelection->EnableArray(arrayName.c_str());
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -452,12 +456,10 @@ void Foam::vtkPV3Foam::setSelectedArrayEntries
|
||||
Foam::vtkPV3Foam::vtkPV3Foam
|
||||
(
|
||||
const char* const FileName,
|
||||
vtkPV3FoamReader* reader,
|
||||
vtkMultiBlockDataSet* output
|
||||
vtkPV3FoamReader* reader
|
||||
)
|
||||
:
|
||||
reader_(reader),
|
||||
output_(output),
|
||||
dbPtr_(NULL),
|
||||
meshPtr_(NULL),
|
||||
selectInfoVolume_(VOLUME, "unzoned"),
|
||||
@ -470,7 +472,10 @@ Foam::vtkPV3Foam::vtkPV3Foam
|
||||
selectInfoFaceSets_(FACESET, "faceSet"),
|
||||
selectInfoPointSets_(POINTSET, "pointSet"),
|
||||
patchTextActorsPtrs_(0),
|
||||
nMesh_(0)
|
||||
nMesh_(0),
|
||||
timeIndex_(-1),
|
||||
meshChanged_(true),
|
||||
fieldsChanged_(true)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
@ -518,17 +523,11 @@ Foam::vtkPV3Foam::vtkPV3Foam
|
||||
|
||||
dbPtr_().functionObjects().off();
|
||||
|
||||
if (debug)
|
||||
{
|
||||
cout<< "constructed with output: ";
|
||||
output_->Print(cout);
|
||||
}
|
||||
|
||||
resetCounters();
|
||||
|
||||
// Set initial cloud name
|
||||
// TODO - TEMPORARY MEASURE UNTIL CAN PROCESS MULTIPLE CLOUDS
|
||||
cloudName_ = "";
|
||||
|
||||
UpdateInformation();
|
||||
}
|
||||
|
||||
|
||||
@ -555,27 +554,37 @@ void Foam::vtkPV3Foam::UpdateInformation()
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3Foam::UpdateInformation - "
|
||||
<< "TimeStep = " << reader_->GetTimeStep() << endl;
|
||||
Info<< "<beg> Foam::vtkPV3Foam::UpdateInformation"
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "] TimeStep="
|
||||
<< reader_->GetTimeStep() << endl;
|
||||
}
|
||||
|
||||
resetCounters();
|
||||
|
||||
// preserve the currently selected values
|
||||
const stringList selectedEntries = getSelectedArrayEntries
|
||||
(
|
||||
reader_->GetRegionSelection()
|
||||
);
|
||||
// Clear current region list/array
|
||||
reader_->GetRegionSelection()->RemoveAllArrays();
|
||||
vtkDataArraySelection* arraySelection = reader_->GetRegionSelection();
|
||||
|
||||
initializeTime();
|
||||
stringList selectedEntries;
|
||||
// enable 'internalMesh' on the first call
|
||||
if (arraySelection->GetNumberOfArrays() == 0)
|
||||
{
|
||||
selectedEntries.setSize(1);
|
||||
selectedEntries[0] = "internalMesh";
|
||||
}
|
||||
else
|
||||
{
|
||||
// preserve the currently selected values
|
||||
selectedEntries = getSelectedArrayEntries
|
||||
(
|
||||
arraySelection
|
||||
);
|
||||
}
|
||||
|
||||
// Clear current region list/array
|
||||
arraySelection->RemoveAllArrays();
|
||||
|
||||
// Update region array
|
||||
updateInformationInternalMesh();
|
||||
|
||||
updateInformationLagrangian();
|
||||
|
||||
updateInformationPatches();
|
||||
|
||||
if (reader_->GetIncludeSets())
|
||||
@ -588,13 +597,18 @@ void Foam::vtkPV3Foam::UpdateInformation()
|
||||
updateInformationZones();
|
||||
}
|
||||
|
||||
// Update region selection with the data just read in
|
||||
// restore the currently enabled values
|
||||
setSelectedArrayEntries
|
||||
(
|
||||
reader_->GetRegionSelection(),
|
||||
arraySelection,
|
||||
selectedEntries
|
||||
);
|
||||
|
||||
if (meshChanged_)
|
||||
{
|
||||
fieldsChanged_ = true;
|
||||
}
|
||||
|
||||
// Update volField array
|
||||
updateInformationFields<fvPatchField, volMesh>
|
||||
(
|
||||
@ -630,24 +644,23 @@ void Foam::vtkPV3Foam::Update
|
||||
output->Print(cout);
|
||||
|
||||
cout<<"Internally:\n";
|
||||
output_->Print(cout);
|
||||
output->Print(cout);
|
||||
|
||||
cout<< " has " << output_->GetNumberOfBlocks() << " blocks\n";
|
||||
cout<< " has " << output->GetNumberOfBlocks() << " blocks\n";
|
||||
}
|
||||
|
||||
|
||||
// Set up region selection(s)
|
||||
updateSelectedRegions();
|
||||
|
||||
// Update the Foam mesh
|
||||
updateFoamMesh();
|
||||
reader_->UpdateProgress(0.2);
|
||||
|
||||
// Convert meshes
|
||||
convertMeshVolume(output);
|
||||
|
||||
convertMeshLagrangian(output);
|
||||
|
||||
convertMeshPatches(output);
|
||||
reader_->UpdateProgress(0.4);
|
||||
|
||||
if (reader_->GetIncludeZones())
|
||||
{
|
||||
@ -658,17 +671,17 @@ void Foam::vtkPV3Foam::Update
|
||||
|
||||
if (reader_->GetIncludeSets())
|
||||
{
|
||||
convertMeshCellSet(output);
|
||||
convertMeshFaceSet(output);
|
||||
convertMeshPointSet(output);
|
||||
convertMeshCellSets(output);
|
||||
convertMeshFaceSets(output);
|
||||
convertMeshPointSets(output);
|
||||
}
|
||||
reader_->UpdateProgress(0.8);
|
||||
|
||||
// Update fields
|
||||
updateVolFields(output);
|
||||
|
||||
updatePointFields(output);
|
||||
|
||||
updateLagrangianFields(output);
|
||||
reader_->UpdateProgress(1.0);
|
||||
|
||||
if (debug)
|
||||
{
|
||||
@ -693,90 +706,31 @@ void Foam::vtkPV3Foam::Update
|
||||
<< GetNumberOfDataSets(output, selectInfoPointSets_) << nl;
|
||||
|
||||
// traverse blocks:
|
||||
|
||||
int nBlocks = output->GetNumberOfBlocks();
|
||||
Info << "nBlocks = " << nBlocks << endl;
|
||||
|
||||
cout<< "nBlocks = " << output->GetNumberOfBlocks() << "\n";
|
||||
cout<< "done Update\n";
|
||||
output_->Print(cout);
|
||||
cout<< " has " << output_->GetNumberOfBlocks() << " blocks\n";
|
||||
output_->GetInformation()->Print(cout);
|
||||
output->Print(cout);
|
||||
cout<< " has " << output->GetNumberOfBlocks() << " blocks\n";
|
||||
output->GetInformation()->Print(cout);
|
||||
|
||||
cout <<"ShouldIReleaseData :" << output_->ShouldIReleaseData() << "\n";
|
||||
cout<<"ShouldIReleaseData :" << output->ShouldIReleaseData() << "\n";
|
||||
}
|
||||
|
||||
meshChanged_ = fieldsChanged_ = false;
|
||||
}
|
||||
|
||||
|
||||
double* Foam::vtkPV3Foam::timeSteps(int& nTimeSteps)
|
||||
double* Foam::vtkPV3Foam::findTimes(int& nTimeSteps)
|
||||
{
|
||||
int nTimes = 0;
|
||||
double* ts = NULL;
|
||||
double* tsteps = NULL;
|
||||
|
||||
if (dbPtr_.valid())
|
||||
{
|
||||
Time& runTime = dbPtr_();
|
||||
instantList timeLst = runTime.times();
|
||||
|
||||
instantList times = runTime.times();
|
||||
|
||||
#ifdef PV3FOAM_TIMESELECTION
|
||||
List<bool> selected = List<bool>(times.size(), false);
|
||||
|
||||
vtkDataArraySelection* arraySelection = reader_->GetTimeSelection();
|
||||
const label nSelectedTimes = arraySelection->GetNumberOfArrays();
|
||||
|
||||
for (int i = 0; i < nSelectedTimes; ++i)
|
||||
{
|
||||
// always skip "constant" time
|
||||
const int timeI = i + 1;
|
||||
if
|
||||
(
|
||||
arraySelection->GetArraySetting(i)
|
||||
&& timeI < times.size()
|
||||
)
|
||||
{
|
||||
if (debug > 1)
|
||||
{
|
||||
Info<<"timeSelection["
|
||||
<< i
|
||||
<<"] = "
|
||||
<< arraySelection->GetArraySetting(i)
|
||||
<< " is "
|
||||
<< arraySelection->GetArrayName(i) << endl;
|
||||
}
|
||||
selected[timeI] = true;
|
||||
++nTimes;
|
||||
}
|
||||
}
|
||||
|
||||
if (debug > 1)
|
||||
{
|
||||
Info<< "selected " << nTimes << " times ";
|
||||
Info<< "found " << times.size() << " times: (";
|
||||
forAll(times, timeI)
|
||||
{
|
||||
Info<< " " << times[timeI].value();
|
||||
}
|
||||
Info<< " )" << endl;
|
||||
}
|
||||
|
||||
if (nTimes)
|
||||
{
|
||||
ts = new double[nTimes];
|
||||
int stepI = 0;
|
||||
|
||||
forAll(selected, selectI)
|
||||
{
|
||||
if (selected[selectI])
|
||||
{
|
||||
ts[stepI] = times[selectI].value();
|
||||
stepI++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#else /* PV3FOAM_TIMESELECTION */
|
||||
// always skip "constant" time, unless there are no other times
|
||||
nTimes = times.size();
|
||||
nTimes = timeLst.size();
|
||||
label timeI = 0;
|
||||
|
||||
if (nTimes > 1)
|
||||
@ -787,26 +741,25 @@ double* Foam::vtkPV3Foam::timeSteps(int& nTimeSteps)
|
||||
|
||||
if (nTimes)
|
||||
{
|
||||
ts = new double[nTimes];
|
||||
tsteps = new double[nTimes];
|
||||
for (label stepI = 0; stepI < nTimes; ++stepI, ++timeI)
|
||||
{
|
||||
ts[stepI] = times[timeI].value();
|
||||
tsteps[stepI] = timeLst[timeI].value();
|
||||
}
|
||||
}
|
||||
#endif /* PV3FOAM_TIMESELECTION */
|
||||
}
|
||||
else
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "no valid dbPtr:" <<endl;
|
||||
cout<< "no valid dbPtr:\n";
|
||||
}
|
||||
}
|
||||
|
||||
// return vector length via the parameter
|
||||
// vector length returned via the parameter
|
||||
nTimeSteps = nTimes;
|
||||
|
||||
return ts;
|
||||
return tsteps;
|
||||
}
|
||||
|
||||
|
||||
@ -820,8 +773,7 @@ void Foam::vtkPV3Foam::addPatchNames(vtkRenderer* renderer)
|
||||
Info<< "<beg> Foam::vtkPV3Foam::addPatchNames" << endl;
|
||||
}
|
||||
|
||||
const fvMesh& mesh = *meshPtr_;
|
||||
const polyBoundaryMesh& pbMesh = mesh.boundaryMesh();
|
||||
const polyBoundaryMesh& pbMesh = meshPtr_->boundaryMesh();
|
||||
|
||||
const selectionInfo& selector = selectInfoPatches_;
|
||||
|
||||
@ -1012,48 +964,17 @@ void Foam::vtkPV3Foam::removePatchNames(vtkRenderer* renderer)
|
||||
}
|
||||
|
||||
|
||||
int Foam::vtkPV3Foam::numberOfAvailableTimes() const
|
||||
void Foam::vtkPV3Foam::PrintSelf(ostream& os, vtkIndent indent) const
|
||||
{
|
||||
if (dbPtr_.valid())
|
||||
{
|
||||
return dbPtr_().times().size();
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
os << indent << "Number of meshes: " << nMesh_ << "\n";
|
||||
os << indent << "Number of nodes: "
|
||||
<< (meshPtr_ ? meshPtr_->nPoints() : 0) << "\n";
|
||||
|
||||
os << indent << "Number of cells: "
|
||||
<< (meshPtr_ ? meshPtr_->nCells() : 0) << "\n";
|
||||
|
||||
os << indent << "Number of available time steps: "
|
||||
<< (dbPtr_.valid() ? dbPtr_().times().size() : 0) << endl;
|
||||
}
|
||||
|
||||
|
||||
int Foam::vtkPV3Foam::numberOfPoints()
|
||||
{
|
||||
if (meshPtr_)
|
||||
{
|
||||
return meshPtr_->nPoints();
|
||||
}
|
||||
else
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int Foam::vtkPV3Foam::numberOfCells()
|
||||
{
|
||||
if (meshPtr_)
|
||||
{
|
||||
return meshPtr_->nCells();
|
||||
}
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int Foam::vtkPV3Foam::numberOfMeshes() const
|
||||
{
|
||||
return nMesh_;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -29,18 +29,16 @@ Description
|
||||
Provides a reader interface for OpenFOAM to VTK interaction.
|
||||
|
||||
SourceFiles
|
||||
interpolatePointToCell.C
|
||||
interpolatePointToCell.H
|
||||
vtkPV3Foam.C
|
||||
vtkPV3Foam.H
|
||||
vtkPV3FoamAddFaceSetMesh.C
|
||||
vtkPV3FoamAddFaceZoneMesh.C
|
||||
vtkPV3FoamAddFields.H
|
||||
vtkPV3FoamI.H
|
||||
vtkPV3FoamAddLagrangianMesh.C
|
||||
vtkPV3FoamAddPatchMesh.C
|
||||
vtkPV3FoamAddPointSetMesh.C
|
||||
vtkPV3FoamAddPointZoneMesh.C
|
||||
vtkPV3FoamAddSetMesh.C
|
||||
vtkPV3FoamAddToSelection.H
|
||||
vtkPV3FoamAddVolumeMesh.C
|
||||
vtkPV3FoamAddZoneMesh.C
|
||||
vtkPV3FoamConvertFaceField.H
|
||||
vtkPV3FoamConvertLagrangianFields.H
|
||||
vtkPV3FoamConvertMesh.C
|
||||
vtkPV3FoamConvertPatchFaceField.H
|
||||
@ -52,7 +50,7 @@ SourceFiles
|
||||
vtkPV3FoamUpdateInformation.C
|
||||
vtkPV3FoamUpdateInformationFields.H
|
||||
|
||||
// Needed by VTK?
|
||||
// Needed by VTK:
|
||||
vtkDataArrayTemplateImplicit.txx
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -64,19 +62,21 @@ SourceFiles
|
||||
#include "fileName.H"
|
||||
#include "volPointInterpolation.H"
|
||||
#include "stringList.H"
|
||||
#include "wordList.H"
|
||||
#include "primitivePatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * //
|
||||
|
||||
class vtkDataArraySelection;
|
||||
class vtkDataSet;
|
||||
class vtkMultiBlockDataSet;
|
||||
class vtkPoints;
|
||||
class vtkPV3FoamReader;
|
||||
class vtkRenderer;
|
||||
class vtkTextActor;
|
||||
class vtkMultiBlockDataSet;
|
||||
class vtkPolyData;
|
||||
class vtkUnstructuredGrid;
|
||||
class vtkIndent;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -196,9 +196,6 @@ private:
|
||||
//- Access to the controlling vtkPV3FoamReader
|
||||
vtkPV3FoamReader* reader_;
|
||||
|
||||
//- Access to the output block
|
||||
vtkMultiBlockDataSet* output_;
|
||||
|
||||
//- Foam time control
|
||||
autoPtr<Time> dbPtr_;
|
||||
|
||||
@ -232,12 +229,12 @@ private:
|
||||
labelList superCells_;
|
||||
|
||||
//- Label of original cell for decomposed cells
|
||||
// - cell zone meshes
|
||||
List<labelList> superCellZonesCells_;
|
||||
// - cellZone meshes
|
||||
List<labelList> zoneSuperCells_;
|
||||
|
||||
//- Label of original cell for decomposed cells
|
||||
// - cell set meshes
|
||||
List<labelList> superCellSetCells_;
|
||||
// - cellSet meshes
|
||||
List<labelList> csetSuperCells_;
|
||||
|
||||
//- List of patch names
|
||||
List<vtkTextActor*> patchTextActorsPtrs_;
|
||||
@ -253,6 +250,15 @@ private:
|
||||
// TODO - currently only set up to process ONE cloud
|
||||
word cloudName_;
|
||||
|
||||
//- The time index
|
||||
int timeIndex_;
|
||||
|
||||
//- Track changes in mesh geometry
|
||||
bool meshChanged_;
|
||||
|
||||
//- Track changes in fields
|
||||
bool fieldsChanged_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
@ -287,9 +293,6 @@ private:
|
||||
//- Reset data counters
|
||||
void resetCounters();
|
||||
|
||||
//- Get all the available times and select the latestTime
|
||||
void initializeTime();
|
||||
|
||||
// Update information helper functions
|
||||
|
||||
//- Update the regions selected in the GUI
|
||||
@ -307,9 +310,21 @@ private:
|
||||
//- Set info
|
||||
void updateInformationSets();
|
||||
|
||||
//- Read zone names for zoneType from file
|
||||
wordList readZoneNames(const word& zoneType);
|
||||
|
||||
//- Zone info
|
||||
void updateInformationZones();
|
||||
|
||||
//- Add to paraview array selection
|
||||
template<class Type>
|
||||
label addToSelection
|
||||
(
|
||||
vtkDataArraySelection *arraySelection,
|
||||
const IOobjectList&,
|
||||
const string& suffix = ""
|
||||
);
|
||||
|
||||
//- Field info
|
||||
template<template<class> class patchType, class meshType>
|
||||
void updateInformationFields
|
||||
@ -350,20 +365,20 @@ private:
|
||||
//- Cell zone meshes
|
||||
void convertMeshCellZones(vtkMultiBlockDataSet* output);
|
||||
|
||||
//- Cell zone meshes
|
||||
//- Face zone meshes
|
||||
void convertMeshFaceZones(vtkMultiBlockDataSet* output);
|
||||
|
||||
//- Cell zone meshes
|
||||
//- Point zone meshes
|
||||
void convertMeshPointZones(vtkMultiBlockDataSet* output);
|
||||
|
||||
//- Cell set meshes
|
||||
void convertMeshCellSet(vtkMultiBlockDataSet* output);
|
||||
void convertMeshCellSets(vtkMultiBlockDataSet* output);
|
||||
|
||||
//- Face set meshes
|
||||
void convertMeshFaceSet(vtkMultiBlockDataSet* output);
|
||||
void convertMeshFaceSets(vtkMultiBlockDataSet* output);
|
||||
|
||||
//- Point set meshes
|
||||
void convertMeshPointSet(vtkMultiBlockDataSet* output);
|
||||
void convertMeshPointSets(vtkMultiBlockDataSet* output);
|
||||
|
||||
|
||||
// Add mesh functions
|
||||
@ -433,7 +448,7 @@ private:
|
||||
//- Add the fields in the selected time directory to the selection
|
||||
// lists
|
||||
template<class GeoField>
|
||||
label addFields
|
||||
label addObjectsToSelection
|
||||
(
|
||||
vtkDataArraySelection* fieldSelection,
|
||||
const IOobjectList& objects,
|
||||
@ -602,8 +617,7 @@ public:
|
||||
vtkPV3Foam
|
||||
(
|
||||
const char* const FileName,
|
||||
vtkPV3FoamReader* reader,
|
||||
vtkMultiBlockDataSet* output
|
||||
vtkPV3FoamReader* reader
|
||||
);
|
||||
|
||||
|
||||
@ -614,13 +628,14 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Update
|
||||
void UpdateInformation();
|
||||
|
||||
void Update(vtkMultiBlockDataSet* output);
|
||||
|
||||
//- allocate and return a list of selected times
|
||||
//- Allocate and return a list of selected times
|
||||
// returns the count via the parameter
|
||||
double* timeSteps(int& nTimeSteps);
|
||||
double* findTimes(int& nTimeSteps);
|
||||
|
||||
//- Add patch names to the display
|
||||
void addPatchNames(vtkRenderer* renderer);
|
||||
@ -635,14 +650,8 @@ public:
|
||||
|
||||
// Access
|
||||
|
||||
//- Return the total number of available timesets
|
||||
int numberOfAvailableTimes() const;
|
||||
|
||||
int numberOfCells();
|
||||
|
||||
int numberOfPoints();
|
||||
|
||||
int numberOfMeshes() const;
|
||||
//- Debug information
|
||||
void PrintSelf(ostream&, vtkIndent) const;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@ -1,73 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 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
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "vtkPV3Foam.H"
|
||||
|
||||
// Foam includes
|
||||
#include "pointSet.H"
|
||||
#include "vtkPV3FoamInsertNextPoint.H"
|
||||
|
||||
// VTK includes
|
||||
#include "vtkPoints.h"
|
||||
#include "vtkPolyData.h"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::vtkPV3Foam::addPointSetMesh
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const pointSet& pSet,
|
||||
vtkPolyData* vtkmesh
|
||||
)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3Foam::addPointSetMesh" << endl;
|
||||
}
|
||||
|
||||
const pointField& meshPoints = mesh.points();
|
||||
|
||||
vtkPoints *vtkpoints = vtkPoints::New();
|
||||
vtkpoints->Allocate(pSet.size());
|
||||
|
||||
forAllConstIter(pointSet, pSet, iter)
|
||||
{
|
||||
vtkPV3FoamInsertNextPoint(vtkpoints, meshPoints[iter.key()]);
|
||||
}
|
||||
|
||||
vtkmesh->SetPoints(vtkpoints);
|
||||
vtkpoints->Delete();
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> Foam::vtkPV3Foam::addPointSetMesh" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,72 +0,0 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 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
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "vtkPV3Foam.H"
|
||||
|
||||
// Foam includes
|
||||
#include "vtkPV3FoamInsertNextPoint.H"
|
||||
|
||||
// VTK includes
|
||||
#include "vtkPoints.h"
|
||||
#include "vtkPolyData.h"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::vtkPV3Foam::addPointZoneMesh
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const labelList& pointLabels,
|
||||
vtkPolyData* vtkmesh
|
||||
)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3Foam::addPointZoneMesh" << endl;
|
||||
}
|
||||
|
||||
const pointField& meshPoints = mesh.points();
|
||||
|
||||
vtkPoints *vtkpoints = vtkPoints::New();
|
||||
vtkpoints->Allocate(pointLabels.size());
|
||||
|
||||
forAll(pointLabels, pointI)
|
||||
{
|
||||
vtkPV3FoamInsertNextPoint(vtkpoints, meshPoints[pointLabels[pointI]]);
|
||||
}
|
||||
|
||||
vtkmesh->SetPoints(vtkpoints);
|
||||
vtkpoints->Delete();
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3Foam::addPointZoneMesh" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -30,6 +30,7 @@ Description
|
||||
|
||||
// Foam includes
|
||||
#include "faceSet.H"
|
||||
#include "pointSet.H"
|
||||
#include "vtkPV3FoamInsertNextPoint.H"
|
||||
|
||||
// VTK includes
|
||||
@ -103,4 +104,36 @@ void Foam::vtkPV3Foam::addFaceSetMesh
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::vtkPV3Foam::addPointSetMesh
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const pointSet& pSet,
|
||||
vtkPolyData* vtkmesh
|
||||
)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3Foam::addPointSetMesh" << endl;
|
||||
}
|
||||
|
||||
const pointField& meshPoints = mesh.points();
|
||||
|
||||
vtkPoints *vtkpoints = vtkPoints::New();
|
||||
vtkpoints->Allocate(pSet.size());
|
||||
|
||||
forAllConstIter(pointSet, pSet, iter)
|
||||
{
|
||||
vtkPV3FoamInsertNextPoint(vtkpoints, meshPoints[iter.key()]);
|
||||
}
|
||||
|
||||
vtkmesh->SetPoints(vtkpoints);
|
||||
vtkpoints->Delete();
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> Foam::vtkPV3Foam::addPointSetMesh" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -22,13 +22,10 @@ License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
InClass
|
||||
vtkPV3Foam
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef vtkPV3FoamAddFields_H
|
||||
#define vtkPV3FoamAddFields_H
|
||||
#ifndef vtkPV3FoamAddToSelection_H
|
||||
#define vtkPV3FoamAddToSelection_H
|
||||
|
||||
// FOAM includes
|
||||
#include "SortableList.H"
|
||||
@ -38,48 +35,48 @@ InClass
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class GeoField>
|
||||
Foam::label Foam::vtkPV3Foam::addFields
|
||||
template<class Type>
|
||||
Foam::label Foam::vtkPV3Foam::addToSelection
|
||||
(
|
||||
vtkDataArraySelection *fieldSelection,
|
||||
const IOobjectList& objects,
|
||||
vtkDataArraySelection *arraySelection,
|
||||
const IOobjectList& objectLst,
|
||||
const string& suffix
|
||||
)
|
||||
{
|
||||
IOobjectList fieldObjects(objects.lookupClass(GeoField::typeName));
|
||||
IOobjectList objects(objectLst.lookupClass(Type::typeName));
|
||||
|
||||
SortableList<word> fields(fieldObjects.size());
|
||||
SortableList<word> objectNames(objects.size());
|
||||
|
||||
label count = 0;
|
||||
forAllConstIter(IOobjectList, fieldObjects, iter)
|
||||
forAllConstIter(IOobjectList, objects, iter)
|
||||
{
|
||||
fields[count++] = iter()->name();
|
||||
objectNames[count++] = iter()->name();
|
||||
}
|
||||
|
||||
if (count)
|
||||
{
|
||||
fields.sort();
|
||||
objectNames.sort();
|
||||
|
||||
forAll(fields, fieldI)
|
||||
forAll (objectNames, objI)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<<" addField to GUI " << GeoField::typeName
|
||||
<< ":" << fields[fieldI] << endl;
|
||||
Info<<" addToSelection<" << Type::typeName << "> to GUI "
|
||||
<< ":" << objectNames[objI] << endl;
|
||||
}
|
||||
|
||||
if (suffix.size())
|
||||
{
|
||||
fieldSelection->AddArray
|
||||
arraySelection->AddArray
|
||||
(
|
||||
(fields[fieldI] + suffix).c_str()
|
||||
(objectNames[objI] + suffix).c_str()
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
fieldSelection->AddArray
|
||||
arraySelection->AddArray
|
||||
(
|
||||
fields[fieldI].c_str()
|
||||
objectNames[objI].c_str()
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -38,6 +38,7 @@ Description
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
void Foam::vtkPV3Foam::addFaceZoneMesh
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
@ -102,4 +103,36 @@ void Foam::vtkPV3Foam::addFaceZoneMesh
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Foam::vtkPV3Foam::addPointZoneMesh
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const labelList& pointLabels,
|
||||
vtkPolyData* vtkmesh
|
||||
)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3Foam::addPointZoneMesh" << endl;
|
||||
}
|
||||
|
||||
const pointField& meshPoints = mesh.points();
|
||||
|
||||
vtkPoints *vtkpoints = vtkPoints::New();
|
||||
vtkpoints->Allocate(pointLabels.size());
|
||||
|
||||
forAll(pointLabels, pointI)
|
||||
{
|
||||
vtkPV3FoamInsertNextPoint(vtkpoints, meshPoints[pointLabels[pointI]]);
|
||||
}
|
||||
|
||||
vtkmesh->SetPoints(vtkpoints);
|
||||
vtkpoints->Delete();
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3Foam::addPointZoneMesh" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -76,7 +76,7 @@ void Foam::vtkPV3Foam::convertMeshVolume
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "Creating VTK internal mesh" << endl;
|
||||
Info<< "Creating VTK internalMesh" << endl;
|
||||
}
|
||||
|
||||
const label datasetId = 0;
|
||||
@ -258,14 +258,14 @@ void Foam::vtkPV3Foam::convertMeshCellZones
|
||||
(
|
||||
subsetter.subMesh(),
|
||||
vtkmesh,
|
||||
superCellZonesCells_[datasetId]
|
||||
zoneSuperCells_[datasetId]
|
||||
);
|
||||
|
||||
// renumber - superCells must contain global cell ids
|
||||
inplaceRenumber
|
||||
(
|
||||
subsetter.cellMap(),
|
||||
superCellZonesCells_[datasetId]
|
||||
zoneSuperCells_[datasetId]
|
||||
);
|
||||
|
||||
AddToBlock
|
||||
@ -285,14 +285,14 @@ void Foam::vtkPV3Foam::convertMeshCellZones
|
||||
}
|
||||
|
||||
|
||||
void Foam::vtkPV3Foam::convertMeshCellSet
|
||||
void Foam::vtkPV3Foam::convertMeshCellSets
|
||||
(
|
||||
vtkMultiBlockDataSet* output
|
||||
)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3Foam::convertMeshCellSet" << endl;
|
||||
Info<< "<beg> Foam::vtkPV3Foam::convertMeshCellSets" << endl;
|
||||
}
|
||||
|
||||
const selectionInfo& selector = selectInfoCellSets_;
|
||||
@ -337,14 +337,14 @@ void Foam::vtkPV3Foam::convertMeshCellSet
|
||||
(
|
||||
subsetter.subMesh(),
|
||||
vtkmesh,
|
||||
superCellSetCells_[datasetId]
|
||||
csetSuperCells_[datasetId]
|
||||
);
|
||||
|
||||
// renumber - superCells must contain global cell ids
|
||||
inplaceRenumber
|
||||
(
|
||||
subsetter.cellMap(),
|
||||
superCellSetCells_[datasetId]
|
||||
csetSuperCells_[datasetId]
|
||||
);
|
||||
|
||||
AddToBlock
|
||||
@ -359,10 +359,11 @@ void Foam::vtkPV3Foam::convertMeshCellSet
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> Foam::vtkPV3Foam::convertMeshCellSet" << endl;
|
||||
Info<< "<end> Foam::vtkPV3Foam::convertMeshCellSets" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Foam::vtkPV3Foam::convertMeshFaceZones
|
||||
(
|
||||
vtkMultiBlockDataSet* output
|
||||
@ -417,7 +418,7 @@ void Foam::vtkPV3Foam::convertMeshFaceZones
|
||||
vtkmesh->Delete();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> Foam::vtkPV3Foam::convertMeshFaceZones" << endl;
|
||||
@ -425,14 +426,14 @@ void Foam::vtkPV3Foam::convertMeshFaceZones
|
||||
}
|
||||
|
||||
|
||||
void Foam::vtkPV3Foam::convertMeshFaceSet
|
||||
void Foam::vtkPV3Foam::convertMeshFaceSets
|
||||
(
|
||||
vtkMultiBlockDataSet* output
|
||||
)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3Foam::convertMeshFaceSet" << endl;
|
||||
Info<< "<beg> Foam::vtkPV3Foam::convertMeshFaceSets" << endl;
|
||||
}
|
||||
|
||||
const selectionInfo& selector = selectInfoFaceSets_;
|
||||
@ -487,10 +488,10 @@ void Foam::vtkPV3Foam::convertMeshFaceSet
|
||||
vtkmesh->Delete();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> Foam::vtkPV3Foam::convertMeshFaceSet" << endl;
|
||||
Info<< "<end> Foam::vtkPV3Foam::convertMeshFaceSets" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
@ -549,7 +550,7 @@ void Foam::vtkPV3Foam::convertMeshPointZones
|
||||
vtkmesh->Delete();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> Foam::vtkPV3Foam::convertMeshPointZones" << endl;
|
||||
@ -558,14 +559,14 @@ void Foam::vtkPV3Foam::convertMeshPointZones
|
||||
|
||||
|
||||
|
||||
void Foam::vtkPV3Foam::convertMeshPointSet
|
||||
void Foam::vtkPV3Foam::convertMeshPointSets
|
||||
(
|
||||
vtkMultiBlockDataSet* output
|
||||
)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3Foam::convertMeshPointSet" << endl;
|
||||
Info<< "<beg> Foam::vtkPV3Foam::convertMeshPointSets" << endl;
|
||||
}
|
||||
|
||||
const selectionInfo& selector = selectInfoPointSets_;
|
||||
@ -620,10 +621,10 @@ void Foam::vtkPV3Foam::convertMeshPointSet
|
||||
vtkmesh->Delete();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<end> Foam::vtkPV3Foam::convertMeshPointSet" << endl;
|
||||
Info<< "<end> Foam::vtkPV3Foam::convertMeshPointSets" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -173,8 +173,7 @@ void Foam::vtkPV3Foam::convertVolFields
|
||||
convertPatchFaceField
|
||||
(
|
||||
tf.name(),
|
||||
fvPatchField<Type>(p, tf)
|
||||
.patchInternalField()(),
|
||||
fvPatchField<Type>(p, tf).patchInternalField()(),
|
||||
output,
|
||||
selectInfoPatches_,
|
||||
selectedRegionDatasetIds_[regionId]
|
||||
@ -236,7 +235,7 @@ void Foam::vtkPV3Foam::convertVolFields
|
||||
(
|
||||
tf,
|
||||
output, selectInfoCellZones_, datasetId,
|
||||
superCellZonesCells_[datasetId]
|
||||
zoneSuperCells_[datasetId]
|
||||
);
|
||||
}
|
||||
|
||||
@ -273,7 +272,7 @@ void Foam::vtkPV3Foam::convertVolFields
|
||||
(
|
||||
tf,
|
||||
output, selectInfoCellSets_, datasetId,
|
||||
superCellSetCells_[datasetId]
|
||||
csetSuperCells_[datasetId]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -28,7 +28,6 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
//- Extract up to the first non-word characters
|
||||
inline Foam::word Foam::vtkPV3Foam::getFirstWord(const char* str)
|
||||
{
|
||||
if (str)
|
||||
@ -46,32 +45,4 @@ inline Foam::word Foam::vtkPV3Foam::getFirstWord(const char* str)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -50,14 +50,7 @@ void Foam::vtkPV3Foam::updateFoamMesh()
|
||||
Info<< "<beg> Foam::vtkPV3Foam::updateFoamMesh" << endl;
|
||||
}
|
||||
|
||||
if
|
||||
(
|
||||
!reader_->GetCacheMesh()
|
||||
#ifdef PV3FOAM_TIMESELECTION
|
||||
// This is only useful if the times are individually selectable
|
||||
|| reader_->GetTimeSelection()->GetArraySetting(0)
|
||||
#endif
|
||||
)
|
||||
if (!reader_->GetCacheMesh())
|
||||
{
|
||||
delete meshPtr_;
|
||||
meshPtr_ = NULL;
|
||||
@ -79,6 +72,8 @@ void Foam::vtkPV3Foam::updateFoamMesh()
|
||||
dbPtr_()
|
||||
)
|
||||
);
|
||||
|
||||
meshChanged_ = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -22,8 +22,6 @@ License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Description
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "vtkPV3Foam.H"
|
||||
@ -31,13 +29,17 @@ Description
|
||||
// Foam includes
|
||||
#include "cellSet.H"
|
||||
#include "faceSet.H"
|
||||
#include "pointSet.H"
|
||||
#include "IOobjectList.H"
|
||||
#include "IOPtrList.H"
|
||||
#include "pointSet.H"
|
||||
#include "polyBoundaryMeshEntries.H"
|
||||
#include "entry.H"
|
||||
#include "vtkPV3FoamReader.h"
|
||||
|
||||
// local headers
|
||||
#include "vtkPV3FoamAddToSelection.H"
|
||||
#include "vtkPV3FoamUpdateInformationFields.H"
|
||||
|
||||
// VTK includes
|
||||
#include "vtkDataArraySelection.h"
|
||||
|
||||
@ -77,10 +79,43 @@ public:
|
||||
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
Foam::wordList Foam::vtkPV3Foam::readZoneNames(const word& zoneType)
|
||||
{
|
||||
wordList zoneNames;
|
||||
|
||||
// mesh not loaded - read from file
|
||||
IOobject ioObj
|
||||
(
|
||||
zoneType,
|
||||
dbPtr_().findInstance
|
||||
(
|
||||
polyMesh::meshSubDir,
|
||||
zoneType,
|
||||
IOobject::READ_IF_PRESENT
|
||||
),
|
||||
polyMesh::meshSubDir,
|
||||
dbPtr_(),
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
);
|
||||
|
||||
if (ioObj.headerOk())
|
||||
{
|
||||
zonesEntries zones(ioObj);
|
||||
|
||||
zoneNames.setSize(zones.size());
|
||||
forAll (zones, zoneI)
|
||||
{
|
||||
zoneNames[zoneI] = zones[zoneI].keyword();
|
||||
}
|
||||
}
|
||||
|
||||
return zoneNames;
|
||||
}
|
||||
|
||||
#include "vtkPV3FoamAddFields.H"
|
||||
#include "vtkPV3FoamUpdateInformationFields.H"
|
||||
|
||||
void Foam::vtkPV3Foam::updateInformationInternalMesh()
|
||||
{
|
||||
@ -103,6 +138,9 @@ void Foam::vtkPV3Foam::updateInformationInternalMesh()
|
||||
|
||||
if (debug)
|
||||
{
|
||||
// just for debug info
|
||||
getSelectedArrayEntries(arraySelection);
|
||||
|
||||
Info<< "<end> Foam::vtkPV3Foam::updateInformationInternalMesh" << endl;
|
||||
}
|
||||
|
||||
@ -132,7 +170,7 @@ void Foam::vtkPV3Foam::updateInformationLagrangian()
|
||||
arraySelection->AddArray("lagrangian");
|
||||
selectInfoLagrangian_ += 1;
|
||||
|
||||
Info<<"added cloudDirs\n";
|
||||
Info<< "... added cloudDirs\n";
|
||||
|
||||
if (cloudDirs.size() > 1)
|
||||
{
|
||||
@ -149,13 +187,16 @@ void Foam::vtkPV3Foam::updateInformationLagrangian()
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<<"no clouds identified in " <<nl
|
||||
Info<< "... no clouds identified in " <<nl
|
||||
<< " " <<dbPtr_->timePath()/"lagrangian" << endl;
|
||||
}
|
||||
}
|
||||
|
||||
if (debug)
|
||||
{
|
||||
// just for debug info
|
||||
getSelectedArrayEntries(arraySelection);
|
||||
|
||||
Info<< "<end> Foam::vtkPV3Foam::updateInformationLagrangian" << endl;
|
||||
}
|
||||
}
|
||||
@ -165,7 +206,8 @@ void Foam::vtkPV3Foam::updateInformationPatches()
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3Foam::updateInformationPatches" << endl;
|
||||
Info<< "<beg> Foam::vtkPV3Foam::updateInformationPatches"
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
|
||||
}
|
||||
|
||||
vtkDataArraySelection *arraySelection = reader_->GetRegionSelection();
|
||||
@ -209,6 +251,9 @@ void Foam::vtkPV3Foam::updateInformationPatches()
|
||||
|
||||
if (debug)
|
||||
{
|
||||
// just for debug info
|
||||
getSelectedArrayEntries(arraySelection);
|
||||
|
||||
Info<< "<end> Foam::vtkPV3Foam::updateInformationPatches" << endl;
|
||||
}
|
||||
}
|
||||
@ -218,108 +263,82 @@ void Foam::vtkPV3Foam::updateInformationZones()
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
Info<< "<beg> Foam::vtkPV3Foam::updateInformationZones" << endl;
|
||||
Info<< "<beg> Foam::vtkPV3Foam::updateInformationZones"
|
||||
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
|
||||
}
|
||||
|
||||
vtkDataArraySelection *arraySelection = reader_->GetRegionSelection();
|
||||
|
||||
// Read cell zone information
|
||||
wordList zoneNames;
|
||||
|
||||
//
|
||||
// cellZones information
|
||||
// ~~~~~~~~~~~~~~~~~~~~~
|
||||
if (meshPtr_)
|
||||
{
|
||||
zonesEntries zones
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"cellZones",
|
||||
dbPtr_().findInstance(polyMesh::meshSubDir, "cellZones"),
|
||||
polyMesh::meshSubDir,
|
||||
dbPtr_(),
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
selectInfoCellZones_ = arraySelection->GetNumberOfArrays();
|
||||
if (zones.headerOk())
|
||||
{
|
||||
forAll(zones, zoneI)
|
||||
{
|
||||
arraySelection->AddArray
|
||||
(
|
||||
(zones[zoneI].keyword() + " - cellZone").c_str()
|
||||
);
|
||||
}
|
||||
selectInfoCellZones_ += zones.size();
|
||||
}
|
||||
|
||||
superCellZonesCells_.setSize(selectInfoCellZones_.size());
|
||||
zoneNames = meshPtr_->cellZones().names();
|
||||
}
|
||||
else
|
||||
{
|
||||
zoneNames = readZoneNames("cellZones");
|
||||
}
|
||||
|
||||
// Read face zone information
|
||||
selectInfoCellZones_ = arraySelection->GetNumberOfArrays();
|
||||
forAll (zoneNames, zoneI)
|
||||
{
|
||||
zonesEntries zones
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"faceZones",
|
||||
dbPtr_().findInstance(polyMesh::meshSubDir, "faceZones"),
|
||||
polyMesh::meshSubDir,
|
||||
dbPtr_(),
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
);
|
||||
arraySelection->AddArray((zoneNames[zoneI] + " - cellZone").c_str());
|
||||
}
|
||||
selectInfoCellZones_ += zoneNames.size();
|
||||
zoneSuperCells_.setSize(selectInfoCellZones_.size());
|
||||
|
||||
selectInfoFaceZones_ = arraySelection->GetNumberOfArrays();
|
||||
if (zones.headerOk())
|
||||
{
|
||||
forAll(zones, zoneI)
|
||||
{
|
||||
arraySelection->AddArray
|
||||
(
|
||||
(zones[zoneI].keyword() + " - faceZone").c_str()
|
||||
);
|
||||
}
|
||||
selectInfoFaceZones_ += zones.size();
|
||||
}
|
||||
|
||||
//
|
||||
// faceZones information
|
||||
// ~~~~~~~~~~~~~~~~~~~~~
|
||||
if (meshPtr_)
|
||||
{
|
||||
zoneNames = meshPtr_->faceZones().names();
|
||||
}
|
||||
else
|
||||
{
|
||||
zoneNames = readZoneNames("faceZones");
|
||||
}
|
||||
|
||||
// Read point zone information
|
||||
selectInfoFaceZones_ = arraySelection->GetNumberOfArrays();
|
||||
forAll (zoneNames, zoneI)
|
||||
{
|
||||
zonesEntries zones
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"pointZones",
|
||||
dbPtr_().findInstance(polyMesh::meshSubDir, "pointZones"),
|
||||
polyMesh::meshSubDir,
|
||||
dbPtr_(),
|
||||
IOobject::READ_IF_PRESENT,
|
||||
IOobject::NO_WRITE,
|
||||
false
|
||||
)
|
||||
);
|
||||
|
||||
selectInfoPointZones_ = arraySelection->GetNumberOfArrays();
|
||||
if (zones.headerOk())
|
||||
{
|
||||
forAll(zones, zoneI)
|
||||
{
|
||||
arraySelection->AddArray
|
||||
(
|
||||
(zones[zoneI].keyword() + " - pointZone").c_str()
|
||||
);
|
||||
}
|
||||
selectInfoPointZones_ += zones.size();
|
||||
}
|
||||
arraySelection->AddArray((zoneNames[zoneI] + " - faceZone").c_str());
|
||||
}
|
||||
selectInfoFaceZones_ += zoneNames.size();
|
||||
|
||||
|
||||
//
|
||||
// pointZones information
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~
|
||||
if (meshPtr_)
|
||||
{
|
||||
zoneNames = meshPtr_->pointZones().names();
|
||||
}
|
||||
else
|
||||
{
|
||||
zoneNames = readZoneNames("pointZones");
|
||||
}
|
||||
|
||||
selectInfoPointZones_ = arraySelection->GetNumberOfArrays();
|
||||
forAll (zoneNames, zoneI)
|
||||
{
|
||||
arraySelection->AddArray((zoneNames[zoneI] + " - pointZone").c_str());
|
||||
}
|
||||
selectInfoPointZones_ += zoneNames.size();
|
||||
|
||||
|
||||
if (debug)
|
||||
{
|
||||
// just for debug info
|
||||
getSelectedArrayEntries(arraySelection);
|
||||
|
||||
Info<< "<end> Foam::vtkPV3Foam::updateInformationZones" << endl;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@ -332,7 +351,7 @@ void Foam::vtkPV3Foam::updateInformationSets()
|
||||
|
||||
vtkDataArraySelection *arraySelection = reader_->GetRegionSelection();
|
||||
|
||||
// Add sets
|
||||
// Add names of sets
|
||||
IOobjectList objects
|
||||
(
|
||||
dbPtr_(),
|
||||
@ -342,16 +361,16 @@ void Foam::vtkPV3Foam::updateInformationSets()
|
||||
|
||||
|
||||
selectInfoCellSets_ = arraySelection->GetNumberOfArrays();
|
||||
selectInfoCellSets_ += addFields<cellSet>
|
||||
selectInfoCellSets_ += addToSelection<cellSet>
|
||||
(
|
||||
arraySelection,
|
||||
objects,
|
||||
" - cellSet"
|
||||
);
|
||||
superCellSetCells_.setSize(selectInfoCellSets_.size());
|
||||
csetSuperCells_.setSize(selectInfoCellSets_.size());
|
||||
|
||||
selectInfoFaceSets_ = arraySelection->GetNumberOfArrays();
|
||||
selectInfoFaceSets_ += addFields<faceSet>
|
||||
selectInfoFaceSets_ += addToSelection<faceSet>
|
||||
(
|
||||
arraySelection,
|
||||
objects,
|
||||
@ -359,7 +378,7 @@ void Foam::vtkPV3Foam::updateInformationSets()
|
||||
);
|
||||
|
||||
selectInfoPointSets_ = arraySelection->GetNumberOfArrays();
|
||||
selectInfoPointSets_ += addFields<pointSet>
|
||||
selectInfoPointSets_ += addToSelection<pointSet>
|
||||
(
|
||||
arraySelection,
|
||||
objects,
|
||||
@ -368,6 +387,9 @@ void Foam::vtkPV3Foam::updateInformationSets()
|
||||
|
||||
if (debug)
|
||||
{
|
||||
// just for debug info
|
||||
getSelectedArrayEntries(arraySelection);
|
||||
|
||||
Info<< "<end> Foam::vtkPV3Foam::updateInformationSets" << endl;
|
||||
}
|
||||
}
|
||||
@ -399,32 +421,32 @@ void Foam::vtkPV3Foam::updateInformationLagrangianFields()
|
||||
"lagrangian"/cloudName_
|
||||
);
|
||||
|
||||
addFields<IOField<label> >
|
||||
addToSelection<IOField<label> >
|
||||
(
|
||||
arraySelection,
|
||||
objects
|
||||
);
|
||||
addFields<IOField<scalar> >
|
||||
addToSelection<IOField<scalar> >
|
||||
(
|
||||
arraySelection,
|
||||
objects
|
||||
);
|
||||
addFields<IOField<vector> >
|
||||
addToSelection<IOField<vector> >
|
||||
(
|
||||
arraySelection,
|
||||
objects
|
||||
);
|
||||
addFields<IOField<sphericalTensor> >
|
||||
addToSelection<IOField<sphericalTensor> >
|
||||
(
|
||||
arraySelection,
|
||||
objects
|
||||
);
|
||||
addFields<IOField<symmTensor> >
|
||||
addToSelection<IOField<symmTensor> >
|
||||
(
|
||||
arraySelection,
|
||||
objects
|
||||
);
|
||||
addFields<IOField<tensor> >
|
||||
addToSelection<IOField<tensor> >
|
||||
(
|
||||
arraySelection,
|
||||
objects
|
||||
@ -444,5 +466,7 @@ void Foam::vtkPV3Foam::updateInformationLagrangianFields()
|
||||
}
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -43,11 +43,23 @@ void Foam::vtkPV3Foam::updateInformationFields
|
||||
Info<< "<beg> Foam::vtkPV3Foam::updateInformationFields" << endl;
|
||||
}
|
||||
|
||||
// preserve the currently selected values
|
||||
const stringList selectedEntries = getSelectedArrayEntries
|
||||
(
|
||||
arraySelection
|
||||
);
|
||||
stringList selectedEntries;
|
||||
// enable 'p' and 'U' on the first call
|
||||
if (arraySelection->GetNumberOfArrays() == 0)
|
||||
{
|
||||
selectedEntries.setSize(2);
|
||||
selectedEntries[0] = "p";
|
||||
selectedEntries[1] = "U";
|
||||
}
|
||||
else
|
||||
{
|
||||
// preserve the currently selected values
|
||||
selectedEntries = getSelectedArrayEntries
|
||||
(
|
||||
arraySelection
|
||||
);
|
||||
}
|
||||
|
||||
arraySelection->RemoveAllArrays();
|
||||
|
||||
// Search for list of objects for this time
|
||||
@ -56,33 +68,33 @@ void Foam::vtkPV3Foam::updateInformationFields
|
||||
|
||||
//- Add volume fields to GUI
|
||||
/*
|
||||
addFields<GeometricField<label, patchType, meshType> >
|
||||
addToSelection<GeometricField<label, patchType, meshType> >
|
||||
(
|
||||
arraySelection,
|
||||
objects
|
||||
);
|
||||
*/
|
||||
addFields<GeometricField<scalar, patchType, meshType> >
|
||||
addToSelection<GeometricField<scalar, patchType, meshType> >
|
||||
(
|
||||
arraySelection,
|
||||
objects
|
||||
);
|
||||
addFields<GeometricField<vector, patchType, meshType> >
|
||||
addToSelection<GeometricField<vector, patchType, meshType> >
|
||||
(
|
||||
arraySelection,
|
||||
objects
|
||||
);
|
||||
addFields<GeometricField<sphericalTensor, patchType, meshType> >
|
||||
addToSelection<GeometricField<sphericalTensor, patchType, meshType> >
|
||||
(
|
||||
arraySelection,
|
||||
objects
|
||||
);
|
||||
addFields<GeometricField<symmTensor, patchType, meshType> >
|
||||
addToSelection<GeometricField<symmTensor, patchType, meshType> >
|
||||
(
|
||||
arraySelection,
|
||||
objects
|
||||
);
|
||||
addFields<GeometricField<tensor, patchType, meshType> >
|
||||
addToSelection<GeometricField<tensor, patchType, meshType> >
|
||||
(
|
||||
arraySelection,
|
||||
objects
|
||||
|
||||
@ -1,3 +1,8 @@
|
||||
#if [ "$FV_HOME" -a -r $FV_HOME ] ; then
|
||||
#!/bin/sh
|
||||
|
||||
# disabled
|
||||
|
||||
# if [ "$FV_HOME" -a -r $FV_HOME ]
|
||||
# then
|
||||
# wmake fieldview9Reader
|
||||
#fi
|
||||
# fi
|
||||
|
||||
@ -418,19 +418,55 @@ Foam::instant Foam::Time::findClosestTime(const scalar t) const
|
||||
return times[times.size() - 1];
|
||||
}
|
||||
|
||||
label nearestIndex = -1;
|
||||
scalar deltaT = GREAT;
|
||||
label closesti = 0;
|
||||
|
||||
for (label i=1; i<times.size(); i++)
|
||||
{
|
||||
if (mag(times[i].value() - t) < deltaT)
|
||||
scalar diff = mag(times[i].value() - t);
|
||||
if (diff < deltaT)
|
||||
{
|
||||
deltaT = mag(times[i].value() - t);
|
||||
closesti = i;
|
||||
deltaT = diff;
|
||||
nearestIndex = i;
|
||||
}
|
||||
}
|
||||
|
||||
return times[closesti];
|
||||
return times[nearestIndex];
|
||||
}
|
||||
|
||||
//
|
||||
// This should work too,
|
||||
// if we don't worry about checking "constant" explicitly
|
||||
//
|
||||
// Foam::instant Foam::Time::findClosestTime(const scalar t) const
|
||||
// {
|
||||
// instantList times = Time::findTimes(path());
|
||||
// label timeIndex = min(findClosestTimeIndex(times, t), 0);
|
||||
// return times[timeIndex];
|
||||
// }
|
||||
|
||||
Foam::label Foam::Time::findClosestTimeIndex
|
||||
(
|
||||
const instantList& times,
|
||||
const scalar t
|
||||
)
|
||||
{
|
||||
label nearestIndex = -1;
|
||||
scalar deltaT = GREAT;
|
||||
|
||||
forAll (times, i)
|
||||
{
|
||||
if (times[i].name() == "constant") continue;
|
||||
|
||||
scalar diff = fabs(times[i].value() - t);
|
||||
if (diff < deltaT)
|
||||
{
|
||||
deltaT = diff;
|
||||
nearestIndex = i;
|
||||
}
|
||||
}
|
||||
|
||||
return nearestIndex;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -300,6 +300,9 @@ public:
|
||||
//- Search the case for the time closest to the given time
|
||||
instant findClosestTime(const scalar) const;
|
||||
|
||||
//- Search instantList for the time index closest to the given time
|
||||
static label findClosestTimeIndex(const instantList&, const scalar);
|
||||
|
||||
//- Write using given format, version and compression
|
||||
virtual bool writeObject
|
||||
(
|
||||
|
||||
@ -33,10 +33,7 @@ Description
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
word Time::findInstance
|
||||
Foam::word Foam::Time::findInstance
|
||||
(
|
||||
const fileName& dir,
|
||||
const word& name,
|
||||
@ -110,7 +107,7 @@ word Time::findInstance
|
||||
// constant function of the time, because the latter points to
|
||||
// the case constant directory in parallel cases
|
||||
|
||||
if
|
||||
if
|
||||
(
|
||||
file(path()/constant()/dir/name)
|
||||
&& IOobject(name, constant(), dir, *this).headerOk()
|
||||
@ -139,9 +136,4 @@ word Time::findInstance
|
||||
return constant();
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -35,12 +35,7 @@ Description
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
instantList Time::findTimes(const fileName& directory)
|
||||
Foam::instantList Foam::Time::findTimes(const fileName& directory)
|
||||
{
|
||||
if (debug)
|
||||
{
|
||||
@ -101,9 +96,4 @@ instantList Time::findTimes(const fileName& directory)
|
||||
return Times;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -337,23 +337,21 @@ Foam::argList::argList
|
||||
|
||||
Switch distributed(false);
|
||||
|
||||
if (decompositionDict.found("distributed"))
|
||||
if
|
||||
(
|
||||
decompositionDict.readIfPresent("distributed", distributed)
|
||||
&& distributed
|
||||
)
|
||||
{
|
||||
decompositionDict.lookup("distributed") >> distributed;
|
||||
decompositionDict.lookup("roots") >> roots;
|
||||
|
||||
if (distributed)
|
||||
if (roots.size() != Pstream::nProcs()-1)
|
||||
{
|
||||
decompositionDict.lookup("roots") >> roots;
|
||||
|
||||
if (roots.size() != Pstream::nProcs())
|
||||
{
|
||||
FatalError
|
||||
<< "number of entries in "
|
||||
<< "decompositionDict::roots"
|
||||
<< " is not equal to the number of processors "
|
||||
<< Pstream::nProcs()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
FatalError
|
||||
<< "number of entries in decompositionDict::roots"
|
||||
<< " is not equal to the number of slaves "
|
||||
<< Pstream::nProcs()-1
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -1,22 +1,7 @@
|
||||
if (args.options().found("time"))
|
||||
{
|
||||
scalar time(readScalar(IStringStream(args.options()["time"])()));
|
||||
scalar timeValue(readScalar(IStringStream(args.options()["time"])()));
|
||||
|
||||
int nearestIndex = -1;
|
||||
scalar nearestDiff = Foam::GREAT;
|
||||
|
||||
forAll(Times, timeIndex)
|
||||
{
|
||||
if (Times[timeIndex].name() == "constant") continue;
|
||||
|
||||
scalar diff = fabs(Times[timeIndex].value() - time);
|
||||
if (diff < nearestDiff)
|
||||
{
|
||||
nearestDiff = diff;
|
||||
nearestIndex = timeIndex;
|
||||
}
|
||||
}
|
||||
|
||||
startTime = nearestIndex;
|
||||
endTime = nearestIndex + 1;
|
||||
startTime = Time::findClosestTimeIndex(Times, timeValue);
|
||||
endTime = startTime + 1;
|
||||
}
|
||||
|
||||
@ -284,6 +284,7 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
|
||||
*this
|
||||
);
|
||||
|
||||
pointZones_.setSize(newPointZones.size());
|
||||
forAll (pointZones_, pzI)
|
||||
{
|
||||
pointZones_[pzI] = newPointZones[pzI];
|
||||
@ -304,6 +305,7 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
|
||||
*this
|
||||
);
|
||||
|
||||
faceZones_.setSize(newFaceZones.size());
|
||||
forAll (faceZones_, fzI)
|
||||
{
|
||||
faceZones_[fzI].resetAddressing
|
||||
@ -328,6 +330,7 @@ Foam::polyMesh::readUpdateState Foam::polyMesh::readUpdate()
|
||||
*this
|
||||
);
|
||||
|
||||
cellZones_.setSize(newCellZones.size());
|
||||
forAll (cellZones_, czI)
|
||||
{
|
||||
cellZones_[czI] = newCellZones[czI];
|
||||
|
||||
@ -102,7 +102,7 @@ Foam::scalar Foam::layerAdditionRemoval::readOldThickness
|
||||
const dictionary& dict
|
||||
)
|
||||
{
|
||||
dict.lookupOrDefault("oldLayerThickness", -1.0);
|
||||
return dict.lookupOrDefault("oldLayerThickness", -1.0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -1,126 +0,0 @@
|
||||
cellClassification/cellClassification.C
|
||||
cellClassification/cellInfo.C
|
||||
|
||||
cellQuality/cellQuality.C
|
||||
|
||||
cellDist/cellDistFuncs.C
|
||||
cellDist/patchWave/patchWave.C
|
||||
cellDist/wallPoint/wallPoint.C
|
||||
|
||||
cellFeatures/cellFeatures.C
|
||||
|
||||
coordinateSystems/parabolicCylindricalCS.C
|
||||
coordinateSystems/coordinateSystem.C
|
||||
coordinateSystems/toroidalCS.C
|
||||
coordinateSystems/cartesianCS.C
|
||||
coordinateSystems/newCoordinateSystem.C
|
||||
coordinateSystems/cylindricalCS.C
|
||||
coordinateSystems/sphericalCS.C
|
||||
coordinateSystems/coordinateRotation/coordinateRotation.C
|
||||
coordinateSystems/coordinateRotation/EulerCoordinateRotation.C
|
||||
coordinateSystems/coordinateRotation/STARCDCoordinateRotation.C
|
||||
|
||||
polyMeshZipUpCells/polyMeshZipUpCells.C
|
||||
|
||||
primitiveMeshGeometry/primitiveMeshGeometry.C
|
||||
|
||||
meshSearch/meshSearch.C
|
||||
|
||||
meshTools/meshTools.C
|
||||
|
||||
PointEdgeWave/PointEdgeWaveName.C
|
||||
PointEdgeWave/pointEdgePoint.C
|
||||
|
||||
regionSplit/regionSplit.C
|
||||
|
||||
octree/octreeName.C
|
||||
octree/octreeDataPoint.C
|
||||
octree/octreeDataPointTreeLeaf.C
|
||||
octree/octreeDataEdges.C
|
||||
octree/octreeDataCell.C
|
||||
octree/octreeDataFace.C
|
||||
octree/treeBoundBox.C
|
||||
octree/treeNodeName.C
|
||||
octree/treeLeafName.C
|
||||
octree/pointIndexHitIOList.C
|
||||
|
||||
indexedOctree/indexedOctreeName.C
|
||||
indexedOctree/treeDataTriSurface.C
|
||||
|
||||
topoSets = sets/topoSets
|
||||
$(topoSets)/cellSet.C
|
||||
$(topoSets)/topoSet.C
|
||||
$(topoSets)/faceSet.C
|
||||
$(topoSets)/pointSet.C
|
||||
|
||||
sets/topoSetSource/topoSetSource.C
|
||||
|
||||
cellSources = sets/cellSources
|
||||
$(cellSources)/faceToCell/faceToCell.C
|
||||
$(cellSources)/fieldToCell/fieldToCell.C
|
||||
$(cellSources)/pointToCell/pointToCell.C
|
||||
$(cellSources)/shapeToCell/shapeToCell.C
|
||||
$(cellSources)/boxToCell/boxToCell.C
|
||||
$(cellSources)/rotatedBoxToCell/rotatedBoxToCell.C
|
||||
$(cellSources)/labelToCell/labelToCell.C
|
||||
$(cellSources)/surfaceToCell/surfaceToCell.C
|
||||
$(cellSources)/cellToCell/cellToCell.C
|
||||
$(cellSources)/nearestToCell/nearestToCell.C
|
||||
$(cellSources)/nbrToCell/nbrToCell.C
|
||||
$(cellSources)/zoneToCell/zoneToCell.C
|
||||
|
||||
faceSources = sets/faceSources
|
||||
$(faceSources)/faceToFace/faceToFace.C
|
||||
$(faceSources)/labelToFace/labelToFace.C
|
||||
$(faceSources)/cellToFace/cellToFace.C
|
||||
$(faceSources)/normalToFace/normalToFace.C
|
||||
$(faceSources)/pointToFace/pointToFace.C
|
||||
$(faceSources)/patchToFace/patchToFace.C
|
||||
$(faceSources)/boundaryToFace/boundaryToFace.C
|
||||
$(faceSources)/zoneToFace/zoneToFace.C
|
||||
$(faceSources)/boxToFace/boxToFace.C
|
||||
|
||||
pointSources = sets/pointSources
|
||||
$(pointSources)/labelToPoint/labelToPoint.C
|
||||
$(pointSources)/pointToPoint/pointToPoint.C
|
||||
$(pointSources)/cellToPoint/cellToPoint.C
|
||||
$(pointSources)/faceToPoint/faceToPoint.C
|
||||
$(pointSources)/boxToPoint/boxToPoint.C
|
||||
$(pointSources)/surfaceToPoint/surfaceToPoint.C
|
||||
$(pointSources)/zoneToPoint/zoneToPoint.C
|
||||
|
||||
surfaceSets/surfaceSets.C
|
||||
|
||||
triSurface/orientedSurface/orientedSurface.C
|
||||
|
||||
booleanOps = triSurface/booleanOps
|
||||
|
||||
surfaceIntersection = $(booleanOps)/surfaceIntersection
|
||||
$(surfaceIntersection)/surfaceIntersection.C
|
||||
$(surfaceIntersection)/surfaceIntersectionFuncs.C
|
||||
$(surfaceIntersection)/edgeIntersections.C
|
||||
|
||||
booleanSurface = $(booleanOps)/booleanSurface
|
||||
$(booleanSurface)/booleanSurface.C
|
||||
|
||||
intersectedSurface = $(booleanOps)/intersectedSurface
|
||||
$(intersectedSurface)/intersectedSurface.C
|
||||
$(intersectedSurface)/edgeSurface.C
|
||||
|
||||
triSurface/triSurfaceSearch/triSurfaceSearch.C
|
||||
|
||||
triSurface/octreeData/octreeDataTriSurface.C
|
||||
triSurface/octreeData/octreeDataTriSurfaceTreeLeaf.C
|
||||
|
||||
triSurface/triangleFuncs/triangleFuncs.C
|
||||
|
||||
triSurface/surfaceFeatures/surfaceFeatures.C
|
||||
|
||||
triSurface/triSurfaceMeshes/triSurfaceMeshes.C
|
||||
|
||||
twoDPointCorrector/twoDPointCorrector.C
|
||||
|
||||
directMapped/directMappedPolyPatch/directMappedPolyPatch.C
|
||||
directMapped/directMappedPointPatch/directMappedPointPatch.C
|
||||
|
||||
LIB = $(FOAM_LIBBIN)/libmeshTools
|
||||
@ -29,6 +29,15 @@ License
|
||||
#include "linePointRef.H"
|
||||
#include "meshTools.H"
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
// set values for what is close to zero and what is considered to
|
||||
// be positive (and not just rounding noise)
|
||||
//! @cond localScope
|
||||
const Foam::scalar zeroish = Foam::SMALL;
|
||||
const Foam::scalar positive = Foam::SMALL * 1E3;
|
||||
//! @endcond localScope
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
// Find cut cells
|
||||
@ -71,8 +80,8 @@ void Foam::cuttingPlane::calcCutCells
|
||||
|
||||
if
|
||||
(
|
||||
(dotProducts[e[0]] < 0 && dotProducts[e[1]] > 0)
|
||||
|| (dotProducts[e[1]] < 0 && dotProducts[e[0]] > 0)
|
||||
(dotProducts[e[0]] < zeroish && dotProducts[e[1]] > positive)
|
||||
|| (dotProducts[e[1]] < zeroish && dotProducts[e[0]] > positive)
|
||||
)
|
||||
{
|
||||
nCutEdges++;
|
||||
@ -116,8 +125,8 @@ Foam::labelList Foam::cuttingPlane::intersectEdges
|
||||
|
||||
if
|
||||
(
|
||||
(dotProducts[e[0]] < 0 && dotProducts[e[1]] > 0)
|
||||
|| (dotProducts[e[1]] < 0 && dotProducts[e[0]] > 0)
|
||||
(dotProducts[e[0]] < zeroish && dotProducts[e[1]] > positive)
|
||||
|| (dotProducts[e[1]] < zeroish && dotProducts[e[0]] > positive)
|
||||
)
|
||||
{
|
||||
// Edge is cut.
|
||||
@ -126,7 +135,19 @@ Foam::labelList Foam::cuttingPlane::intersectEdges
|
||||
|
||||
scalar alpha = lineIntersect(linePointRef(p0, p1));
|
||||
|
||||
dynCuttingPoints.append((1-alpha)*p0 + alpha*p1);
|
||||
if (alpha < zeroish)
|
||||
{
|
||||
dynCuttingPoints.append(p0);
|
||||
}
|
||||
else if (alpha > 1.0)
|
||||
{
|
||||
dynCuttingPoints.append(p1);
|
||||
}
|
||||
else
|
||||
{
|
||||
dynCuttingPoints.append((1-alpha)*p0 + alpha*p1);
|
||||
}
|
||||
|
||||
edgePoint[edgeI] = dynCuttingPoints.size() - 1;
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,6 +30,10 @@ Description
|
||||
|
||||
No attempt at resolving degenerate cases.
|
||||
|
||||
Note
|
||||
When the cutting plane coincides with a mesh face, the cell edge on the
|
||||
positive side of the plane is taken.
|
||||
|
||||
SourceFiles
|
||||
cuttingPlane.C
|
||||
|
||||
|
||||
47
tutorials/simpleFoam/airFoil2D/0/U
Normal file
47
tutorials/simpleFoam/airFoil2D/0/U
Normal file
@ -0,0 +1,47 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volVectorField;
|
||||
object U;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 1 -1 0 0 0 0];
|
||||
|
||||
internalField uniform (25.75 3.62 0);
|
||||
|
||||
boundaryField
|
||||
{
|
||||
inlet
|
||||
{
|
||||
type freestream;
|
||||
freestreamValue uniform (25.75 3.62 0);
|
||||
}
|
||||
|
||||
outlet
|
||||
{
|
||||
type freestream;
|
||||
freestreamValue uniform (25.75 3.62 0);
|
||||
}
|
||||
|
||||
wall
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform (0 0 0);
|
||||
}
|
||||
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
47
tutorials/simpleFoam/airFoil2D/0/nuTilda
Normal file
47
tutorials/simpleFoam/airFoil2D/0/nuTilda
Normal file
@ -0,0 +1,47 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
object nuTilda;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 2 -1 0 0 0 0];
|
||||
|
||||
internalField uniform 0.14;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
inlet
|
||||
{
|
||||
type freestream;
|
||||
freestreamValue uniform 0.14;
|
||||
}
|
||||
|
||||
outlet
|
||||
{
|
||||
type freestream;
|
||||
freestreamValue uniform 0.14;
|
||||
}
|
||||
|
||||
wall
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform 0;
|
||||
}
|
||||
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
47
tutorials/simpleFoam/airFoil2D/0/nut
Normal file
47
tutorials/simpleFoam/airFoil2D/0/nut
Normal file
@ -0,0 +1,47 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
object nut;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 2 -1 0 0 0 0];
|
||||
|
||||
internalField uniform 0.14;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
inlet
|
||||
{
|
||||
type freestream;
|
||||
freestreamValue uniform 0.14;
|
||||
}
|
||||
|
||||
outlet
|
||||
{
|
||||
type freestream;
|
||||
freestreamValue uniform 0.14;
|
||||
}
|
||||
|
||||
wall
|
||||
{
|
||||
type nutWallFunction;
|
||||
value uniform 0;
|
||||
}
|
||||
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.5 |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -9,12 +9,36 @@ FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object transportProperties;
|
||||
class volScalarField;
|
||||
object p;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
nu nu [0 2 -1 0 0 0 0] 0.01;
|
||||
dimensions [0 2 -2 0 0 0 0];
|
||||
|
||||
internalField uniform 0;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
inlet
|
||||
{
|
||||
type freestreamPressure;
|
||||
}
|
||||
|
||||
outlet
|
||||
{
|
||||
type freestreamPressure;
|
||||
}
|
||||
|
||||
wall
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
5
tutorials/simpleFoam/airFoil2D/Allclean
Executable file
5
tutorials/simpleFoam/airFoil2D/Allclean
Executable file
@ -0,0 +1,5 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Clean time folders only
|
||||
|
||||
rm -rf *[1-9]*
|
||||
173
tutorials/simpleFoam/airFoil2D/constant/RASProperties
Normal file
173
tutorials/simpleFoam/airFoil2D/constant/RASProperties
Normal file
@ -0,0 +1,173 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object RASProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
RASModel SpalartAllmaras; //kEpsilon;
|
||||
|
||||
turbulence on;
|
||||
|
||||
laminarCoeffs
|
||||
{
|
||||
}
|
||||
|
||||
kEpsilonCoeffs
|
||||
{
|
||||
Cmu 0.09;
|
||||
C1 1.44;
|
||||
C2 1.92;
|
||||
alphaEps 0.76923;
|
||||
}
|
||||
|
||||
RNGkEpsilonCoeffs
|
||||
{
|
||||
Cmu 0.0845;
|
||||
C1 1.42;
|
||||
C2 1.68;
|
||||
alphak 1.39;
|
||||
alphaEps 1.39;
|
||||
eta0 4.38;
|
||||
beta 0.012;
|
||||
}
|
||||
|
||||
NonlinearKEShihCoeffs
|
||||
{
|
||||
Cmu 0.09;
|
||||
C1 1.44;
|
||||
C2 1.92;
|
||||
alphak 1;
|
||||
alphaEps 0.76932;
|
||||
A1 1.25;
|
||||
A2 1000;
|
||||
Ctau1 -4;
|
||||
Ctau2 13;
|
||||
Ctau3 -2;
|
||||
alphaKsi 0.9;
|
||||
}
|
||||
|
||||
LienCubicKECoeffs
|
||||
{
|
||||
C1 1.44;
|
||||
C2 1.92;
|
||||
alphak 1;
|
||||
alphaEps 0.76923;
|
||||
A1 1.25;
|
||||
A2 1000;
|
||||
Ctau1 -4;
|
||||
Ctau2 13;
|
||||
Ctau3 -2;
|
||||
alphaKsi 0.9;
|
||||
}
|
||||
|
||||
QZetaCoeffs
|
||||
{
|
||||
Cmu 0.09;
|
||||
C1 1.44;
|
||||
C2 1.92;
|
||||
alphaZeta 0.76923;
|
||||
anisotropic no;
|
||||
}
|
||||
|
||||
LaunderSharmaKECoeffs
|
||||
{
|
||||
Cmu 0.09;
|
||||
C1 1.44;
|
||||
C2 1.92;
|
||||
alphaEps 0.76923;
|
||||
}
|
||||
|
||||
LamBremhorstKECoeffs
|
||||
{
|
||||
Cmu 0.09;
|
||||
C1 1.44;
|
||||
C2 1.92;
|
||||
alphaEps 0.76923;
|
||||
}
|
||||
|
||||
LienCubicKELowReCoeffs
|
||||
{
|
||||
Cmu 0.09;
|
||||
C1 1.44;
|
||||
C2 1.92;
|
||||
alphak 1;
|
||||
alphaEps 0.76923;
|
||||
A1 1.25;
|
||||
A2 1000;
|
||||
Ctau1 -4;
|
||||
Ctau2 13;
|
||||
Ctau3 -2;
|
||||
alphaKsi 0.9;
|
||||
Am 0.016;
|
||||
Aepsilon 0.263;
|
||||
Amu 0.00222;
|
||||
}
|
||||
|
||||
LienLeschzinerLowReCoeffs
|
||||
{
|
||||
Cmu 0.09;
|
||||
C1 1.44;
|
||||
C2 1.92;
|
||||
alphak 1;
|
||||
alphaEps 0.76923;
|
||||
Am 0.016;
|
||||
Aepsilon 0.263;
|
||||
Amu 0.00222;
|
||||
}
|
||||
|
||||
LRRCoeffs
|
||||
{
|
||||
Cmu 0.09;
|
||||
Clrr1 1.8;
|
||||
Clrr2 0.6;
|
||||
C1 1.44;
|
||||
C2 1.92;
|
||||
Cs 0.25;
|
||||
Ceps 0.15;
|
||||
alphaEps 0.76923;
|
||||
}
|
||||
|
||||
LaunderGibsonRSTMCoeffs
|
||||
{
|
||||
Cmu 0.09;
|
||||
Clg1 1.8;
|
||||
Clg2 0.6;
|
||||
C1 1.44;
|
||||
C2 1.92;
|
||||
C1Ref 0.5;
|
||||
C2Ref 0.3;
|
||||
Cs 0.25;
|
||||
Ceps 0.15;
|
||||
alphaEps 0.76923;
|
||||
alphaR 1.22;
|
||||
}
|
||||
|
||||
SpalartAllmarasCoeffs
|
||||
{
|
||||
alphaNut 1.5;
|
||||
Cb1 0.1355;
|
||||
Cb2 0.622;
|
||||
Cw2 0.3;
|
||||
Cw3 2;
|
||||
Cv1 7.1;
|
||||
//Next line Modified vorticity factor by Ashford 1996
|
||||
Cv2 5.0;
|
||||
}
|
||||
|
||||
wallFunctionCoeffs
|
||||
{
|
||||
kappa 0.4187;
|
||||
E 9;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
51
tutorials/simpleFoam/airFoil2D/constant/polyMesh/boundary
Normal file
51
tutorials/simpleFoam/airFoil2D/constant/polyMesh/boundary
Normal file
@ -0,0 +1,51 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class polyBoundaryMesh;
|
||||
object boundary;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
4
|
||||
(
|
||||
inlet
|
||||
{
|
||||
type patch;
|
||||
physicalType inlet;
|
||||
nFaces 134;
|
||||
startFace 21254;
|
||||
}
|
||||
|
||||
outlet
|
||||
{
|
||||
type patch;
|
||||
physicalType outlet;
|
||||
nFaces 160;
|
||||
startFace 21388;
|
||||
}
|
||||
|
||||
wall
|
||||
{
|
||||
type wall;
|
||||
physicalType wall;
|
||||
nFaces 78;
|
||||
startFace 21548;
|
||||
}
|
||||
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
physicalType empty;
|
||||
nFaces 21440;
|
||||
startFace 21626;
|
||||
}
|
||||
)
|
||||
|
||||
// ************************************************************************* //
|
||||
10741
tutorials/simpleFoam/airFoil2D/constant/polyMesh/cells
Normal file
10741
tutorials/simpleFoam/airFoil2D/constant/polyMesh/cells
Normal file
File diff suppressed because it is too large
Load Diff
43087
tutorials/simpleFoam/airFoil2D/constant/polyMesh/faces
Normal file
43087
tutorials/simpleFoam/airFoil2D/constant/polyMesh/faces
Normal file
File diff suppressed because it is too large
Load Diff
21275
tutorials/simpleFoam/airFoil2D/constant/polyMesh/neighbour
Normal file
21275
tutorials/simpleFoam/airFoil2D/constant/polyMesh/neighbour
Normal file
File diff suppressed because it is too large
Load Diff
43087
tutorials/simpleFoam/airFoil2D/constant/polyMesh/owner
Normal file
43087
tutorials/simpleFoam/airFoil2D/constant/polyMesh/owner
Normal file
File diff suppressed because it is too large
Load Diff
21833
tutorials/simpleFoam/airFoil2D/constant/polyMesh/points
Normal file
21833
tutorials/simpleFoam/airFoil2D/constant/polyMesh/points
Normal file
File diff suppressed because it is too large
Load Diff
38
tutorials/simpleFoam/airFoil2D/constant/transportProperties
Normal file
38
tutorials/simpleFoam/airFoil2D/constant/transportProperties
Normal file
@ -0,0 +1,38 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object transportProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
transportModel Newtonian;
|
||||
|
||||
rho rho [1 -3 0 0 0 0 0] 1.0;
|
||||
nu nu [0 2 -1 0 0 0 0] 1e-05;
|
||||
|
||||
CrossPowerLawCoeffs
|
||||
{
|
||||
nu0 nu0 [0 2 -1 0 0 0 0] 1e-06;
|
||||
nuInf nuInf [0 2 -1 0 0 0 0] 1e-06;
|
||||
m m [0 0 1 0 0 0 0] 1;
|
||||
n n [0 0 0 0 0 0 0] 1;
|
||||
}
|
||||
|
||||
BirdCarreauCoeffs
|
||||
{
|
||||
nu0 nu0 [0 2 -1 0 0 0 0] 1e-06;
|
||||
nuInf nuInf [0 2 -1 0 0 0 0] 1e-06;
|
||||
k k [0 0 1 0 0 0 0] 0;
|
||||
n n [0 0 0 0 0 0 0] 1;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
173
tutorials/simpleFoam/airFoil2D/constant/turbulenceProperties
Normal file
173
tutorials/simpleFoam/airFoil2D/constant/turbulenceProperties
Normal file
@ -0,0 +1,173 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object turbulenceProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
turbulenceModel SpalartAllmaras; //kEpsilon;
|
||||
|
||||
turbulence on;
|
||||
|
||||
laminarCoeffs
|
||||
{
|
||||
}
|
||||
|
||||
kEpsilonCoeffs
|
||||
{
|
||||
Cmu Cmu [0 0 0 0 0 0 0] 0.09;
|
||||
C1 C1 [0 0 0 0 0 0 0] 1.44;
|
||||
C2 C2 [0 0 0 0 0 0 0] 1.92;
|
||||
alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923;
|
||||
}
|
||||
|
||||
RNGkEpsilonCoeffs
|
||||
{
|
||||
Cmu Cmu [0 0 0 0 0 0 0] 0.0845;
|
||||
C1 C1 [0 0 0 0 0 0 0] 1.42;
|
||||
C2 C2 [0 0 0 0 0 0 0] 1.68;
|
||||
alphak alphaK [0 0 0 0 0 0 0] 1.39;
|
||||
alphaEps alphaEps [0 0 0 0 0 0 0] 1.39;
|
||||
eta0 eta0 [0 0 0 0 0 0 0] 4.38;
|
||||
beta beta [0 0 0 0 0 0 0] 0.012;
|
||||
}
|
||||
|
||||
NonlinearKEShihCoeffs
|
||||
{
|
||||
Cmu Cmu [0 0 0 0 0 0 0] 0.09;
|
||||
C1 C1 [0 0 0 0 0 0 0] 1.44;
|
||||
C2 C2 [0 0 0 0 0 0 0] 1.92;
|
||||
alphak alphak [0 0 0 0 0 0 0] 1;
|
||||
alphaEps alphaEps [0 0 0 0 0 0 0] 0.76932;
|
||||
A1 A1 [0 0 0 0 0 0 0] 1.25;
|
||||
A2 A2 [0 0 0 0 0 0 0] 1000;
|
||||
Ctau1 Ctau1 [0 0 0 0 0 0 0] -4;
|
||||
Ctau2 Ctau2 [0 0 0 0 0 0 0] 13;
|
||||
Ctau3 Ctau3 [0 0 0 0 0 0 0] -2;
|
||||
alphaKsi alphaKsi [0 0 0 0 0 0 0] 0.9;
|
||||
}
|
||||
|
||||
LienCubicKECoeffs
|
||||
{
|
||||
C1 C1 [0 0 0 0 0 0 0] 1.44;
|
||||
C2 C2 [0 0 0 0 0 0 0] 1.92;
|
||||
alphak alphak [0 0 0 0 0 0 0] 1;
|
||||
alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923;
|
||||
A1 A1 [0 0 0 0 0 0 0] 1.25;
|
||||
A2 A2 [0 0 0 0 0 0 0] 1000;
|
||||
Ctau1 Ctau1 [0 0 0 0 0 0 0] -4;
|
||||
Ctau2 Ctau2 [0 0 0 0 0 0 0] 13;
|
||||
Ctau3 Ctau3 [0 0 0 0 0 0 0] -2;
|
||||
alphaKsi alphaKsi [0 0 0 0 0 0 0] 0.9;
|
||||
}
|
||||
|
||||
QZetaCoeffs
|
||||
{
|
||||
Cmu Cmu [0 0 0 0 0 0 0] 0.09;
|
||||
C1 C1 [0 0 0 0 0 0 0] 1.44;
|
||||
C2 C2 [0 0 0 0 0 0 0] 1.92;
|
||||
alphaZeta alphaZeta [0 0 0 0 0 0 0] 0.76923;
|
||||
anisotropic no;
|
||||
}
|
||||
|
||||
LaunderSharmaKECoeffs
|
||||
{
|
||||
Cmu Cmu [0 0 0 0 0 0 0] 0.09;
|
||||
C1 C1 [0 0 0 0 0 0 0] 1.44;
|
||||
C2 C2 [0 0 0 0 0 0 0] 1.92;
|
||||
alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923;
|
||||
}
|
||||
|
||||
LamBremhorstKECoeffs
|
||||
{
|
||||
Cmu Cmu [0 0 0 0 0 0 0] 0.09;
|
||||
C1 C1 [0 0 0 0 0 0 0] 1.44;
|
||||
C2 C2 [0 0 0 0 0 0 0] 1.92;
|
||||
alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923;
|
||||
}
|
||||
|
||||
LienCubicKELowReCoeffs
|
||||
{
|
||||
Cmu Cmu [0 0 0 0 0 0 0] 0.09;
|
||||
C1 C1 [0 0 0 0 0 0 0] 1.44;
|
||||
C2 C2 [0 0 0 0 0 0 0] 1.92;
|
||||
alphak alphak [0 0 0 0 0 0 0] 1;
|
||||
alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923;
|
||||
A1 A1 [0 0 0 0 0 0 0] 1.25;
|
||||
A2 A2 [0 0 0 0 0 0 0] 1000;
|
||||
Ctau1 Ctau1 [0 0 0 0 0 0 0] -4;
|
||||
Ctau2 Ctau2 [0 0 0 0 0 0 0] 13;
|
||||
Ctau3 Ctau3 [0 0 0 0 0 0 0] -2;
|
||||
alphaKsi alphaKsi [0 0 0 0 0 0 0] 0.9;
|
||||
Am Am [0 0 0 0 0 0 0] 0.016;
|
||||
Aepsilon Aepsilon [0 0 0 0 0 0 0] 0.263;
|
||||
Amu Amu [0 0 0 0 0 0 0] 0.00222;
|
||||
}
|
||||
|
||||
LienLeschzinerLowReCoeffs
|
||||
{
|
||||
Cmu Cmu [0 0 0 0 0 0 0] 0.09;
|
||||
C1 C1 [0 0 0 0 0 0 0] 1.44;
|
||||
C2 C2 [0 0 0 0 0 0 0] 1.92;
|
||||
alphak alphak [0 0 0 0 0 0 0] 1;
|
||||
alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923;
|
||||
Am Am [0 0 0 0 0 0 0] 0.016;
|
||||
Aepsilon Aepsilon [0 0 0 0 0 0 0] 0.263;
|
||||
Amu Amu [0 0 0 0 0 0 0] 0.00222;
|
||||
}
|
||||
|
||||
LRRCoeffs
|
||||
{
|
||||
Cmu Cmu [0 0 0 0 0 0 0] 0.09;
|
||||
Clrr1 Clrr1 [0 0 0 0 0 0 0] 1.8;
|
||||
Clrr2 Clrr2 [0 0 0 0 0 0 0] 0.6;
|
||||
C1 C1 [0 0 0 0 0 0 0] 1.44;
|
||||
C2 C2 [0 0 0 0 0 0 0] 1.92;
|
||||
Cs Cs [0 0 0 0 0 0 0] 0.25;
|
||||
Ceps Ceps [0 0 0 0 0 0 0] 0.15;
|
||||
alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923;
|
||||
}
|
||||
|
||||
LaunderGibsonRSTMCoeffs
|
||||
{
|
||||
Cmu Cmu [0 0 0 0 0 0 0] 0.09;
|
||||
Clg1 Clg1 [0 0 0 0 0 0 0] 1.8;
|
||||
Clg2 Clg2 [0 0 0 0 0 0 0] 0.6;
|
||||
C1 C1 [0 0 0 0 0 0 0] 1.44;
|
||||
C2 C2 [0 0 0 0 0 0 0] 1.92;
|
||||
C1Ref C1Ref [0 0 0 0 0 0 0] 0.5;
|
||||
C2Ref C2Ref [0 0 0 0 0 0 0] 0.3;
|
||||
Cs Cs [0 0 0 0 0 0 0] 0.25;
|
||||
Ceps Ceps [0 0 0 0 0 0 0] 0.15;
|
||||
alphaEps alphaEps [0 0 0 0 0 0 0] 0.76923;
|
||||
alphaR alphaR [0 0 0 0 0 0 0] 1.22;
|
||||
}
|
||||
|
||||
SpalartAllmarasCoeffs
|
||||
{
|
||||
alphaNut alphaNut [0 0 0 0 0 0 0] 1.5;
|
||||
Cb1 Cb1 [0 0 0 0 0 0 0] 0.1355;
|
||||
Cb2 Cb2 [0 0 0 0 0 0 0] 0.622;
|
||||
Cw2 Cw2 [0 0 0 0 0 0 0] 0.3;
|
||||
Cw3 Cw3 [0 0 0 0 0 0 0] 2;
|
||||
Cv1 Cv1 [0 0 0 0 0 0 0] 7.1;
|
||||
//Next line Modified vorticity factor by Ashford 1996
|
||||
Cv2 Cv2 [0 0 0 0 0 0 0] 5.0;
|
||||
}
|
||||
|
||||
wallFunctionCoeffs
|
||||
{
|
||||
kappa kappa [0 0 0 0 0 0 0] 0.4187;
|
||||
E E [0 0 0 0 0 0 0] 9;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,7 +1,7 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.5 |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -10,11 +10,38 @@ FoamFile
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object transportProperties;
|
||||
object controlDict;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
nu nu [0 2 -1 0 0 0 0] 0.01;
|
||||
application simpleFoam;
|
||||
|
||||
startFrom latestTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
stopAt endTime;
|
||||
|
||||
endTime 500;
|
||||
|
||||
deltaT 1;
|
||||
|
||||
writeControl timeStep;
|
||||
|
||||
writeInterval 50;
|
||||
|
||||
purgeWrite 0;
|
||||
|
||||
writeFormat ascii;
|
||||
|
||||
writePrecision 6;
|
||||
|
||||
writeCompression uncompressed;
|
||||
|
||||
timeFormat general;
|
||||
|
||||
timePrecision 6;
|
||||
|
||||
runTimeModifiable yes;
|
||||
|
||||
// ************************************************************************* //
|
||||
64
tutorials/simpleFoam/airFoil2D/system/fvSchemes
Normal file
64
tutorials/simpleFoam/airFoil2D/system/fvSchemes
Normal file
@ -0,0 +1,64 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object fvSchemes;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
ddtSchemes
|
||||
{
|
||||
default steadyState;
|
||||
}
|
||||
|
||||
gradSchemes
|
||||
{
|
||||
default Gauss linear;
|
||||
grad(p) Gauss linear;
|
||||
grad(U) Gauss linear;
|
||||
}
|
||||
|
||||
divSchemes
|
||||
{
|
||||
default none;
|
||||
div(phi,U) Gauss linearUpwind Gauss linear;
|
||||
div(phi,nuTilda) Gauss linearUpwind Gauss linear;
|
||||
div((nuEff*dev(grad(U).T()))) Gauss linear;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
{
|
||||
default none;
|
||||
laplacian(nuEff,U) Gauss linear corrected;
|
||||
laplacian((1|A(U)),p) Gauss linear corrected;
|
||||
laplacian(DnuTildaEff,nuTilda) Gauss linear corrected;
|
||||
|
||||
laplacian(1,p) Gauss linear corrected;
|
||||
}
|
||||
|
||||
interpolationSchemes
|
||||
{
|
||||
default linear;
|
||||
interpolate(U) linear;
|
||||
}
|
||||
|
||||
snGradSchemes
|
||||
{
|
||||
default corrected;
|
||||
}
|
||||
|
||||
fluxRequired
|
||||
{
|
||||
default no;
|
||||
p;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
66
tutorials/simpleFoam/airFoil2D/system/fvSolution
Normal file
66
tutorials/simpleFoam/airFoil2D/system/fvSolution
Normal file
@ -0,0 +1,66 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object fvSolution;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
solvers
|
||||
{
|
||||
p GAMG
|
||||
{
|
||||
tolerance 1e-6;
|
||||
relTol 0.1;
|
||||
|
||||
smoother GaussSeidel;
|
||||
nPreSweeps 0;
|
||||
nPostSweeps 2;
|
||||
|
||||
cacheAgglomeration true;
|
||||
|
||||
nCellsInCoarsestLevel 10;
|
||||
agglomerator faceAreaPair;
|
||||
mergeLevels 1;
|
||||
};
|
||||
|
||||
U smoothSolver
|
||||
{
|
||||
smoother GaussSeidel;
|
||||
nSweeps 2;
|
||||
tolerance 1e-8;
|
||||
relTol 0.1;
|
||||
};
|
||||
|
||||
nuTilda smoothSolver
|
||||
{
|
||||
smoother GaussSeidel;
|
||||
nSweeps 2;
|
||||
tolerance 1e-8;
|
||||
relTol 0.1;
|
||||
};
|
||||
}
|
||||
|
||||
SIMPLE
|
||||
{
|
||||
nNonOrthogonalCorrectors 0;
|
||||
pRefCell 0;
|
||||
pRefValue 0;
|
||||
}
|
||||
|
||||
relaxationFactors
|
||||
{
|
||||
p 0.3;
|
||||
U 0.7;
|
||||
nuTilda 0.7;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,52 +0,0 @@
|
||||
// The FOAM Project // File: motionProperties
|
||||
/*
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
========= | dictionary
|
||||
\\ / |
|
||||
\\ / | Name: motionProperties
|
||||
\\ / | Family: FoamX configuration file
|
||||
\\/ |
|
||||
F ield | FOAM version: 2.1
|
||||
O peration | Product of Nabla Ltd.
|
||||
A and |
|
||||
M anipulation | Email: Enquiries@Nabla.co.uk
|
||||
-------------------------------------------------------------------------------
|
||||
*/
|
||||
// FoamX Case Dictionary.
|
||||
|
||||
version 1.0;
|
||||
format ascii;
|
||||
|
||||
root "/home/warhol/chris/foam/chris2.1/run/Test";
|
||||
case "movingCone";
|
||||
instance "constant";
|
||||
local "";
|
||||
|
||||
class dictionary;
|
||||
form dictionary;
|
||||
object motionProperties;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
//motionSolverLibs ("libfvMotionSolvers.so");
|
||||
solver laplacian;
|
||||
//solver componentLaplacian x;
|
||||
|
||||
twoDMotion no;
|
||||
|
||||
diffusivity uniform;
|
||||
|
||||
//motionPlaneNormal (0 0 1);
|
||||
//
|
||||
//movingSurface yes;
|
||||
//
|
||||
//twoFluids no;
|
||||
//
|
||||
//normalMotionDir no;
|
||||
//
|
||||
//motionURF 1.0;
|
||||
//
|
||||
//boundaryCorrection yes;
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,37 +1,19 @@
|
||||
// The FOAM Project // File: decomposeParDict
|
||||
/*
|
||||
-------------------------------------------------------------------------------
|
||||
========= | dictionary
|
||||
\\ / |
|
||||
\\ / | Name: decomposeParDict
|
||||
\\ / | Family: FoamX configuration file
|
||||
\\/ |
|
||||
F ield | FOAM version: 2.1
|
||||
O peration | Product of Nabla Ltd.
|
||||
A and |
|
||||
M anipulation | Email: Enquiries@Nabla.co.uk
|
||||
-------------------------------------------------------------------------------
|
||||
*/
|
||||
// FoamX Case Dictionary.
|
||||
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.5 |
|
||||
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
|
||||
root "/home/penfold/mattijs/foam/mattijs2.1/run/icoFoam";
|
||||
case "cavity";
|
||||
instance "system";
|
||||
local "";
|
||||
|
||||
class dictionary;
|
||||
object decomposeParDict;
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object decomposeParDict;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
arguments "/home/penfold/mattijs/foam/mattijs2.1/run/icoFoam" "cavity";
|
||||
|
||||
numberOfSubdomains 6;
|
||||
|
||||
method hierarchical;
|
||||
|
||||
@ -1,52 +0,0 @@
|
||||
// The FOAM Project // File: motionProperties
|
||||
/*
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
========= | dictionary
|
||||
\\ / |
|
||||
\\ / | Name: motionProperties
|
||||
\\ / | Family: FoamX configuration file
|
||||
\\/ |
|
||||
F ield | FOAM version: 2.1
|
||||
O peration | Product of Nabla Ltd.
|
||||
A and |
|
||||
M anipulation | Email: Enquiries@Nabla.co.uk
|
||||
-------------------------------------------------------------------------------
|
||||
*/
|
||||
// FoamX Case Dictionary.
|
||||
|
||||
version 1.0;
|
||||
format ascii;
|
||||
|
||||
root "/home/warhol/chris/foam/chris2.1/run/Test";
|
||||
case "movingCone";
|
||||
instance "constant";
|
||||
local "";
|
||||
|
||||
class dictionary;
|
||||
form dictionary;
|
||||
object motionProperties;
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
//motionSolverLibs ("libfvMotionSolvers.so");
|
||||
solver laplacian;
|
||||
//solver componentLaplacian x;
|
||||
|
||||
twoDMotion no;
|
||||
|
||||
diffusivity uniform;
|
||||
|
||||
//motionPlaneNormal (0 0 1);
|
||||
//
|
||||
//movingSurface yes;
|
||||
//
|
||||
//twoFluids no;
|
||||
//
|
||||
//normalMotionDir no;
|
||||
//
|
||||
//motionURF 1.0;
|
||||
//
|
||||
//boundaryCorrection yes;
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -1,37 +1,19 @@
|
||||
// The FOAM Project // File: decomposeParDict
|
||||
/*
|
||||
-------------------------------------------------------------------------------
|
||||
========= | dictionary
|
||||
\\ / |
|
||||
\\ / | Name: decomposeParDict
|
||||
\\ / | Family: FoamX configuration file
|
||||
\\/ |
|
||||
F ield | FOAM version: 2.1
|
||||
O peration | Product of Nabla Ltd.
|
||||
A and |
|
||||
M anipulation | Email: Enquiries@Nabla.co.uk
|
||||
-------------------------------------------------------------------------------
|
||||
*/
|
||||
// FoamX Case Dictionary.
|
||||
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 1.5 |
|
||||
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
|
||||
root "/home/penfold/mattijs/foam/mattijs2.1/run/icoFoam";
|
||||
case "cavity";
|
||||
instance "system";
|
||||
local "";
|
||||
|
||||
class dictionary;
|
||||
object decomposeParDict;
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object decomposeParDict;
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
arguments "/home/penfold/mattijs/foam/mattijs2.1/run/icoFoam" "cavity";
|
||||
|
||||
numberOfSubdomains 6;
|
||||
|
||||
method hierarchical;
|
||||
|
||||
Reference in New Issue
Block a user