Merge branch 'master' into cvm

This commit is contained in:
graham
2008-07-31 16:36:28 +01:00
66 changed files with 1130 additions and 1633 deletions

View File

@ -256,8 +256,7 @@ void Foam::kineticTheoryModel::solve()
/(alpha*rhoa_*sqrtPi*(ThetaSqrt + TsmallSqrt)); /(alpha*rhoa_*sqrtPi*(ThetaSqrt + TsmallSqrt));
// bulk viscosity p. 45 (Lun et al. 1984). // bulk viscosity p. 45 (Lun et al. 1984).
volScalarField lambda_ = lambda_ = (4.0/3.0)*sqr(alpha_)*rhoa_*da_*gs0_*(1.0+e_)*ThetaSqrt/sqrtPi;
(4.0/3.0)*sqr(alpha_)*rhoa_*da_*gs0_*(1.0+e_)*ThetaSqrt/sqrtPi;
// stress tensor, Definitions, Table 3.1, p. 43 // stress tensor, Definitions, Table 3.1, p. 43

View File

@ -5,15 +5,12 @@ set -x
# run from this directory only # run from this directory only
cd ${0%/*} || exit 1 cd ${0%/*} || exit 1
# build libccmio if required # build libccmio and create lnInclude directory
if [ ! -e $FOAM_LIBBIN/libccmio.so ]
then
( (
cd $WM_THIRD_PARTY_DIR && ./AllwmakeLibccmio 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 ] if [ -e $FOAM_LIBBIN/libccmio.so ]
then then
wmake ccm26ToFoam wmake ccm26ToFoam

View File

@ -22,9 +22,29 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation, along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Application
blockMesh
Description Description
A multi-block mesh generator. 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" #include "Time.H"
@ -60,59 +80,70 @@ int main(int argc, char *argv[])
word regionName; word regionName;
fileName polyMeshDir; fileName polyMeshDir;
word dictName("blockMeshDict");
fileName dictPath(runTime.constant());
if (args.options().found("region")) if (args.options().found("region"))
{ {
regionName = args.options()["region"]; // constant/<region>/polyMesh/blockMeshDict
regionName = args.options()["region"];
polyMeshDir = regionName/polyMesh::meshSubDir; polyMeshDir = regionName/polyMesh::meshSubDir;
Info<< nl << "Generating mesh for region " << regionName << endl; Info<< nl << "Generating mesh for region " << regionName << endl;
} }
else else
{ {
regionName = polyMesh::defaultRegion; // constant/polyMesh/blockMeshDict
regionName = polyMesh::defaultRegion;
polyMeshDir = polyMesh::meshSubDir; polyMeshDir = polyMesh::meshSubDir;
} }
fileName dictLocal = polyMeshDir;
Info<< nl << "Reading block mesh description dictionary" << endl;
word dictName("blockMeshDict");
fileName dictPath(runTime.constant()/polyMeshDir);
if (args.options().found("dict")) 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(); if (elems.size() == 1)
dictPath = userDict.path(); {
dictPath = ".";
}
else if (elems.size() > 2)
{
dictLocal = fileName(SubList<word>(elems, elems.size()-2, 1));
}
} }
IOobject meshDescriptionIOobject
IOobject meshDictIo
( (
dictName, dictName,
dictPath, dictPath,
dictLocal,
runTime, runTime,
IOobject::MUST_READ, IOobject::MUST_READ,
IOobject::NO_WRITE, IOobject::NO_WRITE,
false false
); );
if (!meshDescriptionIOobject.headerOk()) if (!meshDictIo.headerOk())
{ {
FatalErrorIn(args.executable()) FatalErrorIn(args.executable())
<< "Cannot open mesh description file: " << nl << "Cannot open mesh description file\n "
<< dictPath/dictName << nl << meshDictIo.objectPath()
<< nl
<< exit(FatalError); << 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(meshDict);
blockMesh blocks(meshDescription);
if (writeTopo) if (writeTopo)
{ {
@ -169,7 +200,7 @@ int main(int argc, char *argv[])
( (
runTime, runTime,
runTime.constant(), runTime.constant(),
polyMeshDir, //polyMesh::meshSubDir polyMeshDir,
patchNames, patchNames,
patchTypes, patchTypes,
defaultFacesName, defaultFacesName,
@ -197,11 +228,11 @@ int main(int argc, char *argv[])
// Read in a list of dictionaries for the merge patch pairs // Read in a list of dictionaries for the merge patch pairs
if (meshDescription.found("mergePatchPairs")) if (meshDict.found("mergePatchPairs"))
{ {
List<Pair<word> > mergePatchPairs List<Pair<word> > mergePatchPairs
( (
meshDescription.lookup("mergePatchPairs") meshDict.lookup("mergePatchPairs")
); );
if (mergePatchPairs.size()) if (mergePatchPairs.size())

View File

@ -275,6 +275,12 @@ void Foam::mergePolyMesh::addMesh(const polyMesh& m)
patchIndices[patchI] = patchIndex(bm[patchI]); 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(); const faceZoneMesh& fz = m.faceZones();
labelList faceZoneIndices(fz.size()); labelList faceZoneIndices(fz.size());

View File

@ -58,4 +58,15 @@ manualCoeffs
dataFile "decompositionData"; dataFile "decompositionData";
} }
//// Is the case distributred
//distributed yes;
//// Per slave (so nProcs-1 entries) the directory above the case.
//roots
//(
// "/tmp"
// "/tmp"
//);
// ************************************************************************* // // ************************************************************************* //

View File

@ -1,7 +1,5 @@
#!/bin/sh #!/bin/sh
set -x set -x
rm -r PV3FoamReader/Make rm -rf PV3FoamReader/Make
wclean libso vtkPV3Foam wclean libso vtkPV3Foam

View File

@ -1,6 +1,6 @@
<ParaViewReaders> <ParaViewReaders>
<Reader name="PV3FoamReader" <Reader name="PV3FoamReader"
extensions="OpenFOAM" extensions="OpenFOAM"
file_description="OpenFOAM"> file_description="OpenFOAM Reader">
</Reader> </Reader>
</ParaViewReaders> </ParaViewReaders>

View File

@ -31,26 +31,6 @@
<TimeRangeInformationHelper/> <TimeRangeInformationHelper/>
</DoubleVectorProperty> </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 --> <!-- ExtrapolateWalls check box -->
<IntVectorProperty <IntVectorProperty
name="ExtrapolateWalls" name="ExtrapolateWalls"
@ -186,34 +166,25 @@
</ArraySelectionDomain> </ArraySelectionDomain>
</StringVectorProperty> </StringVectorProperty>
<!-- Available times array --> <!-- Cache mesh check box -->
<!-- PV3FOAM_TIMESELECTION must be defined when compiling vtkPV3Foam <IntVectorProperty
might discard this in the future name="CacheMesh"
<StringVectorProperty command="SetCacheMesh"
name="TimeArrayInfo" number_of_elements="1"
information_only="1"> default_values="1">
<ArraySelectionInformationHelper <BooleanDomain
attribute_name="Time"/> name="bool"/>
</StringVectorProperty> </IntVectorProperty>
<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>
PV3FOAM_TIMESELECTION <!-- Update GUI check box -->
--> <IntVectorProperty
name="UpdateGUI"
command="SetUpdateGUI"
number_of_elements="1"
default_values="0">
<BooleanDomain
name="bool"/>
</IntVectorProperty>
</SourceProxy> </SourceProxy>
</ProxyGroup> </ProxyGroup>

View File

@ -21,32 +21,19 @@
// VTK includes // VTK includes
#include "vtkCallbackCommand.h" #include "vtkCallbackCommand.h"
#include "vtkCellArray.h"
#include "vtkCellData.h"
#include "vtkDataArraySelection.h" #include "vtkDataArraySelection.h"
#include "vtkDirectory.h"
#include "vtkDoubleArray.h"
#include "vtkErrorCode.h"
#include "vtkFloatArray.h"
#include "vtkInformation.h" #include "vtkInformation.h"
#include "vtkInformationVector.h" #include "vtkInformationVector.h"
#include "vtkIntArray.h"
#include "vtkMultiBlockDataSet.h" #include "vtkMultiBlockDataSet.h"
#include "vtkObjectFactory.h" #include "vtkObjectFactory.h"
#include "vtkPoints.h"
#include "vtkRenderer.h"
#include "vtkSMRenderViewProxy.h" #include "vtkSMRenderViewProxy.h"
#include "vtkStreamingDemandDrivenPipeline.h" #include "vtkStreamingDemandDrivenPipeline.h"
#include "vtkStringArray.h" #include "vtkStringArray.h"
#include "vtkUnstructuredGrid.h"
#include "vtkUnstructuredGridAlgorithm.h"
#include "vtkAlgorithmOutput.h"
#include "vtkMultiBlockDataSet.h"
// Foam includes // Foam includes
#include "vtkPV3Foam.H" #include "vtkPV3Foam.H"
vtkCxxRevisionMacro(vtkPV3FoamReader, "$Revision: 1.2$"); vtkCxxRevisionMacro(vtkPV3FoamReader, "$Revision: 1.5$");
vtkStandardNewMacro(vtkPV3FoamReader); vtkStandardNewMacro(vtkPV3FoamReader);
@ -60,17 +47,22 @@ vtkPV3FoamReader::vtkPV3FoamReader()
FileName = NULL; FileName = NULL;
foamData_ = NULL; foamData_ = NULL;
CacheMesh = 0; output1_ = NULL;
UpdateGUI = 1;
UpdateGUIOld = 1;
TimeStep = 0; TimeStep = 0;
TimeStepRange[0] = 0; TimeStepRange[0] = 0;
TimeStepRange[1] = 0; TimeStepRange[1] = 0;
CacheMesh = 0;
ExtrapolateWalls = 0;
IncludeSets = 0;
IncludeZones = 0;
ShowPatchNames = 0; ShowPatchNames = 0;
TimeSelection = vtkDataArraySelection::New(); UpdateGUI = 1;
UpdateGUIOld = 1;
RegionSelection = vtkDataArraySelection::New(); RegionSelection = vtkDataArraySelection::New();
VolFieldSelection = vtkDataArraySelection::New(); VolFieldSelection = vtkDataArraySelection::New();
PointFieldSelection = vtkDataArraySelection::New(); PointFieldSelection = vtkDataArraySelection::New();
@ -85,11 +77,6 @@ vtkPV3FoamReader::vtkPV3FoamReader()
); );
SelectionObserver->SetClientData(this); SelectionObserver->SetClientData(this);
TimeSelection->AddObserver
(
vtkCommand::ModifiedEvent,
this->SelectionObserver
);
RegionSelection->AddObserver RegionSelection->AddObserver
( (
vtkCommand::ModifiedEvent, vtkCommand::ModifiedEvent,
@ -112,6 +99,7 @@ vtkPV3FoamReader::vtkPV3FoamReader()
); );
} }
vtkPV3FoamReader::~vtkPV3FoamReader() vtkPV3FoamReader::~vtkPV3FoamReader()
{ {
vtkDebugMacro(<<"Deconstructor"); vtkDebugMacro(<<"Deconstructor");
@ -126,7 +114,6 @@ vtkPV3FoamReader::~vtkPV3FoamReader()
delete [] FileName; delete [] FileName;
} }
TimeSelection->RemoveObserver(this->SelectionObserver);
RegionSelection->RemoveObserver(this->SelectionObserver); RegionSelection->RemoveObserver(this->SelectionObserver);
VolFieldSelection->RemoveObserver(this->SelectionObserver); VolFieldSelection->RemoveObserver(this->SelectionObserver);
PointFieldSelection->RemoveObserver(this->SelectionObserver); PointFieldSelection->RemoveObserver(this->SelectionObserver);
@ -134,7 +121,6 @@ vtkPV3FoamReader::~vtkPV3FoamReader()
SelectionObserver->Delete(); SelectionObserver->Delete();
TimeSelection->Delete();
RegionSelection->Delete(); RegionSelection->Delete();
VolFieldSelection->Delete(); VolFieldSelection->Delete();
PointFieldSelection->Delete(); PointFieldSelection->Delete();
@ -152,7 +138,6 @@ int vtkPV3FoamReader::RequestInformation
{ {
vtkDebugMacro(<<"RequestInformation"); vtkDebugMacro(<<"RequestInformation");
if (Foam::vtkPV3Foam::debug) if (Foam::vtkPV3Foam::debug)
{ {
cout<<"REQUEST_INFORMATION\n"; cout<<"REQUEST_INFORMATION\n";
@ -164,38 +149,6 @@ int vtkPV3FoamReader::RequestInformation
return 0; 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); vtkInformation *outInfo = outputVector->GetInformationObject(0);
if (!foamData_) if (!foamData_)
@ -205,17 +158,22 @@ int vtkPV3FoamReader::RequestInformation
( (
outInfo->Get(vtkMultiBlockDataSet::DATA_OBJECT()) 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 else
{ {
vtkDebugMacro("RequestInformation: updating information");
foamData_->UpdateInformation(); foamData_->UpdateInformation();
} }
int nTimeSteps = 0; int nTimeSteps = 0;
double* timeSteps = foamData_->timeSteps(nTimeSteps); double* timeSteps = foamData_->findTimes(nTimeSteps);
outInfo->Set outInfo->Set
( (
@ -230,7 +188,7 @@ int vtkPV3FoamReader::RequestInformation
timeRange[0] = timeSteps[0]; timeRange[0] = timeSteps[0];
timeRange[1] = timeSteps[nTimeSteps-1]; timeRange[1] = timeSteps[nTimeSteps-1];
if (Foam::vtkPV3Foam::debug) if (Foam::vtkPV3Foam::debug > 1)
{ {
cout<<"nTimeSteps " << nTimeSteps << "\n"; cout<<"nTimeSteps " << nTimeSteps << "\n";
cout<<"timeRange " << timeRange[0] << " to " << timeRange[1] << "\n"; cout<<"timeRange " << timeRange[0] << " to " << timeRange[1] << "\n";
@ -271,20 +229,15 @@ int vtkPV3FoamReader::RequestData
return 0; return 0;
} }
if (Foam::vtkPV3Foam::debug)
{ {
int nInfo = outputVector->GetNumberOfInformationObjects(); int nInfo = outputVector->GetNumberOfInformationObjects();
if (Foam::vtkPV3Foam::debug) cout<<"requestData with " << nInfo << " items\n";
{
cout<<"requestData with " << nInfo << " items\n"; for (int i = 0; i < nInfo; ++i)
}
for (int i=0; i<nInfo; i++)
{ {
vtkInformation *info = outputVector->GetInformationObject(i); vtkInformation *info = outputVector->GetInformationObject(i);
info->Print(cout);
if (Foam::vtkPV3Foam::debug)
{
info->Print(cout);
}
} }
} }
@ -330,7 +283,7 @@ int vtkPV3FoamReader::RequestData
} }
else else
{ {
cout << "no data_object\n"; cout<< "no data_object\n";
} }
} }
@ -423,91 +376,29 @@ void vtkPV3FoamReader::removePatchNamesFromView()
} }
void vtkPV3FoamReader::PrintSelf void vtkPV3FoamReader::PrintSelf(ostream& os, vtkIndent indent)
(
ostream& os,
vtkIndent indent
)
{ {
vtkDebugMacro(<<"PrintSelf"); vtkDebugMacro(<<"PrintSelf");
this->Superclass::PrintSelf(os,indent); this->Superclass::PrintSelf(os,indent);
os<< indent << "File name: " os<< indent << "File name: "
<< (this->FileName ? this->FileName : "(none)") << "\n"; << (this->FileName ? this->FileName : "(none)") << "\n";
os<< indent << "Number of meshes: " << foamData_->numberOfMeshes() << "\n";
os<< indent << "Number of nodes: " << foamData_->numberOfPoints() << "\n"; foamData_->PrintSelf(os, indent);
os<< indent << "Number of cells: " << foamData_->numberOfCells() << "\n";
os<< indent << "Number of available time steps: " << foamData_->numberOfAvailableTimes()
<< endl;
os<< indent << "Time step range: " os<< indent << "Time step range: "
<< this->TimeStepRange[0] << " - " << this->TimeStepRange[1] << this->TimeStepRange[0] << " - " << this->TimeStepRange[1]
<< endl; << "\n";
os<< indent << "Time step: " << this->TimeStep << endl; os<< indent << "Time step: " << this->TimeStep << endl;
return;
} }
vtkDataArraySelection* vtkPV3FoamReader::GetTimeSelection() // ----------------------------------------------------------------------
{ // Region selection list control
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);
}
}
vtkDataArraySelection* vtkPV3FoamReader::GetRegionSelection() vtkDataArraySelection* vtkPV3FoamReader::GetRegionSelection()
{ {
vtkDebugMacro(<<"GetRegionSelection"); vtkDebugMacro(<<"GetRegionSelection");
return RegionSelection; return RegionSelection;
} }
@ -515,42 +406,29 @@ vtkDataArraySelection* vtkPV3FoamReader::GetRegionSelection()
int vtkPV3FoamReader::GetNumberOfRegionArrays() int vtkPV3FoamReader::GetNumberOfRegionArrays()
{ {
vtkDebugMacro(<<"GetNumberOfRegionArrays"); vtkDebugMacro(<<"GetNumberOfRegionArrays");
return RegionSelection->GetNumberOfArrays(); return RegionSelection->GetNumberOfArrays();
} }
const char* vtkPV3FoamReader::GetRegionArrayName const char* vtkPV3FoamReader::GetRegionArrayName(int index)
(
int index
)
{ {
vtkDebugMacro(<<"GetRegionArrayName"); vtkDebugMacro(<<"GetRegionArrayName");
return RegionSelection->GetArrayName(index); return RegionSelection->GetArrayName(index);
} }
int vtkPV3FoamReader::GetRegionArrayStatus int vtkPV3FoamReader::GetRegionArrayStatus(const char* name)
(
const char* name
)
{ {
vtkDebugMacro(<<"GetRegionArrayStatus"); vtkDebugMacro(<<"GetRegionArrayStatus");
return RegionSelection->ArrayIsEnabled(name); return RegionSelection->ArrayIsEnabled(name);
} }
void vtkPV3FoamReader::SetRegionArrayStatus void vtkPV3FoamReader::SetRegionArrayStatus(const char* name, int status)
(
const char* name,
int status
)
{ {
vtkDebugMacro(<<"SetRegionArrayStatus"); vtkDebugMacro(<<"SetRegionArrayStatus");
if(status) if (status)
{ {
RegionSelection->EnableArray(name); RegionSelection->EnableArray(name);
} }
@ -561,10 +439,12 @@ void vtkPV3FoamReader::SetRegionArrayStatus
} }
// ----------------------------------------------------------------------
// volField selection list control
vtkDataArraySelection* vtkPV3FoamReader::GetVolFieldSelection() vtkDataArraySelection* vtkPV3FoamReader::GetVolFieldSelection()
{ {
vtkDebugMacro(<<"GetVolFieldSelection"); vtkDebugMacro(<<"GetVolFieldSelection");
return VolFieldSelection; return VolFieldSelection;
} }
@ -572,41 +452,27 @@ vtkDataArraySelection* vtkPV3FoamReader::GetVolFieldSelection()
int vtkPV3FoamReader::GetNumberOfVolFieldArrays() int vtkPV3FoamReader::GetNumberOfVolFieldArrays()
{ {
vtkDebugMacro(<<"GetNumberOfVolFieldArrays"); vtkDebugMacro(<<"GetNumberOfVolFieldArrays");
return VolFieldSelection->GetNumberOfArrays(); return VolFieldSelection->GetNumberOfArrays();
} }
const char* vtkPV3FoamReader::GetVolFieldArrayName const char* vtkPV3FoamReader::GetVolFieldArrayName(int index)
(
int index
)
{ {
vtkDebugMacro(<<"GetVolFieldArrayName"); vtkDebugMacro(<<"GetVolFieldArrayName");
return VolFieldSelection->GetArrayName(index); return VolFieldSelection->GetArrayName(index);
} }
int vtkPV3FoamReader::GetVolFieldArrayStatus int vtkPV3FoamReader::GetVolFieldArrayStatus(const char* name)
(
const char* name
)
{ {
vtkDebugMacro(<<"GetVolFieldArrayStatus"); vtkDebugMacro(<<"GetVolFieldArrayStatus");
return VolFieldSelection->ArrayIsEnabled(name); return VolFieldSelection->ArrayIsEnabled(name);
} }
void vtkPV3FoamReader::SetVolFieldArrayStatus void vtkPV3FoamReader::SetVolFieldArrayStatus(const char* name, int status)
(
const char* name,
int status
)
{ {
vtkDebugMacro(<<"SetVolFieldArrayStatus"); vtkDebugMacro(<<"SetVolFieldArrayStatus");
if (status) if (status)
{ {
VolFieldSelection->EnableArray(name); VolFieldSelection->EnableArray(name);
@ -618,10 +484,12 @@ void vtkPV3FoamReader::SetVolFieldArrayStatus
} }
// ----------------------------------------------------------------------
// pointField selection list control
vtkDataArraySelection* vtkPV3FoamReader::GetPointFieldSelection() vtkDataArraySelection* vtkPV3FoamReader::GetPointFieldSelection()
{ {
vtkDebugMacro(<<"GetPointFieldSelection"); vtkDebugMacro(<<"GetPointFieldSelection");
return PointFieldSelection; return PointFieldSelection;
} }
@ -629,41 +497,27 @@ vtkDataArraySelection* vtkPV3FoamReader::GetPointFieldSelection()
int vtkPV3FoamReader::GetNumberOfPointFieldArrays() int vtkPV3FoamReader::GetNumberOfPointFieldArrays()
{ {
vtkDebugMacro(<<"GetNumberOfPointFieldArrays"); vtkDebugMacro(<<"GetNumberOfPointFieldArrays");
return PointFieldSelection->GetNumberOfArrays(); return PointFieldSelection->GetNumberOfArrays();
} }
const char* vtkPV3FoamReader::GetPointFieldArrayName const char* vtkPV3FoamReader::GetPointFieldArrayName(int index)
(
int index
)
{ {
vtkDebugMacro(<<"GetPointFieldArrayName"); vtkDebugMacro(<<"GetPointFieldArrayName");
return PointFieldSelection->GetArrayName(index); return PointFieldSelection->GetArrayName(index);
} }
int vtkPV3FoamReader::GetPointFieldArrayStatus int vtkPV3FoamReader::GetPointFieldArrayStatus(const char* name)
(
const char* name
)
{ {
vtkDebugMacro(<<"GetPointFieldArrayStatus"); vtkDebugMacro(<<"GetPointFieldArrayStatus");
return PointFieldSelection->ArrayIsEnabled(name); return PointFieldSelection->ArrayIsEnabled(name);
} }
void vtkPV3FoamReader::SetPointFieldArrayStatus void vtkPV3FoamReader::SetPointFieldArrayStatus(const char* name, int status)
(
const char* name,
int status
)
{ {
vtkDebugMacro(<<"SetPointFieldArrayStatus"); vtkDebugMacro(<<"SetPointFieldArrayStatus");
if (status) if (status)
{ {
PointFieldSelection->EnableArray(name); PointFieldSelection->EnableArray(name);
@ -675,10 +529,12 @@ void vtkPV3FoamReader::SetPointFieldArrayStatus
} }
// ----------------------------------------------------------------------
// lagrangianField selection list control
vtkDataArraySelection* vtkPV3FoamReader::GetLagrangianFieldSelection() vtkDataArraySelection* vtkPV3FoamReader::GetLagrangianFieldSelection()
{ {
vtkDebugMacro(<<"GetLagrangianFieldSelection"); vtkDebugMacro(<<"GetLagrangianFieldSelection");
return LagrangianFieldSelection; return LagrangianFieldSelection;
} }
@ -686,29 +542,20 @@ vtkDataArraySelection* vtkPV3FoamReader::GetLagrangianFieldSelection()
int vtkPV3FoamReader::GetNumberOfLagrangianFieldArrays() int vtkPV3FoamReader::GetNumberOfLagrangianFieldArrays()
{ {
vtkDebugMacro(<<"GetNumberOfLagrangianFieldArrays"); vtkDebugMacro(<<"GetNumberOfLagrangianFieldArrays");
return LagrangianFieldSelection->GetNumberOfArrays(); return LagrangianFieldSelection->GetNumberOfArrays();
} }
const char* vtkPV3FoamReader::GetLagrangianFieldArrayName const char* vtkPV3FoamReader::GetLagrangianFieldArrayName(int index)
(
int index
)
{ {
vtkDebugMacro(<<"GetLagrangianFieldArrayName"); vtkDebugMacro(<<"GetLagrangianFieldArrayName");
return LagrangianFieldSelection->GetArrayName(index); return LagrangianFieldSelection->GetArrayName(index);
} }
int vtkPV3FoamReader::GetLagrangianFieldArrayStatus int vtkPV3FoamReader::GetLagrangianFieldArrayStatus(const char* name)
(
const char* name
)
{ {
vtkDebugMacro(<<"GetLagrangianFieldArrayStatus"); vtkDebugMacro(<<"GetLagrangianFieldArrayStatus");
return LagrangianFieldSelection->ArrayIsEnabled(name); return LagrangianFieldSelection->ArrayIsEnabled(name);
} }
@ -720,7 +567,6 @@ void vtkPV3FoamReader::SetLagrangianFieldArrayStatus
) )
{ {
vtkDebugMacro(<<"SetLagrangianFieldArrayStatus"); vtkDebugMacro(<<"SetLagrangianFieldArrayStatus");
if (status) if (status)
{ {
LagrangianFieldSelection->EnableArray(name); LagrangianFieldSelection->EnableArray(name);
@ -731,6 +577,7 @@ void vtkPV3FoamReader::SetLagrangianFieldArrayStatus
} }
} }
// ----------------------------------------------------------------------
void vtkPV3FoamReader::SelectionModifiedCallback void vtkPV3FoamReader::SelectionModifiedCallback
( (
@ -747,7 +594,7 @@ void vtkPV3FoamReader::SelectionModifiedCallback
void vtkPV3FoamReader::SelectionModified() void vtkPV3FoamReader::SelectionModified()
{ {
vtkDebugMacro(<<"SelectionModified"); vtkDebugMacro(<<"SelectionModified");
Modified(); Modified();
} }
// ************************************************************************* //

View File

@ -14,11 +14,9 @@
=========================================================================*/ =========================================================================*/
// .NAME vtkPV3FoamReader - reads a dataset in OpenFOAM format // .NAME vtkPV3FoamReader - reads a dataset in OpenFOAM format
// .SECTION Description // .SECTION Description
// vtkPV3FoamReader creates an multiblock dataset. It reads a controlDict // vtkPV3FoamReader creates an multiblock dataset.
// file, mesh information, and time dependent data. The controlDict file // It uses the OpenFOAM infrastructure (fvMesh, etc) to
// contains timestep information. The polyMesh folders contain mesh information // handle mesh and field data.
// The time folders contain transient data for the cells Each folder can
// contain any number of data files.
#ifndef __vtkPV3FoamReader_h #ifndef __vtkPV3FoamReader_h
#define __vtkPV3FoamReader_h #define __vtkPV3FoamReader_h
@ -66,6 +64,13 @@ public:
vtkSetStringMacro(FileName); vtkSetStringMacro(FileName);
vtkGetStringMacro(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 // GUI update control
vtkSetMacro(UpdateGUI, int); vtkSetMacro(UpdateGUI, int);
vtkGetMacro(UpdateGUI, int); vtkGetMacro(UpdateGUI, int);
@ -86,24 +91,10 @@ public:
vtkSetMacro(IncludeZones, int); vtkSetMacro(IncludeZones, int);
vtkGetMacro(IncludeZones, int); vtkGetMacro(IncludeZones, int);
// FOAM patch names control // FOAM display patch names control
vtkSetMacro(ShowPatchNames, int); vtkSetMacro(ShowPatchNames, int);
vtkGetMacro(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 // Region selection list control
vtkDataArraySelection* GetRegionSelection(); vtkDataArraySelection* GetRegionSelection();
int GetNumberOfRegionArrays(); int GetNumberOfRegionArrays();
@ -121,16 +112,16 @@ public:
// pointField selection list control // pointField selection list control
vtkDataArraySelection* GetPointFieldSelection(); vtkDataArraySelection* GetPointFieldSelection();
int GetNumberOfPointFieldArrays(); int GetNumberOfPointFieldArrays();
const char* GetPointFieldArrayName(int index);
int GetPointFieldArrayStatus(const char* name); int GetPointFieldArrayStatus(const char* name);
void SetPointFieldArrayStatus(const char* name, int status); void SetPointFieldArrayStatus(const char* name, int status);
const char* GetPointFieldArrayName(int index);
// lagrangianField selection list control // lagrangianField selection list control
vtkDataArraySelection* GetLagrangianFieldSelection(); vtkDataArraySelection* GetLagrangianFieldSelection();
int GetNumberOfLagrangianFieldArrays(); int GetNumberOfLagrangianFieldArrays();
const char* GetLagrangianFieldArrayName(int index);
int GetLagrangianFieldArrayStatus(const char* name); int GetLagrangianFieldArrayStatus(const char* name);
void SetLagrangianFieldArrayStatus(const char* name, int status); void SetLagrangianFieldArrayStatus(const char* name, int status);
const char* GetLagrangianFieldArrayName(int index);
// Callback registered with the SelectionObserver // Callback registered with the SelectionObserver
// for all the selection lists // for all the selection lists
@ -182,7 +173,11 @@ private:
//- Remove patch names from the view //- Remove patch names from the view
void removePatchNamesFromView(); void removePatchNamesFromView();
int TimeStep;
int TimeStepRange[2];
int CacheMesh; int CacheMesh;
int ExtrapolateWalls; int ExtrapolateWalls;
int IncludeSets; int IncludeSets;
int IncludeZones; int IncludeZones;
@ -190,18 +185,22 @@ private:
int UpdateGUI; int UpdateGUI;
int UpdateGUIOld; int UpdateGUIOld;
int TimeStep;
int TimeStepRange[2];
vtkDataArraySelection* TimeSelection;
vtkDataArraySelection* RegionSelection; vtkDataArraySelection* RegionSelection;
vtkDataArraySelection* VolFieldSelection; vtkDataArraySelection* VolFieldSelection;
vtkDataArraySelection* PointFieldSelection; vtkDataArraySelection* PointFieldSelection;
vtkDataArraySelection* LagrangianFieldSelection; vtkDataArraySelection* LagrangianFieldSelection;
//- Access to the output port1
vtkMultiBlockDataSet* output1_;
//BTX //BTX
Foam::vtkPV3Foam* foamData_; Foam::vtkPV3Foam* foamData_;
//ETX //ETX
}; };
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif #endif
// ************************************************************************* //

View File

@ -2,10 +2,8 @@ vtkPV3Foam.C
vtkPV3FoamAddVolumeMesh.C vtkPV3FoamAddVolumeMesh.C
vtkPV3FoamAddLagrangianMesh.C vtkPV3FoamAddLagrangianMesh.C
vtkPV3FoamAddPatchMesh.C vtkPV3FoamAddPatchMesh.C
vtkPV3FoamAddFaceZoneMesh.C vtkPV3FoamAddZoneMesh.C
vtkPV3FoamAddPointZoneMesh.C vtkPV3FoamAddSetMesh.C
vtkPV3FoamAddFaceSetMesh.C
vtkPV3FoamAddPointSetMesh.C
vtkPV3FoamUpdate.C vtkPV3FoamUpdate.C
vtkPV3FoamUpdateInformation.C vtkPV3FoamUpdateInformation.C
vtkPV3FoamConvertMesh.C vtkPV3FoamConvertMesh.C

View File

@ -1,5 +1,4 @@
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 \

View File

@ -32,6 +32,7 @@ License
#include "IOobjectList.H" #include "IOobjectList.H"
#include "patchZones.H" #include "patchZones.H"
#include "vtkPV3FoamReader.h" #include "vtkPV3FoamReader.h"
#include "IFstream.H"
// VTK includes // VTK includes
#include "vtkCharArray.h" #include "vtkCharArray.h"
@ -52,7 +53,7 @@ defineTypeNameAndDebug(Foam::vtkPV3Foam, 0);
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
#include "vtkPV3FoamAddFields.H" #include "vtkPV3FoamAddToSelection.H"
#include "vtkPV3FoamUpdateInformationFields.H" #include "vtkPV3FoamUpdateInformationFields.H"
@ -172,38 +173,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) bool Foam::vtkPV3Foam::setTime(const double& requestedTime)
{ {
if (debug) if (debug)
@ -215,24 +184,10 @@ bool Foam::vtkPV3Foam::setTime(const double& requestedTime)
Time& runTime = dbPtr_(); Time& runTime = dbPtr_();
// Get times list // Get times list
instantList times = runTime.times(); instantList Times = runTime.times();
// logic as per "checkTimeOption.H"
bool found = false; bool found = false;
int nearestIndex = -1; int nearestIndex = Time::findClosestTimeIndex(Times, requestedTime);
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;
}
}
if (nearestIndex == -1) if (nearestIndex == -1)
{ {
@ -244,12 +199,36 @@ bool Foam::vtkPV3Foam::setTime(const double& requestedTime)
found = true; 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;
// patches, zones etc might have changed
UpdateInformation();
}
}
else
{
meshChanged_ = true;
}
}
if (debug) if (debug)
{ {
Info<< "<end> Foam::vtkPV3Foam::setTime() - selected time " Info<< "<end> Foam::vtkPV3Foam::setTime() - selected time "
<< times[nearestIndex].name() << endl; << Times[nearestIndex].name() << " index=" << nearestIndex
<< " meshChanged=" << meshChanged_
<< " fieldsChanged=" << fieldsChanged_ << endl;
} }
return found; return found;
@ -265,15 +244,28 @@ void Foam::vtkPV3Foam::updateSelectedRegions()
vtkDataArraySelection* arraySelection = reader_->GetRegionSelection(); vtkDataArraySelection* arraySelection = reader_->GetRegionSelection();
const label nRegions = arraySelection->GetNumberOfArrays(); const label nSelect = arraySelection->GetNumberOfArrays();
selectedRegions_.setSize(nRegions); if (selectedRegions_.size() != nSelect)
selectedRegionDatasetIds_.setSize(nRegions);
// Read the selected patches and add to the region list
for (int regionId=0; regionId < nRegions; ++regionId)
{ {
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; selectedRegionDatasetIds_[regionId] = -1;
if (debug) if (debug)
@ -301,7 +293,13 @@ Foam::stringList Foam::vtkPV3Foam::getSelectedArrayEntries
if (debug) if (debug)
{ {
Info << "selections("; Info<< "available(";
forAll (selections, elemI)
{
Info<< " \"" << arraySelection->GetArrayName(elemI) << "\"";
}
Info<< " )\n"
<< "selected(";
} }
forAll (selections, elemI) forAll (selections, elemI)
@ -322,7 +320,7 @@ Foam::stringList Foam::vtkPV3Foam::getSelectedArrayEntries
if (debug) if (debug)
{ {
Info << " " << selections[nElem]; Info<< " " << selections[nElem];
} }
++nElem; ++nElem;
@ -331,7 +329,7 @@ Foam::stringList Foam::vtkPV3Foam::getSelectedArrayEntries
if (debug) if (debug)
{ {
Info << " )" << endl; Info<< " )" << endl;
} }
selections.setSize(nElem); selections.setSize(nElem);
@ -351,33 +349,45 @@ Foam::stringList Foam::vtkPV3Foam::getSelectedArrayEntries
if (debug) if (debug)
{ {
Info << "selections("; Info<< "available(";
for
(
int elemI = selector.start();
elemI < selector.end();
++elemI
)
{
Info<< " \"" << arraySelection->GetArrayName(elemI) << "\"";
}
Info<< " )\n"
<< "selected(";
} }
for for
( (
int regionId = selector.start(); int elemI = selector.start();
regionId < selector.end(); elemI < selector.end();
++regionId ++elemI
) )
{ {
if (arraySelection->GetArraySetting(regionId)) if (arraySelection->GetArraySetting(elemI))
{ {
if (firstWord) if (firstWord)
{ {
selections[nElem] = getFirstWord selections[nElem] = getFirstWord
( (
arraySelection->GetArrayName(regionId) arraySelection->GetArrayName(elemI)
); );
} }
else else
{ {
selections[nElem] = arraySelection->GetArrayName(regionId); selections[nElem] = arraySelection->GetArrayName(elemI);
} }
if (debug) if (debug)
{ {
Info << " " << selections[nElem]; Info<< " " << selections[nElem];
} }
++nElem; ++nElem;
@ -386,10 +396,9 @@ Foam::stringList Foam::vtkPV3Foam::getSelectedArrayEntries
if (debug) if (debug)
{ {
Info << " )" << endl; Info<< " )" << endl;
} }
selections.setSize(nElem); selections.setSize(nElem);
return selections; return selections;
} }
@ -432,10 +441,7 @@ void Foam::vtkPV3Foam::setSelectedArrayEntries
<< endl; << endl;
} }
arraySelection->EnableArray arraySelection->EnableArray(arrayName.c_str());
(
arrayName.c_str()
);
break; break;
} }
} }
@ -452,12 +458,10 @@ void Foam::vtkPV3Foam::setSelectedArrayEntries
Foam::vtkPV3Foam::vtkPV3Foam Foam::vtkPV3Foam::vtkPV3Foam
( (
const char* const FileName, const char* const FileName,
vtkPV3FoamReader* reader, vtkPV3FoamReader* reader
vtkMultiBlockDataSet* output
) )
: :
reader_(reader), reader_(reader),
output_(output),
dbPtr_(NULL), dbPtr_(NULL),
meshPtr_(NULL), meshPtr_(NULL),
selectInfoVolume_(VOLUME, "unzoned"), selectInfoVolume_(VOLUME, "unzoned"),
@ -470,11 +474,15 @@ Foam::vtkPV3Foam::vtkPV3Foam
selectInfoFaceSets_(FACESET, "faceSet"), selectInfoFaceSets_(FACESET, "faceSet"),
selectInfoPointSets_(POINTSET, "pointSet"), selectInfoPointSets_(POINTSET, "pointSet"),
patchTextActorsPtrs_(0), patchTextActorsPtrs_(0),
nMesh_(0) nMesh_(0),
timeIndex_(-1),
meshChanged_(true),
fieldsChanged_(true)
{ {
if (debug) if (debug)
{ {
Info<< "Foam::vtkPV3Foam::vtkPV3Foam - " << FileName << endl; Info<< "Foam::vtkPV3Foam::vtkPV3Foam - " << FileName << endl;
printMemory();
} }
// avoid argList and get rootPath/caseName directly from the file // avoid argList and get rootPath/caseName directly from the file
@ -518,17 +526,11 @@ Foam::vtkPV3Foam::vtkPV3Foam
dbPtr_().functionObjects().off(); dbPtr_().functionObjects().off();
if (debug)
{
cout<< "constructed with output: ";
output_->Print(cout);
}
resetCounters();
// Set initial cloud name // Set initial cloud name
// TODO - TEMPORARY MEASURE UNTIL CAN PROCESS MULTIPLE CLOUDS // TODO - TEMPORARY MEASURE UNTIL CAN PROCESS MULTIPLE CLOUDS
cloudName_ = ""; cloudName_ = "";
UpdateInformation();
} }
@ -555,27 +557,37 @@ void Foam::vtkPV3Foam::UpdateInformation()
{ {
if (debug) if (debug)
{ {
Info<< "<beg> Foam::vtkPV3Foam::UpdateInformation - " Info<< "<beg> Foam::vtkPV3Foam::UpdateInformation"
<< "TimeStep = " << reader_->GetTimeStep() << endl; << " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "] TimeStep="
<< reader_->GetTimeStep() << endl;
} }
resetCounters(); resetCounters();
// preserve the currently selected values vtkDataArraySelection* arraySelection = reader_->GetRegionSelection();
const stringList selectedEntries = getSelectedArrayEntries
(
reader_->GetRegionSelection()
);
// Clear current region list/array
reader_->GetRegionSelection()->RemoveAllArrays();
initializeTime(); stringList selectedEntries;
// enable 'internalMesh' on the first call
if (arraySelection->GetNumberOfArrays() == 0 && !meshPtr_)
{
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 // Update region array
updateInformationInternalMesh(); updateInformationInternalMesh();
updateInformationLagrangian(); updateInformationLagrangian();
updateInformationPatches(); updateInformationPatches();
if (reader_->GetIncludeSets()) if (reader_->GetIncludeSets())
@ -588,13 +600,18 @@ void Foam::vtkPV3Foam::UpdateInformation()
updateInformationZones(); updateInformationZones();
} }
// Update region selection with the data just read in // restore the currently enabled values
setSelectedArrayEntries setSelectedArrayEntries
( (
reader_->GetRegionSelection(), arraySelection,
selectedEntries selectedEntries
); );
if (meshChanged_)
{
fieldsChanged_ = true;
}
// Update volField array // Update volField array
updateInformationFields<fvPatchField, volMesh> updateInformationFields<fvPatchField, volMesh>
( (
@ -630,24 +647,24 @@ void Foam::vtkPV3Foam::Update
output->Print(cout); output->Print(cout);
cout<<"Internally:\n"; cout<<"Internally:\n";
output_->Print(cout); output->Print(cout);
cout<< " has " << output_->GetNumberOfBlocks() << " blocks\n"; cout<< " has " << output->GetNumberOfBlocks() << " blocks\n";
printMemory();
} }
// Set up region selection(s) // Set up region selection(s)
updateSelectedRegions(); updateSelectedRegions();
// Update the Foam mesh // Update the Foam mesh
updateFoamMesh(); updateFoamMesh();
reader_->UpdateProgress(0.2);
// Convert meshes // Convert meshes
convertMeshVolume(output); convertMeshVolume(output);
convertMeshLagrangian(output); convertMeshLagrangian(output);
convertMeshPatches(output); convertMeshPatches(output);
reader_->UpdateProgress(0.4);
if (reader_->GetIncludeZones()) if (reader_->GetIncludeZones())
{ {
@ -658,17 +675,17 @@ void Foam::vtkPV3Foam::Update
if (reader_->GetIncludeSets()) if (reader_->GetIncludeSets())
{ {
convertMeshCellSet(output); convertMeshCellSets(output);
convertMeshFaceSet(output); convertMeshFaceSets(output);
convertMeshPointSet(output); convertMeshPointSets(output);
} }
reader_->UpdateProgress(0.8);
// Update fields // Update fields
updateVolFields(output); updateVolFields(output);
updatePointFields(output); updatePointFields(output);
updateLagrangianFields(output); updateLagrangianFields(output);
reader_->UpdateProgress(1.0);
if (debug) if (debug)
{ {
@ -693,90 +710,32 @@ void Foam::vtkPV3Foam::Update
<< GetNumberOfDataSets(output, selectInfoPointSets_) << nl; << GetNumberOfDataSets(output, selectInfoPointSets_) << nl;
// traverse blocks: // traverse blocks:
cout<< "nBlocks = " << output->GetNumberOfBlocks() << "\n";
int nBlocks = output->GetNumberOfBlocks();
Info << "nBlocks = " << nBlocks << endl;
cout<< "done Update\n"; cout<< "done Update\n";
output_->Print(cout); output->Print(cout);
cout<< " has " << output_->GetNumberOfBlocks() << " blocks\n"; cout<< " has " << output->GetNumberOfBlocks() << " blocks\n";
output_->GetInformation()->Print(cout); output->GetInformation()->Print(cout);
cout <<"ShouldIReleaseData :" << output_->ShouldIReleaseData() << "\n"; cout<<"ShouldIReleaseData :" << output->ShouldIReleaseData() << "\n";
printMemory();
} }
meshChanged_ = fieldsChanged_ = false;
} }
double* Foam::vtkPV3Foam::timeSteps(int& nTimeSteps) double* Foam::vtkPV3Foam::findTimes(int& nTimeSteps)
{ {
int nTimes = 0; int nTimes = 0;
double* ts = NULL; double* tsteps = NULL;
if (dbPtr_.valid()) if (dbPtr_.valid())
{ {
Time& runTime = dbPtr_(); 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 // always skip "constant" time, unless there are no other times
nTimes = times.size(); nTimes = timeLst.size();
label timeI = 0; label timeI = 0;
if (nTimes > 1) if (nTimes > 1)
@ -787,26 +746,25 @@ double* Foam::vtkPV3Foam::timeSteps(int& nTimeSteps)
if (nTimes) if (nTimes)
{ {
ts = new double[nTimes]; tsteps = new double[nTimes];
for (label stepI = 0; stepI < nTimes; ++stepI, ++timeI) for (label stepI = 0; stepI < nTimes; ++stepI, ++timeI)
{ {
ts[stepI] = times[timeI].value(); tsteps[stepI] = timeLst[timeI].value();
} }
} }
#endif /* PV3FOAM_TIMESELECTION */
} }
else else
{ {
if (debug) 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; nTimeSteps = nTimes;
return ts; return tsteps;
} }
@ -820,8 +778,7 @@ void Foam::vtkPV3Foam::addPatchNames(vtkRenderer* renderer)
Info<< "<beg> Foam::vtkPV3Foam::addPatchNames" << endl; Info<< "<beg> Foam::vtkPV3Foam::addPatchNames" << endl;
} }
const fvMesh& mesh = *meshPtr_; const polyBoundaryMesh& pbMesh = meshPtr_->boundaryMesh();
const polyBoundaryMesh& pbMesh = mesh.boundaryMesh();
const selectionInfo& selector = selectInfoPatches_; const selectionInfo& selector = selectInfoPatches_;
@ -835,7 +792,7 @@ void Foam::vtkPV3Foam::addPatchNames(vtkRenderer* renderer)
if (debug) if (debug)
{ {
Info<<"... add patches: " << selectedPatches <<endl; Info<<"... add patches: " << selectedPatches << endl;
} }
// Find the total number of zones // Find the total number of zones
@ -924,8 +881,8 @@ void Foam::vtkPV3Foam::addPatchNames(vtkRenderer* renderer)
if (debug) if (debug)
{ {
Info<< "patch zone centres = " << zoneCentre << endl; Info<< "patch zone centres = " << zoneCentre << nl
Info<< "zones per patch = " << nZones << endl; << "zones per patch = " << nZones << endl;
} }
// Set the size of the patch labels to max number of zones // Set the size of the patch labels to max number of zones
@ -946,9 +903,9 @@ void Foam::vtkPV3Foam::addPatchNames(vtkRenderer* renderer)
{ {
if (debug) if (debug)
{ {
Info<< "patch name = " << pp.name() << endl; Info<< "patch name = " << pp.name() << nl
Info<< "anchor = " << zoneCentre[globalZoneI] << endl; << "anchor = " << zoneCentre[globalZoneI] << nl
Info<< "globalZoneI = " << globalZoneI << endl; << "globalZoneI = " << globalZoneI << endl;
} }
vtkTextActor* txt = vtkTextActor::New(); vtkTextActor* txt = vtkTextActor::New();
@ -1012,48 +969,59 @@ void Foam::vtkPV3Foam::removePatchNames(vtkRenderer* renderer)
} }
int Foam::vtkPV3Foam::numberOfAvailableTimes() const void Foam::vtkPV3Foam::PrintSelf(ostream& os, vtkIndent indent) const
{ {
if (dbPtr_.valid()) os << indent << "Number of meshes: " << nMesh_ << "\n";
{ os << indent << "Number of nodes: "
return dbPtr_().times().size(); << (meshPtr_ ? meshPtr_->nPoints() : 0) << "\n";
}
else os << indent << "Number of cells: "
{ << (meshPtr_ ? meshPtr_->nCells() : 0) << "\n";
return 0;
} os << indent << "Number of available time steps: "
<< (dbPtr_.valid() ? dbPtr_().times().size() : 0) << endl;
} }
int Foam::vtkPV3Foam::numberOfPoints() // parse these bits of info from /proc/meminfo (Linux)
//
// MemTotal: 2062660 kB
// MemFree: 1124400 kB
//
// used = MemTotal - MemFree is what the free(1) uses.
//
void Foam::vtkPV3Foam::printMemory()
{ {
if (meshPtr_) const char* meminfo = "/proc/meminfo";
if (exists(meminfo))
{ {
return meshPtr_->nPoints(); IFstream is(meminfo);
} label memTotal = 0;
else label memFree = 0;
{
return 0; string line;
while (is.getLine(line).good())
{
char tag[32];
int value;
if (sscanf(line.c_str(), "%30s %d", tag, &value) == 2)
{
if (!strcmp(tag, "MemTotal:"))
{
memTotal = value;
}
else if (!strcmp(tag, "MemFree:"))
{
memFree = value;
}
}
}
Info << "memUsed: " << (memTotal - memFree) << " kB\n";
} }
} }
int Foam::vtkPV3Foam::numberOfCells()
{
if (meshPtr_)
{
return meshPtr_->nCells();
}
{
return 0;
}
}
int Foam::vtkPV3Foam::numberOfMeshes() const
{
return nMesh_;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -29,18 +29,16 @@ Description
Provides a reader interface for OpenFOAM to VTK interaction. Provides a reader interface for OpenFOAM to VTK interaction.
SourceFiles SourceFiles
interpolatePointToCell.C
interpolatePointToCell.H
vtkPV3Foam.C vtkPV3Foam.C
vtkPV3Foam.H vtkPV3Foam.H
vtkPV3FoamAddFaceSetMesh.C vtkPV3FoamI.H
vtkPV3FoamAddFaceZoneMesh.C
vtkPV3FoamAddFields.H
vtkPV3FoamAddLagrangianMesh.C vtkPV3FoamAddLagrangianMesh.C
vtkPV3FoamAddPatchMesh.C vtkPV3FoamAddPatchMesh.C
vtkPV3FoamAddPointSetMesh.C vtkPV3FoamAddSetMesh.C
vtkPV3FoamAddPointZoneMesh.C vtkPV3FoamAddToSelection.H
vtkPV3FoamAddVolumeMesh.C vtkPV3FoamAddVolumeMesh.C
vtkPV3FoamAddZoneMesh.C
vtkPV3FoamConvertFaceField.H
vtkPV3FoamConvertLagrangianFields.H vtkPV3FoamConvertLagrangianFields.H
vtkPV3FoamConvertMesh.C vtkPV3FoamConvertMesh.C
vtkPV3FoamConvertPatchFaceField.H vtkPV3FoamConvertPatchFaceField.H
@ -52,7 +50,7 @@ SourceFiles
vtkPV3FoamUpdateInformation.C vtkPV3FoamUpdateInformation.C
vtkPV3FoamUpdateInformationFields.H vtkPV3FoamUpdateInformationFields.H
// Needed by VTK? // Needed by VTK:
vtkDataArrayTemplateImplicit.txx vtkDataArrayTemplateImplicit.txx
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -64,19 +62,21 @@ SourceFiles
#include "fileName.H" #include "fileName.H"
#include "volPointInterpolation.H" #include "volPointInterpolation.H"
#include "stringList.H" #include "stringList.H"
#include "wordList.H"
#include "primitivePatch.H" #include "primitivePatch.H"
// * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * // // * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * //
class vtkDataArraySelection; class vtkDataArraySelection;
class vtkDataSet; class vtkDataSet;
class vtkMultiBlockDataSet;
class vtkPoints; class vtkPoints;
class vtkPV3FoamReader; class vtkPV3FoamReader;
class vtkRenderer; class vtkRenderer;
class vtkTextActor; class vtkTextActor;
class vtkMultiBlockDataSet;
class vtkPolyData; class vtkPolyData;
class vtkUnstructuredGrid; class vtkUnstructuredGrid;
class vtkIndent;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -196,9 +196,6 @@ private:
//- Access to the controlling vtkPV3FoamReader //- Access to the controlling vtkPV3FoamReader
vtkPV3FoamReader* reader_; vtkPV3FoamReader* reader_;
//- Access to the output block
vtkMultiBlockDataSet* output_;
//- Foam time control //- Foam time control
autoPtr<Time> dbPtr_; autoPtr<Time> dbPtr_;
@ -232,12 +229,12 @@ private:
labelList superCells_; labelList superCells_;
//- Label of original cell for decomposed cells //- Label of original cell for decomposed cells
// - cell zone meshes // - cellZone meshes
List<labelList> superCellZonesCells_; List<labelList> zoneSuperCells_;
//- Label of original cell for decomposed cells //- Label of original cell for decomposed cells
// - cell set meshes // - cellSet meshes
List<labelList> superCellSetCells_; List<labelList> csetSuperCells_;
//- List of patch names //- List of patch names
List<vtkTextActor*> patchTextActorsPtrs_; List<vtkTextActor*> patchTextActorsPtrs_;
@ -253,6 +250,15 @@ private:
// TODO - currently only set up to process ONE cloud // TODO - currently only set up to process ONE cloud
word cloudName_; word cloudName_;
//- The time index
int timeIndex_;
//- Track changes in mesh geometry
bool meshChanged_;
//- Track changes in fields
bool fieldsChanged_;
// Private Member Functions // Private Member Functions
@ -287,9 +293,6 @@ private:
//- Reset data counters //- Reset data counters
void resetCounters(); void resetCounters();
//- Get all the available times and select the latestTime
void initializeTime();
// Update information helper functions // Update information helper functions
//- Update the regions selected in the GUI //- Update the regions selected in the GUI
@ -307,9 +310,21 @@ private:
//- Set info //- Set info
void updateInformationSets(); void updateInformationSets();
//- Read zone names for zoneType from file
wordList readZoneNames(const word& zoneType);
//- Zone info //- Zone info
void updateInformationZones(); void updateInformationZones();
//- Add to paraview array selection
template<class Type>
label addToSelection
(
vtkDataArraySelection *arraySelection,
const IOobjectList&,
const string& suffix = ""
);
//- Field info //- Field info
template<template<class> class patchType, class meshType> template<template<class> class patchType, class meshType>
void updateInformationFields void updateInformationFields
@ -350,20 +365,20 @@ private:
//- Cell zone meshes //- Cell zone meshes
void convertMeshCellZones(vtkMultiBlockDataSet* output); void convertMeshCellZones(vtkMultiBlockDataSet* output);
//- Cell zone meshes //- Face zone meshes
void convertMeshFaceZones(vtkMultiBlockDataSet* output); void convertMeshFaceZones(vtkMultiBlockDataSet* output);
//- Cell zone meshes //- Point zone meshes
void convertMeshPointZones(vtkMultiBlockDataSet* output); void convertMeshPointZones(vtkMultiBlockDataSet* output);
//- Cell set meshes //- Cell set meshes
void convertMeshCellSet(vtkMultiBlockDataSet* output); void convertMeshCellSets(vtkMultiBlockDataSet* output);
//- Face set meshes //- Face set meshes
void convertMeshFaceSet(vtkMultiBlockDataSet* output); void convertMeshFaceSets(vtkMultiBlockDataSet* output);
//- Point set meshes //- Point set meshes
void convertMeshPointSet(vtkMultiBlockDataSet* output); void convertMeshPointSets(vtkMultiBlockDataSet* output);
// Add mesh functions // Add mesh functions
@ -433,7 +448,7 @@ private:
//- Add the fields in the selected time directory to the selection //- Add the fields in the selected time directory to the selection
// lists // lists
template<class GeoField> template<class GeoField>
label addFields label addObjectsToSelection
( (
vtkDataArraySelection* fieldSelection, vtkDataArraySelection* fieldSelection,
const IOobjectList& objects, const IOobjectList& objects,
@ -602,8 +617,7 @@ public:
vtkPV3Foam vtkPV3Foam
( (
const char* const FileName, const char* const FileName,
vtkPV3FoamReader* reader, vtkPV3FoamReader* reader
vtkMultiBlockDataSet* output
); );
@ -614,13 +628,14 @@ public:
// Member Functions // Member Functions
//- Update
void UpdateInformation(); void UpdateInformation();
void Update(vtkMultiBlockDataSet* output); 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 // returns the count via the parameter
double* timeSteps(int& nTimeSteps); double* findTimes(int& nTimeSteps);
//- Add patch names to the display //- Add patch names to the display
void addPatchNames(vtkRenderer* renderer); void addPatchNames(vtkRenderer* renderer);
@ -635,14 +650,11 @@ public:
// Access // Access
//- Return the total number of available timesets //- Debug information
int numberOfAvailableTimes() const; void PrintSelf(ostream&, vtkIndent) const;
int numberOfCells(); //- Simple memory used debugging information
static void printMemory();
int numberOfPoints();
int numberOfMeshes() const;
}; };

View File

@ -52,6 +52,7 @@ void Foam::vtkPV3Foam::addLagrangianMesh
{ {
Info<< "<beg> Foam::vtkPV3Foam::addLagrangianMesh - timePath " Info<< "<beg> Foam::vtkPV3Foam::addLagrangianMesh - timePath "
<< mesh.time().timePath()/"lagrangian" << endl; << mesh.time().timePath()/"lagrangian" << endl;
printMemory();
} }
fileNameList cloudDirs fileNameList cloudDirs
@ -103,6 +104,7 @@ void Foam::vtkPV3Foam::addLagrangianMesh
if (debug) if (debug)
{ {
Info<< "<end> Foam::vtkPV3Foam::addLagrangianMesh" << endl; Info<< "<end> Foam::vtkPV3Foam::addLagrangianMesh" << endl;
printMemory();
} }
} }

