mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' into molecularDynamics
This commit is contained in:
@ -28,7 +28,8 @@ Description
|
|||||||
Work in progress! Handles ascii multiblock (and optionally singleBlock)
|
Work in progress! Handles ascii multiblock (and optionally singleBlock)
|
||||||
format.
|
format.
|
||||||
By default expects blanking. Use -noBlank if none.
|
By default expects blanking. Use -noBlank if none.
|
||||||
Use -2D <thickness> if 2D.
|
Use -2D @a thickness if 2D.
|
||||||
|
|
||||||
Niklas Nordin has experienced a problem with lefthandedness of the blocks.
|
Niklas Nordin has experienced a problem with lefthandedness of the blocks.
|
||||||
The code should detect this automatically - see hexBlock::readPoints but
|
The code should detect this automatically - see hexBlock::readPoints but
|
||||||
if this goes wrong just set the blockHandedness_ variable to 'right'
|
if this goes wrong just set the blockHandedness_ variable to 'right'
|
||||||
|
|||||||
@ -26,6 +26,6 @@ blockPoints.C
|
|||||||
blockCells.C
|
blockCells.C
|
||||||
blockBoundary.C
|
blockBoundary.C
|
||||||
|
|
||||||
genBlockMesh.C
|
blockMeshApp.C
|
||||||
|
|
||||||
EXE = $(FOAM_APPBIN)/blockMesh
|
EXE = $(FOAM_APPBIN)/blockMesh
|
||||||
|
|||||||
@ -1,3 +1,4 @@
|
|||||||
argList::noParallel();
|
argList::noParallel();
|
||||||
argList::validOptions.insert("blockTopology", "");
|
argList::validOptions.insert("blockTopology", "");
|
||||||
|
argList::validOptions.insert("dict", "dictionary");
|
||||||
# include "addRegionOption.H"
|
# include "addRegionOption.H"
|
||||||
|
|||||||
@ -77,11 +77,21 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
Info<< nl << "Reading block mesh description dictionary" << endl;
|
Info<< nl << "Reading block mesh description dictionary" << endl;
|
||||||
|
|
||||||
|
word dictName("blockMeshDict");
|
||||||
|
fileName dictPath(runTime.constant()/polyMeshDir);
|
||||||
|
|
||||||
|
if (args.options().found("dict"))
|
||||||
|
{
|
||||||
|
fileName userDict(args.options()["dict"]);
|
||||||
|
|
||||||
|
dictName = userDict.name();
|
||||||
|
dictPath = userDict.path();
|
||||||
|
}
|
||||||
|
|
||||||
IOobject meshDescriptionIOobject
|
IOobject meshDescriptionIOobject
|
||||||
(
|
(
|
||||||
"blockMeshDict",
|
dictName,
|
||||||
runTime.constant(),
|
dictPath,
|
||||||
polyMeshDir,
|
|
||||||
runTime,
|
runTime,
|
||||||
IOobject::MUST_READ,
|
IOobject::MUST_READ,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
@ -91,13 +101,14 @@ int main(int argc, char *argv[])
|
|||||||
if (!meshDescriptionIOobject.headerOk())
|
if (!meshDescriptionIOobject.headerOk())
|
||||||
{
|
{
|
||||||
FatalErrorIn(args.executable())
|
FatalErrorIn(args.executable())
|
||||||
<< "Cannot open mesh description file " << nl
|
<< "Cannot open mesh description file: " << nl
|
||||||
<< runTime.constant()/polyMeshDir/"blockMeshDict" << nl
|
<< dictPath/dictName << nl
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
IOdictionary meshDescription(meshDescriptionIOobject);
|
IOdictionary meshDescription(meshDescriptionIOobject);
|
||||||
|
|
||||||
|
|
||||||
Info<< nl << "Creating block mesh" << endl;
|
Info<< nl << "Creating block mesh" << endl;
|
||||||
|
|
||||||
blockMesh blocks(meshDescription);
|
blockMesh blocks(meshDescription);
|
||||||
@ -1,10 +1,8 @@
|
|||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lautoMesh \
|
|
||||||
-lbasicThermophysicalModels \
|
-lbasicThermophysicalModels \
|
||||||
-lchemistryModel \
|
-lchemistryModel \
|
||||||
-lcombustionThermophysicalModels \
|
-lcombustionThermophysicalModels \
|
||||||
-lcompressibleLESModels \
|
-lcompressibleLESModels \
|
||||||
-lcompressibleRASModels \
|
|
||||||
-ldecompositionMethods \
|
-ldecompositionMethods \
|
||||||
-ldieselSpray \
|
-ldieselSpray \
|
||||||
-ldynamicFvMesh \
|
-ldynamicFvMesh \
|
||||||
@ -17,6 +15,7 @@ EXE_LIBS = \
|
|||||||
-lfvMotionSolvers \
|
-lfvMotionSolvers \
|
||||||
-lincompressibleLESModels \
|
-lincompressibleLESModels \
|
||||||
-lincompressibleTransportModels \
|
-lincompressibleTransportModels \
|
||||||
|
-lcompressibleRASModels \
|
||||||
-lincompressibleRASModels \
|
-lincompressibleRASModels \
|
||||||
-linterfaceProperties \
|
-linterfaceProperties \
|
||||||
-llagrangianIntermediate \
|
-llagrangianIntermediate \
|
||||||
@ -39,5 +38,5 @@ EXE_LIBS = \
|
|||||||
-lspecie \
|
-lspecie \
|
||||||
-lthermophysicalFunctions \
|
-lthermophysicalFunctions \
|
||||||
-ltopoChangerFvMesh \
|
-ltopoChangerFvMesh \
|
||||||
-ltriSurface
|
-ltriSurface \
|
||||||
|
-lautoMesh
|
||||||
|
|||||||
@ -90,52 +90,6 @@
|
|||||||
<BooleanDomain name="bool"/>
|
<BooleanDomain name="bool"/>
|
||||||
</IntVectorProperty>
|
</IntVectorProperty>
|
||||||
|
|
||||||
<!-- Time step edit box -->
|
|
||||||
<!-- OLESEN
|
|
||||||
<IntVectorProperty
|
|
||||||
name="TimeStepRangeInfo"
|
|
||||||
command="GetTimeStepRange"
|
|
||||||
information_only="1">
|
|
||||||
<SimpleIntInformationHelper/>
|
|
||||||
</IntVectorProperty>
|
|
||||||
<IntVectorProperty
|
|
||||||
name="TimeStep"
|
|
||||||
command="SetTimeStep"
|
|
||||||
number_of_elements="1"
|
|
||||||
animateable="1"
|
|
||||||
default_values="0"
|
|
||||||
information_property="TimestepValues">
|
|
||||||
<IntRangeDomain
|
|
||||||
name="range">
|
|
||||||
<RequiredProperties>
|
|
||||||
<Property name="TimeStepRangeInfo"
|
|
||||||
function="Range"/>
|
|
||||||
</RequiredProperties>
|
|
||||||
</IntRangeDomain>
|
|
||||||
</IntVectorProperty>
|
|
||||||
-->
|
|
||||||
|
|
||||||
<!-- Time step limits boxes -->
|
|
||||||
<!-- <IntVectorProperty
|
|
||||||
name="TimeStepLimitsInfo"
|
|
||||||
command="GetTimeStepLimits"
|
|
||||||
information_only="1">
|
|
||||||
<SimpleIntInformationHelper/>
|
|
||||||
</IntVectorProperty>
|
|
||||||
<IntVectorProperty
|
|
||||||
name="TimeStepLimits"
|
|
||||||
command="SetTimeStepLimits"
|
|
||||||
number_of_elements="2"
|
|
||||||
default_values="2 5" >
|
|
||||||
<IntRangeDomain
|
|
||||||
name="range">
|
|
||||||
<RequiredProperties>
|
|
||||||
<Property name="TimeStepLimitsInfo"
|
|
||||||
function="Range"/>
|
|
||||||
</RequiredProperties>
|
|
||||||
</IntRangeDomain>
|
|
||||||
</IntVectorProperty>-->
|
|
||||||
|
|
||||||
<!-- Available regions array -->
|
<!-- Available regions array -->
|
||||||
<StringVectorProperty
|
<StringVectorProperty
|
||||||
name="RegionArrayInfo"
|
name="RegionArrayInfo"
|
||||||
@ -233,7 +187,9 @@
|
|||||||
</StringVectorProperty>
|
</StringVectorProperty>
|
||||||
|
|
||||||
<!-- Available times array -->
|
<!-- Available times array -->
|
||||||
<!-- <StringVectorProperty
|
<!-- PV3FOAM_TIMESELECTION must be defined when compiling vtkPV3Foam
|
||||||
|
might discard this in the future
|
||||||
|
<StringVectorProperty
|
||||||
name="TimeArrayInfo"
|
name="TimeArrayInfo"
|
||||||
information_only="1">
|
information_only="1">
|
||||||
<ArraySelectionInformationHelper
|
<ArraySelectionInformationHelper
|
||||||
@ -255,6 +211,8 @@
|
|||||||
</RequiredProperties>
|
</RequiredProperties>
|
||||||
</ArraySelectionDomain>
|
</ArraySelectionDomain>
|
||||||
</StringVectorProperty>
|
</StringVectorProperty>
|
||||||
|
|
||||||
|
PV3FOAM_TIMESELECTION
|
||||||
-->
|
-->
|
||||||
|
|
||||||
</SourceProxy>
|
</SourceProxy>
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
|
/* -DPV3FOAM_TIMESELECTION */ \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
|
|||||||
@ -27,8 +27,6 @@ License
|
|||||||
#include "vtkPV3Foam.H"
|
#include "vtkPV3Foam.H"
|
||||||
|
|
||||||
// Foam includes
|
// Foam includes
|
||||||
#include "argList.H"
|
|
||||||
#include "JobInfo.H"
|
|
||||||
#include "Time.H"
|
#include "Time.H"
|
||||||
#include "fvMesh.H"
|
#include "fvMesh.H"
|
||||||
#include "IOobjectList.H"
|
#include "IOobjectList.H"
|
||||||
@ -176,11 +174,7 @@ void Foam::vtkPV3Foam::resetCounters()
|
|||||||
|
|
||||||
void Foam::vtkPV3Foam::initializeTime()
|
void Foam::vtkPV3Foam::initializeTime()
|
||||||
{
|
{
|
||||||
if (debug)
|
#ifdef PV3FOAM_TIMESELECTION
|
||||||
{
|
|
||||||
Info<< "entered Foam::vtkPV3Foam::initializeTime" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
Time& runTime = dbPtr_();
|
Time& runTime = dbPtr_();
|
||||||
|
|
||||||
// Get times list
|
// Get times list
|
||||||
@ -206,6 +200,7 @@ void Foam::vtkPV3Foam::initializeTime()
|
|||||||
times[timeI].name().c_str()
|
times[timeI].name().c_str()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
#endif /* PV3FOAM_TIMESELECTION */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -213,8 +208,8 @@ bool Foam::vtkPV3Foam::setTime(const double& requestedTime)
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::setTime("
|
Info<< "<beg> Foam::vtkPV3Foam::setTime(" << requestedTime << ")"
|
||||||
<< requestedTime << ")" << endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
Time& runTime = dbPtr_();
|
Time& runTime = dbPtr_();
|
||||||
@ -249,12 +244,14 @@ bool Foam::vtkPV3Foam::setTime(const double& requestedTime)
|
|||||||
found = true;
|
found = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
runTime.setTime(times[nearestIndex], nearestIndex);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "Selecting time " << times[nearestIndex].name() << endl;
|
Info<< "<end> Foam::vtkPV3Foam::setTime() - selected time "
|
||||||
|
<< times[nearestIndex].name() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
runTime.setTime(times[nearestIndex], nearestIndex);
|
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -263,7 +260,7 @@ void Foam::vtkPV3Foam::updateSelectedRegions()
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::updateSelectedRegions" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::updateSelectedRegions" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
vtkDataArraySelection* arraySelection = reader_->GetRegionSelection();
|
vtkDataArraySelection* arraySelection = reader_->GetRegionSelection();
|
||||||
@ -281,10 +278,15 @@ void Foam::vtkPV3Foam::updateSelectedRegions()
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "region " << regionId
|
Info<< " region[" << regionId << "] = "
|
||||||
<< " = " << selectedRegions_[regionId] << endl;
|
<< selectedRegions_[regionId]
|
||||||
|
<< " : " << arraySelection->GetArrayName(regionId) << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::updateSelectedRegions" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -294,13 +296,14 @@ Foam::stringList Foam::vtkPV3Foam::getSelectedArrayEntries
|
|||||||
const bool firstWord
|
const bool firstWord
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Info<< "entered Foam::vtkPV3Foam::getSelectedArrayEntries" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
stringList selections(arraySelection->GetNumberOfArrays());
|
stringList selections(arraySelection->GetNumberOfArrays());
|
||||||
label nElem = 0;
|
label nElem = 0;
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info << "selections(";
|
||||||
|
}
|
||||||
|
|
||||||
forAll (selections, elemI)
|
forAll (selections, elemI)
|
||||||
{
|
{
|
||||||
if (arraySelection->GetArraySetting(elemI))
|
if (arraySelection->GetArraySetting(elemI))
|
||||||
@ -316,16 +319,22 @@ Foam::stringList Foam::vtkPV3Foam::getSelectedArrayEntries
|
|||||||
{
|
{
|
||||||
selections[nElem] = arraySelection->GetArrayName(elemI);
|
selections[nElem] = arraySelection->GetArrayName(elemI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info << " " << selections[nElem];
|
||||||
|
}
|
||||||
|
|
||||||
++nElem;
|
++nElem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
selections.setSize(nElem);
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "Active array: " << selections << endl;
|
Info << " )" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
selections.setSize(nElem);
|
||||||
return selections;
|
return selections;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -337,14 +346,14 @@ Foam::stringList Foam::vtkPV3Foam::getSelectedArrayEntries
|
|||||||
const bool firstWord
|
const bool firstWord
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Info<< "entered Foam::vtkPV3Foam::getSelectedArrayEntries" << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
stringList selections(selector.size());
|
stringList selections(selector.size());
|
||||||
label nElem = 0;
|
label nElem = 0;
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info << "selections(";
|
||||||
|
}
|
||||||
|
|
||||||
for
|
for
|
||||||
(
|
(
|
||||||
int regionId = selector.start();
|
int regionId = selector.start();
|
||||||
@ -366,16 +375,22 @@ Foam::stringList Foam::vtkPV3Foam::getSelectedArrayEntries
|
|||||||
selections[nElem] = arraySelection->GetArrayName(regionId);
|
selections[nElem] = arraySelection->GetArrayName(regionId);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info << " " << selections[nElem];
|
||||||
|
}
|
||||||
|
|
||||||
++nElem;
|
++nElem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
selections.setSize(nElem);
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "Active array: " << selections << endl;
|
Info << " )" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
selections.setSize(nElem);
|
||||||
return selections;
|
return selections;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -386,9 +401,9 @@ void Foam::vtkPV3Foam::setSelectedArrayEntries
|
|||||||
const stringList& selections
|
const stringList& selections
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug > 1)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::setSelectedArrayEntries" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::setSelectedArrayEntries" << endl;
|
||||||
}
|
}
|
||||||
const label nEntries = arraySelection->GetNumberOfArrays();
|
const label nEntries = arraySelection->GetNumberOfArrays();
|
||||||
|
|
||||||
@ -398,7 +413,7 @@ void Foam::vtkPV3Foam::setSelectedArrayEntries
|
|||||||
// Loop through entries, setting values from selectedEntries
|
// Loop through entries, setting values from selectedEntries
|
||||||
forAll (selections, elemI)
|
forAll (selections, elemI)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug > 1)
|
||||||
{
|
{
|
||||||
Info<< "selections[" << elemI << "] = " << selections[elemI]
|
Info<< "selections[" << elemI << "] = " << selections[elemI]
|
||||||
<< endl;
|
<< endl;
|
||||||
@ -410,7 +425,7 @@ void Foam::vtkPV3Foam::setSelectedArrayEntries
|
|||||||
|
|
||||||
if (arrayName == selections[elemI])
|
if (arrayName == selections[elemI])
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug > 1)
|
||||||
{
|
{
|
||||||
Info<< "enabling array: " << arrayName << " Index = "
|
Info<< "enabling array: " << arrayName << " Index = "
|
||||||
<< i
|
<< i
|
||||||
@ -425,6 +440,10 @@ void Foam::vtkPV3Foam::setSelectedArrayEntries
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (debug > 1)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::setSelectedArrayEntries" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -455,8 +474,7 @@ Foam::vtkPV3Foam::vtkPV3Foam
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::vtkPV3Foam with "
|
Info<< "Foam::vtkPV3Foam::vtkPV3Foam - " << FileName << endl;
|
||||||
<< FileName << endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// avoid argList and get rootPath/caseName directly from the file
|
// avoid argList and get rootPath/caseName directly from the file
|
||||||
@ -471,6 +489,22 @@ Foam::vtkPV3Foam::vtkPV3Foam
|
|||||||
fullCasePath = cwd();
|
fullCasePath = cwd();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Set the case as an environment variable - some BCs might use this
|
||||||
|
if (fullCasePath.name().find("processor", 0) == 0)
|
||||||
|
{
|
||||||
|
setEnv("FOAM_CASE", fullCasePath.path(), true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
setEnv("FOAM_CASE", fullCasePath, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "fullCasePath=" << fullCasePath << nl
|
||||||
|
<< "FOAM_CASE=" << getEnv("FOAM_CASE") << endl;
|
||||||
|
}
|
||||||
|
|
||||||
// Create time object
|
// Create time object
|
||||||
dbPtr_.reset
|
dbPtr_.reset
|
||||||
(
|
(
|
||||||
@ -504,7 +538,7 @@ Foam::vtkPV3Foam::~vtkPV3Foam()
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::~vtkPV3Foam" << endl;
|
Info<< "<end> Foam::vtkPV3Foam::~vtkPV3Foam" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (meshPtr_)
|
if (meshPtr_)
|
||||||
@ -521,7 +555,7 @@ void Foam::vtkPV3Foam::UpdateInformation()
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::UpdateInformation" << nl
|
Info<< "<beg> Foam::vtkPV3Foam::UpdateInformation - "
|
||||||
<< "TimeStep = " << reader_->GetTimeStep() << endl;
|
<< "TimeStep = " << reader_->GetTimeStep() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -575,6 +609,12 @@ void Foam::vtkPV3Foam::UpdateInformation()
|
|||||||
|
|
||||||
// Update lagrangian field array
|
// Update lagrangian field array
|
||||||
updateInformationLagrangianFields();
|
updateInformationLagrangianFields();
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::UpdateInformation" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -585,8 +625,8 @@ void Foam::vtkPV3Foam::Update
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
cout<< "entered Foam::vtkPV3Foam::Update" << nl
|
cout<< "<beg> Foam::vtkPV3Foam::Update" << nl
|
||||||
<<"Update\n";
|
<<"Update\n";
|
||||||
output->Print(cout);
|
output->Print(cout);
|
||||||
|
|
||||||
cout<<"Internally:\n";
|
cout<<"Internally:\n";
|
||||||
@ -596,7 +636,6 @@ void Foam::vtkPV3Foam::Update
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Set up region selection(s)
|
// Set up region selection(s)
|
||||||
updateSelectedRegions();
|
updateSelectedRegions();
|
||||||
|
|
||||||
@ -673,15 +712,16 @@ double* Foam::vtkPV3Foam::timeSteps(int& nTimeSteps)
|
|||||||
int nTimes = 0;
|
int nTimes = 0;
|
||||||
double* ts = NULL;
|
double* ts = NULL;
|
||||||
|
|
||||||
vtkDataArraySelection* arraySelection = reader_->GetTimeSelection();
|
|
||||||
|
|
||||||
if (dbPtr_.valid())
|
if (dbPtr_.valid())
|
||||||
{
|
{
|
||||||
Time& runTime = dbPtr_();
|
Time& runTime = dbPtr_();
|
||||||
|
|
||||||
instantList times = runTime.times();
|
instantList times = runTime.times();
|
||||||
|
|
||||||
|
#ifdef PV3FOAM_TIMESELECTION
|
||||||
List<bool> selected = List<bool>(times.size(), false);
|
List<bool> selected = List<bool>(times.size(), false);
|
||||||
|
|
||||||
|
vtkDataArraySelection* arraySelection = reader_->GetTimeSelection();
|
||||||
const label nSelectedTimes = arraySelection->GetNumberOfArrays();
|
const label nSelectedTimes = arraySelection->GetNumberOfArrays();
|
||||||
|
|
||||||
for (int i = 0; i < nSelectedTimes; ++i)
|
for (int i = 0; i < nSelectedTimes; ++i)
|
||||||
@ -694,20 +734,21 @@ double* Foam::vtkPV3Foam::timeSteps(int& nTimeSteps)
|
|||||||
&& timeI < times.size()
|
&& timeI < times.size()
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
#if 0
|
if (debug > 1)
|
||||||
Info<<"timeSelection["
|
{
|
||||||
<< i
|
Info<<"timeSelection["
|
||||||
<<"] = "
|
<< i
|
||||||
<< arraySelection->GetArraySetting(i)
|
<<"] = "
|
||||||
<< " is "
|
<< arraySelection->GetArraySetting(i)
|
||||||
<< arraySelection->GetArrayName(i) << endl;
|
<< " is "
|
||||||
#endif
|
<< arraySelection->GetArrayName(i) << endl;
|
||||||
|
}
|
||||||
selected[timeI] = true;
|
selected[timeI] = true;
|
||||||
++nTimes;
|
++nTimes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug)
|
if (debug > 1)
|
||||||
{
|
{
|
||||||
Info<< "selected " << nTimes << " times ";
|
Info<< "selected " << nTimes << " times ";
|
||||||
Info<< "found " << times.size() << " times: (";
|
Info<< "found " << times.size() << " times: (";
|
||||||
@ -732,6 +773,27 @@ double* Foam::vtkPV3Foam::timeSteps(int& nTimeSteps)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#else /* PV3FOAM_TIMESELECTION */
|
||||||
|
// always skip "constant" time, unless there are no other times
|
||||||
|
nTimes = times.size();
|
||||||
|
label timeI = 0;
|
||||||
|
|
||||||
|
if (nTimes > 1)
|
||||||
|
{
|
||||||
|
timeI = 1;
|
||||||
|
--nTimes;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nTimes)
|
||||||
|
{
|
||||||
|
ts = new double[nTimes];
|
||||||
|
for (label stepI = 0; stepI < nTimes; ++stepI, ++timeI)
|
||||||
|
{
|
||||||
|
ts[stepI] = times[timeI].value();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#endif /* PV3FOAM_TIMESELECTION */
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -741,7 +803,7 @@ double* Foam::vtkPV3Foam::timeSteps(int& nTimeSteps)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// return length via the parameter
|
// return vector length via the parameter
|
||||||
nTimeSteps = nTimes;
|
nTimeSteps = nTimes;
|
||||||
|
|
||||||
return ts;
|
return ts;
|
||||||
@ -755,7 +817,7 @@ void Foam::vtkPV3Foam::addPatchNames(vtkRenderer* renderer)
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "addPatchNames()" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::addPatchNames" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
@ -773,7 +835,7 @@ void Foam::vtkPV3Foam::addPatchNames(vtkRenderer* renderer)
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<<"patches: " << selectedPatches <<endl;
|
Info<<"... add patches: " << selectedPatches <<endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Find the total number of zones
|
// Find the total number of zones
|
||||||
@ -787,7 +849,7 @@ void Foam::vtkPV3Foam::addPatchNames(vtkRenderer* renderer)
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "determining patch zones" << endl;
|
Info<< "... determining patch zones" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loop through all patches to determine zones, and centre of each zone
|
// Loop through all patches to determine zones, and centre of each zone
|
||||||
@ -926,6 +988,11 @@ void Foam::vtkPV3Foam::addPatchNames(vtkRenderer* renderer)
|
|||||||
|
|
||||||
// Resize the patch names list to the actual number of patch names added
|
// Resize the patch names list to the actual number of patch names added
|
||||||
patchTextActorsPtrs_.setSize(globalZoneI);
|
patchTextActorsPtrs_.setSize(globalZoneI);
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::addPatchNames)" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -48,7 +48,7 @@ void Foam::vtkPV3Foam::addFaceSetMesh
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered add face set internal mesh" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::addFaceSetMesh" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Construct primitivePatch of faces in fSet.
|
// Construct primitivePatch of faces in fSet.
|
||||||
@ -96,6 +96,11 @@ void Foam::vtkPV3Foam::addFaceSetMesh
|
|||||||
|
|
||||||
vtkmesh->SetPolys(vtkcells);
|
vtkmesh->SetPolys(vtkcells);
|
||||||
vtkcells->Delete();
|
vtkcells->Delete();
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::addFaceSetMesh" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -47,7 +47,7 @@ void Foam::vtkPV3Foam::addFaceZoneMesh
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered addFaceZoneMesh" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::addFaceZoneMesh" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Construct primitivePatch of faces in fSet.
|
// Construct primitivePatch of faces in fSet.
|
||||||
@ -94,6 +94,11 @@ void Foam::vtkPV3Foam::addFaceZoneMesh
|
|||||||
|
|
||||||
vtkmesh->SetPolys(vtkcells);
|
vtkmesh->SetPolys(vtkcells);
|
||||||
vtkcells->Delete();
|
vtkcells->Delete();
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::addFaceZoneMesh" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -64,7 +64,7 @@ Foam::label Foam::vtkPV3Foam::addFields
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<<"add region " << GeoField::typeName
|
Info<<" addField to GUI " << GeoField::typeName
|
||||||
<< ":" << fields[fieldI] << endl;
|
<< ":" << fields[fieldI] << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -50,7 +50,7 @@ void Foam::vtkPV3Foam::addLagrangianMesh
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered add Lagrangian mesh with timePath "
|
Info<< "<beg> Foam::vtkPV3Foam::addLagrangianMesh - timePath "
|
||||||
<< mesh.time().timePath()/"lagrangian" << endl;
|
<< mesh.time().timePath()/"lagrangian" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,7 +61,7 @@ void Foam::vtkPV3Foam::addLagrangianMesh
|
|||||||
|
|
||||||
if (debug && cloudDirs.size())
|
if (debug && cloudDirs.size())
|
||||||
{
|
{
|
||||||
Info<< "check cloudDirs: " << cloudDirs << endl;
|
Info<< "... check cloudDirs: " << cloudDirs << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool foundCloud = false;
|
bool foundCloud = false;
|
||||||
@ -99,6 +99,11 @@ void Foam::vtkPV3Foam::addLagrangianMesh
|
|||||||
vtkpoints->Delete();
|
vtkpoints->Delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::addLagrangianMesh" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -48,7 +48,7 @@ void Foam::vtkPV3Foam::addPatchMesh
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "Adding patch: " << p.name() << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::addPatchMesh - " << p.name() << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert Foam mesh vertices to VTK
|
// Convert Foam mesh vertices to VTK
|
||||||
@ -84,6 +84,11 @@ void Foam::vtkPV3Foam::addPatchMesh
|
|||||||
|
|
||||||
vtkmesh->SetPolys(vtkcells);
|
vtkmesh->SetPolys(vtkcells);
|
||||||
vtkcells->Delete();
|
vtkcells->Delete();
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::addPatchMesh - " << p.name() << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -47,7 +47,7 @@ void Foam::vtkPV3Foam::addPointSetMesh
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered add point set mesh" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::addPointSetMesh" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const pointField& meshPoints = mesh.points();
|
const pointField& meshPoints = mesh.points();
|
||||||
@ -62,6 +62,11 @@ void Foam::vtkPV3Foam::addPointSetMesh
|
|||||||
|
|
||||||
vtkmesh->SetPoints(vtkpoints);
|
vtkmesh->SetPoints(vtkpoints);
|
||||||
vtkpoints->Delete();
|
vtkpoints->Delete();
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::addPointSetMesh" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,7 @@ void Foam::vtkPV3Foam::addPointZoneMesh
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered add point zone mesh" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::addPointZoneMesh" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const pointField& meshPoints = mesh.points();
|
const pointField& meshPoints = mesh.points();
|
||||||
@ -61,6 +61,11 @@ void Foam::vtkPV3Foam::addPointZoneMesh
|
|||||||
|
|
||||||
vtkmesh->SetPoints(vtkpoints);
|
vtkmesh->SetPoints(vtkpoints);
|
||||||
vtkpoints->Delete();
|
vtkpoints->Delete();
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<beg> Foam::vtkPV3Foam::addPointZoneMesh" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -54,7 +54,7 @@ void Foam::vtkPV3Foam::addVolumeMesh
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered add volume mesh" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::addVolumeMesh" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Number of additional points needed by the decomposition of polyhedra
|
// Number of additional points needed by the decomposition of polyhedra
|
||||||
@ -74,13 +74,13 @@ void Foam::vtkPV3Foam::addVolumeMesh
|
|||||||
// and cells
|
// and cells
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "building cell-shapes" << endl;
|
Info<< "... building cell-shapes" << endl;
|
||||||
}
|
}
|
||||||
const cellShapeList& cellShapes = mesh.cellShapes();
|
const cellShapeList& cellShapes = mesh.cellShapes();
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "scanning" << endl;
|
Info<< "... scanning" << endl;
|
||||||
}
|
}
|
||||||
forAll(cellShapes, cellI)
|
forAll(cellShapes, cellI)
|
||||||
{
|
{
|
||||||
@ -133,7 +133,7 @@ void Foam::vtkPV3Foam::addVolumeMesh
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "converting points" << endl;
|
Info<< "... converting points" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Convert Foam mesh vertices to VTK
|
// Convert Foam mesh vertices to VTK
|
||||||
@ -150,7 +150,7 @@ void Foam::vtkPV3Foam::addVolumeMesh
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "converting cells" << endl;
|
Info<< "... converting cells" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
vtkmesh->Allocate(mesh.nCells() + nAddCells);
|
vtkmesh->Allocate(mesh.nCells() + nAddCells);
|
||||||
@ -350,6 +350,11 @@ void Foam::vtkPV3Foam::addVolumeMesh
|
|||||||
|
|
||||||
vtkmesh->SetPoints(vtkpoints);
|
vtkmesh->SetPoints(vtkpoints);
|
||||||
vtkpoints->Delete();
|
vtkpoints->Delete();
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::addVolumeMesh" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -50,7 +50,7 @@ void Foam::vtkPV3Foam::convertMeshVolume
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::convertMeshVolume" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::convertMeshVolume" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const selectionInfo& selector = selectInfoVolume_;
|
const selectionInfo& selector = selectInfoVolume_;
|
||||||
@ -88,6 +88,11 @@ void Foam::vtkPV3Foam::convertMeshVolume
|
|||||||
selectedRegionDatasetIds_[regionId] = datasetId;
|
selectedRegionDatasetIds_[regionId] = datasetId;
|
||||||
vtkmesh->Delete();
|
vtkmesh->Delete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::convertMeshVolume" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -98,7 +103,7 @@ void Foam::vtkPV3Foam::convertMeshLagrangian
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::convertMeshLagrangian" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::convertMeshLagrangian" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const selectionInfo& selector = selectInfoLagrangian_;
|
const selectionInfo& selector = selectInfoLagrangian_;
|
||||||
@ -131,6 +136,10 @@ void Foam::vtkPV3Foam::convertMeshLagrangian
|
|||||||
selectedRegionDatasetIds_[regionId] = datasetId;
|
selectedRegionDatasetIds_[regionId] = datasetId;
|
||||||
vtkmesh->Delete();
|
vtkmesh->Delete();
|
||||||
}
|
}
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::convertMeshLagrangian" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -141,7 +150,7 @@ void Foam::vtkPV3Foam::convertMeshPatches
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::convertMeshPatches" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::convertMeshPatches" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const selectionInfo& selector = selectInfoPatches_;
|
const selectionInfo& selector = selectInfoPatches_;
|
||||||
@ -196,6 +205,11 @@ void Foam::vtkPV3Foam::convertMeshPatches
|
|||||||
vtkmesh->Delete();
|
vtkmesh->Delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::convertMeshPatches" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -206,7 +220,7 @@ void Foam::vtkPV3Foam::convertMeshCellZones
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::convertMeshCellZones" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::convertMeshCellZones" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const selectionInfo& selector = selectInfoCellZones_;
|
const selectionInfo& selector = selectInfoCellZones_;
|
||||||
@ -263,6 +277,11 @@ void Foam::vtkPV3Foam::convertMeshCellZones
|
|||||||
vtkmesh->Delete();
|
vtkmesh->Delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::convertMeshCellZones" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -273,7 +292,7 @@ void Foam::vtkPV3Foam::convertMeshCellSet
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::convertMeshCellSet" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::convertMeshCellSet" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const selectionInfo& selector = selectInfoCellSets_;
|
const selectionInfo& selector = selectInfoCellSets_;
|
||||||
@ -337,6 +356,11 @@ void Foam::vtkPV3Foam::convertMeshCellSet
|
|||||||
vtkmesh->Delete();
|
vtkmesh->Delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::convertMeshCellSet" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Foam::vtkPV3Foam::convertMeshFaceZones
|
void Foam::vtkPV3Foam::convertMeshFaceZones
|
||||||
@ -346,7 +370,7 @@ void Foam::vtkPV3Foam::convertMeshFaceZones
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::convertMeshFaceZones" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::convertMeshFaceZones" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const selectionInfo& selector = selectInfoFaceZones_;
|
const selectionInfo& selector = selectInfoFaceZones_;
|
||||||
@ -393,6 +417,11 @@ void Foam::vtkPV3Foam::convertMeshFaceZones
|
|||||||
vtkmesh->Delete();
|
vtkmesh->Delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::convertMeshFaceZones" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -403,7 +432,7 @@ void Foam::vtkPV3Foam::convertMeshFaceSet
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::convertMeshFaceSet" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::convertMeshFaceSet" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const selectionInfo& selector = selectInfoFaceSets_;
|
const selectionInfo& selector = selectInfoFaceSets_;
|
||||||
@ -458,6 +487,11 @@ void Foam::vtkPV3Foam::convertMeshFaceSet
|
|||||||
vtkmesh->Delete();
|
vtkmesh->Delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::convertMeshFaceSet" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -468,7 +502,7 @@ void Foam::vtkPV3Foam::convertMeshPointZones
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::convertMeshPointZones" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::convertMeshPointZones" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const selectionInfo& selector = selectInfoPointZones_;
|
const selectionInfo& selector = selectInfoPointZones_;
|
||||||
@ -498,7 +532,7 @@ void Foam::vtkPV3Foam::convertMeshPointZones
|
|||||||
const label datasetId = GetNumberOfDataSets(output, selector);
|
const label datasetId = GetNumberOfDataSets(output, selector);
|
||||||
|
|
||||||
vtkPolyData* vtkmesh = vtkPolyData::New();
|
vtkPolyData* vtkmesh = vtkPolyData::New();
|
||||||
|
|
||||||
addPointZoneMesh
|
addPointZoneMesh
|
||||||
(
|
(
|
||||||
mesh,
|
mesh,
|
||||||
@ -515,6 +549,11 @@ void Foam::vtkPV3Foam::convertMeshPointZones
|
|||||||
vtkmesh->Delete();
|
vtkmesh->Delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::convertMeshPointZones" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -526,7 +565,7 @@ void Foam::vtkPV3Foam::convertMeshPointSet
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::convertMeshPointSet" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::convertMeshPointSet" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const selectionInfo& selector = selectInfoPointSets_;
|
const selectionInfo& selector = selectInfoPointSets_;
|
||||||
@ -581,7 +620,11 @@ void Foam::vtkPV3Foam::convertMeshPointSet
|
|||||||
vtkmesh->Delete();
|
vtkmesh->Delete();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::convertMeshPointSet" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -66,7 +66,7 @@ void Foam::vtkPV3Foam::convertPointFields
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "converting Foam point field: " << fieldName
|
Info<< "Foam::vtkPV3Foam::convertPointFields : " << fieldName
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -47,13 +47,16 @@ void Foam::vtkPV3Foam::updateFoamMesh()
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::updateFoamMesh" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::updateFoamMesh" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if
|
if
|
||||||
(
|
(
|
||||||
!reader_->GetCacheMesh()
|
!reader_->GetCacheMesh()
|
||||||
|
#ifdef PV3FOAM_TIMESELECTION
|
||||||
|
// This is only useful if the times are individually selectable
|
||||||
|| reader_->GetTimeSelection()->GetArraySetting(0)
|
|| reader_->GetTimeSelection()->GetArraySetting(0)
|
||||||
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
delete meshPtr_;
|
delete meshPtr_;
|
||||||
@ -84,6 +87,11 @@ void Foam::vtkPV3Foam::updateFoamMesh()
|
|||||||
Info<< "Using existing Foam mesh" << endl;
|
Info<< "Using existing Foam mesh" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::updateFoamMesh" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -94,7 +102,7 @@ void Foam::vtkPV3Foam::updateVolFields
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::updateVolFields" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::updateVolFields" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
@ -155,6 +163,11 @@ void Foam::vtkPV3Foam::updateVolFields
|
|||||||
(
|
(
|
||||||
mesh, pInterp, ppInterpList, objects, arraySelection, output
|
mesh, pInterp, ppInterpList, objects, arraySelection, output
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::updateVolFields" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -165,7 +178,7 @@ void Foam::vtkPV3Foam::updatePointFields
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::updatePointFields" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::updatePointFields" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
@ -175,11 +188,6 @@ void Foam::vtkPV3Foam::updatePointFields
|
|||||||
|
|
||||||
vtkDataArraySelection* arraySelection = reader_->GetPointFieldSelection();
|
vtkDataArraySelection* arraySelection = reader_->GetPointFieldSelection();
|
||||||
|
|
||||||
// Convert point fields
|
|
||||||
if (debug)
|
|
||||||
{
|
|
||||||
Info<< "converting Foam point fields" << endl;
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
convertPointFields<Foam::label>
|
convertPointFields<Foam::label>
|
||||||
(
|
(
|
||||||
@ -206,6 +214,11 @@ void Foam::vtkPV3Foam::updatePointFields
|
|||||||
(
|
(
|
||||||
mesh, objects, arraySelection, output
|
mesh, objects, arraySelection, output
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::updatePointFields" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -216,7 +229,7 @@ void Foam::vtkPV3Foam::updateLagrangianFields
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::updateLagrangianFields" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::updateLagrangianFields" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
const fvMesh& mesh = *meshPtr_;
|
const fvMesh& mesh = *meshPtr_;
|
||||||
@ -264,6 +277,11 @@ void Foam::vtkPV3Foam::updateLagrangianFields
|
|||||||
(
|
(
|
||||||
mesh, objects, arraySelection, output
|
mesh, objects, arraySelection, output
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::updateLagrangianFields" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -86,8 +86,7 @@ void Foam::vtkPV3Foam::updateInformationInternalMesh()
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::updateInformationInternalMesh"
|
Info<< "<beg> Foam::vtkPV3Foam::updateInformationInternalMesh" << endl;
|
||||||
<< endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
vtkDataArraySelection* arraySelection = reader_->GetRegionSelection();
|
vtkDataArraySelection* arraySelection = reader_->GetRegionSelection();
|
||||||
@ -101,6 +100,12 @@ void Foam::vtkPV3Foam::updateInformationInternalMesh()
|
|||||||
selectInfoVolume_ = arraySelection->GetNumberOfArrays();
|
selectInfoVolume_ = arraySelection->GetNumberOfArrays();
|
||||||
arraySelection->AddArray("internalMesh");
|
arraySelection->AddArray("internalMesh");
|
||||||
selectInfoVolume_ += 1;
|
selectInfoVolume_ += 1;
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::updateInformationInternalMesh" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -108,8 +113,8 @@ void Foam::vtkPV3Foam::updateInformationLagrangian()
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::updateInformationLagrangian "
|
Info<< "<beg> Foam::vtkPV3Foam::updateInformationLagrangian" << nl
|
||||||
<< "at timePath " << dbPtr_->timePath()/"lagrangian" << endl;
|
<< " " << dbPtr_->timePath()/"lagrangian" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
vtkDataArraySelection* arraySelection = reader_->GetRegionSelection();
|
vtkDataArraySelection* arraySelection = reader_->GetRegionSelection();
|
||||||
@ -144,11 +149,15 @@ void Foam::vtkPV3Foam::updateInformationLagrangian()
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<<"no clouds identified in "
|
Info<<"no clouds identified in " <<nl
|
||||||
<< dbPtr_->timePath()/"lagrangian" << endl;
|
<< " " <<dbPtr_->timePath()/"lagrangian" << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::updateInformationLagrangian" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -156,7 +165,7 @@ void Foam::vtkPV3Foam::updateInformationPatches()
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::updateInformationPatches" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::updateInformationPatches" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
vtkDataArraySelection *arraySelection = reader_->GetRegionSelection();
|
vtkDataArraySelection *arraySelection = reader_->GetRegionSelection();
|
||||||
@ -198,6 +207,10 @@ void Foam::vtkPV3Foam::updateInformationPatches()
|
|||||||
}
|
}
|
||||||
selectInfoPatches_ += nPatches;
|
selectInfoPatches_ += nPatches;
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::updateInformationPatches" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -205,7 +218,7 @@ void Foam::vtkPV3Foam::updateInformationZones()
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::updateInformationZones" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::updateInformationZones" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
vtkDataArraySelection *arraySelection = reader_->GetRegionSelection();
|
vtkDataArraySelection *arraySelection = reader_->GetRegionSelection();
|
||||||
@ -301,6 +314,12 @@ void Foam::vtkPV3Foam::updateInformationZones()
|
|||||||
selectInfoPointZones_ += zones.size();
|
selectInfoPointZones_ += zones.size();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::updateInformationZones" << endl;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -308,7 +327,7 @@ void Foam::vtkPV3Foam::updateInformationSets()
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::updateInformationSets" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::updateInformationSets" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
vtkDataArraySelection *arraySelection = reader_->GetRegionSelection();
|
vtkDataArraySelection *arraySelection = reader_->GetRegionSelection();
|
||||||
@ -346,6 +365,11 @@ void Foam::vtkPV3Foam::updateInformationSets()
|
|||||||
objects,
|
objects,
|
||||||
" - pointSet"
|
" - pointSet"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::updateInformationSets" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -353,7 +377,7 @@ void Foam::vtkPV3Foam::updateInformationLagrangianFields()
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::updateInformationLagrangianFields"
|
Info<< "<beg> Foam::vtkPV3Foam::updateInformationLagrangianFields"
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -415,8 +439,8 @@ void Foam::vtkPV3Foam::updateInformationLagrangianFields()
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "lagrangian objects.size() = " << objects.size()
|
Info<< "<end> Foam::vtkPV3Foam::updateInformationLagrangianFields - "
|
||||||
<< endl;
|
<< "lagrangian objects.size() = " << objects.size() << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -40,7 +40,7 @@ void Foam::vtkPV3Foam::updateInformationFields
|
|||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "entered Foam::vtkPV3Foam::updateInformationFields" << endl;
|
Info<< "<beg> Foam::vtkPV3Foam::updateInformationFields" << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
// preserve the currently selected values
|
// preserve the currently selected values
|
||||||
@ -94,6 +94,11 @@ void Foam::vtkPV3Foam::updateInformationFields
|
|||||||
arraySelection,
|
arraySelection,
|
||||||
selectedEntries
|
selectedEntries
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "<end> Foam::vtkPV3Foam::updateInformationFields" << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1 +1,2 @@
|
|||||||
|
#!/bin/sh
|
||||||
wmake libso
|
wmake libso
|
||||||
@ -26,10 +26,9 @@ Application
|
|||||||
libuserd-foam
|
libuserd-foam
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Module for EnSight 7.6 to read FOAM data directly without translation
|
EnSight library module to read OpenFOAM data directly without translation
|
||||||
|
|
||||||
It can currently handle cells of type:
|
It can currently handle most cell types.
|
||||||
Z_HEX08, Z_PEN06, Z_TET04, Z_PUR05
|
|
||||||
|
|
||||||
See also: README_USERD_2.0
|
See also: README_USERD_2.0
|
||||||
24 Sep 2001: NN - Added support for Ensight API 2.0
|
24 Sep 2001: NN - Added support for Ensight API 2.0
|
||||||
@ -44,7 +44,7 @@ int main(int argc, char *argv[])
|
|||||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
# include "createMesh.H"
|
# include "createMesh.H"
|
||||||
|
|
||||||
IOprobes sniff(mesh, "probesDict", true);
|
IOprobes sniff(mesh, "probesDict", IOobject::MUST_READ, true);
|
||||||
|
|
||||||
forAll(timeDirs, timeI)
|
forAll(timeDirs, timeI)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -28,39 +28,39 @@ Description
|
|||||||
|
|
||||||
Keywords:
|
Keywords:
|
||||||
|
|
||||||
setFormat: set output format, choice of
|
@param setFormat : set output format, choice of \n
|
||||||
xmgr
|
- xmgr
|
||||||
jplot
|
- jplot
|
||||||
gnuplot
|
- gnuplot
|
||||||
raw
|
- raw
|
||||||
|
|
||||||
surfaceFormat: surface output format, choice of
|
@param surfaceFormat : surface output format, choice of \n
|
||||||
null : suppress output
|
- null : suppress output
|
||||||
foamFile : separate points, faces and values file
|
- foamFile : separate points, faces and values file
|
||||||
dx : DX scalar or vector format
|
- dx : DX scalar or vector format
|
||||||
vtk : VTK ascii format
|
- vtk : VTK ascii format
|
||||||
raw : x y z value format for use with e.g. gnuplot 'splot'.
|
- raw : x y z value format for use with e.g. gnuplot 'splot'.
|
||||||
stl : ascii stl. Does not contain values!
|
- stl : ascii stl. Does not contain values!
|
||||||
|
|
||||||
interpolationScheme: interpolation scheme, choice of
|
@param interpolationScheme : interpolation scheme, choice of \n
|
||||||
cell : use cell-centre value; constant over cells (default)
|
- cell : use cell-centre value; constant over cells (default)
|
||||||
cellPoint : use cell-centre and vertex values
|
- cellPoint : use cell-centre and vertex values
|
||||||
cellPointFace : use cell-centre, vertex and face values.
|
- cellPointFace : use cell-centre, vertex and face values. \n
|
||||||
1] vertex values determined from neighbouring cell-centre values
|
-# vertex values determined from neighbouring cell-centre values
|
||||||
2] face values determined using the current face interpolation scheme
|
-# face values determined using the current face interpolation scheme
|
||||||
for the field (linear, limitedLinear, etc.)
|
for the field (linear, limitedLinear, etc.)
|
||||||
|
|
||||||
fields: list of fields to sample
|
@param fields : list of fields to sample
|
||||||
|
|
||||||
sets: list of sets to sample, choice of
|
@param sets : list of sets to sample, choice of \n
|
||||||
uniform evenly distributed points on line
|
- uniform evenly distributed points on line
|
||||||
face one point per face intersection
|
- face one point per face intersection
|
||||||
midPoint one point per cell, inbetween two face intersections
|
- midPoint one point per cell, inbetween two face intersections
|
||||||
midPointAndFace combination of face and midPoint
|
- midPointAndFace combination of face and midPoint
|
||||||
|
|
||||||
curve specified points, not nessecary on line, uses
|
- curve specified points, not nessecary on line, uses
|
||||||
tracking
|
tracking
|
||||||
cloud specified points, uses findCell
|
- cloud specified points, uses findCell
|
||||||
|
|
||||||
Option axis: how to write point coordinate. Choice of
|
Option axis: how to write point coordinate. Choice of
|
||||||
- x/y/z: x/y/z coordinate only
|
- x/y/z: x/y/z coordinate only
|
||||||
@ -74,11 +74,12 @@ Description
|
|||||||
uniform: extra number of sampling points
|
uniform: extra number of sampling points
|
||||||
curve, cloud: list of coordinates
|
curve, cloud: list of coordinates
|
||||||
|
|
||||||
surfaces: list of surfaces to sample, choice of
|
@param surfaces : list of surfaces to sample, choice of \n
|
||||||
plane : values on plane defined by point, normal.
|
- plane : values on plane defined by point, normal.
|
||||||
patch : values on patch.
|
- patch : values on patch.
|
||||||
|
|
||||||
Runs in parallel.
|
Notes
|
||||||
|
Runs in parallel
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
@ -100,8 +101,8 @@ int main(int argc, char *argv[])
|
|||||||
instantList timeDirs = timeSelector::select0(runTime, args);
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
# include "createMesh.H"
|
# include "createMesh.H"
|
||||||
|
|
||||||
IOsampledSets sSets(mesh, "sampleDict", true);
|
IOsampledSets sSets(mesh, "sampleDict", IOobject::MUST_READ, true);
|
||||||
IOsampledSurfaces sSurfaces(mesh, "sampleDict", true);
|
IOsampledSurfaces sSurfs(mesh, "sampleDict", IOobject::MUST_READ, true);
|
||||||
|
|
||||||
forAll(timeDirs, timeI)
|
forAll(timeDirs, timeI)
|
||||||
{
|
{
|
||||||
@ -112,10 +113,10 @@ int main(int argc, char *argv[])
|
|||||||
polyMesh::readUpdateState state = mesh.readUpdate();
|
polyMesh::readUpdateState state = mesh.readUpdate();
|
||||||
|
|
||||||
sSets.readUpdate(state);
|
sSets.readUpdate(state);
|
||||||
sSurfaces.readUpdate(state);
|
sSurfs.readUpdate(state);
|
||||||
|
|
||||||
sSets.write();
|
sSets.write();
|
||||||
sSurfaces.write();
|
sSurfs.write();
|
||||||
|
|
||||||
Info<< endl;
|
Info<< endl;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -95,8 +95,8 @@ int main(int argc, char *argv[])
|
|||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "\nCreating boundary-layer for U of thickness" << ybl.value() << " m"
|
Info<< "\nCreating boundary-layer for U of thickness "
|
||||||
<< nl << endl;
|
<< ybl.value() << " m" << nl << endl;
|
||||||
|
|
||||||
// Modify velocity by applying a 1/7th power law boundary-layer
|
// Modify velocity by applying a 1/7th power law boundary-layer
|
||||||
// u/U0 = (y/ybl)^(1/7)
|
// u/U0 = (y/ybl)^(1/7)
|
||||||
|
|||||||
@ -35,7 +35,7 @@ usage() {
|
|||||||
while [ "$#" -ge 1 ]; do echo "$1" 1>&2; shift; done
|
while [ "$#" -ge 1 ]; do echo "$1" 1>&2; shift; done
|
||||||
cat <<USAGE 1>&2
|
cat <<USAGE 1>&2
|
||||||
|
|
||||||
usage: ${0##*/} [-case dir]
|
usage: ${0##*/} [-case dir] [-region name]
|
||||||
|
|
||||||
Remove the contents of the constant/polyMesh directory
|
Remove the contents of the constant/polyMesh directory
|
||||||
as per the Foam::polyMesh::removeFiles() method.
|
as per the Foam::polyMesh::removeFiles() method.
|
||||||
@ -44,46 +44,60 @@ USAGE
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
unset caseDir
|
unset caseDir regionName
|
||||||
unset meshDir
|
|
||||||
|
|
||||||
# parse options
|
# parse a single option
|
||||||
if [ "$#" -gt 0 ]; then
|
while [ "$#" -gt 0 ]
|
||||||
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-h | -help)
|
-h | -help)
|
||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
-case)
|
-case)
|
||||||
shift
|
[ "$#" -ge 2 ] || usage "'-case' option requires an argument"
|
||||||
caseDir=$1
|
caseDir=$2
|
||||||
[ "$#" -ge 1 ] || usage "'-case' option requires an argument"
|
shift 2
|
||||||
cd "$caseDir" 2>/dev/null || usage "directory does not exist: '$caseDir'"
|
cd "$caseDir" 2>/dev/null || usage "directory does not exist: '$caseDir'"
|
||||||
meshDir="constant/polyMesh"
|
;;
|
||||||
|
-region)
|
||||||
|
[ "$#" -ge 2 ] || usage "'-region' option requires an argument"
|
||||||
|
regionName=$2
|
||||||
|
shift 2
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
usage "unknown option/argument: '$*'"
|
usage "unknown option/argument: '$*'"
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
if [ -n "$regionName" ]
|
||||||
|
then
|
||||||
|
meshDir=$regionName/polyMesh
|
||||||
|
else
|
||||||
|
meshDir=polyMesh
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# meshDir is only set if -case was specified: insist upon 'constant/polyMesh'
|
# if -case was specified: insist upon 'constant/polyMesh'
|
||||||
if [ -n "$meshDir" ]
|
if [ -n "$caseDir" ]
|
||||||
then
|
then
|
||||||
if [ ! -d "$meshDir" ]
|
if [ -d constant/$meshDir ]
|
||||||
then
|
then
|
||||||
echo "Error: no '$meshDir' in $caseDir" 1>&2
|
# use constant/polyMesh
|
||||||
|
meshDir=constant/$meshDir
|
||||||
|
else
|
||||||
|
echo "Error: no 'constant/$meshDir' in $caseDir" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if [ -d constant/polyMesh ]
|
if [ -d constant/$meshDir ]
|
||||||
then
|
then
|
||||||
# use constant/polyMesh
|
# use constant/polyMesh
|
||||||
meshDir=constant/polyMesh
|
meshDir=constant/$meshDir
|
||||||
elif [ -d polyMesh ]
|
elif [ -d $meshDir ]
|
||||||
then
|
then
|
||||||
# likely already in constant/
|
# likely already in constant/ - do not adjust anything
|
||||||
meshDir=polyMesh
|
:
|
||||||
elif [ "${PWD##*/}" = polyMesh ]
|
elif [ "${PWD##*/}" = polyMesh -a -z "$regionName" ]
|
||||||
then
|
then
|
||||||
# apparently already within polyMesh/
|
# apparently already within polyMesh/
|
||||||
meshDir=.
|
meshDir=.
|
||||||
|
|||||||
@ -84,9 +84,9 @@ for i in $fileList
|
|||||||
do
|
do
|
||||||
name="${i##*/}"
|
name="${i##*/}"
|
||||||
# skip numerical (results) directories (except 0)
|
# skip numerical (results) directories (except 0)
|
||||||
# and things that look like queuing system output
|
# and things that look like queuing system output or log files
|
||||||
case "$name" in
|
case "$name" in
|
||||||
[1-9] | [0-9]?* | foam.[eo][1-9]*)
|
[1-9] | [0-9]?* | foam.[eo][1-9]* | log | *.log )
|
||||||
echo "$i [skipped]"
|
echo "$i [skipped]"
|
||||||
continue
|
continue
|
||||||
;;
|
;;
|
||||||
|
|||||||
@ -1,135 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
# ========= |
|
|
||||||
# \\ / 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
|
|
||||||
#
|
|
||||||
# Script
|
|
||||||
# foamDiffSourceList <oldDir> <newDir> <tarFile>
|
|
||||||
#
|
|
||||||
# Description
|
|
||||||
# Packs and compresses files that have changed (diff -uw) between
|
|
||||||
# oldDir newDir
|
|
||||||
#
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
tmpFile=${TMPDIR:-/tmp}/foamDiffList.$$
|
|
||||||
|
|
||||||
if [ $# -ne 3 ]; then
|
|
||||||
echo "Usage : ${0##*/} oldDir newDir tarFile"
|
|
||||||
echo ""
|
|
||||||
echo "Find the files that changed (diff -uw) between <oldDir> and <newDir>"
|
|
||||||
echo "and pack them into <tarFile>"
|
|
||||||
echo ""
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# canonical form (no double and no trailing dashes)
|
|
||||||
oldDir=$(echo "$1" | sed -e 's@//*@/@g' -e 's@/$@@')
|
|
||||||
newDir=$(echo "$2" | sed -e 's@//*@/@g' -e 's@/$@@')
|
|
||||||
packFile=$3
|
|
||||||
|
|
||||||
if [ ! -d $oldDir ]; then
|
|
||||||
echo "Error: directory $oldDir does not exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -d $newDir ]; then
|
|
||||||
echo "Error: directory $newDir does not exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ -f $packFile ]; then
|
|
||||||
echo "Error: $packFile already exists"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Clean up on termination and on Ctrl-C
|
|
||||||
trap 'rm -f $tmpFile 2>/dev/null; exit 0' EXIT TERM INT
|
|
||||||
|
|
||||||
fileCount=0
|
|
||||||
cat /dev/null > $tmpFile
|
|
||||||
|
|
||||||
find -H $newDir \
|
|
||||||
! -type d -type f \
|
|
||||||
! -name "*~" \
|
|
||||||
-a ! -name ".*~" \
|
|
||||||
-a ! -name ".#*" \
|
|
||||||
-a ! -name "*.orig" \
|
|
||||||
-a ! -name "*.dep" \
|
|
||||||
-a ! -name "*.o" \
|
|
||||||
-a ! -name "*.so" \
|
|
||||||
-a ! -name "*.a" \
|
|
||||||
-a ! -name "*.tgz" \
|
|
||||||
-a ! -name "core" \
|
|
||||||
-a ! -name "core.[1-9]*" \
|
|
||||||
-a ! -name "log[0-9]*" \
|
|
||||||
| sed \
|
|
||||||
-e "\@$newDir/.git/@d" \
|
|
||||||
-e "\@$newDir/lib/@d" \
|
|
||||||
-e '\@applications/bin/@d' \
|
|
||||||
-e '\@/t/@d' \
|
|
||||||
-e '\@Make[.A-Za-z]*/[^/]*/@d' \
|
|
||||||
-e '\@[Dd]oxygen/html@d' \
|
|
||||||
-e '\@[Dd]oxygen/latex@d' \
|
|
||||||
-e '\@[Dd]oxygen/man@d' \
|
|
||||||
-e "s@$newDir/*@@" \
|
|
||||||
| \
|
|
||||||
(
|
|
||||||
while read file
|
|
||||||
do
|
|
||||||
(( fileCount=$fileCount + 1))
|
|
||||||
|
|
||||||
if [ -f "$oldDir/$file" ]
|
|
||||||
then
|
|
||||||
diff -uw $oldDir/$file $newDir/$file >/dev/null 2>&1
|
|
||||||
if [ $? = 1 ]
|
|
||||||
then
|
|
||||||
echo "[DIFF]" $file
|
|
||||||
echo $newDir/$file >> $tmpFile
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "[NEW]" $file
|
|
||||||
echo $newDir/$file >> $tmpFile
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
echo $fileCount $file
|
|
||||||
done
|
|
||||||
)
|
|
||||||
|
|
||||||
# file fileCount
|
|
||||||
fileCount=$(cat $tmpFile | wc -l)
|
|
||||||
echo "----------------------------------------------------------------------"
|
|
||||||
echo "pack $fileCount changed/new files"
|
|
||||||
|
|
||||||
tar -czpf $packFile --files-from $tmpFile
|
|
||||||
|
|
||||||
if [ $? = 0 ]
|
|
||||||
then
|
|
||||||
echo "Finished packing changed files from $newDir into $packFile"
|
|
||||||
else
|
|
||||||
echo "Error: failure packing changed files from $newDir into $packFile"
|
|
||||||
rm -f $packFile 2>/dev/null
|
|
||||||
fi
|
|
||||||
echo "----------------------------------------------------------------------"
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------------------
|
|
||||||
@ -37,13 +37,11 @@
|
|||||||
# foamExec -v <foamVersion> <foamCommand> ... -parallel
|
# foamExec -v <foamVersion> <foamCommand> ... -parallel
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
Script=${0##*/}
|
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
usage: $Script [OPTION] <application> ...
|
usage: ${0##*/} [OPTION] <application> ...
|
||||||
|
|
||||||
options:
|
options:
|
||||||
-v ver specify OpenFOAM version
|
-v ver specify OpenFOAM version
|
||||||
|
|||||||
10
bin/foamJob
10
bin/foamJob
@ -29,13 +29,11 @@
|
|||||||
# Description
|
# Description
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
Script=${0##*/}
|
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
usage: $Script [OPTION] <application> ...
|
usage: ${0##*/} [OPTION] <application> ...
|
||||||
|
|
||||||
options:
|
options:
|
||||||
-case dir specify case directory
|
-case dir specify case directory
|
||||||
@ -108,9 +106,9 @@ do
|
|||||||
usage
|
usage
|
||||||
;;
|
;;
|
||||||
-case)
|
-case)
|
||||||
shift
|
[ "$#" -ge 2 ] || usage "'-case' option requires an argument"
|
||||||
caseDir=$1
|
caseDir=$2
|
||||||
[ "$#" -ge 1 ] || usage "'-case' option requires an argument"
|
shift 2
|
||||||
cd "$caseDir" 2>/dev/null || usage "directory does not exist: '$caseDir'"
|
cd "$caseDir" 2>/dev/null || usage "directory does not exist: '$caseDir'"
|
||||||
;;
|
;;
|
||||||
-s)
|
-s)
|
||||||
|
|||||||
@ -30,13 +30,11 @@
|
|||||||
# Create a new standard OpenFOAM source file
|
# Create a new standard OpenFOAM source file
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
Script=${0##*/}
|
|
||||||
|
|
||||||
usage() {
|
usage() {
|
||||||
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
while [ "$#" -ge 1 ]; do echo "$1"; shift; done
|
||||||
cat<<USAGE
|
cat<<USAGE
|
||||||
|
|
||||||
usage: $Script <type> {args}
|
usage: ${0##*/} <type> {args}
|
||||||
|
|
||||||
* create a new standard OpenFOAM source file
|
* create a new standard OpenFOAM source file
|
||||||
|
|
||||||
|
|||||||
@ -43,7 +43,8 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# add optional output directory
|
# add optional output directory
|
||||||
if [ -d "$1" ]; then
|
if [ -d "$1" ]
|
||||||
|
then
|
||||||
packFile="$1/$packFile"
|
packFile="$1/$packFile"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user