diff --git a/src/functionObjects/graphics/runTimePostProcessing/functionObjectCloud.C b/src/functionObjects/graphics/runTimePostProcessing/functionObjectCloud.C index 74df866dff..ce98b41226 100644 --- a/src/functionObjects/graphics/runTimePostProcessing/functionObjectCloud.C +++ b/src/functionObjects/graphics/runTimePostProcessing/functionObjectCloud.C @@ -95,41 +95,14 @@ addGeometryToScene return; } - inputFileName_.clear(); - - // The CloudToVTK functionObject from - // - // lagrangian/intermediate/submodels/CloudFunctionObjects/ - // - // stores file state on cloud OutputProperties itself, - // - // whereas the vtkCloud functionObject treats it like other - // output and stores via the stateFunctionObject. - // Since it uses VTP format, there is only a single file with all fields - // - lookup by cloudName. - - const dictionary& cloudDict = - geometryBase::parent_.mesh().lookupObject - ( - cloudName_ + "OutputProperties" - ); - - if (cloudDict.found("cloudFunctionObject")) - { - const dictionary& foDict = cloudDict.subDict("cloudFunctionObject"); - if (foDict.found(functionObjectName_)) - { - foDict.subDict(functionObjectName_) - .readIfPresent("file", inputFileName_); - } - } - else - { - inputFileName_ = getFileName("file", cloudName_); - } - + // The vtkCloud stores 'file' via the stateFunctionObject + // (lookup by cloudName). + // It only generates VTP format, which means there is a single file + // containing all fields. + inputFileName_ = getFileName("file", cloudName_); inputFileName_.expand(); + if (inputFileName_.empty()) { WarningInFunction @@ -150,17 +123,11 @@ addGeometryToScene dataset = reader->GetOutput(); } - else if (inputFileName_.hasExt("vtk")) - { - auto reader = vtkSmartPointer::New(); - reader->SetFileName(inputFileName_.c_str()); - reader->Update(); - - dataset = reader->GetOutput(); - } else { - // Invalid name - ignore + // Invalid name - ignore. + // Don't support VTK legacy format at all - it is too wasteful + // and cumbersome. inputFileName_.clear(); } diff --git a/src/lagrangian/intermediate/Make/files b/src/lagrangian/intermediate/Make/files index 5b869d5e21..b04a8f0f00 100644 --- a/src/lagrangian/intermediate/Make/files +++ b/src/lagrangian/intermediate/Make/files @@ -1,5 +1,3 @@ -submodels/CloudFunctionObjects/CloudToVTK/vtkTools.C - PARCELS=parcels BASEPARCELS=$(PARCELS)/baseClasses DERIVEDPARCELS=$(PARCELS)/derived diff --git a/src/lagrangian/intermediate/parcels/include/makeParcelCloudFunctionObjects.H b/src/lagrangian/intermediate/parcels/include/makeParcelCloudFunctionObjects.H index 69618baabf..0bd12e2650 100644 --- a/src/lagrangian/intermediate/parcels/include/makeParcelCloudFunctionObjects.H +++ b/src/lagrangian/intermediate/parcels/include/makeParcelCloudFunctionObjects.H @@ -28,7 +28,6 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "CloudToVTK.H" #include "FacePostProcessing.H" #include "ParticleCollector.H" #include "ParticleErosion.H" diff --git a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudToVTK/CloudToVTK.C b/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudToVTK/CloudToVTK.C deleted file mode 100644 index c7e37de568..0000000000 --- a/src/lagrangian/intermediate/submodels/CloudFunctionObjects/CloudToVTK/CloudToVTK.C +++ /dev/null @@ -1,165 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2015 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd. -------------------------------------------------------------------------------- -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 3 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, see . - -\*---------------------------------------------------------------------------*/ - -#include "CloudToVTK.H" -#include "vtkTools.H" -#include "floatScalar.H" - -// * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // - -template -void Foam::CloudToVTK::writeData -( - std::ostream& vtkOs, - const bool binary, - const List& data -) const -{ - const label procI = Pstream::myProcNo(); - - List> allProcData(Pstream::nProcs()); - allProcData[procI] = data; - Pstream::gatherList(allProcData); - List allData = - ListListOps::combine> - ( - allProcData, - accessOp>() - ); - - vtkTools::write(vtkOs, binary, allData); -} - - -template -template -void Foam::CloudToVTK::writeFieldData -( - std::ostream& vtkOs, - const bool binary, - const List& data, - const word& title, - const label nParcels -) const -{ - vtkOs - << title << ' ' - << int(pTraits::nComponents) << ' ' - << nParcels << " float" << std::endl; - writeData(vtkOs, binary, data); -} - - -template -void Foam::CloudToVTK::write() -{ - label nParcels = this->owner().size(); - DynamicList position(3*nParcels); - DynamicList U(3*nParcels); - DynamicList d(nParcels); - DynamicList age(nParcels); - DynamicList rho(nParcels); - - forAllConstIter(typename CloudType, this->owner(), iter) - { - vtkTools::insert(iter().position(), position); - vtkTools::insert(iter().U(), U); - vtkTools::insert(iter().d(), d); - vtkTools::insert(iter().age(), age); - vtkTools::insert(iter().rho(), rho); - } - - reduce(nParcels, sumOp