View File

@ -49,6 +49,7 @@ void Foam::vtkPV3Foam::addPatchMesh
if (debug) if (debug)
{ {
Info<< "<beg> Foam::vtkPV3Foam::addPatchMesh - " << p.name() << endl; Info<< "<beg> Foam::vtkPV3Foam::addPatchMesh - " << p.name() << endl;
printMemory();
} }
// Convert Foam mesh vertices to VTK // Convert Foam mesh vertices to VTK
@ -88,6 +89,7 @@ void Foam::vtkPV3Foam::addPatchMesh
if (debug) if (debug)
{ {
Info<< "<end> Foam::vtkPV3Foam::addPatchMesh - " << p.name() << endl; Info<< "<end> Foam::vtkPV3Foam::addPatchMesh - " << p.name() << endl;
printMemory();
} }
} }

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -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;
}
}
// ************************************************************************* //

View File

@ -30,6 +30,7 @@ Description
// Foam includes // Foam includes
#include "faceSet.H" #include "faceSet.H"
#include "pointSet.H"
#include "vtkPV3FoamInsertNextPoint.H" #include "vtkPV3FoamInsertNextPoint.H"
// VTK includes // VTK includes
@ -49,6 +50,7 @@ void Foam::vtkPV3Foam::addFaceSetMesh
if (debug) if (debug)
{ {
Info<< "<beg> Foam::vtkPV3Foam::addFaceSetMesh" << endl; Info<< "<beg> Foam::vtkPV3Foam::addFaceSetMesh" << endl;
printMemory();
} }
// Construct primitivePatch of faces in fSet. // Construct primitivePatch of faces in fSet.
@ -100,6 +102,41 @@ void Foam::vtkPV3Foam::addFaceSetMesh
if (debug) if (debug)
{ {
Info<< "<end> Foam::vtkPV3Foam::addFaceSetMesh" << endl; Info<< "<end> Foam::vtkPV3Foam::addFaceSetMesh" << endl;
printMemory();
}
}
void Foam::vtkPV3Foam::addPointSetMesh
(
const fvMesh& mesh,
const pointSet& pSet,
vtkPolyData* vtkmesh
)
{
if (debug)
{
Info<< "<beg> Foam::vtkPV3Foam::addPointSetMesh" << endl;
printMemory();
}
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;
printMemory();
} }
} }

