Commit 73208588 authored by Andrew Heather's avatar Andrew Heather
Browse files
parents 7343b385 8136d271
......@@ -183,5 +183,5 @@
Linux users with a 64-bit machine may install either the OpenFOAM 32-bit
version (linux) or the OpenFOAM 64-bit version (linux64), or both. The 64-bit
is the default mode on a 64-bit machine. To use an installed 32-bit version,
the user must set the environment variable $WM_32 (to anything, e.g. "on")
before sourcing the etc/bashrc (or etc/cshrc) file.
the user must set the environment variable WM_ARCH_OPTION to 32 before
sourcing the etc/bashrc (or etc/cshrc) file.
......@@ -28,7 +28,8 @@ Description
Work in progress! Handles ascii multiblock (and optionally singleBlock)
format.
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.
The code should detect this automatically - see hexBlock::readPoints but
if this goes wrong just set the blockHandedness_ variable to 'right'
......
......@@ -26,6 +26,6 @@ blockPoints.C
blockCells.C
blockBoundary.C
genBlockMesh.C
blockMeshApp.C
EXE = $(FOAM_APPBIN)/blockMesh
......@@ -90,52 +90,6 @@
<BooleanDomain name="bool"/>
</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 -->
<StringVectorProperty
name="RegionArrayInfo"
......@@ -233,7 +187,9 @@
</StringVectorProperty>
<!-- Available times array -->
<!-- <StringVectorProperty
<!-- PV3FOAM_TIMESELECTION must be defined when compiling vtkPV3Foam
might discard this in the future
<StringVectorProperty
name="TimeArrayInfo"
information_only="1">
<ArraySelectionInformationHelper
......@@ -255,6 +211,8 @@
</RequiredProperties>
</ArraySelectionDomain>
</StringVectorProperty>
PV3FOAM_TIMESELECTION
-->
</SourceProxy>
......
EXE_INC = \
/* -DPV3FOAM_TIMESELECTION */ \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
......
......@@ -27,8 +27,6 @@ License
#include "vtkPV3Foam.H"
// Foam includes
#include "argList.H"
#include "JobInfo.H"
#include "Time.H"
#include "fvMesh.H"
#include "IOobjectList.H"
......@@ -176,11 +174,7 @@ void Foam::vtkPV3Foam::resetCounters()
void Foam::vtkPV3Foam::initializeTime()
{
if (debug)
{
Info<< "entered Foam::vtkPV3Foam::initializeTime" << endl;
}
#ifdef PV3FOAM_TIMESELECTION
Time& runTime = dbPtr_();
// Get times list
......@@ -206,6 +200,7 @@ void Foam::vtkPV3Foam::initializeTime()
times[timeI].name().c_str()
);
}
#endif /* PV3FOAM_TIMESELECTION */
}
......@@ -213,8 +208,8 @@ bool Foam::vtkPV3Foam::setTime(const double& requestedTime)
{
if (debug)
{
Info<< "entered Foam::vtkPV3Foam::setTime("
<< requestedTime << ")" << endl;
Info<< "<beg> Foam::vtkPV3Foam::setTime(" << requestedTime << ")"
<< endl;
}
Time& runTime = dbPtr_();
......@@ -249,12 +244,14 @@ bool Foam::vtkPV3Foam::setTime(const double& requestedTime)
found = true;
}
runTime.setTime(times[nearestIndex], nearestIndex);
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;
}
......@@ -263,7 +260,7 @@ void Foam::vtkPV3Foam::updateSelectedRegions()
{
if (debug)
{
Info<< "entered Foam::vtkPV3Foam::updateSelectedRegions" << endl;
Info<< "<beg> Foam::vtkPV3Foam::updateSelectedRegions" << endl;
}
vtkDataArraySelection* arraySelection = reader_->GetRegionSelection();
......@@ -281,10 +278,15 @@ void Foam::vtkPV3Foam::updateSelectedRegions()
if (debug)
{
Info<< "region " << regionId
<< " = " << selectedRegions_[regionId] << endl;
Info<< " region[" << regionId << "] = "
<< 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
)
{
stringList selections(arraySelection->GetNumberOfArrays());
label nElem = 0;
if (debug)
{
Info<< "entered Foam::vtkPV3Foam::getSelectedArrayEntries" << endl;
Info << "selections(";
}
stringList selections(arraySelection->GetNumberOfArrays());
label nElem = 0;
forAll (selections, elemI)
{
if (arraySelection->GetArraySetting(elemI))
......@@ -316,16 +319,22 @@ Foam::stringList Foam::vtkPV3Foam::getSelectedArrayEntries
{
selections[nElem] = arraySelection->GetArrayName(elemI);
}
if (debug)
{
Info << " " << selections[nElem];
}
++nElem;
}
}
selections.setSize(nElem);
if (debug)
{
Info<< "Active array: " << selections << endl;
Info << " )" << endl;
}
selections.setSize(nElem);
return selections;
}
......@@ -337,14 +346,14 @@ Foam::stringList Foam::vtkPV3Foam::getSelectedArrayEntries
const bool firstWord
)
{
stringList selections(selector.size());
label nElem = 0;
if (debug)
{
Info<< "entered Foam::vtkPV3Foam::getSelectedArrayEntries" << endl;
Info << "selections(";
}
stringList selections(selector.size());
label nElem = 0;
for
(
int regionId = selector.start();
......@@ -366,16 +375,22 @@ Foam::stringList Foam::vtkPV3Foam::getSelectedArrayEntries
selections[nElem] = arraySelection->GetArrayName(regionId);
}
if (debug)
{
Info << " " << selections[nElem];
}
++nElem;
}
}
selections.setSize(nElem);
if (debug)
{
Info<< "Active array: " << selections << endl;
Info << " )" << endl;
}
selections.setSize(nElem);
return selections;
}
......@@ -386,9 +401,9 @@ void Foam::vtkPV3Foam::setSelectedArrayEntries
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();
......@@ -398,7 +413,7 @@ void Foam::vtkPV3Foam::setSelectedArrayEntries
// Loop through entries, setting values from selectedEntries
forAll (selections, elemI)
{
if (debug)
if (debug > 1)
{
Info<< "selections[" << elemI << "] = " << selections[elemI]
<< endl;
......@@ -410,7 +425,7 @@ void Foam::vtkPV3Foam::setSelectedArrayEntries
if (arrayName == selections[elemI])
{
if (debug)
if (debug > 1)
{
Info<< "enabling array: " << arrayName << " Index = "
<< 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)
{
Info<< "entered Foam::vtkPV3Foam::vtkPV3Foam with "
<< FileName << endl;
Info<< "Foam::vtkPV3Foam::vtkPV3Foam - " << FileName << endl;
}
// avoid argList and get rootPath/caseName directly from the file
......@@ -471,6 +489,22 @@ Foam::vtkPV3Foam::vtkPV3Foam
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
dbPtr_.reset
(
......@@ -504,7 +538,7 @@ Foam::vtkPV3Foam::~vtkPV3Foam()
{
if (debug)
{
Info<< "entered Foam::vtkPV3Foam::~vtkPV3Foam" << endl;
Info<< "<end> Foam::vtkPV3Foam::~vtkPV3Foam" << endl;
}
if (meshPtr_)
......@@ -521,7 +555,7 @@ void Foam::vtkPV3Foam::UpdateInformation()
{
if (debug)
{
Info<< "entered Foam::vtkPV3Foam::UpdateInformation" << nl
Info<< "<beg> Foam::vtkPV3Foam::UpdateInformation - "
<< "TimeStep = " << reader_->GetTimeStep() << endl;
}
......@@ -575,6 +609,12 @@ void Foam::vtkPV3Foam::UpdateInformation()
// Update lagrangian field array
updateInformationLagrangianFields();
if (debug)
{
Info<< "<end> Foam::vtkPV3Foam::UpdateInformation" << endl;
}
}
......@@ -585,8 +625,8 @@ void Foam::vtkPV3Foam::Update
{
if (debug)
{
cout<< "entered Foam::vtkPV3Foam::Update" << nl
<<"Update\n";
cout<< "<beg> Foam::vtkPV3Foam::Update" << nl
<<"Update\n";
output->Print(cout);
cout<<"Internally:\n";
......@@ -596,7 +636,6 @@ void Foam::vtkPV3Foam::Update
}
// Set up region selection(s)
updateSelectedRegions();
......@@ -673,15 +712,16 @@ double* Foam::vtkPV3Foam::timeSteps(int& nTimeSteps)
int nTimes = 0;
double* ts = NULL;
vtkDataArraySelection* arraySelection = reader_->GetTimeSelection();
if (dbPtr_.valid())
{
Time& runTime = dbPtr_();
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)
......@@ -694,20 +734,21 @@ double* Foam::vtkPV3Foam::timeSteps(int& nTimeSteps)
&& timeI < times.size()
)
{
#if 0
Info<<"timeSelection["
<< i
<<"] = "
<< arraySelection->GetArraySetting(i)
<< " is "
<< arraySelection->GetArrayName(i) << endl;
#endif
if (debug > 1)
{
Info<<"timeSelection["
<< i
<<"] = "
<< arraySelection->GetArraySetting(i)
<< " is "
<< arraySelection->GetArrayName(i) << endl;
}
selected[timeI] = true;
++nTimes;
}
}
if (debug)
if (debug > 1)
{
Info<< "selected " << nTimes << " 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
{
......@@ -741,7 +803,7 @@ double* Foam::vtkPV3Foam::timeSteps(int& nTimeSteps)
}
}
// return length via the parameter
// return vector length via the parameter
nTimeSteps = nTimes;
return ts;
......@@ -755,7 +817,7 @@ void Foam::vtkPV3Foam::addPatchNames(vtkRenderer* renderer)
if (debug)
{
Info<< "addPatchNames()" << endl;
Info<< "<beg> Foam::vtkPV3Foam::addPatchNames" << endl;
}
const fvMesh& mesh = *meshPtr_;
......@@ -773,7 +835,7 @@ void Foam::vtkPV3Foam::addPatchNames(vtkRenderer* renderer)
if (debug)
{
Info<<"patches: " << selectedPatches <<endl;
Info<<"... add patches: " << selectedPatches <<endl;
}
// Find the total number of zones
......@@ -787,7 +849,7 @@ void Foam::vtkPV3Foam::addPatchNames(vtkRenderer* renderer)
if (debug)
{
Info<< "determining patch zones" << endl;
Info<< "... determining patch zones" << endl;
}
// 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
patchTextActorsPtrs_.setSize(globalZoneI);
if (debug)
{
Info<< "<end> Foam::vtkPV3Foam::addPatchNames)" << endl;
}
}
......
......@@ -48,7 +48,7 @@ void Foam::vtkPV3Foam::addFaceSetMesh
{
if (debug)
{
Info<< "entered add face set internal mesh" << endl;
Info<< "<beg> Foam::vtkPV3Foam::addFaceSetMesh" << endl;
}
// Construct primitivePatch of faces in fSet.
......@@ -96,6 +96,11 @@ void Foam::vtkPV3Foam::addFaceSetMesh
vtkmesh->SetPolys(vtkcells);
vtkcells->Delete();
if (debug)
{
Info<< "<end> Foam::vtkPV3Foam::addFaceSetMesh" << endl;
}
}
// ************************************************************************* //
......@@ -47,7 +47,7 @@ void Foam::vtkPV3Foam::addFaceZoneMesh
{
if (debug)
{
Info<< "entered addFaceZoneMesh" << endl;
Info<< "<beg> Foam::vtkPV3Foam::addFaceZoneMesh" << endl;
}
// Construct primitivePatch of faces in fSet.
......@@ -94,6 +94,11 @@ void Foam::vtkPV3Foam::addFaceZoneMesh
vtkmesh->SetPolys(vtkcells);
vtkcells->Delete();
if (debug)
{
Info<< "<end> Foam::vtkPV3Foam::addFaceZoneMesh" << endl;
}
}
......
......@@ -64,7 +64,7 @@ Foam::label Foam::vtkPV3Foam::addFields
{
if (debug)
{
Info<<"add region " << GeoField::typeName
Info<<" addField to GUI " << GeoField::typeName
<< ":" << fields[fieldI] << endl;
}
......
......@@ -50,7 +50,7 @@ void Foam::vtkPV3Foam::addLagrangianMesh
{
if (debug)
{
Info<< "entered add Lagrangian mesh with timePath "
Info<< "<beg> Foam::vtkPV3Foam::addLagrangianMesh - timePath "
<< mesh.time().timePath()/"lagrangian" << endl;
}
......@@ -61,7 +61,7 @@ void Foam::vtkPV3Foam::addLagrangianMesh
if (debug && cloudDirs.size())
{
Info<< "check cloudDirs: " << cloudDirs << endl;
Info<< "... check cloudDirs: " << cloudDirs << endl;
}
bool foundCloud = false;
......@@ -99,6 +99,11 @@ void Foam::vtkPV3Foam::addLagrangianMesh
vtkpoints->Delete();
}
}
if (debug)
{
Info<< "<end> Foam::vtkPV3Foam::addLagrangianMesh" << endl;