From e80f84db8d2fc93a4d243e0bc54a1a18464e5dab Mon Sep 17 00:00:00 2001 From: andy Date: Wed, 30 Apr 2008 18:17:31 +0100 Subject: [PATCH 1/9] added turbulentMixingLengthFrequencyInlet (- for turbulence omega) --- ...ngLengthFrequencyInletFvPatchScalarField.C | 161 +++++++++++++++++ ...ngLengthFrequencyInletFvPatchScalarField.H | 168 ++++++++++++++++++ 2 files changed, 329 insertions(+) create mode 100644 src/finiteVolume/fields/fvPatchFields/derived/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C create mode 100644 src/finiteVolume/fields/fvPatchFields/derived/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C new file mode 100644 index 0000000000..d14d18abe8 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C @@ -0,0 +1,161 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2006-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 "turbulentMixingLengthFrequencyInletFvPatchScalarField.H" +#include "addToRunTimeSelectionTable.H" +#include "fvPatchFieldMapper.H" +#include "surfaceFields.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +turbulentMixingLengthFrequencyInletFvPatchScalarField:: +turbulentMixingLengthFrequencyInletFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF +) +: + fixedValueFvPatchField(p, iF), + mixingLength_(0.0), + kName_("undefined-k") +{} + +turbulentMixingLengthFrequencyInletFvPatchScalarField:: +turbulentMixingLengthFrequencyInletFvPatchScalarField +( + const turbulentMixingLengthFrequencyInletFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchField(ptf, p, iF, mapper), + mixingLength_(ptf.mixingLength_), + kName_(ptf.kName_) +{} + +turbulentMixingLengthFrequencyInletFvPatchScalarField:: +turbulentMixingLengthFrequencyInletFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + fixedValueFvPatchField(p, iF, dict), + mixingLength_(readScalar(dict.lookup("mixingLength"))), + kName_(dict.lookup("k")) +{} + +turbulentMixingLengthFrequencyInletFvPatchScalarField:: +turbulentMixingLengthFrequencyInletFvPatchScalarField +( + const turbulentMixingLengthFrequencyInletFvPatchScalarField& ptf +) +: + fixedValueFvPatchField(ptf), + mixingLength_(ptf.mixingLength_), + kName_(ptf.kName_) +{} + +turbulentMixingLengthFrequencyInletFvPatchScalarField:: +turbulentMixingLengthFrequencyInletFvPatchScalarField +( + const turbulentMixingLengthFrequencyInletFvPatchScalarField& ptf, + const DimensionedField& iF +) +: + fixedValueFvPatchField(ptf, iF), + mixingLength_(ptf.mixingLength_), + kName_(ptf.kName_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void turbulentMixingLengthFrequencyInletFvPatchScalarField::updateCoeffs() +{ + if (updated()) + { + return; + } + + // Lookup Cmu corresponding to the turbulence model selected + const dictionary& turbulenceProperties = db().lookupObject + ( + "turbulenceProperties" + ); + + const dictionary& turbulenceCoeffs = turbulenceProperties.subDict + ( + word(turbulenceProperties.lookup("turbulenceModel")) + "Coeffs" + ); + + scalar Cmu = dimensionedScalar(turbulenceCoeffs.lookup("Cmu")).value(); + scalar Cmu25 = pow(Cmu, 0.25); + + const fvPatchField& kp = + patch().lookupPatchField(kName_); + + operator==(sqrt(kp)/(Cmu25*mixingLength_)); + + fixedValueFvPatchField::updateCoeffs(); +} + + +void turbulentMixingLengthFrequencyInletFvPatchScalarField::write +( + Ostream& os +) const +{ + fvPatchField::write(os); + os.writeKeyword("mixingLength") + << mixingLength_ << token::END_STATEMENT << nl; + os.writeKeyword("k") << kName_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + turbulentMixingLengthFrequencyInletFvPatchScalarField +); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H new file mode 100644 index 0000000000..621741e05e --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.H @@ -0,0 +1,168 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2006-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 + +Class + Foam::turbulentMixingLengthDissipationRateInletFvPatchScalarField + +Description + Calculate omega via the mixing length + + Example of the boundary condition specification: + @verbatim + inlet + { + type turbulentMixingLengthFrequencyInlet; + mixingLength 0.005; // 5 mm + k k; // turbulent k field + value uniform 5; // initial value + } + @endverbatim + +SourceFiles + turbulentMixingLengthFrequencyInletFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef turbulentMixingLengthFrequencyInletFvPatchScalarField_H +#define turbulentMixingLengthFrequencyInletFvPatchScalarField_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class turbulentMixingLengthFrequencyInletFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class turbulentMixingLengthFrequencyInletFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ + // Private data + + //- Turbulent length scale + scalar mixingLength_; + + //- Name of the turbulent kinetic energy field + word kName_; + + +public: + + //- Runtime type information + TypeName("turbulentMixingLengthFrequencyInlet"); + + + // Constructors + + //- Construct from patch and internal field + turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given + // turbulentMixingLengthFrequencyInletFvPatchScalarField + // onto a new patch + turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + const turbulentMixingLengthFrequencyInletFvPatchScalarField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + const turbulentMixingLengthFrequencyInletFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp clone() const + { + return tmp + ( + new turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + *this + ) + ); + } + + //- Construct as copy setting internal field reference + turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + const turbulentMixingLengthFrequencyInletFvPatchScalarField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp clone + ( + const DimensionedField& iF + ) const + { + return tmp + ( + new turbulentMixingLengthFrequencyInletFvPatchScalarField + ( + *this, + iF + ) + ); + } + + + // Member functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // From cd161a338507b5db29bfd38ba5610243b8d00b91 Mon Sep 17 00:00:00 2001 From: henry Date: Thu, 1 May 2008 15:39:17 +0100 Subject: [PATCH 2/9] Updated PV3Foam reader --- .../PV3FoamReader/vtkPV3FoamReader.cxx | 2 +- .../PV3FoamReader/vtkPV3FoamReader.h | 4 +- .../vtkPV3Foam/Make/options.save | 16 ---- .../PV3FoamReader/vtkPV3Foam/vtkPV3Foam.C | 74 +++++++++++++++++-- .../PV3FoamReader/vtkPV3Foam/vtkPV3Foam.H | 30 +++++++- .../vtkPV3Foam/vtkPV3FoamAddFields.H | 4 +- .../vtkPV3FoamConvertLagrangianFields.H | 8 +- .../vtkPV3Foam/vtkPV3FoamConvertMesh.C | 21 +++--- .../vtkPV3FoamConvertPatchFaceField.H | 8 +- .../vtkPV3FoamConvertPatchPointField.H | 8 +- .../vtkPV3Foam/vtkPV3FoamConvertPointFields.H | 8 +- .../vtkPV3Foam/vtkPV3FoamConvertVolFields.H | 10 +-- .../vtkPV3Foam/vtkPV3FoamInsertNextPoint.H | 4 +- .../vtkPV3FoamUpdateInformationFields.H | 4 +- 14 files changed, 140 insertions(+), 61 deletions(-) delete mode 100755 applications/utilities/postProcessing/graphics/PV3FoamReader/vtkPV3Foam/Make/options.save 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 \*---------------------------------------------------------------------------*/ From 8bcbf3533a0ae924c36e79e9ab637f3bad7ec595 Mon Sep 17 00:00:00 2001 From: henry Date: Thu, 1 May 2008 16:09:21 +0100 Subject: [PATCH 3/9] Update sampling to include surface and line sampling functionObjects --- src/sampling/Make/files | 37 +- src/sampling/Make/options | 3 +- .../IOOutputFilter/IOOutputFilter.C | 2 +- .../IOOutputFilter/IOOutputFilter.H | 6 +- src/sampling/probes/probes.H | 5 + src/sampling/sampledSet/cloud/cloudSet.C | 171 ++++++ .../cloud/cloudSet.H} | 98 ++-- src/sampling/sampledSet/coordSet/coordSet.C | 174 ++++++ src/sampling/sampledSet/coordSet/coordSet.H | 145 +++++ src/sampling/sampledSet/curve/curveSet.C | 415 +++++++++++++++ src/sampling/sampledSet/curve/curveSet.H | 142 +++++ src/sampling/sampledSet/face/faceOnlySet.C | 393 ++++++++++++++ src/sampling/sampledSet/face/faceOnlySet.H | 154 ++++++ .../sampledSet/midPoint/midPointSet.C | 165 ++++++ .../sampledSet/midPoint/midPointSet.H | 105 ++++ .../midPointAndFace/midPointAndFaceSet.C | 191 +++++++ .../midPointAndFace/midPointAndFaceSet.H | 106 ++++ .../sampledSet/sampledSet/sampledSet.C | 467 ++++++++++++++++ .../sampledSet/sampledSet/sampledSet.H | 301 +++++++++++ .../sampledSet/sampledSets/IOsampledSets.H | 50 ++ .../sampledSet/sampledSets/sampledSets.C | 368 +++++++++++++ .../sampledSet/sampledSets/sampledSets.H | 315 +++++++++++ .../sampledSets/sampledSetsTemplates.C | 353 +++++++++++++ .../sampledSetsFunctionObject.C} | 6 +- .../sampledSetsFunctionObject.H | 55 ++ src/sampling/sampledSet/uniform/uniformSet.C | 498 ++++++++++++++++++ src/sampling/sampledSet/uniform/uniformSet.H | 162 ++++++ .../sampledSet/writers/gnuplot/gnuplot.C | 100 ++++ .../sampledSet/writers/gnuplot/gnuplot.H | 105 ++++ .../writers/gnuplot/gnuplotWriters.C | 45 ++ .../writers/gnuplot/gnuplotWriters.H | 62 +++ src/sampling/sampledSet/writers/jplot/jplot.C | 106 ++++ src/sampling/sampledSet/writers/jplot/jplot.H | 115 ++++ .../sampledSet/writers/jplot/jplotWriters.C | 45 ++ .../sampledSet/writers/jplot/jplotWriters.H | 62 +++ src/sampling/sampledSet/writers/raw/raw.C | 83 +++ src/sampling/sampledSet/writers/raw/raw.H | 106 ++++ .../writers}/raw/rawWriters.C | 4 +- .../writers}/raw/rawWriters.H | 9 +- .../sampledSet/writers/writer/writer.C | 205 +++++++ .../sampledSet/writers/writer/writer.H | 239 +++++++++ .../sampledSet/writers/writer/writers.C | 57 ++ .../sampledSet/writers/writer/writers.H | 59 +++ src/sampling/sampledSet/writers/xmgr/xmgr.C | 89 ++++ src/sampling/sampledSet/writers/xmgr/xmgr.H | 105 ++++ .../sampledSet/writers/xmgr/xmgrWriters.C | 45 ++ .../sampledSet/writers/xmgr/xmgrWriters.H | 62 +++ .../sampledSurface/patch/sampledPatch.C | 91 +--- .../sampledSurface/patch/sampledPatch.H | 18 +- .../patch/sampledPatchTemplates.C | 103 ++++ .../sampledSurface/plane/sampledPlane.C | 74 +-- .../sampledSurface/plane/sampledPlane.H | 18 +- .../plane/sampledPlaneTemplates.C | 79 +++ .../sampledSurface.C | 35 +- .../sampledSurface.H | 73 +-- .../sampledSurfaceTemplates.C | 0 .../IOsampledSurfaces.C.save | 0 .../IOsampledSurfaces.H | 0 .../IOsampledSurfaces.H.save | 0 .../sampledSurfaces.C | 43 +- .../sampledSurfaces.H | 44 +- .../sampledSurfacesTemplates.C | 29 +- .../sampledSurfacesFunctionObject.C | 43 ++ .../sampledSurfacesFunctionObject.H} | 11 +- .../surfacesFunctionObject.C.save | 164 ------ .../writers}/dx/dx.C | 0 .../writers}/dx/dx.H | 2 +- .../writers}/dx/dxWriters.C | 2 +- .../writers}/dx/dxWriters.H | 0 .../writers}/foamFile/foamFile.C | 0 .../writers}/foamFile/foamFile.H | 0 .../writers}/foamFile/foamFileWriters.C | 2 +- .../writers}/foamFile/foamFileWriters.H | 0 .../writers}/null/null.C | 0 .../writers}/null/null.H | 2 +- .../writers}/null/nullWriters.C | 2 +- .../writers}/null/nullWriters.H | 0 .../writers/raw/rawSurfaceWriter.C} | 24 +- .../writers/raw/rawSurfaceWriter.H} | 22 +- .../writers/raw/rawSurfaceWriters.C | 43 ++ .../writers/raw/rawSurfaceWriters.H | 63 +++ .../writers}/stl/stl.C | 0 .../writers}/stl/stl.H | 2 +- .../writers}/stl/stlWriters.C | 2 +- .../writers}/stl/stlWriters.H | 0 .../writers}/surfaceWriter.C | 0 .../writers}/surfaceWriter.H | 48 +- .../writers}/surfaceWriters.C | 0 .../writers}/surfaceWriters.H | 0 .../writers}/vtk/vtk.C | 0 .../writers}/vtk/vtk.H | 4 +- .../writers}/vtk/vtkWriters.C | 2 +- .../writers}/vtk/vtkWriters.H | 0 93 files changed, 7071 insertions(+), 564 deletions(-) create mode 100644 src/sampling/sampledSet/cloud/cloudSet.C rename src/sampling/{sampledSurface/surfacesFunctionObject/surfacesFunctionObject.H.save => sampledSet/cloud/cloudSet.H} (54%) create mode 100644 src/sampling/sampledSet/coordSet/coordSet.C create mode 100644 src/sampling/sampledSet/coordSet/coordSet.H create mode 100644 src/sampling/sampledSet/curve/curveSet.C create mode 100644 src/sampling/sampledSet/curve/curveSet.H create mode 100644 src/sampling/sampledSet/face/faceOnlySet.C create mode 100644 src/sampling/sampledSet/face/faceOnlySet.H create mode 100644 src/sampling/sampledSet/midPoint/midPointSet.C create mode 100644 src/sampling/sampledSet/midPoint/midPointSet.H create mode 100644 src/sampling/sampledSet/midPointAndFace/midPointAndFaceSet.C create mode 100644 src/sampling/sampledSet/midPointAndFace/midPointAndFaceSet.H create mode 100644 src/sampling/sampledSet/sampledSet/sampledSet.C create mode 100644 src/sampling/sampledSet/sampledSet/sampledSet.H create mode 100644 src/sampling/sampledSet/sampledSets/IOsampledSets.H create mode 100644 src/sampling/sampledSet/sampledSets/sampledSets.C create mode 100644 src/sampling/sampledSet/sampledSets/sampledSets.H create mode 100644 src/sampling/sampledSet/sampledSets/sampledSetsTemplates.C rename src/sampling/{sampledSurface/surfacesFunctionObject/surfacesFunctionObject.C => sampledSet/sampledSetsFunctionObject/sampledSetsFunctionObject.C} (91%) create mode 100644 src/sampling/sampledSet/sampledSetsFunctionObject/sampledSetsFunctionObject.H create mode 100644 src/sampling/sampledSet/uniform/uniformSet.C create mode 100644 src/sampling/sampledSet/uniform/uniformSet.H create mode 100644 src/sampling/sampledSet/writers/gnuplot/gnuplot.C create mode 100644 src/sampling/sampledSet/writers/gnuplot/gnuplot.H create mode 100644 src/sampling/sampledSet/writers/gnuplot/gnuplotWriters.C create mode 100644 src/sampling/sampledSet/writers/gnuplot/gnuplotWriters.H create mode 100644 src/sampling/sampledSet/writers/jplot/jplot.C create mode 100644 src/sampling/sampledSet/writers/jplot/jplot.H create mode 100644 src/sampling/sampledSet/writers/jplot/jplotWriters.C create mode 100644 src/sampling/sampledSet/writers/jplot/jplotWriters.H create mode 100644 src/sampling/sampledSet/writers/raw/raw.C create mode 100644 src/sampling/sampledSet/writers/raw/raw.H rename src/sampling/{surfaceWriters => sampledSet/writers}/raw/rawWriters.C (96%) rename src/sampling/{surfaceWriters => sampledSet/writers}/raw/rawWriters.H (92%) create mode 100644 src/sampling/sampledSet/writers/writer/writer.C create mode 100644 src/sampling/sampledSet/writers/writer/writer.H create mode 100644 src/sampling/sampledSet/writers/writer/writers.C create mode 100644 src/sampling/sampledSet/writers/writer/writers.H create mode 100644 src/sampling/sampledSet/writers/xmgr/xmgr.C create mode 100644 src/sampling/sampledSet/writers/xmgr/xmgr.H create mode 100644 src/sampling/sampledSet/writers/xmgr/xmgrWriters.C create mode 100644 src/sampling/sampledSet/writers/xmgr/xmgrWriters.H create mode 100644 src/sampling/sampledSurface/patch/sampledPatchTemplates.C create mode 100644 src/sampling/sampledSurface/plane/sampledPlaneTemplates.C rename src/sampling/sampledSurface/{surface => sampledSurface}/sampledSurface.C (96%) rename src/sampling/sampledSurface/{surface => sampledSurface}/sampledSurface.H (87%) rename src/sampling/sampledSurface/{surface => sampledSurface}/sampledSurfaceTemplates.C (100%) rename src/sampling/sampledSurface/{surfaces => sampledSurfaces}/IOsampledSurfaces.C.save (100%) rename src/sampling/sampledSurface/{surfaces => sampledSurfaces}/IOsampledSurfaces.H (100%) rename src/sampling/sampledSurface/{surfaces => sampledSurfaces}/IOsampledSurfaces.H.save (100%) rename src/sampling/sampledSurface/{surfaces => sampledSurfaces}/sampledSurfaces.C (91%) rename src/sampling/sampledSurface/{surfaces => sampledSurfaces}/sampledSurfaces.H (90%) rename src/sampling/sampledSurface/{surfaces => sampledSurfaces}/sampledSurfacesTemplates.C (88%) create mode 100644 src/sampling/sampledSurface/sampledSurfacesFunctionObject/sampledSurfacesFunctionObject.C rename src/sampling/sampledSurface/{surfacesFunctionObject/surfacesFunctionObject.H => sampledSurfacesFunctionObject/sampledSurfacesFunctionObject.H} (87%) delete mode 100644 src/sampling/sampledSurface/surfacesFunctionObject/surfacesFunctionObject.C.save rename src/sampling/{surfaceWriters => sampledSurface/writers}/dx/dx.C (100%) rename src/sampling/{surfaceWriters => sampledSurface/writers}/dx/dx.H (99%) rename src/sampling/{surfaceWriters => sampledSurface/writers}/dx/dxWriters.C (98%) rename src/sampling/{surfaceWriters => sampledSurface/writers}/dx/dxWriters.H (100%) rename src/sampling/{surfaceWriters => sampledSurface/writers}/foamFile/foamFile.C (100%) rename src/sampling/{surfaceWriters => sampledSurface/writers}/foamFile/foamFile.H (100%) rename src/sampling/{surfaceWriters => sampledSurface/writers}/foamFile/foamFileWriters.C (98%) rename src/sampling/{surfaceWriters => sampledSurface/writers}/foamFile/foamFileWriters.H (100%) rename src/sampling/{surfaceWriters => sampledSurface/writers}/null/null.C (100%) rename src/sampling/{surfaceWriters => sampledSurface/writers}/null/null.H (99%) rename src/sampling/{surfaceWriters => sampledSurface/writers}/null/nullWriters.C (98%) rename src/sampling/{surfaceWriters => sampledSurface/writers}/null/nullWriters.H (100%) rename src/sampling/{surfaceWriters/raw/raw.C => sampledSurface/writers/raw/rawSurfaceWriter.C} (93%) rename src/sampling/{surfaceWriters/raw/raw.H => sampledSurface/writers/raw/rawSurfaceWriter.H} (94%) create mode 100644 src/sampling/sampledSurface/writers/raw/rawSurfaceWriters.C create mode 100644 src/sampling/sampledSurface/writers/raw/rawSurfaceWriters.H rename src/sampling/{surfaceWriters => sampledSurface/writers}/stl/stl.C (100%) rename src/sampling/{surfaceWriters => sampledSurface/writers}/stl/stl.H (99%) rename src/sampling/{surfaceWriters => sampledSurface/writers}/stl/stlWriters.C (98%) rename src/sampling/{surfaceWriters => sampledSurface/writers}/stl/stlWriters.H (100%) rename src/sampling/{surfaceWriters => sampledSurface/writers}/surfaceWriter.C (100%) rename src/sampling/{surfaceWriters => sampledSurface/writers}/surfaceWriter.H (67%) rename src/sampling/{surfaceWriters => sampledSurface/writers}/surfaceWriters.C (100%) rename src/sampling/{surfaceWriters => sampledSurface/writers}/surfaceWriters.H (100%) rename src/sampling/{surfaceWriters => sampledSurface/writers}/vtk/vtk.C (100%) rename src/sampling/{surfaceWriters => sampledSurface/writers}/vtk/vtk.H (99%) rename src/sampling/{surfaceWriters => sampledSurface/writers}/vtk/vtkWriters.C (98%) rename src/sampling/{surfaceWriters => sampledSurface/writers}/vtk/vtkWriters.H (100%) diff --git a/src/sampling/Make/files b/src/sampling/Make/files index b6c268be3f..9e4a5f1bb4 100644 --- a/src/sampling/Make/files +++ b/src/sampling/Make/files @@ -1,21 +1,38 @@ probes/probes.C probes/probesFunctionObject.C +sampledSet/coordSet/coordSet.C +sampledSet/sampledSet/sampledSet.C +sampledSet/cloud/cloudSet.C +sampledSet/face/faceOnlySet.C +sampledSet/curve/curveSet.C +sampledSet/uniform/uniformSet.C +sampledSet/midPoint/midPointSet.C +sampledSet/midPointAndFace/midPointAndFaceSet.C +sampledSet/sampledSets/sampledSets.C +sampledSet/sampledSetsFunctionObject/sampledSetsFunctionObject.C + +sampledSet/writers/writer/writers.C +sampledSet/writers/xmgr/xmgrWriters.C +sampledSet/writers/gnuplot/gnuplotWriters.C +sampledSet/writers/jplot/jplotWriters.C +sampledSet/writers/raw/rawWriters.C + cuttingPlane/cuttingPlane.C sampledSurface/patch/sampledPatch.C sampledSurface/plane/sampledPlane.C -sampledSurface/surface/sampledSurface.C -sampledSurface/surfaces/sampledSurfaces.C -sampledSurface/surfacesFunctionObject/surfacesFunctionObject.C +sampledSurface/sampledSurface/sampledSurface.C +sampledSurface/sampledSurfaces/sampledSurfaces.C +sampledSurface/sampledSurfacesFunctionObject/sampledSurfacesFunctionObject.C -surfaceWriters/surfaceWriters.C -surfaceWriters/foamFile/foamFileWriters.C -surfaceWriters/dx/dxWriters.C -surfaceWriters/raw/rawWriters.C -surfaceWriters/vtk/vtkWriters.C -surfaceWriters/stl/stlWriters.C -surfaceWriters/null/nullWriters.C +sampledSurface/writers/surfaceWriters.C +sampledSurface/writers/foamFile/foamFileWriters.C +sampledSurface/writers/dx/dxWriters.C +sampledSurface/writers/raw/rawSurfaceWriters.C +sampledSurface/writers/vtk/vtkWriters.C +sampledSurface/writers/stl/stlWriters.C +sampledSurface/writers/null/nullWriters.C graphField/writePatchGraph.C graphField/writeCellGraph.C diff --git a/src/sampling/Make/options b/src/sampling/Make/options index 083733c5a4..5bfdcb260c 100644 --- a/src/sampling/Make/options +++ b/src/sampling/Make/options @@ -1,7 +1,8 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/triSurface/lnInclude + -I$(LIB_SRC)/triSurface/lnInclude \ + -I$(LIB_SRC)/lagrangian/basic/lnInclude LIB_LIBS = \ -lfiniteVolume \ diff --git a/src/sampling/outputFilters/IOOutputFilter/IOOutputFilter.C b/src/sampling/outputFilters/IOOutputFilter/IOOutputFilter.C index 5cc1abbf13..39434d92cb 100644 --- a/src/sampling/outputFilters/IOOutputFilter/IOOutputFilter.C +++ b/src/sampling/outputFilters/IOOutputFilter/IOOutputFilter.C @@ -48,7 +48,7 @@ Foam::IOOutputFilter::IOOutputFilter IOobject::NO_WRITE ) ), - OutputFilter(name(), obr, *this, readFromFiles) + OutputFilter(OutputFilter::typeName, obr, *this, readFromFiles) {} diff --git a/src/sampling/outputFilters/IOOutputFilter/IOOutputFilter.H b/src/sampling/outputFilters/IOOutputFilter/IOOutputFilter.H index fde0f91867..aa095f376f 100644 --- a/src/sampling/outputFilters/IOOutputFilter/IOOutputFilter.H +++ b/src/sampling/outputFilters/IOOutputFilter/IOOutputFilter.H @@ -1,4 +1,4 @@ -/*---------------------------------------------------------------------------*\ +/*---------------------------------------------------------------------------* \ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | @@ -99,14 +99,14 @@ public: virtual void write(); //- Update for changes of mesh - void updateMesh(const mapPolyMesh& mpm) + virtual void updateMesh(const mapPolyMesh& mpm) { read(); OutputFilter::updateMesh(mpm); } //- Update for changes of mesh - void movePoints(const pointField& points) + virtual void movePoints(const pointField& points) { read(); OutputFilter::movePoints(points); diff --git a/src/sampling/probes/probes.H b/src/sampling/probes/probes.H index 267cf42c63..e62fe7a50c 100644 --- a/src/sampling/probes/probes.H +++ b/src/sampling/probes/probes.H @@ -40,6 +40,7 @@ SourceFiles #include "HashPtrTable.H" #include "OFstream.H" +#include "polyMesh.H" #include "pointField.H" #include "volFieldsFwd.H" @@ -207,6 +208,10 @@ public: virtual void movePoints(const pointField&) {} + //- Update for changes of mesh due to readUpdate + virtual void readUpdate(const polyMesh::readUpdateState state) + {} + //- Sample a volume field at all locations template tmp > sample diff --git a/src/sampling/sampledSet/cloud/cloudSet.C b/src/sampling/sampledSet/cloud/cloudSet.C new file mode 100644 index 0000000000..f8fbf8ecdf --- /dev/null +++ b/src/sampling/sampledSet/cloud/cloudSet.C @@ -0,0 +1,171 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "cloudSet.H" +#include "sampledSet.H" +#include "meshSearch.H" +#include "DynamicList.H" +#include "polyMesh.H" +#include "addToRunTimeSelectionTable.H" +#include "word.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(cloudSet, 0); + addToRunTimeSelectionTable(sampledSet, cloudSet, word); +} + + +// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // + +void Foam::cloudSet::calcSamples +( + DynamicList& samplingPts, + DynamicList