View File

@ -22,13 +22,10 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation, along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
InClass
vtkPV3Foam
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef vtkPV3FoamAddFields_H #ifndef vtkPV3FoamAddToSelection_H
#define vtkPV3FoamAddFields_H #define vtkPV3FoamAddToSelection_H
// FOAM includes // FOAM includes
#include "SortableList.H" #include "SortableList.H"
@ -38,48 +35,48 @@ InClass
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class GeoField> template<class Type>
Foam::label Foam::vtkPV3Foam::addFields Foam::label Foam::vtkPV3Foam::addToSelection
( (
vtkDataArraySelection *fieldSelection, vtkDataArraySelection *arraySelection,
const IOobjectList& objects, const IOobjectList& objectLst,
const string& suffix 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; label count = 0;
forAllConstIter(IOobjectList, fieldObjects, iter) forAllConstIter(IOobjectList, objects, iter)
{ {
fields[count++] = iter()->name(); objectNames[count++] = iter()->name();
} }
if (count) if (count)
{ {
fields.sort(); objectNames.sort();
forAll(fields, fieldI) forAll (objectNames, objI)
{ {
if (debug) if (debug)
{ {
Info<<" addField to GUI " << GeoField::typeName Info<<" addToSelection<" << Type::typeName << "> to GUI "
<< ":" << fields[fieldI] << endl; << ":" << objectNames[objI] << endl;
} }
if (suffix.size()) if (suffix.size())
{ {
fieldSelection->AddArray arraySelection->AddArray
( (
(fields[fieldI] + suffix).c_str() (objectNames[objI] + suffix).c_str()
); );
} }
else else
{ {
fieldSelection->AddArray arraySelection->AddArray
( (
fields[fieldI].c_str() objectNames[objI].c_str()
); );
} }
} }

View File

@ -55,6 +55,7 @@ void Foam::vtkPV3Foam::addVolumeMesh
if (debug) if (debug)
{ {
Info<< "<beg> Foam::vtkPV3Foam::addVolumeMesh" << endl; Info<< "<beg> Foam::vtkPV3Foam::addVolumeMesh" << endl;
printMemory();
} }
// Number of additional points needed by the decomposition of polyhedra // Number of additional points needed by the decomposition of polyhedra
@ -354,6 +355,7 @@ void Foam::vtkPV3Foam::addVolumeMesh
if (debug) if (debug)
{ {
Info<< "<end> Foam::vtkPV3Foam::addVolumeMesh" << endl; Info<< "<end> Foam::vtkPV3Foam::addVolumeMesh" << endl;
printMemory();
} }
} }

View File

@ -38,6 +38,7 @@ Description
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
void Foam::vtkPV3Foam::addFaceZoneMesh void Foam::vtkPV3Foam::addFaceZoneMesh
( (
const fvMesh& mesh, const fvMesh& mesh,
@ -48,6 +49,7 @@ void Foam::vtkPV3Foam::addFaceZoneMesh
if (debug) if (debug)
{ {
Info<< "<beg> Foam::vtkPV3Foam::addFaceZoneMesh" << endl; Info<< "<beg> Foam::vtkPV3Foam::addFaceZoneMesh" << endl;
printMemory();
} }
// Construct primitivePatch of faces in fSet. // Construct primitivePatch of faces in fSet.
@ -98,8 +100,43 @@ void Foam::vtkPV3Foam::addFaceZoneMesh
if (debug) if (debug)
{ {
Info<< "<end> Foam::vtkPV3Foam::addFaceZoneMesh" << endl; Info<< "<end> Foam::vtkPV3Foam::addFaceZoneMesh" << endl;
printMemory();
} }
} }
void Foam::vtkPV3Foam::addPointZoneMesh
(
const fvMesh& mesh,
const labelList& pointLabels,
vtkPolyData* vtkmesh
)
{
if (debug)
{
Info<< "<beg> Foam::vtkPV3Foam::addPointZoneMesh" << endl;
printMemory();
}
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;
printMemory();
}
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -51,6 +51,7 @@ void Foam::vtkPV3Foam::convertMeshVolume
if (debug) if (debug)
{ {
Info<< "<beg> Foam::vtkPV3Foam::convertMeshVolume" << endl; Info<< "<beg> Foam::vtkPV3Foam::convertMeshVolume" << endl;
printMemory();
} }
const selectionInfo& selector = selectInfoVolume_; const selectionInfo& selector = selectInfoVolume_;
@ -76,7 +77,7 @@ void Foam::vtkPV3Foam::convertMeshVolume
if (debug) if (debug)
{ {
Info<< "Creating VTK internal mesh" << endl; Info<< "Creating VTK internalMesh" << endl;
} }
const label datasetId = 0; const label datasetId = 0;
@ -92,6 +93,7 @@ void Foam::vtkPV3Foam::convertMeshVolume
if (debug) if (debug)
{ {
Info<< "<end> Foam::vtkPV3Foam::convertMeshVolume" << endl; Info<< "<end> Foam::vtkPV3Foam::convertMeshVolume" << endl;
printMemory();
} }
} }
@ -104,6 +106,7 @@ void Foam::vtkPV3Foam::convertMeshLagrangian
if (debug) if (debug)
{ {
Info<< "<beg> Foam::vtkPV3Foam::convertMeshLagrangian" << endl; Info<< "<beg> Foam::vtkPV3Foam::convertMeshLagrangian" << endl;
printMemory();
} }
const selectionInfo& selector = selectInfoLagrangian_; const selectionInfo& selector = selectInfoLagrangian_;
@ -139,6 +142,7 @@ void Foam::vtkPV3Foam::convertMeshLagrangian
if (debug) if (debug)
{ {
Info<< "<end> Foam::vtkPV3Foam::convertMeshLagrangian" << endl; Info<< "<end> Foam::vtkPV3Foam::convertMeshLagrangian" << endl;
printMemory();
} }
} }
@ -151,6 +155,7 @@ void Foam::vtkPV3Foam::convertMeshPatches
if (debug) if (debug)
{ {
Info<< "<beg> Foam::vtkPV3Foam::convertMeshPatches" << endl; Info<< "<beg> Foam::vtkPV3Foam::convertMeshPatches" << endl;
printMemory();
} }
const selectionInfo& selector = selectInfoPatches_; const selectionInfo& selector = selectInfoPatches_;
@ -209,6 +214,7 @@ void Foam::vtkPV3Foam::convertMeshPatches
if (debug) if (debug)
{ {
Info<< "<end> Foam::vtkPV3Foam::convertMeshPatches" << endl; Info<< "<end> Foam::vtkPV3Foam::convertMeshPatches" << endl;
printMemory();
} }
} }
@ -221,6 +227,7 @@ void Foam::vtkPV3Foam::convertMeshCellZones
if (debug) if (debug)
{ {
Info<< "<beg> Foam::vtkPV3Foam::convertMeshCellZones" << endl; Info<< "<beg> Foam::vtkPV3Foam::convertMeshCellZones" << endl;
printMemory();
} }
const selectionInfo& selector = selectInfoCellZones_; const selectionInfo& selector = selectInfoCellZones_;
@ -258,14 +265,14 @@ void Foam::vtkPV3Foam::convertMeshCellZones
( (
subsetter.subMesh(), subsetter.subMesh(),
vtkmesh, vtkmesh,
superCellZonesCells_[datasetId] zoneSuperCells_[datasetId]
); );
// renumber - superCells must contain global cell ids // renumber - superCells must contain global cell ids
inplaceRenumber inplaceRenumber
( (
subsetter.cellMap(), subsetter.cellMap(),
superCellZonesCells_[datasetId] zoneSuperCells_[datasetId]
); );
AddToBlock AddToBlock
@ -281,18 +288,20 @@ void Foam::vtkPV3Foam::convertMeshCellZones
if (debug) if (debug)
{ {
Info<< "<end> Foam::vtkPV3Foam::convertMeshCellZones" << endl; Info<< "<end> Foam::vtkPV3Foam::convertMeshCellZones" << endl;
printMemory();
} }
} }
void Foam::vtkPV3Foam::convertMeshCellSet void Foam::vtkPV3Foam::convertMeshCellSets
( (
vtkMultiBlockDataSet* output vtkMultiBlockDataSet* output
) )
{ {
if (debug) if (debug)
{ {
Info<< "<beg> Foam::vtkPV3Foam::convertMeshCellSet" << endl; Info<< "<beg> Foam::vtkPV3Foam::convertMeshCellSets" << endl;
printMemory();
} }
const selectionInfo& selector = selectInfoCellSets_; const selectionInfo& selector = selectInfoCellSets_;
@ -337,14 +346,14 @@ void Foam::vtkPV3Foam::convertMeshCellSet
( (
subsetter.subMesh(), subsetter.subMesh(),
vtkmesh, vtkmesh,
superCellSetCells_[datasetId] csetSuperCells_[datasetId]
); );
// renumber - superCells must contain global cell ids // renumber - superCells must contain global cell ids
inplaceRenumber inplaceRenumber
( (
subsetter.cellMap(), subsetter.cellMap(),
superCellSetCells_[datasetId] csetSuperCells_[datasetId]
); );
AddToBlock AddToBlock
@ -359,10 +368,12 @@ void Foam::vtkPV3Foam::convertMeshCellSet
if (debug) if (debug)
{ {
Info<< "<end> Foam::vtkPV3Foam::convertMeshCellSet" << endl; Info<< "<end> Foam::vtkPV3Foam::convertMeshCellSets" << endl;
printMemory();
} }
} }
void Foam::vtkPV3Foam::convertMeshFaceZones void Foam::vtkPV3Foam::convertMeshFaceZones
( (
vtkMultiBlockDataSet* output vtkMultiBlockDataSet* output
@ -371,6 +382,7 @@ void Foam::vtkPV3Foam::convertMeshFaceZones
if (debug) if (debug)
{ {
Info<< "<beg> Foam::vtkPV3Foam::convertMeshFaceZones" << endl; Info<< "<beg> Foam::vtkPV3Foam::convertMeshFaceZones" << endl;
printMemory();
} }
const selectionInfo& selector = selectInfoFaceZones_; const selectionInfo& selector = selectInfoFaceZones_;
@ -417,22 +429,24 @@ void Foam::vtkPV3Foam::convertMeshFaceZones
vtkmesh->Delete(); vtkmesh->Delete();
} }
} }
if (debug) if (debug)
{ {
Info<< "<end> Foam::vtkPV3Foam::convertMeshFaceZones" << endl; Info<< "<end> Foam::vtkPV3Foam::convertMeshFaceZones" << endl;
printMemory();
} }
} }
void Foam::vtkPV3Foam::convertMeshFaceSet void Foam::vtkPV3Foam::convertMeshFaceSets
( (
vtkMultiBlockDataSet* output vtkMultiBlockDataSet* output
) )
{ {
if (debug) if (debug)
{ {
Info<< "<beg> Foam::vtkPV3Foam::convertMeshFaceSet" << endl; Info<< "<beg> Foam::vtkPV3Foam::convertMeshFaceSets" << endl;
printMemory();
} }
const selectionInfo& selector = selectInfoFaceSets_; const selectionInfo& selector = selectInfoFaceSets_;
@ -487,10 +501,11 @@ void Foam::vtkPV3Foam::convertMeshFaceSet
vtkmesh->Delete(); vtkmesh->Delete();
} }
} }
if (debug) if (debug)
{ {
Info<< "<end> Foam::vtkPV3Foam::convertMeshFaceSet" << endl; Info<< "<end> Foam::vtkPV3Foam::convertMeshFaceSets" << endl;
printMemory();
} }
} }
@ -503,6 +518,7 @@ void Foam::vtkPV3Foam::convertMeshPointZones
if (debug) if (debug)
{ {
Info<< "<beg> Foam::vtkPV3Foam::convertMeshPointZones" << endl; Info<< "<beg> Foam::vtkPV3Foam::convertMeshPointZones" << endl;
printMemory();
} }
const selectionInfo& selector = selectInfoPointZones_; const selectionInfo& selector = selectInfoPointZones_;
@ -549,23 +565,25 @@ void Foam::vtkPV3Foam::convertMeshPointZones
vtkmesh->Delete(); vtkmesh->Delete();
} }
} }
if (debug) if (debug)
{ {
Info<< "<end> Foam::vtkPV3Foam::convertMeshPointZones" << endl; Info<< "<end> Foam::vtkPV3Foam::convertMeshPointZones" << endl;
printMemory();
} }
} }
void Foam::vtkPV3Foam::convertMeshPointSet void Foam::vtkPV3Foam::convertMeshPointSets
( (
vtkMultiBlockDataSet* output vtkMultiBlockDataSet* output
) )
{ {
if (debug) if (debug)
{ {
Info<< "<beg> Foam::vtkPV3Foam::convertMeshPointSet" << endl; Info<< "<beg> Foam::vtkPV3Foam::convertMeshPointSets" << endl;
printMemory();
} }
const selectionInfo& selector = selectInfoPointSets_; const selectionInfo& selector = selectInfoPointSets_;
@ -620,10 +638,11 @@ void Foam::vtkPV3Foam::convertMeshPointSet
vtkmesh->Delete(); vtkmesh->Delete();
} }
} }
if (debug) if (debug)
{ {
Info<< "<end> Foam::vtkPV3Foam::convertMeshPointSet" << endl; Info<< "<end> Foam::vtkPV3Foam::convertMeshPointSets" << endl;
printMemory();
} }
} }

