diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx b/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx index 3c9570c27d..12872d6143 100644 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx +++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.cxx @@ -210,7 +210,7 @@ int vtkPV3FoamReader::RequestData if ( (UpdateGUIOld == GetUpdateGUI()) - || (output->GetNumberOfDataSets(0) == 0) + || (output->GetNumberOfBlocks() == 0) ) { foamData_->Update(output); diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.h b/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.h index 318016f673..c9875f9673 100644 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.h +++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/PV3FoamReader/vtkPV3FoamReader.h @@ -41,7 +41,9 @@ class vtkDataArraySelection; class vtkCallbackCommand; -class VTK_IO_EXPORT vtkPV3FoamReader : public vtkMultiBlockDataSetAlgorithm +class VTK_IO_EXPORT vtkPV3FoamReader +: + public vtkMultiBlockDataSetAlgorithm { public: diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/Make/options.save b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/Make/options.save deleted file mode 100755 index 650b286a7d..0000000000 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/Make/options.save +++ /dev/null @@ -1,16 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/lagrangian/basic/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(ParaView_DIR) \ - -I$(ParaView_DIR)/VTK \ - -I$(ParaView_DIR)/VTK/Common \ - -I$(ParaView_DIR)/VTK/Filtering \ - -I$(ParaView_DIR)/VTK/Rendering \ - -I../PV3FoamReader - -LIB_LIBS = \ - -lfiniteVolume \ - -llagrangian \ - -lmeshTools \ - $(GLIBS) diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C index 3e3d2af10c..61e33a5d77 100644 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C +++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C @@ -37,6 +37,7 @@ License // VTK includes #include "vtkCharArray.h" #include "vtkDataArraySelection.h" +#include "vtkDataSet.h" #include "vtkFieldData.h" #include "vtkMultiBlockDataSet.h" #include "vtkRenderer.h" @@ -55,6 +56,69 @@ defineTypeNameAndDebug(Foam::vtkPV3Foam, 0); #include "vtkPV3FoamUpdateInformationFields.H" +void Foam::vtkPV3Foam::AddToBlock +( + vtkMultiBlockDataSet* output, + unsigned int blockNo, + unsigned int datasetNo, + vtkDataSet* dataset +) +{ + vtkDataObject* blockDO = output->GetBlock(blockNo); + vtkMultiBlockDataSet* block = vtkMultiBlockDataSet::SafeDownCast(blockDO); + if (blockDO && !block) + { + FatalErrorIn("Foam::vtkPV3Foam::AddToBlock") + << "Block already has a vtkDataSet assigned to it" << nl << endl; + return; + } + + if (!block) + { + block = vtkMultiBlockDataSet::New(); + output->SetBlock(blockNo, block); + block->Delete(); + } + + block->SetBlock(datasetNo, dataset); +} + + +vtkDataSet* Foam::vtkPV3Foam::GetDataSetFromBlock +( + vtkMultiBlockDataSet* output, + unsigned int blockNo, + unsigned int datasetNo +) +{ + vtkDataObject* blockDO = output->GetBlock(blockNo); + vtkMultiBlockDataSet* block = vtkMultiBlockDataSet::SafeDownCast(blockDO); + if (block) + { + return vtkDataSet::SafeDownCast(block->GetBlock(datasetNo)); + } + + return 0; +} + + +Foam::label Foam::vtkPV3Foam::GetNumberOfDataSets +( + vtkMultiBlockDataSet* output, + unsigned int blockNo +) +{ + vtkDataObject* blockDO = output->GetBlock(blockNo); + vtkMultiBlockDataSet* block = vtkMultiBlockDataSet::SafeDownCast(blockDO); + if (block) + { + return block->GetNumberOfBlocks(); + } + + return 0; +} + + void Foam::vtkPV3Foam::resetCounters() { // Reset data size counts @@ -481,11 +545,11 @@ void Foam::vtkPV3Foam::Update if (debug) { Info<< "Number of data sets after update" << nl - << " VOLUME = " << output->GetNumberOfDataSets(VOLUME) << nl - << " LAGRANGIAN = " << output->GetNumberOfDataSets(LAGRANGIAN) - << nl << " CELLSET = " << output->GetNumberOfDataSets(CELLSET) - << nl << " FACESET = " << output->GetNumberOfDataSets(FACESET) - << nl << " POINTSET = " << output->GetNumberOfDataSets(POINTSET) + << " VOLUME = " << GetNumberOfDataSets(output, VOLUME) << nl + << " LAGRANGIAN = " << GetNumberOfDataSets(output, LAGRANGIAN) + << nl << " CELLSET = " << GetNumberOfDataSets(output, CELLSET) + << nl << " FACESET = " << GetNumberOfDataSets(output, FACESET) + << nl << " POINTSET = " << GetNumberOfDataSets(output, POINTSET) << endl; } } diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H index 21d02e4a9a..8657a9b3e2 100644 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H +++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H @@ -23,7 +23,7 @@ License Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Class - Foam::vtkPV3Foam + vtkPV3Foam Description @@ -65,6 +65,7 @@ SourceFiles // * * * * * * * * * * * * * Forward Declarations * * * * * * * * * * * * * // class vtkDataArraySelection; +class vtkDataSet; class vtkMultiBlockDataSet; class vtkPoints; class vtkPV3FoamReader; @@ -188,6 +189,33 @@ class vtkPV3Foam // Private Member Functions + // Convenience method use to convert the readers from VTK 5 + // multiblock API to the current composite data infrastructure + void AddToBlock + ( + vtkMultiBlockDataSet* output, + unsigned int blockNo, + unsigned int datasetNo, + vtkDataSet* dataset + ); + + // Convenience method use to convert the readers from VTK 5 + // multiblock API to the current composite data infrastructure + vtkDataSet* GetDataSetFromBlock + ( + vtkMultiBlockDataSet* output, + unsigned int blockNo, + unsigned int datasetNo + ); + + // Convenience method use to convert the readers from VTK 5 + // multiblock API to the current composite data infrastructure + label GetNumberOfDataSets + ( + vtkMultiBlockDataSet* output, + unsigned int blockNo + ); + //- Reset data counters void resetCounters(); diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddFields.H b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddFields.H index 357e260b1f..4cf48293e7 100644 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddFields.H +++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamAddFields.H @@ -22,8 +22,8 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -InClass - Foam::vtkPV3Foam +Class + vtkPV3Foam \*---------------------------------------------------------------------------*/ diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertLagrangianFields.H b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertLagrangianFields.H index c52e3d69bd..9de17ee561 100644 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertLagrangianFields.H +++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertLagrangianFields.H @@ -22,8 +22,8 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -InClass - Foam::vtkPV3Foam +Class + vtkPV3Foam \*---------------------------------------------------------------------------*/ @@ -102,7 +102,7 @@ void Foam::vtkPV3Foam::convertLagrangianField { vtkUnstructuredGrid* lagrangianMesh = vtkUnstructuredGrid::SafeDownCast ( - output->GetDataSet(LAGRANGIAN, 0) + GetDataSetFromBlock(output, LAGRANGIAN, 0) ); vtkFloatArray *pointTypes = vtkFloatArray::New(); @@ -144,7 +144,7 @@ void Foam::vtkPV3Foam::convertLagrangianField { vtkUnstructuredGrid* lagrangianMesh = vtkUnstructuredGrid::SafeDownCast ( - output->GetDataSet(LAGRANGIAN, 0) + GetDataSetFromBlock(output, LAGRANGIAN, 0) ); vtkFloatArray *pointScalars = vtkFloatArray::New(); diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertMesh.C b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertMesh.C index 95a0797081..2edace96dc 100644 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertMesh.C +++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertMesh.C @@ -65,7 +65,8 @@ void Foam::vtkPV3Foam::convertMeshVolume vtkUnstructuredGrid* ugrid = vtkUnstructuredGrid::New(); SetName(ugrid, "internalMesh"); addVolumeMesh(mesh, ugrid, superCells_); - output->SetDataSet(VOLUME, 0, ugrid); + AddToBlock(output, VOLUME, 0, ugrid); +// reader_->SetBlock(output->GetNumberOfBlocks(), ugrid); selectedRegionDatasetIds_[VOLUME] = 0; ugrid->Delete(); } @@ -96,7 +97,7 @@ void Foam::vtkPV3Foam::convertMeshLagrangian vtkUnstructuredGrid* ugrid = vtkUnstructuredGrid::New(); addLagrangianMesh(mesh, ugrid); - output->SetDataSet(LAGRANGIAN, 0, ugrid); + AddToBlock(output, LAGRANGIAN, 0, ugrid); selectedRegionDatasetIds_[LAGRANGIAN] = 0; ugrid->Delete(); } @@ -141,8 +142,8 @@ void Foam::vtkPV3Foam::convertMeshPatches const label patchId = mesh.boundaryMesh() .findPatchID(regionName); addPatchMesh(patches[patchId], ugrid); - const label nextId = output->GetNumberOfDataSets(VOLUME); - output->SetDataSet(VOLUME, nextId, ugrid); + const label nextId = GetNumberOfDataSets(output, VOLUME); + AddToBlock(output, VOLUME, nextId, ugrid); selectedRegionDatasetIds_[i] = nextId; ugrid->Delete(); } @@ -188,14 +189,14 @@ void Foam::vtkPV3Foam::convertMeshCellSet vtkUnstructuredGrid* ugrid = vtkUnstructuredGrid::New(); SetName(ugrid, cSetName.c_str()); - const label nextId = output->GetNumberOfDataSets(CELLSET); + const label nextId = GetNumberOfDataSets(output, CELLSET); addVolumeMesh ( subsetter.subMesh(), ugrid, superCellSetCells_[nextId] ); - output->SetDataSet(CELLSET, nextId, ugrid); + AddToBlock(output, CELLSET, nextId, ugrid); selectedRegionDatasetIds_[i] = nextId; ugrid->Delete(); } @@ -245,8 +246,8 @@ void Foam::vtkPV3Foam::convertMeshFaceSet fSet, ugrid ); - const label nextId = output->GetNumberOfDataSets(FACESET); - output->SetDataSet(FACESET, nextId, ugrid); + const label nextId = GetNumberOfDataSets(output, FACESET); + AddToBlock(output, FACESET, nextId, ugrid); selectedRegionDatasetIds_[i] = nextId; ugrid->Delete(); } @@ -296,8 +297,8 @@ void Foam::vtkPV3Foam::convertMeshPointSet pSet, ugrid ); - const label nextId = output->GetNumberOfDataSets(POINTSET); - output->SetDataSet(POINTSET, nextId, ugrid); + label nextId = GetNumberOfDataSets(output, POINTSET); + AddToBlock(output, POINTSET, nextId, ugrid); selectedRegionDatasetIds_[i] = nextId; ugrid->Delete(); } diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertPatchFaceField.H b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertPatchFaceField.H index 938455ed73..db24e17578 100644 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertPatchFaceField.H +++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertPatchFaceField.H @@ -22,8 +22,8 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -InClass - Foam::vtkPV3Foam +Class + vtkPV3Foam \*---------------------------------------------------------------------------*/ @@ -49,7 +49,7 @@ void Foam::vtkPV3Foam::convertPatchFaceField { vtkUnstructuredGrid* vtkMesh = vtkUnstructuredGrid::SafeDownCast ( - output->GetDataSet(VOLUME, regioni) + GetDataSetFromBlock(output, VOLUME, regioni) ); vtkFloatArray *cellTypes = vtkFloatArray::New(); @@ -87,7 +87,7 @@ void Foam::vtkPV3Foam::convertPatchFaceField { vtkUnstructuredGrid* vtkMesh = vtkUnstructuredGrid::SafeDownCast ( - output->GetDataSet(VOLUME, regioni) + GetDataSetFromBlock(output, VOLUME, regioni) ); vtkFloatArray *cellScalars = vtkFloatArray::New(); diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertPatchPointField.H b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertPatchPointField.H index 50c258d1b0..2ec93dffdc 100644 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertPatchPointField.H +++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertPatchPointField.H @@ -22,8 +22,8 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -InClass - Foam::vtkPV3Foam +Class + vtkPV3Foam \*---------------------------------------------------------------------------*/ @@ -46,7 +46,7 @@ void Foam::vtkPV3Foam::convertPatchPointField { vtkUnstructuredGrid* vtkMesh = vtkUnstructuredGrid::SafeDownCast ( - output->GetDataSet(VOLUME, regioni) + GetDataSetFromBlock(output, VOLUME, regioni) ); vtkFloatArray *pointTypes = vtkFloatArray::New(); @@ -83,7 +83,7 @@ void Foam::vtkPV3Foam::convertPatchPointField { vtkUnstructuredGrid* vtkMesh = vtkUnstructuredGrid::SafeDownCast ( - output->GetDataSet(VOLUME, regioni) + GetDataSetFromBlock(output, VOLUME, regioni) ); vtkFloatArray *pointScalars = vtkFloatArray::New(); diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertPointFields.H b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertPointFields.H index 19777cc109..4e6fe75065 100644 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertPointFields.H +++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertPointFields.H @@ -22,8 +22,8 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -InClass - Foam::vtkPV3Foam +Class + vtkPV3Foam \*---------------------------------------------------------------------------*/ @@ -130,7 +130,7 @@ void Foam::vtkPV3Foam::convertPointField { vtkUnstructuredGrid* internalMesh = vtkUnstructuredGrid::SafeDownCast ( - output->GetDataSet(VOLUME, 0) + GetDataSetFromBlock(output, VOLUME, 0) ); vtkFloatArray *pointTypes = vtkFloatArray::New(); @@ -197,7 +197,7 @@ void Foam::vtkPV3Foam::convertPointField { vtkUnstructuredGrid* internalMesh = vtkUnstructuredGrid::SafeDownCast ( - output->GetDataSet(VOLUME, 0) + GetDataSetFromBlock(output, VOLUME, 0) ); vtkFloatArray *pointScalars = vtkFloatArray::New(); diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertVolFields.H b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertVolFields.H index f4520f0d74..e27af752bb 100644 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertVolFields.H +++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamConvertVolFields.H @@ -22,8 +22,8 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -InClass - Foam::vtkPV3Foam +Class + vtkPV3Foam \*---------------------------------------------------------------------------*/ @@ -177,10 +177,10 @@ void Foam::vtkPV3Foam::convertVolField { vtkUnstructuredGrid* internalMesh = vtkUnstructuredGrid::SafeDownCast ( - output->GetDataSet(VOLUME, 0) + GetDataSetFromBlock(output, VOLUME, 0) ); - vtkFloatArray *cellTypes = vtkFloatArray::New(); + vtkFloatArray* cellTypes = vtkFloatArray::New(); cellTypes->SetNumberOfTuples(superCells_.size()); cellTypes->SetNumberOfComponents(Type::nComponents); cellTypes->Allocate(Type::nComponents*superCells_.size()); @@ -220,7 +220,7 @@ void Foam::vtkPV3Foam::convertVolField { vtkUnstructuredGrid* internalMesh = vtkUnstructuredGrid::SafeDownCast ( - output->GetDataSet(VOLUME, 0) + GetDataSetFromBlock(output, VOLUME, 0) ); vtkFloatArray *cellScalars = vtkFloatArray::New(); diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamInsertNextPoint.H b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamInsertNextPoint.H index 307fc811cc..107296e5fd 100644 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamInsertNextPoint.H +++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamInsertNextPoint.H @@ -22,8 +22,8 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -InClass - Foam::vtkPV3Foam +Class + vtkPV3Foam \*---------------------------------------------------------------------------*/ diff --git a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInformationFields.H b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInformationFields.H index fc32fc260f..da6f766bcf 100644 --- a/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInformationFields.H +++ b/applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/vtkPV3FoamUpdateInformationFields.H @@ -22,8 +22,8 @@ License along with OpenFOAM; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -InClass - Foam::vtkPV3Foam +Class + vtkPV3Foam \*---------------------------------------------------------------------------*/ diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/axis.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/axis.cfg deleted file mode 100644 index 8657f923a9..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/axis.cfg +++ /dev/null @@ -1,24 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -axis -{ - type word; - description "Form of distance data"; - default distance; - valueList - ( - distance - x - y - z - xyz - ); -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/cloud.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/cloud.cfg deleted file mode 100644 index 89c304e331..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/cloud.cfg +++ /dev/null @@ -1,21 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -cloud -{ - type dictionary; - description "Samples a set of specified points"; - entries - { - include "name.cfg"; - include "axis.cfg"; - include "points.cfg"; - } -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/curve.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/curve.cfg deleted file mode 100644 index 4f70749663..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/curve.cfg +++ /dev/null @@ -1,21 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -curve -{ - type dictionary; - description "Samples a set of specified points that are tracked along a curve"; - entries - { - include "name.cfg"; - include "axis.cfg"; - include "points.cfg"; - } -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/end.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/end.cfg deleted file mode 100644 index 5d2c5b6d05..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/end.cfg +++ /dev/null @@ -1,15 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -end -{ - type vector; - description "End point on sampling line"; -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/face.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/face.cfg deleted file mode 100644 index d00a4a76c4..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/face.cfg +++ /dev/null @@ -1,22 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -face -{ - type dictionary; - description "One sampling point per face intersection"; - entries - { - include "name.cfg"; - include "axis.cfg"; - include "start.cfg"; - include "end.cfg"; - } -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/midPoint.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/midPoint.cfg deleted file mode 100644 index 5930161b49..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/midPoint.cfg +++ /dev/null @@ -1,22 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -midPoint -{ - type dictionary; - description "One sampling point per cell, between two face intersections"; - entries - { - include "name.cfg"; - include "axis.cfg"; - include "start.cfg"; - include "end.cfg"; - } -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/midPointAndFace.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/midPointAndFace.cfg deleted file mode 100644 index bb492b5c18..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/midPointAndFace.cfg +++ /dev/null @@ -1,22 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -midPointAndFace -{ - type dictionary; - description "One sampling point per intersected face and one per cell, between two face intersections"; - entries - { - include "name.cfg"; - include "axis.cfg"; - include "start.cfg"; - include "end.cfg"; - } -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/nPoints.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/nPoints.cfg deleted file mode 100644 index aba1b8a868..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/nPoints.cfg +++ /dev/null @@ -1,15 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -nPoints -{ - type label; - description "Number of points on sampling line"; -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/name.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/name.cfg deleted file mode 100644 index 4ab16bf9d8..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/name.cfg +++ /dev/null @@ -1,15 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -name -{ - type word; - description "Name of sampling set"; -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/points.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/points.cfg deleted file mode 100644 index 3b4f47ebbe..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/points.cfg +++ /dev/null @@ -1,16 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -points -{ - type list; - description "List of points to be sampled"; - elementType vector; -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/sample.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/sample.cfg deleted file mode 100644 index 9cf95d9ae5..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/sample.cfg +++ /dev/null @@ -1,71 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ -// sample tool definition - -description "Line sampling"; - -sampleDict -{ - type dictionary; - description "sample control dictionary"; - dictionaryPath "system"; - - entries - { - arguments - { - type rootCaseTimeArguments; - } - - interpolationScheme - { - type word; - description "Sampling interpolation scheme"; - default cellPoint; - valueList - ( - cell - cellPoint - cellPointFace - ); - } - - writeFormat - { - type word; - description "Output format of data"; - default raw; - valueList - ( - raw - gnuplot - xmgr - jplot - ); - } - - sampleSets - { - type list; - description "List of sampling sets"; - elementType - { - include "sampleSet.cfg"; - } - } - - fields - { - type list; - description "List of fields to be sampled"; - elementType word; - } - } -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/sampleSet.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/sampleSet.cfg deleted file mode 100644 index 9248dc4aec..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/sampleSet.cfg +++ /dev/null @@ -1,23 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -sampleSet -{ - type selection; - entries - { - include "uniform.cfg"; - include "face.cfg"; - include "midPoint.cfg"; - include "midPointAndFace.cfg"; - include "curve.cfg"; - include "cloud.cfg"; - } -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/start.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/start.cfg deleted file mode 100644 index 5382f60eb8..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/start.cfg +++ /dev/null @@ -1,15 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -start -{ - type vector; - description "Start point on sampling line"; -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/tensorFieldSample.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/tensorFieldSample.cfg deleted file mode 100644 index 1aee8b66ce..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/tensorFieldSample.cfg +++ /dev/null @@ -1,43 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -tensorFieldSample -{ - type compound; - description "Tensor field to be sampled"; - entries - { - name - { - type word; - description "Field name"; - } - - component - { - type word; - description "Tensor component(s)"; - valueList - ( - xx - xy - xz - yx - yy - yz - zx - zy - zz - mag - full - ); - } - } -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/uniform.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/uniform.cfg deleted file mode 100644 index e382ed1e44..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/uniform.cfg +++ /dev/null @@ -1,23 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -uniform -{ - type dictionary; - description "Uniform distribution of points on a line"; - entries - { - include "name.cfg"; - include "axis.cfg"; - include "start.cfg"; - include "end.cfg"; - include "nPoints.cfg"; - } -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/FoamX/vectorFieldSample.cfg b/applications/utilities/postProcessing/sampling/sample/FoamX/vectorFieldSample.cfg deleted file mode 100644 index 89d901d975..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/FoamX/vectorFieldSample.cfg +++ /dev/null @@ -1,37 +0,0 @@ -/*---------------------------------------------------------------------------*\ -| ========= | | -| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | -| \\ / O peration | Version: 1.0 | -| \\ / A nd | Web: http://www.openfoam.org | -| \\/ M anipulation | | -\*---------------------------------------------------------------------------*/ - -vectorFieldSample -{ - type compound; - description "Vector field to be sampled"; - entries - { - name - { - type word; - description "Field name"; - } - - component - { - type word; - description "Vector component(s)"; - valueList - ( - x - y - z - mag - full - ); - } - } -} - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/Make/files b/applications/utilities/postProcessing/sampling/sample/Make/files deleted file mode 100644 index d8193c0500..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/Make/files +++ /dev/null @@ -1,19 +0,0 @@ -combineSampleSets.C -sample.C - -writers/writer/writers.C -writers/xmgr/xmgrWriters.C -writers/gnuplot/gnuplotWriters.C -writers/jplot/jplotWriters.C -writers/raw/rawWriters.C - -sampleSets/coordSet/coordSet.C -sampleSets/sampleSet/sampleSet.C -sampleSets/cloud/cloudSet.C -sampleSets/face/faceOnlySet.C -sampleSets/curve/curveSet.C -sampleSets/uniform/uniformSet.C -sampleSets/midPoint/midPointSet.C -sampleSets/midPointAndFace/midPointAndFaceSet.C - -EXE = $(FOAM_APPBIN)/sample diff --git a/applications/utilities/postProcessing/sampling/sample/combineSampleSets.C b/applications/utilities/postProcessing/sampling/sample/combineSampleSets.C deleted file mode 100644 index 276eb1021a..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/combineSampleSets.C +++ /dev/null @@ -1,120 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2007 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 - -\*---------------------------------------------------------------------------*/ - - -#include "Pstream.H" -#include "ListListOps.H" -#include "combineSampleSets.H" -#include "SortableList.H" -#include "IndirectList.H" - -using namespace Foam; - -// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // - -// Combine points from all processors. Sort by curveDist and produce -// index list. Valid result only on master processor. -void combineSampleSets -( - const PtrList& sampleSets, - PtrList& masterSampleSets, - labelListList& indexSets -) -{ - forAll(sampleSets, setI) - { - const sampleSet& samplePts = sampleSets[setI]; - - // Collect data from all processors - List > gatheredPts(Pstream::nProcs()); - gatheredPts[Pstream::myProcNo()] = samplePts; - Pstream::gatherList(gatheredPts); - - List gatheredSegments(Pstream::nProcs()); - gatheredSegments[Pstream::myProcNo()] = samplePts.segments(); - Pstream::gatherList(gatheredSegments); - - List gatheredDist(Pstream::nProcs()); - gatheredDist[Pstream::myProcNo()] = samplePts.curveDist(); - Pstream::gatherList(gatheredDist); - - - // Combine processor lists into one big list. - List allPts - ( - ListListOps::combine > - ( - gatheredPts, accessOp >() - ) - ); - labelList allSegments - ( - ListListOps::combine - ( - gatheredSegments, accessOp() - ) - ); - scalarList allCurveDist - ( - ListListOps::combine - ( - gatheredDist, accessOp() - ) - ); - - // Sort curveDist and use to fill masterSamplePts - SortableList sortedDist(allCurveDist); - indexSets[setI] = sortedDist.indices(); - - // Get reference point (note: only master has all points) - point refPt; - - if (allPts.size() > 0) - { - refPt = samplePts.getRefPoint(allPts); - } - else - { - refPt = vector::zero; - } - - - masterSampleSets.set - ( - setI, - new coordSet - ( - samplePts.name(), - samplePts.axis(), - IndirectList(allPts, indexSets[setI]), - refPt - ) - ); - } -} - - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/combineSampleSets.H b/applications/utilities/postProcessing/sampling/sample/combineSampleSets.H deleted file mode 100644 index 3dc889ed49..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/combineSampleSets.H +++ /dev/null @@ -1,60 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2007 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 - -InClass - Foam::combineSampleSets - -Description - Various utility functions for collection of samples on processors. - -SourceFiles - combineSampleSets.C - -\*---------------------------------------------------------------------------*/ - -#ifndef combineSampleSets_H -#define combineSampleSets_H - -#include "labelList.H" -#include "PtrList.H" -#include "coordSet.H" -#include "sampleSet.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -// Combine points from all processors. Sort by curveDist and produce -// index list. Valid result only on master processor. -void combineSampleSets -( - const Foam::PtrList& sampleSets, - Foam::PtrList& masterSampleSets, - Foam::labelListList& indexSets -); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/applications/utilities/postProcessing/sampling/sample/combineSampleValues.C b/applications/utilities/postProcessing/sampling/sample/combineSampleValues.C deleted file mode 100644 index adbf92f1ba..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/combineSampleValues.C +++ /dev/null @@ -1,86 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2007 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 - -\*---------------------------------------------------------------------------*/ - - -#include "combineSampleValues.H" -#include "Pstream.H" -#include "ListListOps.H" -#include "IndirectList.H" - -using namespace Foam; - -// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * // - -// Combine values from all processors. Valid result only on master processor. -template -void combineSampleValues -( - const PtrList >& sampledFields, - const labelListList& indexSets, - PtrList >& masterFields -) -{ - forAll(sampledFields, fieldI) - { - List > masterValues(indexSets.size()); - - forAll(indexSets, setI) - { - // Collect data from all processors - List > gatheredData(Pstream::nProcs()); - gatheredData[Pstream::myProcNo()] = sampledFields[fieldI][setI]; - Pstream::gatherList(gatheredData); - - if (Pstream::master()) - { - Field allData - ( - ListListOps::combine > - ( - gatheredData, - Foam::accessOp >() - ) - ); - - masterValues[setI] = - IndirectList(allData, indexSets[setI])(); - } - } - masterFields.set - ( - fieldI, - new volFieldSampler - ( - masterValues, - sampledFields[fieldI].name() - ) - ); - } -} - - -// ************************************************************************* // - diff --git a/applications/utilities/postProcessing/sampling/sample/sample.C b/applications/utilities/postProcessing/sampling/sample/sample.C deleted file mode 100644 index 18cd64e869..0000000000 --- a/applications/utilities/postProcessing/sampling/sample/sample.C +++ /dev/null @@ -1,887 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 1991-2007 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 - Sample field data with a choice of interpolation schemes, sampling options - and write formats. - - interpolationScheme : choice of - cell : use cell-centre value only; constant over cells - cellPoint : use cell-centre and vertex values - cellPointFace : use cell-centre, vertex and face values. - - sample: choice of - uniform evenly distributed points on line - face one point per face intersection - midPoint one point per cell, inbetween two face intersections - midPointAndFace combination of face and midPoint - - curve specified points, not nessecary on line, uses - tracking - cloud specified points, uses findCell - - writeFormat : choice of - xmgr - jplot - gnuplot - raw - -\*---------------------------------------------------------------------------*/ - -#include "Pstream.H" -#include "argList.H" -#include "OSspecific.H" - -#include "Cloud.H" -#include "passiveParticle.H" -#include "meshSearch.H" -#include "interpolation.H" -#include "volPointInterpolation.H" - -#include "writer.H" -#include "sampleSet.H" -#include "volFieldSampler.H" -#include "dictionaryEntry.H" - -#include "combineSampleSets.H" -#include "combineSampleValues.H" - -using namespace Foam; - - -template -void writeSampleFile -( - const coordSet& masterSampleSet, - const PtrList >& masterFields, - const label setI, - const fileName& timeDir, - const word& writeFormat -) -{ - if (masterFields.size() > 0) - { - wordList valueSetNames(masterFields.size()); - List*> valueSets(masterFields.size()); - - forAll(masterFields, fieldI) - { - valueSetNames[fieldI] = masterFields[fieldI].name(); - valueSets[fieldI] = &masterFields[fieldI][setI]; - } - - autoPtr > formatter - ( - writer::New(writeFormat) - ); - - fileName fName - ( - timeDir/formatter().getFileName(masterSampleSet, valueSetNames) - ); - - Info<< "Writing fields to " << fName << endl; - - formatter().write - ( - masterSampleSet, - valueSetNames, - valueSets, - OFstream(fName)() - ); - } -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -// Main program: - -int main(int argc, char *argv[]) -{ -# include "addTimeOptions.H" -# include "setRootCase.H" - -# include "createTime.H" - - // Get times list - instantList Times = runTime.times(); - - // set startTime and endTime depending on -time and -latestTime options -# include "checkTimeOptions.H" - - runTime.setTime(Times[startTime], startTime); - -# include "createMesh.H" - - // - // Hack: initialize Cloud to initialize the processor table so from - // now on we can use cloud on single processors only. - // - Cloud dummyCloud(mesh, IDLList()); - - // Read control dictionary - IOdictionary sampleDict - ( - IOobject - ( - "sampleDict", - runTime.system(), - mesh, - IOobject::MUST_READ, - IOobject::NO_WRITE - ) - ); - - const word interpolationScheme(sampleDict.lookup("interpolationScheme")); - const wordList fieldNames = sampleDict.lookup("fields"); - - // - // Construct writers - // - - word writeFormat(sampleDict.lookup("writeFormat")); - - // - // Construct interpolation dictionary (same interpolation for all fields) - // - - dictionary interpolationSchemes; - - forAll(fieldNames, fieldI) - { - interpolationSchemes.add - ( - fieldNames[fieldI], - interpolationScheme - ); - } - - // Set up interpolation - autoPtr pMeshPtr(new pointMesh(mesh)); - autoPtr pInterpPtr - ( - new volPointInterpolation(mesh, pMeshPtr()) - ); - - // Set up mesh searching - meshSearch searchEngine(mesh, true); - - - fileName samplePath; - - if (Pstream::master()) - { - if (Pstream::parRun()) - { - samplePath = runTime.path()/".."/"samples"; - } - else - { - samplePath = runTime.path()/"samples"; - } - - if (exists(samplePath)) - { - Info<< "Deleting samples/ directory" << endl << endl; - rmDir(samplePath); - } - } - - fileName oldPointsDir("constant"); - - for (label i=startTime; i > sampledScalarFields - ( - fieldNames.size() - ); - PtrList > sampledVectorFields - ( - fieldNames.size() - ); - PtrList > sampledSphericalTensorFields - ( - fieldNames.size() - ); - PtrList > sampledSymmTensorFields - ( - fieldNames.size() - ); - PtrList > sampledTensorFields - ( - fieldNames.size() - ); - - // - // Do actual interpolation - // - - label nScalarFields = 0; - label nVectorFields = 0; - label nSphericalTensorFields = 0; - label nSymmTensorFields = 0; - label nTensorFields = 0; - - forAll(fieldNames, fieldI) - { - const word& fieldName = fieldNames[fieldI]; - - IOobject fieldHeader - ( - fieldName, - runTime.timeName(), - mesh, - IOobject::MUST_READ - ); - - // Determine number of processor actually having this field - label fieldFound = (fieldHeader.headerOk() ? 1 : 0); - reduce(fieldFound, sumOp