diff --git a/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposer.C b/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposer.C index 274e3a51a..efb7dd2a2 100644 --- a/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposer.C +++ b/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposer.C @@ -42,7 +42,7 @@ Foam::lagrangianFieldDecomposer::lagrangianFieldDecomposer ) : procMesh_(procMesh), - positions_(procMesh, cloudName, false), + positions_(procMesh, cloudName, IDLList()), particleIndices_(lagrangianPositions.size()) { label pi = 0; diff --git a/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposer.H b/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposer.H index 6e0280398..aca067229 100644 --- a/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposer.H +++ b/applications/utilities/parallelProcessing/decomposePar/lagrangianFieldDecomposer.H @@ -101,7 +101,6 @@ public: const label cloudI, const IOobjectList& lagrangianObjects, PtrList>>& lagrangianFields -// PtrList>& lagrangianFields ); template @@ -113,7 +112,6 @@ public: < PtrList, Type>> >& lagrangianFields -// PtrList, Type >>& lagrangianFields ); diff --git a/applications/utilities/postProcessing/dataConversion/foamToGMV/gmvOutput.H b/applications/utilities/postProcessing/dataConversion/foamToGMV/gmvOutput.H index a6c0c7dd3..4c65e583e 100644 --- a/applications/utilities/postProcessing/dataConversion/foamToGMV/gmvOutput.H +++ b/applications/utilities/postProcessing/dataConversion/foamToGMV/gmvOutput.H @@ -73,7 +73,7 @@ for (label i=0; i < nTypes; i++) if (lagrangianHeader.headerOk()) { - Cloud particles(mesh); + Cloud particles(mesh, cloud::defaultName); IOobjectList objects(mesh, runTime.timeName(), cloud::prefix); diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_maxsize_info.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_maxsize_info.H index ca2033453..aab4c0c90 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_maxsize_info.H +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_get_maxsize_info.H @@ -73,7 +73,7 @@ int USERD_get_maxsize_info { // Get the maximum number of spray parcels // and store it - Cloud lagrangian(*meshPtr); + Cloud lagrangian(*meshPtr, cloud::defaultName); if (lagrangian.size() > nMaxParcels) { diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_set_filenames.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_set_filenames.H index fdb7c38c9..6167798a3 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_set_filenames.H +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_set_filenames.H @@ -151,7 +151,7 @@ int USERD_set_filenames { runTime.setTime(timeDirs[n+1], n+1); - Cloud lagrangian(*meshPtr); + Cloud lagrangian(*meshPtr, cloud::defaultName); n++; if (lagrangian.size()) @@ -177,7 +177,7 @@ int USERD_set_filenames delete sprayPtr; - sprayPtr = new Cloud(*meshPtr); + sprayPtr = new Cloud(*meshPtr, cloud::defaultName); IOobjectList objects(*meshPtr, runTime.timeName(), cloud::prefix); diff --git a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_set_time_set_and_step.H b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_set_time_set_and_step.H index 5459f67ba..7bc4ba1c5 100644 --- a/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_set_time_set_and_step.H +++ b/applications/utilities/postProcessing/graphics/ensightFoamReader/USERD_set_time_set_and_step.H @@ -49,9 +49,7 @@ void USERD_set_time_set_and_step if (Numparts_available > nPatches+1) { delete sprayPtr; - sprayPtr = new Cloud(*meshPtr); + sprayPtr = new Cloud(*meshPtr, cloud::defaultName); } } } - - diff --git a/src/OpenFOAM/fields/cloud/cloud.C b/src/OpenFOAM/fields/cloud/cloud.C index 3a7b98e96..69cba912e 100644 --- a/src/OpenFOAM/fields/cloud/cloud.C +++ b/src/OpenFOAM/fields/cloud/cloud.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -30,10 +30,10 @@ License namespace Foam { -defineTypeNameAndDebug(cloud, 0); + defineTypeNameAndDebug(cloud, 0); -const word cloud::prefix("lagrangian"); -word cloud::defaultName("defaultCloud"); + const word cloud::prefix("lagrangian"); + word cloud::defaultName("defaultCloud"); } @@ -45,7 +45,7 @@ Foam::cloud::cloud(const objectRegistry& obr, const word& cloudName) ( IOobject ( - (cloudName.size() ? cloudName : defaultName), + cloudName, obr.time().timeName(), prefix, obr, diff --git a/src/OpenFOAM/fields/cloud/cloud.H b/src/OpenFOAM/fields/cloud/cloud.H index 457858838..9b7aa4329 100644 --- a/src/OpenFOAM/fields/cloud/cloud.H +++ b/src/OpenFOAM/fields/cloud/cloud.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -78,7 +78,7 @@ public: // Constructors //- Construct for the given objectRegistry and named cloud instance - cloud(const objectRegistry&, const word& cloudName = ""); + cloud(const objectRegistry&, const word& cloudName = defaultName); //- Destructor diff --git a/src/functionObjects/field/nearWallFields/nearWallFields.C b/src/functionObjects/field/nearWallFields/nearWallFields.C index b63ee9558..063ff610f 100644 --- a/src/functionObjects/field/nearWallFields/nearWallFields.C +++ b/src/functionObjects/field/nearWallFields/nearWallFields.C @@ -60,7 +60,12 @@ void Foam::functionObjects::nearWallFields::calcAddressing() DebugInFunction << "nPatchFaces: " << globalWalls.size() << endl; // Construct cloud - Cloud cloud(mesh_, IDLList()); + Cloud cloud + ( + mesh_, + cloud::defaultName, + IDLList() + ); // Add particles to track to sample locations nPatchFaces = 0; diff --git a/src/lagrangian/basic/Cloud/Cloud.C b/src/lagrangian/basic/Cloud/Cloud.C index 1e108771a..710e36bfd 100644 --- a/src/lagrangian/basic/Cloud/Cloud.C +++ b/src/lagrangian/basic/Cloud/Cloud.C @@ -92,31 +92,6 @@ void Foam::Cloud::calcCellWallFaces() const // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -Foam::Cloud::Cloud -( - const polyMesh& pMesh, - const IDLList& particles -) -: - cloud(pMesh), - IDLList(), - polyMesh_(pMesh), - labels_(), - nTrackingRescues_(), - cellWallFacesPtr_() -{ - checkPatches(); - - // Ask for the tetBasePtIs to trigger all processors to build - // them, otherwise, if some processors have no particles then - // there is a comms mismatch. - polyMesh_.tetBasePtIs(); - - IDLList::operator=(particles); -} - - template Foam::Cloud::Cloud ( @@ -139,7 +114,10 @@ Foam::Cloud::Cloud // there is a comms mismatch. polyMesh_.tetBasePtIs(); - IDLList::operator=(particles); + if (particles.size()) + { + IDLList::operator=(particles); + } } diff --git a/src/lagrangian/basic/Cloud/Cloud.H b/src/lagrangian/basic/Cloud/Cloud.H index cb6b5eee8..2ad874691 100644 --- a/src/lagrangian/basic/Cloud/Cloud.H +++ b/src/lagrangian/basic/Cloud/Cloud.H @@ -131,28 +131,12 @@ public: //- Construct from mesh and a list of particles Cloud - ( - const polyMesh& mesh, - const IDLList& particles - ); - - //- Construct from mesh, cloud name, and a list of particles - Cloud ( const polyMesh& mesh, const word& cloudName, const IDLList& particles ); - //- Construct from mesh by reading from file - // Optionally disable checking of class name for post-processing - Cloud - ( - const polyMesh& mesh, - const bool checkClass = true - ); - - //- Construct from mesh by reading from file with given cloud instance // Optionally disable checking of class name for post-processing Cloud diff --git a/src/lagrangian/basic/Cloud/CloudIO.C b/src/lagrangian/basic/Cloud/CloudIO.C index 5cdba6ba8..0be85442e 100644 --- a/src/lagrangian/basic/Cloud/CloudIO.C +++ b/src/lagrangian/basic/Cloud/CloudIO.C @@ -144,25 +144,6 @@ void Foam::Cloud::initCloud(const bool checkClass) // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -Foam::Cloud::Cloud -( - const polyMesh& pMesh, - const bool checkClass -) -: - cloud(pMesh), - polyMesh_(pMesh), - labels_(), - nTrackingRescues_(), - cellWallFacesPtr_() -{ - checkPatches(); - - initCloud(checkClass); -} - - template Foam::Cloud::Cloud (