View File

@ -173,8 +173,7 @@ void Foam::vtkPV3Foam::convertVolFields
convertPatchFaceField convertPatchFaceField
( (
tf.name(), tf.name(),
fvPatchField<Type>(p, tf) fvPatchField<Type>(p, tf).patchInternalField()(),
.patchInternalField()(),
output, output,
selectInfoPatches_, selectInfoPatches_,
selectedRegionDatasetIds_[regionId] selectedRegionDatasetIds_[regionId]
@ -236,7 +235,7 @@ void Foam::vtkPV3Foam::convertVolFields
( (
tf, tf,
output, selectInfoCellZones_, datasetId, output, selectInfoCellZones_, datasetId,
superCellZonesCells_[datasetId] zoneSuperCells_[datasetId]
); );
} }
@ -273,7 +272,7 @@ void Foam::vtkPV3Foam::convertVolFields
( (
tf, tf,
output, selectInfoCellSets_, datasetId, output, selectInfoCellSets_, datasetId,
superCellSetCells_[datasetId] csetSuperCells_[datasetId]
); );
} }

View File

@ -28,7 +28,6 @@ License
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
//- Extract up to the first non-word characters
inline Foam::word Foam::vtkPV3Foam::getFirstWord(const char* str) inline Foam::word Foam::vtkPV3Foam::getFirstWord(const char* str)
{ {
if (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 * * * * * * * * * * * * * //
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// ************************************************************************* // // ************************************************************************* //

View File

@ -48,16 +48,10 @@ void Foam::vtkPV3Foam::updateFoamMesh()
if (debug) if (debug)
{ {
Info<< "<beg> Foam::vtkPV3Foam::updateFoamMesh" << endl; Info<< "<beg> Foam::vtkPV3Foam::updateFoamMesh" << endl;
printMemory();
} }
if if (!reader_->GetCacheMesh())
(
!reader_->GetCacheMesh()
#ifdef PV3FOAM_TIMESELECTION
// This is only useful if the times are individually selectable
|| reader_->GetTimeSelection()->GetArraySetting(0)
#endif
)
{ {
delete meshPtr_; delete meshPtr_;
meshPtr_ = NULL; meshPtr_ = NULL;
@ -79,6 +73,8 @@ void Foam::vtkPV3Foam::updateFoamMesh()
dbPtr_() dbPtr_()
) )
); );
meshChanged_ = true;
} }
else else
{ {
@ -91,6 +87,7 @@ void Foam::vtkPV3Foam::updateFoamMesh()
if (debug) if (debug)
{ {
Info<< "<end> Foam::vtkPV3Foam::updateFoamMesh" << endl; Info<< "<end> Foam::vtkPV3Foam::updateFoamMesh" << endl;
printMemory();
} }
} }
@ -103,6 +100,7 @@ void Foam::vtkPV3Foam::updateVolFields
if (debug) if (debug)
{ {
Info<< "<beg> Foam::vtkPV3Foam::updateVolFields" << endl; Info<< "<beg> Foam::vtkPV3Foam::updateVolFields" << endl;
printMemory();
} }
const fvMesh& mesh = *meshPtr_; const fvMesh& mesh = *meshPtr_;
@ -167,6 +165,7 @@ void Foam::vtkPV3Foam::updateVolFields
if (debug) if (debug)
{ {
Info<< "<end> Foam::vtkPV3Foam::updateVolFields" << endl; Info<< "<end> Foam::vtkPV3Foam::updateVolFields" << endl;
printMemory();
} }
} }
@ -179,6 +178,7 @@ void Foam::vtkPV3Foam::updatePointFields
if (debug) if (debug)
{ {
Info<< "<beg> Foam::vtkPV3Foam::updatePointFields" << endl; Info<< "<beg> Foam::vtkPV3Foam::updatePointFields" << endl;
printMemory();
} }
const fvMesh& mesh = *meshPtr_; const fvMesh& mesh = *meshPtr_;
@ -218,6 +218,7 @@ void Foam::vtkPV3Foam::updatePointFields
if (debug) if (debug)
{ {
Info<< "<end> Foam::vtkPV3Foam::updatePointFields" << endl; Info<< "<end> Foam::vtkPV3Foam::updatePointFields" << endl;
printMemory();
} }
} }
@ -230,6 +231,7 @@ void Foam::vtkPV3Foam::updateLagrangianFields
if (debug) if (debug)
{ {
Info<< "<beg> Foam::vtkPV3Foam::updateLagrangianFields" << endl; Info<< "<beg> Foam::vtkPV3Foam::updateLagrangianFields" << endl;
printMemory();
} }
const fvMesh& mesh = *meshPtr_; const fvMesh& mesh = *meshPtr_;
@ -281,6 +283,7 @@ void Foam::vtkPV3Foam::updateLagrangianFields
if (debug) if (debug)
{ {
Info<< "<end> Foam::vtkPV3Foam::updateLagrangianFields" << endl; Info<< "<end> Foam::vtkPV3Foam::updateLagrangianFields" << endl;
printMemory();
} }
} }

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation, along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "vtkPV3Foam.H" #include "vtkPV3Foam.H"
@ -31,13 +29,17 @@ Description
// Foam includes // Foam includes
#include "cellSet.H" #include "cellSet.H"
#include "faceSet.H" #include "faceSet.H"
#include "pointSet.H"
#include "IOobjectList.H" #include "IOobjectList.H"
#include "IOPtrList.H" #include "IOPtrList.H"
#include "pointSet.H"
#include "polyBoundaryMeshEntries.H" #include "polyBoundaryMeshEntries.H"
#include "entry.H" #include "entry.H"
#include "vtkPV3FoamReader.h" #include "vtkPV3FoamReader.h"
// local headers
#include "vtkPV3FoamAddToSelection.H"
#include "vtkPV3FoamUpdateInformationFields.H"
// VTK includes // VTK includes
#include "vtkDataArraySelection.h" #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() void Foam::vtkPV3Foam::updateInformationInternalMesh()
{ {
@ -103,6 +138,9 @@ void Foam::vtkPV3Foam::updateInformationInternalMesh()
if (debug) if (debug)
{ {
// just for debug info
getSelectedArrayEntries(arraySelection);
Info<< "<end> Foam::vtkPV3Foam::updateInformationInternalMesh" << endl; Info<< "<end> Foam::vtkPV3Foam::updateInformationInternalMesh" << endl;
} }
@ -132,7 +170,7 @@ void Foam::vtkPV3Foam::updateInformationLagrangian()
arraySelection->AddArray("lagrangian"); arraySelection->AddArray("lagrangian");
selectInfoLagrangian_ += 1; selectInfoLagrangian_ += 1;
Info<<"added cloudDirs\n"; Info<< "... added cloudDirs\n";
if (cloudDirs.size() > 1) if (cloudDirs.size() > 1)
{ {
@ -149,13 +187,16 @@ void Foam::vtkPV3Foam::updateInformationLagrangian()
{ {
if (debug) if (debug)
{ {
Info<<"no clouds identified in " <<nl Info<< "... no clouds identified in " <<nl
<< " " <<dbPtr_->timePath()/"lagrangian" << endl; << " " <<dbPtr_->timePath()/"lagrangian" << endl;
} }
} }
if (debug) if (debug)
{ {
// just for debug info
getSelectedArrayEntries(arraySelection);
Info<< "<end> Foam::vtkPV3Foam::updateInformationLagrangian" << endl; Info<< "<end> Foam::vtkPV3Foam::updateInformationLagrangian" << endl;
} }
} }
@ -165,50 +206,80 @@ void Foam::vtkPV3Foam::updateInformationPatches()
{ {
if (debug) if (debug)
{ {
Info<< "<beg> Foam::vtkPV3Foam::updateInformationPatches" << endl; Info<< "<beg> Foam::vtkPV3Foam::updateInformationPatches"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
} }
vtkDataArraySelection *arraySelection = reader_->GetRegionSelection(); vtkDataArraySelection *arraySelection = reader_->GetRegionSelection();
// Read patches
polyBoundaryMeshEntries patchEntries
(
IOobject
(
"boundary",
dbPtr_().findInstance(polyMesh::meshSubDir, "boundary"),
polyMesh::meshSubDir,
dbPtr_(),
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
);
selectInfoPatches_ = arraySelection->GetNumberOfArrays(); selectInfoPatches_ = arraySelection->GetNumberOfArrays();
int nPatches = 0; int nPatches = 0;
// Start regions at patches if (meshPtr_)
forAll (patchEntries, entryI)
{ {
label nFaces(readLabel(patchEntries[entryI].dict().lookup("nFaces"))); const polyBoundaryMesh& patches = meshPtr_->boundaryMesh();
forAll (patches, patchI)
// Valid patch if nFace > 0
if (nFaces)
{ {
// Add patch to GUI region list const polyPatch& pp = patches[patchI];
arraySelection->AddArray
(
(patchEntries[entryI].keyword() + " - patch").c_str()
);
++nPatches; if (pp.size())
{
// Add patch to GUI region list
arraySelection->AddArray
(
(pp.name() + " - patch").c_str()
);
++nPatches;
}
} }
} }
else
{
// Read patches
polyBoundaryMeshEntries patchEntries
(
IOobject
(
"boundary",
dbPtr_().findInstance(polyMesh::meshSubDir, "boundary"),
polyMesh::meshSubDir,
dbPtr_(),
IOobject::MUST_READ,
IOobject::NO_WRITE,
false
)
);
// Start regions at patches
forAll (patchEntries, entryI)
{
label nFaces
(
readLabel(patchEntries[entryI].dict().lookup("nFaces"))
);
// Valid patch if nFace > 0
if (nFaces)
{
// Add patch to GUI region list
arraySelection->AddArray
(
(patchEntries[entryI].keyword() + " - patch").c_str()
);
++nPatches;
}
}
}
selectInfoPatches_ += nPatches; selectInfoPatches_ += nPatches;
if (debug) if (debug)
{ {
// just for debug info
getSelectedArrayEntries(arraySelection);
Info<< "<end> Foam::vtkPV3Foam::updateInformationPatches" << endl; Info<< "<end> Foam::vtkPV3Foam::updateInformationPatches" << endl;
} }
} }
@ -218,108 +289,82 @@ void Foam::vtkPV3Foam::updateInformationZones()
{ {
if (debug) if (debug)
{ {
Info<< "<beg> Foam::vtkPV3Foam::updateInformationZones" << endl; Info<< "<beg> Foam::vtkPV3Foam::updateInformationZones"
<< " [meshPtr=" << (meshPtr_ ? "set" : "NULL") << "]" << endl;
} }
vtkDataArraySelection *arraySelection = reader_->GetRegionSelection(); vtkDataArraySelection *arraySelection = reader_->GetRegionSelection();
// Read cell zone information wordList namesLst;
//
// cellZones information
// ~~~~~~~~~~~~~~~~~~~~~
if (meshPtr_)
{ {
zonesEntries zones namesLst = meshPtr_->cellZones().names();
( }
IOobject else
( {
"cellZones", namesLst = readZoneNames("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());
} }
// Read face zone information selectInfoCellZones_ = arraySelection->GetNumberOfArrays();
forAll (namesLst, elemI)
{ {
zonesEntries zones arraySelection->AddArray((namesLst[elemI] + " - cellZone").c_str());
( }
IOobject selectInfoCellZones_ += namesLst.size();
( zoneSuperCells_.setSize(selectInfoCellZones_.size());
"faceZones",
dbPtr_().findInstance(polyMesh::meshSubDir, "faceZones"),
polyMesh::meshSubDir,
dbPtr_(),
IOobject::READ_IF_PRESENT,
IOobject::NO_WRITE,
false
)
);
selectInfoFaceZones_ = arraySelection->GetNumberOfArrays();
if (zones.headerOk()) //
{ // faceZones information
forAll(zones, zoneI) // ~~~~~~~~~~~~~~~~~~~~~
{ if (meshPtr_)
arraySelection->AddArray {
( namesLst = meshPtr_->faceZones().names();
(zones[zoneI].keyword() + " - faceZone").c_str() }
); else
} {
selectInfoFaceZones_ += zones.size(); namesLst = readZoneNames("faceZones");
}
} }
// Read point zone information selectInfoFaceZones_ = arraySelection->GetNumberOfArrays();
forAll (namesLst, elemI)
{ {
zonesEntries zones arraySelection->AddArray((namesLst[elemI] + " - faceZone").c_str());
(
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();
}
} }
selectInfoFaceZones_ += namesLst.size();
//
// pointZones information
// ~~~~~~~~~~~~~~~~~~~~~~
if (meshPtr_)
{
namesLst = meshPtr_->pointZones().names();
}
else
{
namesLst = readZoneNames("pointZones");
}
selectInfoPointZones_ = arraySelection->GetNumberOfArrays();
forAll (namesLst, elemI)
{
arraySelection->AddArray((namesLst[elemI] + " - pointZone").c_str());
}
selectInfoPointZones_ += namesLst.size();
if (debug) if (debug)
{ {
// just for debug info
getSelectedArrayEntries(arraySelection);
Info<< "<end> Foam::vtkPV3Foam::updateInformationZones" << endl; Info<< "<end> Foam::vtkPV3Foam::updateInformationZones" << endl;
} }
} }
@ -332,7 +377,7 @@ void Foam::vtkPV3Foam::updateInformationSets()
vtkDataArraySelection *arraySelection = reader_->GetRegionSelection(); vtkDataArraySelection *arraySelection = reader_->GetRegionSelection();
// Add sets // Add names of sets
IOobjectList objects IOobjectList objects
( (
dbPtr_(), dbPtr_(),
@ -342,16 +387,16 @@ void Foam::vtkPV3Foam::updateInformationSets()
selectInfoCellSets_ = arraySelection->GetNumberOfArrays(); selectInfoCellSets_ = arraySelection->GetNumberOfArrays();
selectInfoCellSets_ += addFields<cellSet> selectInfoCellSets_ += addToSelection<cellSet>
( (
arraySelection, arraySelection,
objects, objects,
" - cellSet" " - cellSet"
); );
superCellSetCells_.setSize(selectInfoCellSets_.size()); csetSuperCells_.setSize(selectInfoCellSets_.size());
selectInfoFaceSets_ = arraySelection->GetNumberOfArrays(); selectInfoFaceSets_ = arraySelection->GetNumberOfArrays();
selectInfoFaceSets_ += addFields<faceSet> selectInfoFaceSets_ += addToSelection<faceSet>
( (
arraySelection, arraySelection,
objects, objects,
@ -359,7 +404,7 @@ void Foam::vtkPV3Foam::updateInformationSets()
); );
selectInfoPointSets_ = arraySelection->GetNumberOfArrays(); selectInfoPointSets_ = arraySelection->GetNumberOfArrays();
selectInfoPointSets_ += addFields<pointSet> selectInfoPointSets_ += addToSelection<pointSet>
( (
arraySelection, arraySelection,
objects, objects,
@ -368,6 +413,9 @@ void Foam::vtkPV3Foam::updateInformationSets()
if (debug) if (debug)
{ {
// just for debug info
getSelectedArrayEntries(arraySelection);
Info<< "<end> Foam::vtkPV3Foam::updateInformationSets" << endl; Info<< "<end> Foam::vtkPV3Foam::updateInformationSets" << endl;
} }
} }
@ -399,32 +447,32 @@ void Foam::vtkPV3Foam::updateInformationLagrangianFields()
"lagrangian"/cloudName_ "lagrangian"/cloudName_
); );
addFields<IOField<label> > addToSelection<IOField<label> >
( (
arraySelection, arraySelection,
objects objects
); );
addFields<IOField<scalar> > addToSelection<IOField<scalar> >
( (
arraySelection, arraySelection,
objects objects
); );
addFields<IOField<vector> > addToSelection<IOField<vector> >
( (
arraySelection, arraySelection,
objects objects
); );
addFields<IOField<sphericalTensor> > addToSelection<IOField<sphericalTensor> >
( (
arraySelection, arraySelection,
objects objects
); );
addFields<IOField<symmTensor> > addToSelection<IOField<symmTensor> >
( (
arraySelection, arraySelection,
objects objects
); );
addFields<IOField<tensor> > addToSelection<IOField<tensor> >
( (
arraySelection, arraySelection,
objects objects
@ -444,5 +492,7 @@ void Foam::vtkPV3Foam::updateInformationLagrangianFields()
} }
} }
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
// ************************************************************************* // // ************************************************************************* //

View File

@ -43,11 +43,23 @@ void Foam::vtkPV3Foam::updateInformationFields
Info<< "<beg> Foam::vtkPV3Foam::updateInformationFields" << endl; Info<< "<beg> Foam::vtkPV3Foam::updateInformationFields" << endl;
} }
// preserve the currently selected values stringList selectedEntries;
const stringList selectedEntries = getSelectedArrayEntries // enable 'p' and 'U' on the first call
( if (arraySelection->GetNumberOfArrays() == 0 && !meshPtr_)
arraySelection {
); selectedEntries.setSize(2);
selectedEntries[0] = "p";
selectedEntries[1] = "U";
}
else
{
// preserve the currently selected values
selectedEntries = getSelectedArrayEntries
(
arraySelection
);
}
arraySelection->RemoveAllArrays(); arraySelection->RemoveAllArrays();
// Search for list of objects for this time // Search for list of objects for this time
@ -56,33 +68,33 @@ void Foam::vtkPV3Foam::updateInformationFields
//- Add volume fields to GUI //- Add volume fields to GUI
/* /*
addFields<GeometricField<label, patchType, meshType> > addToSelection<GeometricField<label, patchType, meshType> >
( (
arraySelection, arraySelection,
objects objects
); );
*/ */
addFields<GeometricField<scalar, patchType, meshType> > addToSelection<GeometricField<scalar, patchType, meshType> >
( (
arraySelection, arraySelection,
objects objects
); );
addFields<GeometricField<vector, patchType, meshType> > addToSelection<GeometricField<vector, patchType, meshType> >
( (
arraySelection, arraySelection,
objects objects
); );
addFields<GeometricField<sphericalTensor, patchType, meshType> > addToSelection<GeometricField<sphericalTensor, patchType, meshType> >
( (
arraySelection, arraySelection,
objects objects
); );
addFields<GeometricField<symmTensor, patchType, meshType> > addToSelection<GeometricField<symmTensor, patchType, meshType> >
( (
arraySelection, arraySelection,
objects objects
); );
addFields<GeometricField<tensor, patchType, meshType> > addToSelection<GeometricField<tensor, patchType, meshType> >
( (
arraySelection, arraySelection,
objects objects

View File

@ -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 # wmake fieldview9Reader
#fi # fi

View File

@ -107,11 +107,12 @@ int main(int argc, char *argv[])
*mag(U.boundaryField()[patchi].snGrad()) *mag(U.boundaryField()[patchi].snGrad())
) )
/sgsModel->nu().boundaryField()[patchi]; /sgsModel->nu().boundaryField()[patchi];
const scalarField& Yp = yPlus.boundaryField()[patchi];
Info<< "Patch " << patchi Info<< "Patch " << patchi
<< " named " << currPatch.name() << " named " << currPatch.name()
<< " y+ : min: " << min(yPlus) << " max: " << max(yPlus) << " y+ : min: " << min(Yp) << " max: " << max(Yp)
<< " average: " << average(yPlus) << nl << endl; << " average: " << average(Yp) << nl << endl;
} }
} }

