mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: rationalize cloud method inheritance
- a top-level cloud::nParcels() virtual, which is overloaded by the
first level of Cloud inheritance. This permits quick determination of
cloud sizes, even when retrieved from registry with the base level.
Eg,
cloud* cldPtr = mesh.cfindObject<cloud>("myCloud");
label nParcels = (cldPtr ? cldPtr->nParcels() : 0);
- make writeLagrangianPositions on by default unless explicitly
disabled in the InfoSwitches.
Flag output errors (where neither coordinates nor positions are
written) with Fatal.
- additional IOField helper functions in cloud
STYLE: simplify iterator inheritance
This commit is contained in:
committed by
Andrew Heather
parent
0cfd019b92
commit
e90eafcf18
@ -159,7 +159,7 @@ addGeometry
|
||||
|
||||
objPtr->writeObjects(obrTmp);
|
||||
|
||||
const auto* pointsPtr = obrTmp.findObject<vectorField>("position");
|
||||
const auto* pointsPtr = cloud::findIOPosition(obrTmp);
|
||||
|
||||
if (!pointsPtr)
|
||||
{
|
||||
|
||||
@ -46,7 +46,7 @@ Foam::functionObjects::runTimePostPro::geometryCloud::gatherCloud
|
||||
auto multiPiece = vtkSmartPointer<vtkMultiPieceDataSet>::New();
|
||||
multiPiece->SetNumberOfPieces(Pstream::nProcs());
|
||||
|
||||
const auto* pointsPtr = obrTmp.findObject<vectorField>("position");
|
||||
const auto* pointsPtr = cloud::findIOPosition(obrTmp);
|
||||
|
||||
if (!needsCollective())
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -23,6 +23,7 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "cloud.H"
|
||||
#include "parcelSelectionDetail.H"
|
||||
#include "scalarPredicates.H"
|
||||
#include "labelField.H"
|
||||
@ -167,7 +168,7 @@ bool Foam::Detail::parcelSelection::calculateFilter
|
||||
// Start with all parcels unselected
|
||||
|
||||
// Number of parcels (locally)
|
||||
const auto* pointsPtr = obrTmp.findObject<vectorField>("position");
|
||||
const auto* pointsPtr = cloud::findIOPosition(obrTmp);
|
||||
label nParcels = pointsPtr->size();
|
||||
|
||||
parcelAddr_.reset();
|
||||
|
||||
@ -71,7 +71,7 @@ bool Foam::functionObjects::dataCloud::writeCloud
|
||||
|
||||
objPtr->writeObjects(obrTmp);
|
||||
|
||||
const auto* pointsPtr = obrTmp.findObject<vectorField>("position");
|
||||
const auto* pointsPtr = cloud::findIOPosition(obrTmp);
|
||||
|
||||
if (!pointsPtr)
|
||||
{
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
||||
\\ / A nd | Copyright (C) 2018-2019 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -23,6 +23,7 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "cloud.H"
|
||||
#include "IOField.H"
|
||||
#include "OFstream.H"
|
||||
#include "ListOps.H"
|
||||
@ -171,7 +172,7 @@ bool Foam::functionObjects::dataCloud::writeField
|
||||
const objectRegistry& obrTmp
|
||||
) const
|
||||
{
|
||||
const auto* pointsPtr = obrTmp.findObject<vectorField>("position");
|
||||
const auto* pointsPtr = cloud::findIOPosition(obrTmp);
|
||||
|
||||
if (!pointsPtr)
|
||||
{
|
||||
|
||||
@ -120,7 +120,7 @@ bool Foam::functionObjects::vtkCloud::writeCloud
|
||||
|
||||
objPtr->writeObjects(obrTmp);
|
||||
|
||||
const auto* pointsPtr = obrTmp.findObject<vectorField>("position");
|
||||
const auto* pointsPtr = cloud::findIOPosition(obrTmp);
|
||||
|
||||
if (!pointsPtr)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user