mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
MRG: resolved merge conflicts from merge from develop branch
This commit is contained in:
@ -23,7 +23,7 @@ if (!fieldsToUse.found(fieldName))
|
||||
).typeHeaderOk<volScalarField>(false, false)
|
||||
);
|
||||
|
||||
if (variableGood)
|
||||
if (!variableGood)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
@ -35,36 +35,25 @@ if (timeDirs.size() && !noLagrangian)
|
||||
cloudPrefix/cloudName
|
||||
);
|
||||
|
||||
// clouds always require "positions"
|
||||
// Clouds always have "positions"
|
||||
if (cloudObjs.found("positions"))
|
||||
{
|
||||
HashTable<HashTable<word>>::iterator cloudIter =
|
||||
cloudFields.find(cloudName);
|
||||
// Save the cloud fields on a per cloud basis
|
||||
auto fieldsPerCloud = cloudFields(cloudName);
|
||||
|
||||
if (cloudIter == cloudFields.end())
|
||||
forAllConstIters(cloudObjs, fieldIter)
|
||||
{
|
||||
// A newly discovered cloud
|
||||
cloudFields.insert(cloudName, HashTable<word>());
|
||||
cloudIter = cloudFields.find(cloudName);
|
||||
}
|
||||
const IOobject* obj = fieldIter();
|
||||
|
||||
forAllConstIter(IOobjectList, cloudObjs, fieldIter)
|
||||
{
|
||||
const IOobject& obj = *fieldIter();
|
||||
|
||||
// Add field and field type
|
||||
cloudIter().insert
|
||||
(
|
||||
obj.name(),
|
||||
obj.headerClassName()
|
||||
);
|
||||
// Field name/type
|
||||
fieldsPerCloud.insert(obj->name(), obj->headerClassName());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// prune out "positions" again since it gets treated specially
|
||||
forAllIter(HashTable<HashTable<word>>, cloudFields, cloudIter)
|
||||
// Prune out "positions" again since it gets treated specially
|
||||
forAllIters(cloudFields, cloudIter)
|
||||
{
|
||||
cloudIter().erase("positions");
|
||||
}
|
||||
@ -76,18 +65,13 @@ if (timeDirs.size() && !noLagrangian)
|
||||
}
|
||||
|
||||
|
||||
// sorted list of cloud names
|
||||
// Sorted list of cloud names
|
||||
const wordList cloudNames(cloudFields.sortedToc());
|
||||
|
||||
if (cloudNames.size())
|
||||
{
|
||||
// complete the echo information
|
||||
Info<< "(";
|
||||
forAll(cloudNames, cloudNo)
|
||||
{
|
||||
Info<< ' ' << cloudNames[cloudNo];
|
||||
}
|
||||
Info<< " ) " << endl;
|
||||
// Complete the echo information - as flatOutput
|
||||
cloudNames.writeList(Info) << endl;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||
\\/ M anipulation | Copyright (C) 2016-2017 OpenCFD Ltd.
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
@ -78,6 +78,7 @@ Note
|
||||
|
||||
#include "fvc.H"
|
||||
#include "volFields.H"
|
||||
#include "hashedWordList.H"
|
||||
|
||||
#include "labelIOField.H"
|
||||
#include "scalarIOField.H"
|
||||
@ -190,7 +191,7 @@ int main(int argc, char *argv[])
|
||||
);
|
||||
|
||||
// The volume field types that we handle
|
||||
const wordList volFieldTypes
|
||||
const hashedWordList volFieldTypes
|
||||
{
|
||||
volScalarField::typeName,
|
||||
volVectorField::typeName,
|
||||
@ -207,7 +208,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
#include "setRootCase.H"
|
||||
|
||||
// default to binary output, unless otherwise specified
|
||||
// Default to binary output, unless otherwise specified
|
||||
const IOstream::streamFormat format =
|
||||
(
|
||||
args.optionFound("ascii")
|
||||
@ -234,7 +235,7 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
|
||||
//
|
||||
// general (case) output options
|
||||
// General (case) output options
|
||||
//
|
||||
ensightCase::options caseOpts(format);
|
||||
|
||||
@ -257,7 +258,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
|
||||
//
|
||||
// output configuration (geometry related)
|
||||
// Output configuration (geometry related)
|
||||
//
|
||||
ensightMesh::options writeOpts(format);
|
||||
writeOpts.noPatches(args.optionFound("noPatches"));
|
||||
@ -313,12 +314,6 @@ int main(int argc, char *argv[])
|
||||
ensCase.printInfo(Info) << endl;
|
||||
}
|
||||
|
||||
|
||||
// Set Time to the last time before looking for lagrangian objects
|
||||
runTime.setTime(timeDirs.last(), timeDirs.size()-1);
|
||||
|
||||
IOobjectList objects(mesh, runTime.timeName());
|
||||
|
||||
#include "checkMeshMoving.H"
|
||||
#include "findCloudFields.H"
|
||||
|
||||
@ -331,6 +326,40 @@ int main(int argc, char *argv[])
|
||||
<< timer.cpuTimeIncrement() << " s, "
|
||||
<< mem.update().size() << " kB" << nl << endl;
|
||||
|
||||
// Get the list of supported classes/fields
|
||||
HashTable<wordHashSet> usableObjects;
|
||||
{
|
||||
// Initially all possible objects that are available at the final time
|
||||
IOobjectList objects(mesh, timeDirs.last().name());
|
||||
|
||||
// Categorize by classes, pre-filter on name (if requested)
|
||||
usableObjects =
|
||||
(
|
||||
fieldPatterns.empty()
|
||||
? objects.classes()
|
||||
: objects.classes(fieldPatterns)
|
||||
);
|
||||
|
||||
// Limit to types that we explicitly handle
|
||||
usableObjects.filterKeys(volFieldTypes);
|
||||
|
||||
// Force each field-type into existence (simplifies code logic
|
||||
// and doesn't cost much) and simultaneously remove all
|
||||
// "*_0" restart fields
|
||||
|
||||
for (auto fieldType : volFieldTypes)
|
||||
{
|
||||
usableObjects
|
||||
(
|
||||
fieldType
|
||||
).filterKeys
|
||||
(
|
||||
[](const word& k){ return k.endsWith("_0"); },
|
||||
true // prune
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// ignore special fields (_0 fields),
|
||||
// ignore fields we don't handle,
|
||||
// ignore fields that are not available for all time-steps
|
||||
@ -362,25 +391,22 @@ int main(int argc, char *argv[])
|
||||
// ~~~~~~~~~~~~~~~~~~~~~~
|
||||
Info<< "Write volume field (";
|
||||
|
||||
forAll(volFieldTypes, typei)
|
||||
for (auto fieldType : volFieldTypes)
|
||||
{
|
||||
const word& fieldType = volFieldTypes[typei];
|
||||
wordList fieldNames = objects.names(fieldType);
|
||||
// For convenience, just force each field-type into existence.
|
||||
// This simplifies code logic and doesn't cost much at all.
|
||||
wordHashSet& fieldNames = usableObjects(fieldType);
|
||||
|
||||
// Filter on name as required
|
||||
if (!fieldPatterns.empty())
|
||||
forAllIters(fieldNames, fieldIter)
|
||||
{
|
||||
inplaceSubsetStrings(fieldPatterns, fieldNames);
|
||||
}
|
||||
|
||||
forAll(fieldNames, fieldi)
|
||||
{
|
||||
const word& fieldName = fieldNames[fieldi];
|
||||
const word& fieldName = fieldIter.key();
|
||||
|
||||
#include "checkData.H"
|
||||
|
||||
// Partially complete field?
|
||||
if (!fieldsToUse[fieldName])
|
||||
{
|
||||
fieldNames.erase(fieldIter);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -597,7 +623,8 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
else
|
||||
{
|
||||
// Do not currently handle this type - blacklist for the future.
|
||||
// Do not currently handle this type
|
||||
// - blacklist for the future.
|
||||
fieldsToUse.set(fieldName, false);
|
||||
}
|
||||
|
||||
|
||||
@ -199,7 +199,7 @@ void print(Ostream& os, const wordList& flds)
|
||||
labelList getSelectedPatches
|
||||
(
|
||||
const polyBoundaryMesh& patches,
|
||||
const List<wordRe>& excludePatches
|
||||
const wordRes& excludePatches
|
||||
)
|
||||
{
|
||||
DynamicList<label> patchIDs(patches.size());
|
||||
@ -219,7 +219,7 @@ labelList getSelectedPatches
|
||||
Info<< " discarding empty/processor patch " << patchi
|
||||
<< " " << pp.name() << endl;
|
||||
}
|
||||
else if (findStrings(excludePatches, pp.name()))
|
||||
else if (excludePatches.match(pp.name()))
|
||||
{
|
||||
Info<< " excluding patch " << patchi
|
||||
<< " " << pp.name() << endl;
|
||||
@ -379,7 +379,7 @@ int main(int argc, char *argv[])
|
||||
|
||||
const bool allPatches = args.optionFound("allPatches");
|
||||
|
||||
List<wordRe> excludePatches;
|
||||
wordReList excludePatches;
|
||||
if (args.optionFound("excludePatches"))
|
||||
{
|
||||
args.optionLookup("excludePatches")() >> excludePatches;
|
||||
|
||||
@ -55,7 +55,7 @@ namespace Foam
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class vtkPVFoamReader Declaration
|
||||
Class vtkPVFoamReader Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class vtkPVFoamReader
|
||||
@ -64,7 +64,7 @@ class vtkPVFoamReader
|
||||
{
|
||||
public:
|
||||
vtkTypeMacro(vtkPVFoamReader, vtkMultiBlockDataSetAlgorithm);
|
||||
void PrintSelf(ostream&, vtkIndent);
|
||||
void PrintSelf(ostream&, vtkIndent) VTK_OVERRIDE;
|
||||
|
||||
static vtkPVFoamReader* New();
|
||||
|
||||
@ -199,7 +199,7 @@ protected:
|
||||
vtkInformation*,
|
||||
vtkInformationVector**,
|
||||
vtkInformationVector*
|
||||
);
|
||||
) VTK_OVERRIDE;
|
||||
|
||||
//- Get the mesh/fields for a particular time
|
||||
virtual int RequestData
|
||||
@ -207,10 +207,10 @@ protected:
|
||||
vtkInformation*,
|
||||
vtkInformationVector**,
|
||||
vtkInformationVector*
|
||||
);
|
||||
) VTK_OVERRIDE;
|
||||
|
||||
//- Fill in additional port information
|
||||
virtual int FillOutputPortInformation(int, vtkInformation*);
|
||||
virtual int FillOutputPortInformation(int, vtkInformation*) VTK_OVERRIDE;
|
||||
|
||||
//- The observer to modify this object when array selections are modified
|
||||
vtkCallbackCommand* SelectionObserver;
|
||||
|
||||
@ -62,7 +62,7 @@ class vtkPVblockMeshReader
|
||||
{
|
||||
public:
|
||||
vtkTypeMacro(vtkPVblockMeshReader, vtkMultiBlockDataSetAlgorithm);
|
||||
void PrintSelf(ostream&, vtkIndent);
|
||||
void PrintSelf(ostream&, vtkIndent) VTK_OVERRIDE;
|
||||
|
||||
static vtkPVblockMeshReader* New();
|
||||
|
||||
@ -127,7 +127,7 @@ protected:
|
||||
vtkInformation* unusedRequest,
|
||||
vtkInformationVector** unusedInputVector,
|
||||
vtkInformationVector* outputVector
|
||||
);
|
||||
) VTK_OVERRIDE;
|
||||
|
||||
//- Get the mesh for a particular time
|
||||
virtual int RequestData
|
||||
@ -135,10 +135,10 @@ protected:
|
||||
vtkInformation* unusedRequest,
|
||||
vtkInformationVector** unusedInputVector,
|
||||
vtkInformationVector* outputVector
|
||||
);
|
||||
) VTK_OVERRIDE;
|
||||
|
||||
//- Fill in additional port information
|
||||
virtual int FillOutputPortInformation(int, vtkInformation*);
|
||||
virtual int FillOutputPortInformation(int, vtkInformation*) VTK_OVERRIDE;
|
||||
|
||||
// The observer to modify this object when array selections are modified
|
||||
vtkCallbackCommand* SelectionObserver;
|
||||
|
||||
Reference in New Issue
Block a user