View File

@ -49,20 +49,20 @@ bool validTri(const triSurface& surf, const label faceI)
|| (f[2] < 0) || (f[2] >= surf.points().size()) || (f[2] < 0) || (f[2] >= surf.points().size())
) )
{ {
WarningIn("validTri(const triSurface&, const label)") //WarningIn("validTri(const triSurface&, const label)")
<< "triangle " << faceI << " vertices " << f // << "triangle " << faceI << " vertices " << f
<< " uses point indices outside point range 0.." // << " uses point indices outside point range 0.."
<< surf.points().size()-1 << endl; // << surf.points().size()-1 << endl;
return false; return false;
} }
if ((f[0] == f[1]) || (f[0] == f[2]) || (f[1] == f[2])) if ((f[0] == f[1]) || (f[0] == f[2]) || (f[1] == f[2]))
{ {
WarningIn("validTri(const triSurface&, const label)") //WarningIn("validTri(const triSurface&, const label)")
<< "triangle " << faceI // << "triangle " << faceI
<< " uses non-unique vertices " << f // << " uses non-unique vertices " << f
<< endl; // << endl;
return false; return false;
} }
@ -91,11 +91,11 @@ bool validTri(const triSurface& surf, const label faceI)
&& ((f[2] == nbrF[0]) || (f[2] == nbrF[1]) || (f[2] == nbrF[2])) && ((f[2] == nbrF[0]) || (f[2] == nbrF[1]) || (f[2] == nbrF[2]))
) )
{ {
WarningIn("validTri(const triSurface&, const label)") //WarningIn("validTri(const triSurface&, const label)")
<< "triangle " << faceI << " vertices " << f // << "triangle " << faceI << " vertices " << f
<< " has the same vertices as triangle " << nbrFaceI // << " has the same vertices as triangle " << nbrFaceI
<< " vertices " << nbrF // << " vertices " << nbrF
<< endl; // << endl;
return false; return false;
} }
@ -270,9 +270,9 @@ int main(int argc, char *argv[])
if (f[0] == f[1] || f[0] == f[2] || f[1] == f[2]) if (f[0] == f[1] || f[0] == f[2] || f[1] == f[2])
{ {
WarningIn(args.executable()) //WarningIn(args.executable())
<< "Illegal triangle " << faceI << " vertices " << f // << "Illegal triangle " << faceI << " vertices " << f
<< " coords " << f.points(surf.points()) << endl; // << " coords " << f.points(surf.points()) << endl;
} }
else else
{ {

View File

@ -418,19 +418,55 @@ Foam::instant Foam::Time::findClosestTime(const scalar t) const
return times[times.size() - 1]; return times[times.size() - 1];
} }
label nearestIndex = -1;
scalar deltaT = GREAT; scalar deltaT = GREAT;
label closesti = 0;
for (label i=1; i<times.size(); i++) 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); deltaT = diff;
closesti = i; 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;
} }

View File

@ -300,6 +300,9 @@ public:
//- Search the case for the time closest to the given time //- Search the case for the time closest to the given time
instant findClosestTime(const scalar) const; 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 //- Write using given format, version and compression
virtual bool writeObject virtual bool writeObject
( (

View File

@ -33,10 +33,7 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam Foam::word Foam::Time::findInstance
{
word Time::findInstance
( (
const fileName& dir, const fileName& dir,
const word& name, const word& name,
@ -110,7 +107,7 @@ word Time::findInstance
// constant function of the time, because the latter points to // constant function of the time, because the latter points to
// the case constant directory in parallel cases // the case constant directory in parallel cases
if if
( (
file(path()/constant()/dir/name) file(path()/constant()/dir/name)
&& IOobject(name, constant(), dir, *this).headerOk() && IOobject(name, constant(), dir, *this).headerOk()
@ -139,9 +136,4 @@ word Time::findInstance
return constant(); return constant();
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -35,12 +35,7 @@ Description
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam Foam::instantList Foam::Time::findTimes(const fileName& directory)
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
instantList Time::findTimes(const fileName& directory)
{ {
if (debug) if (debug)
{ {
@ -101,9 +96,4 @@ instantList Time::findTimes(const fileName& directory)
return Times; return Times;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -337,23 +337,21 @@ Foam::argList::argList
Switch distributed(false); 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; FatalError
<< "number of entries in decompositionDict::roots"
if (roots.size() != Pstream::nProcs()) << " is not equal to the number of slaves "
{ << Pstream::nProcs()-1
FatalError << exit(FatalError);
<< "number of entries in "
<< "decompositionDict::roots"
<< " is not equal to the number of processors "
<< Pstream::nProcs()
<< exit(FatalError);
}
} }
} }

View File

@ -1,22 +1,7 @@
if (args.options().found("time")) if (args.options().found("time"))
{ {
scalar time(readScalar(IStringStream(args.options()["time"])())); scalar timeValue(readScalar(IStringStream(args.options()["time"])()));
int nearestIndex = -1; startTime = Time::findClosestTimeIndex(Times, timeValue);
scalar nearestDiff = Foam::GREAT; endTime = startTime + 1;
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;
} }

View File

@ -1072,7 +1072,7 @@ const Foam::globalMeshData& Foam::polyMesh::globalData() const
// Remove all files and some subdirs (eg, sets) // Remove all files and some subdirs (eg, sets)
void Foam::polyMesh::removeFiles(const fileName& instanceDir) const void Foam::polyMesh::removeFiles(const fileName& instanceDir) const
{ {
fileName meshFilesPath = db().path()/instanceDir/meshSubDir; fileName meshFilesPath = db().path()/instanceDir/meshDir();
rm(meshFilesPath/"points"); rm(meshFilesPath/"points");
rm(meshFilesPath/"faces"); rm(meshFilesPath/"faces");

View File

@ -102,7 +102,7 @@ Foam::scalar Foam::layerAdditionRemoval::readOldThickness
const dictionary& dict const dictionary& dict
) )
{ {
dict.lookupOrDefault("oldLayerThickness", -1.0); return dict.lookupOrDefault("oldLayerThickness", -1.0);
} }

View File

@ -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

View File

@ -13,10 +13,10 @@ sampledSet/sampledSets/sampledSets.C
sampledSet/sampledSetsFunctionObject/sampledSetsFunctionObject.C sampledSet/sampledSetsFunctionObject/sampledSetsFunctionObject.C
sampledSet/writers/writer/writers.C sampledSet/writers/writer/writers.C
sampledSet/writers/raw/rawWriters.C
sampledSet/writers/xmgr/xmgrWriters.C sampledSet/writers/xmgr/xmgrWriters.C
sampledSet/writers/gnuplot/gnuplotWriters.C sampledSet/writers/gnuplot/gnuplotWriters.C
sampledSet/writers/jplot/jplotWriters.C sampledSet/writers/jplot/jplotWriters.C
sampledSet/writers/raw/rawWriters.C
cuttingPlane/cuttingPlane.C cuttingPlane/cuttingPlane.C

View File

@ -29,6 +29,15 @@ License
#include "linePointRef.H" #include "linePointRef.H"
#include "meshTools.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 * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
// Find cut cells // Find cut cells
@ -71,8 +80,8 @@ void Foam::cuttingPlane::calcCutCells
if if
( (
(dotProducts[e[0]] < 0 && dotProducts[e[1]] > 0) (dotProducts[e[0]] < zeroish && dotProducts[e[1]] > positive)
|| (dotProducts[e[1]] < 0 && dotProducts[e[0]] > 0) || (dotProducts[e[1]] < zeroish && dotProducts[e[0]] > positive)
) )
{ {
nCutEdges++; nCutEdges++;
@ -116,8 +125,8 @@ Foam::labelList Foam::cuttingPlane::intersectEdges
if if
( (
(dotProducts[e[0]] < 0 && dotProducts[e[1]] > 0) (dotProducts[e[0]] < zeroish && dotProducts[e[1]] > positive)
|| (dotProducts[e[1]] < 0 && dotProducts[e[0]] > 0) || (dotProducts[e[1]] < zeroish && dotProducts[e[0]] > positive)
) )
{ {
// Edge is cut. // Edge is cut.
@ -126,7 +135,19 @@ Foam::labelList Foam::cuttingPlane::intersectEdges
scalar alpha = lineIntersect(linePointRef(p0, p1)); 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; edgePoint[edgeI] = dynCuttingPoints.size() - 1;
} }
} }

View File

@ -30,6 +30,10 @@ Description
No attempt at resolving degenerate cases. 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 SourceFiles
cuttingPlane.C cuttingPlane.C

View File

@ -63,28 +63,26 @@ public:
//- Construct null //- Construct null
gnuplot(); gnuplot();
// Destructor
virtual ~gnuplot(); //- Destructor
virtual ~gnuplot();
// Member Functions // Member Functions
// Write virtual fileName getFileName
(
const coordSet&,
const wordList&
) const;
virtual fileName getFileName void write
( (
const coordSet&, const coordSet&,
const wordList& const wordList&,
) const; const List<const Field<Type>*>&,
Ostream& os
void write ) const;
(
const coordSet&,
const wordList&,
const List<const Field<Type>*>&,
Ostream& os
) const;
}; };

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation, along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "gnuplotWriters.H" #include "gnuplotWriters.H"
@ -33,13 +31,7 @@ Description
namespace Foam namespace Foam
{ {
makeWriters(gnuplot)
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // }
makeWriters(gnuplot);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -25,12 +25,9 @@ License
InClass InClass
Foam::gnuplotWriters Foam::gnuplotWriters
Description
SourceFiles SourceFiles
gnuplotWriters.C gnuplotWriters.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef gnuplotWriters_H #ifndef gnuplotWriters_H
@ -44,16 +41,8 @@ SourceFiles
namespace Foam namespace Foam
{ {
makeWritersTypedefs(gnuplot)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // }
typedef gnuplot<scalar> gnuplotScalarWriter;
typedef gnuplot<vector> gnuplotVectorWriter;
typedef gnuplot<tensor> gnuplotTensorWriter;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -25,8 +25,6 @@ License
Class Class
Foam::jplot Foam::jplot
Description
SourceFiles SourceFiles
jplot.C jplot.C
@ -43,8 +41,6 @@ SourceFiles
namespace Foam namespace Foam
{ {
// Forward declaration of classes
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class jplot Declaration Class jplot Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -71,30 +67,26 @@ public:
//- Construct null //- Construct null
jplot(); jplot();
// Destructor
virtual ~jplot(); //- Destructor
virtual ~jplot();
// Member Functions // Member Functions
// Access virtual fileName getFileName
(
const coordSet&,
const wordList&
) const;
// Write void write
(
virtual fileName getFileName const coordSet&,
( const wordList&,
const coordSet&, const List<const Field<Type>*>&,
const wordList& Ostream& os
) const; ) const;
void write
(
const coordSet&,
const wordList&,
const List<const Field<Type>*>&,
Ostream& os
) const;
}; };

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation, along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "jplotWriters.H" #include "jplotWriters.H"
@ -33,13 +31,7 @@ Description
namespace Foam namespace Foam
{ {
makeWriters(jplot)
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // }
makeWriters(jplot);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -25,12 +25,9 @@ License
InClass InClass
Foam::jplotWriters Foam::jplotWriters
Description
SourceFiles SourceFiles
jplotWriters.C jplotWriters.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef jplotWriters_H #ifndef jplotWriters_H
@ -44,16 +41,8 @@ SourceFiles
namespace Foam namespace Foam
{ {
makeWritersTypedefs(jplot)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // }
typedef jplot<scalar> jplotScalarWriter;
typedef jplot<vector> jplotVectorWriter;
typedef jplot<tensor> jplotTensorWriter;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -64,28 +64,25 @@ public:
raw(); raw();
// Destructor //- Destructor
virtual ~raw();
virtual ~raw();
// Member Functions // Member Functions
// Write virtual fileName getFileName
(
const coordSet&,
const wordList&
) const;
virtual fileName getFileName virtual void write
( (
const coordSet&, const coordSet&,
const wordList& const wordList&,
) const; const List<const Field<Type>*>&,
Ostream& os
virtual void write ) const;
(
const coordSet&,
const wordList&,
const List<const Field<Type>*>&,
Ostream& os
) const;
}; };

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation, along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "rawWriters.H" #include "rawWriters.H"
@ -33,13 +31,7 @@ Description
namespace Foam namespace Foam
{ {
makeWriters(raw)
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // }
makeWriters(raw);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -25,12 +25,9 @@ License
InClass InClass
Foam::rawWriters Foam::rawWriters
Description
SourceFiles SourceFiles
rawWriters.C rawWriters.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef rawWriters_H #ifndef rawWriters_H
@ -44,16 +41,8 @@ SourceFiles
namespace Foam namespace Foam
{ {
makeWritersTypedefs(raw)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // }
typedef raw<scalar> rawScalarWriter;
typedef raw<vector> rawVectorWriter;
typedef raw<tensor> rawTensorWriter;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -31,11 +31,11 @@ License
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
template<class Type> template<class Type>
autoPtr<writer<Type> > writer<Type>::New(const word& writeType) Foam::autoPtr<Foam::writer<Type> > Foam::writer<Type>::New
(
const word& writeType
)
{ {
typename wordConstructorTable::iterator cstrIter = typename wordConstructorTable::iterator cstrIter =
wordConstructorTablePtr_ wordConstructorTablePtr_
@ -60,7 +60,7 @@ autoPtr<writer<Type> > writer<Type>::New(const word& writeType)
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template<class Type> template<class Type>
fileName writer<Type>::getBaseName Foam::fileName Foam::writer<Type>::getBaseName
( (
const coordSet& points, const coordSet& points,
const wordList& valueSets const wordList& valueSets
@ -78,7 +78,7 @@ fileName writer<Type>::getBaseName
template<class Type> template<class Type>
void writer<Type>::writeCoord void Foam::writer<Type>::writeCoord
( (
const coordSet& points, const coordSet& points,
const label pointI, const label pointI,
@ -97,7 +97,7 @@ void writer<Type>::writeCoord
template<class Type> template<class Type>
void writer<Type>::writeTable void Foam::writer<Type>::writeTable
( (
const coordSet& points, const coordSet& points,
const List<Type>& values, const List<Type>& values,
@ -109,16 +109,14 @@ void writer<Type>::writeTable
writeCoord(points, pointI, os); writeCoord(points, pointI, os);
os << token::SPACE; os << token::SPACE;
write(values[pointI], os); write(values[pointI], os);
os << endl; os << endl;
} }
} }
template<class Type> template<class Type>
void writer<Type>::writeTable void Foam::writer<Type>::writeTable
( (
const coordSet& points, const coordSet& points,
const List<const List<Type>*>& valuesPtrList, const List<const List<Type>*>& valuesPtrList,
@ -132,9 +130,7 @@ void writer<Type>::writeTable
forAll(valuesPtrList, i) forAll(valuesPtrList, i)
{ {
os << token::SPACE; os << token::SPACE;
const List<Type>& values = *valuesPtrList[i]; const List<Type>& values = *valuesPtrList[i];
write(values[pointI], os); write(values[pointI], os);
} }
os << endl; os << endl;
@ -144,36 +140,44 @@ void writer<Type>::writeTable
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
// Construct null
template<class Type> template<class Type>
writer<Type>::writer() Foam::writer<Type>::writer()
{} {}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class Type> template<class Type>
writer<Type>::~writer() Foam::writer<Type>::~writer()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class Type> template<class Type>
Foam::Ostream& Foam::writer<Type>::write(const scalar value, Ostream& os) const Foam::Ostream& Foam::writer<Type>::write
(
const scalar value,
Ostream& os
) const
{ {
return os << value; return os << value;
} }
template<class Type> template<class Type>
Foam::Ostream& Foam::writer<Type>::write(const vector& value, Ostream& os) const template<class VSType>
Foam::Ostream& Foam::writer<Type>::writeVS
(
const VSType& value,
Ostream& os
) const
{ {
for (direction d=0; d<vector::nComponents; d++) for (direction d=0; d<VSType::nComponents; d++)
{ {
os << value.component(d); os << value.component(d);
if (d <= vector::nComponents-1) if (d <= VSType::nComponents-1)
{ {
os << token::TAB; os << token::TAB;
} }
@ -183,23 +187,47 @@ Foam::Ostream& Foam::writer<Type>::write(const vector& value, Ostream& os) const
template<class Type> template<class Type>
Foam::Ostream& Foam::writer<Type>::write(const tensor& value, Ostream& os) const Foam::Ostream& Foam::writer<Type>::write
(
const vector& value,
Ostream& os
) const
{ {
for (direction d=0; d<tensor::nComponents; d++) return writeVS(value, os);
{
os << value.component(d);
if (d <= tensor::nComponents-1)
{
os << token::TAB;
}
}
return os;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // template<class Type>
Foam::Ostream& Foam::writer<Type>::write
(
const sphericalTensor& value,
Ostream& os
) const
{
return writeVS(value, os);
}
template<class Type>
Foam::Ostream& Foam::writer<Type>::write
(
const symmTensor& value,
Ostream& os
) const
{
return writeVS(value, os);
}
template<class Type>
Foam::Ostream& Foam::writer<Type>::write
(
const tensor& value,
Ostream& os
) const
{
return writeVS(value, os);
}
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -29,8 +29,8 @@ Description
Base class for graphics format writing. Entry points are Base class for graphics format writing. Entry points are
- write(..). \n - write(..). \n
Write to an Ostream a table of points with corresponding values. Write to an Ostream a table of points with corresponding values.
- write(scalar/vector/tensor). \n - write(scalar/vector/sphericalTensor/symmTensor/tensor). \n
Write single scalar/vector/tensor. Write single scalar/vector/sphericalTensor/symmTensor/tensor.
Default is to write space separated components. Default is to write space separated components.
Example: Example:
@ -151,43 +151,47 @@ public:
writer(); writer();
// Destructor //- Destructor
virtual ~writer() = 0;
virtual ~writer() = 0;
// Member Functions // Member Functions
// Access //- Generate file name with correct extension
virtual fileName getFileName
(
const coordSet&,
const wordList&
) const = 0;
// Write //- General entry point for writing.
// The data is organized in a set of point with one or
// more values per point
virtual void write
(
const coordSet&,
const wordList&,
const List<const Field<Type>*>&,
Ostream&
) const = 0;
//- Generate file name with correct extension //- Write scalar as ascii
virtual fileName getFileName virtual Ostream& write(const scalar, Ostream&) const;
(
const coordSet&,
const wordList&
) const = 0;
//- General entry point for writing. template<class VSType>
// The data is organized in a set of point with one or Ostream& writeVS(const VSType& value, Ostream& os) const;
// more values per point
virtual void write
(
const coordSet&,
const wordList&,
const List<const Field<Type>*>&,
Ostream&
) const = 0;
//- Write scalar as ascii //- Write vector. Tab separated ascii
virtual Ostream& write(const scalar, Ostream&) const; virtual Ostream& write(const vector&, Ostream&) const;
//- Write vector. Tab separated ascii //- Write sphericalTensor. Tab separated ascii
virtual Ostream& write(const vector&, Ostream&) const; virtual Ostream& write(const sphericalTensor&, Ostream&) const;
//- Write tensor. Tab separated ascii //- Write symmTensor. Tab separated ascii
virtual Ostream& write(const tensor&, Ostream&) const; virtual Ostream& write(const symmTensor&, Ostream&) const;
//- Write tensor. Tab separated ascii
virtual Ostream& write(const tensor&, Ostream&) const;
}; };
@ -202,34 +206,47 @@ public:
#endif #endif
// Only used internally // Only used internally
#define makeTypeWritersTypeName(type) \ #define makeTypeWritersTypeName(type) \
\ \
defineNamedTemplateTypeNameAndDebug(type, 0); defineNamedTemplateTypeNameAndDebug(type, 0);
// Used externally sometimes // Used externally sometimes
#define makeWritersTypeName(typeWriter) \ #define makeWritersTypeName(typeWriter) \
\ \
makeTypeWritersTypeName(typeWriter##ScalarWriter); \ makeTypeWritersTypeName(typeWriter##ScalarWriter); \
makeTypeWritersTypeName(typeWriter##VectorWriter); \ makeTypeWritersTypeName(typeWriter##VectorWriter); \
makeTypeWritersTypeName(typeWriter##SphericalTensorWriter); \
makeTypeWritersTypeName(typeWriter##SymmTensorWriter); \
makeTypeWritersTypeName(typeWriter##TensorWriter); makeTypeWritersTypeName(typeWriter##TensorWriter);
// Define type info for single template instantiation (e.g. vector) // Define type info for single template instantiation (e.g. vector)
#define makeWriterTypes(WriterType, type) \ #define makeWriterTypes(WriterType, type) \
\ \
defineNamedTemplateTypeNameAndDebug(type, 0); \ defineNamedTemplateTypeNameAndDebug(type, 0); \
\ \
addToRunTimeSelectionTable \ addToRunTimeSelectionTable \
( \ ( \
WriterType, type, word \ WriterType, type, word \
); );
// Define type info info for scalar, vector etc. instantiations // Define type info info for scalar, vector etc. instantiations
#define makeWriters(typeWriter) \ #define makeWriters(typeWriter) \
\ \
makeWriterTypes(scalarWriter, typeWriter##ScalarWriter); \ makeWriterTypes(writerScalarWriter, typeWriter##ScalarWriter); \
makeWriterTypes(vectorWriter, typeWriter##VectorWriter); \ makeWriterTypes(writerVectorWriter, typeWriter##VectorWriter); \
makeWriterTypes(tensorWriter, typeWriter##TensorWriter); makeWriterTypes(writerSphericalTensorWriter, typeWriter##SphericalTensorWriter);\
makeWriterTypes(writerSymmTensorWriter, typeWriter##SymmTensorWriter); \
makeWriterTypes(writerTensorWriter, typeWriter##TensorWriter);
#define makeWritersTypedefs(typeWriter) \
\
typedef typeWriter<scalar> typeWriter##ScalarWriter; \
typedef typeWriter<vector> typeWriter##VectorWriter; \
typedef typeWriter<sphericalTensor> typeWriter##SphericalTensorWriter; \
typedef typeWriter<symmTensor> typeWriter##SymmTensorWriter; \
typedef typeWriter<tensor> typeWriter##TensorWriter;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation, along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "writers.H" #include "writers.H"
@ -35,20 +33,20 @@ namespace Foam
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
defineNamedTemplateTypeNameAndDebug(scalarWriter, 0); defineNamedTemplateTypeNameAndDebug(writerScalarWriter, 0);
defineTemplateRunTimeSelectionTable(scalarWriter, word); defineTemplateRunTimeSelectionTable(writerScalarWriter, word);
defineNamedTemplateTypeNameAndDebug(vectorWriter, 0); defineNamedTemplateTypeNameAndDebug(writerVectorWriter, 0);
defineTemplateRunTimeSelectionTable(vectorWriter, word); defineTemplateRunTimeSelectionTable(writerVectorWriter, word);
defineNamedTemplateTypeNameAndDebug(sphericalTensorWriter, 0); defineNamedTemplateTypeNameAndDebug(writerSphericalTensorWriter, 0);
defineTemplateRunTimeSelectionTable(sphericalTensorWriter, word); defineTemplateRunTimeSelectionTable(writerSphericalTensorWriter, word);
defineNamedTemplateTypeNameAndDebug(symmTensorWriter, 0); defineNamedTemplateTypeNameAndDebug(writerSymmTensorWriter, 0);
defineTemplateRunTimeSelectionTable(symmTensorWriter, word); defineTemplateRunTimeSelectionTable(writerSymmTensorWriter, word);
defineNamedTemplateTypeNameAndDebug(tensorWriter, 0); defineNamedTemplateTypeNameAndDebug(writerTensorWriter, 0);
defineTemplateRunTimeSelectionTable(tensorWriter, word); defineTemplateRunTimeSelectionTable(writerTensorWriter, word);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -23,9 +23,10 @@ License
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
InClass InClass
Foam::writer Foam::rawWriters
Description SourceFiles
writers.C
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
@ -39,18 +40,8 @@ Description
namespace Foam namespace Foam
{ {
makeWritersTypedefs(writer)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // }
typedef writer<scalar> scalarWriter;
typedef writer<vector> vectorWriter;
typedef writer<sphericalTensor> sphericalTensorWriter;
typedef writer<symmTensor> symmTensorWriter;
typedef writer<tensor> tensorWriter;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -63,28 +63,26 @@ public:
//- Construct null //- Construct null
xmgr(); xmgr();
// Destructor
virtual ~xmgr(); //- Destructor
virtual ~xmgr();
// Member Functions // Member Functions
// Write virtual fileName getFileName
(
const coordSet&,
const wordList&
) const;
virtual fileName getFileName void write
( (
const coordSet&, const coordSet&,
const wordList& const wordList&,
) const; const List<const Field<Type>*>&,
Ostream& os
void write ) const;
(
const coordSet&,
const wordList&,
const List<const Field<Type>*>&,
Ostream& os
) const;
}; };

View File

@ -22,8 +22,6 @@ License
along with OpenFOAM; if not, write to the Free Software Foundation, along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "xmgrWriters.H" #include "xmgrWriters.H"
@ -33,13 +31,7 @@ Description
namespace Foam namespace Foam
{ {
makeWriters(xmgr)
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // }
makeWriters(xmgr);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* // // ************************************************************************* //

View File

@ -44,16 +44,8 @@ SourceFiles
namespace Foam namespace Foam
{ {
makeWritersTypedefs(xmgr)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // }
typedef xmgr<scalar> xmgrScalarWriter;
typedef xmgr<vector> xmgrVectorWriter;
typedef xmgr<tensor> xmgrTensorWriter;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -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;
// ************************************************************************* //

View File

@ -1,20 +0,0 @@
/*--------------------------------*- 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;
class dictionary;
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
nu nu [0 2 -1 0 0 0 0] 0.01;
// ************************************************************************* //

View File

@ -1,37 +1,19 @@
// The FOAM Project // File: decomposeParDict /*--------------------------------*- C++ -*----------------------------------*\
/* | ========= | |
------------------------------------------------------------------------------- | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
========= | dictionary | \\ / O peration | Version: 1.5 |
\\ / | | \\ / A nd | Web: http://www.OpenFOAM.org |
\\ / | Name: decomposeParDict | \\/ M anipulation | |
\\ / | 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.
FoamFile FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary;
root "/home/penfold/mattijs/foam/mattijs2.1/run/icoFoam"; object decomposeParDict;
case "cavity";
instance "system";
local "";
class dictionary;
object decomposeParDict;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
arguments "/home/penfold/mattijs/foam/mattijs2.1/run/icoFoam" "cavity";
numberOfSubdomains 6; numberOfSubdomains 6;
method hierarchical; method hierarchical;

View File

@ -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;
// ************************************************************************* //

View File

@ -1,20 +0,0 @@
/*--------------------------------*- 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;
class dictionary;
object transportProperties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
nu nu [0 2 -1 0 0 0 0] 0.01;
// ************************************************************************* //

View File

@ -1,37 +1,19 @@
// The FOAM Project // File: decomposeParDict /*--------------------------------*- C++ -*----------------------------------*\
/* | ========= | |
------------------------------------------------------------------------------- | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
========= | dictionary | \\ / O peration | Version: 1.5 |
\\ / | | \\ / A nd | Web: http://www.OpenFOAM.org |
\\ / | Name: decomposeParDict | \\/ M anipulation | |
\\ / | 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.
FoamFile FoamFile
{ {
version 2.0; version 2.0;
format ascii; format ascii;
class dictionary;
root "/home/penfold/mattijs/foam/mattijs2.1/run/icoFoam"; object decomposeParDict;
case "cavity";
instance "system";
local "";
class dictionary;
object decomposeParDict;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
arguments "/home/penfold/mattijs/foam/mattijs2.1/run/icoFoam" "cavity";
numberOfSubdomains 6; numberOfSubdomains 6;
method hierarchical; method hierarchical;