mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: sampleAndWrite reading fields on time folders and not on the
database
This commit is contained in:
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -171,19 +171,17 @@ void Foam::sampledSurfaces::write()
|
||||
writeGeometry();
|
||||
}
|
||||
|
||||
const IOobjectList objects(mesh_, mesh_.time().timeName());
|
||||
sampleAndWrite<volScalarField>();
|
||||
sampleAndWrite<volVectorField>();
|
||||
sampleAndWrite<volSphericalTensorField>();
|
||||
sampleAndWrite<volSymmTensorField>();
|
||||
sampleAndWrite<volTensorField>();
|
||||
|
||||
sampleAndWrite<volScalarField>(objects);
|
||||
sampleAndWrite<volVectorField>(objects);
|
||||
sampleAndWrite<volSphericalTensorField>(objects);
|
||||
sampleAndWrite<volSymmTensorField>(objects);
|
||||
sampleAndWrite<volTensorField>(objects);
|
||||
|
||||
sampleAndWrite<surfaceScalarField>(objects);
|
||||
sampleAndWrite<surfaceVectorField>(objects);
|
||||
sampleAndWrite<surfaceSphericalTensorField>(objects);
|
||||
sampleAndWrite<surfaceSymmTensorField>(objects);
|
||||
sampleAndWrite<surfaceTensorField>(objects);
|
||||
sampleAndWrite<surfaceScalarField>();
|
||||
sampleAndWrite<surfaceVectorField>();
|
||||
sampleAndWrite<surfaceSphericalTensorField>();
|
||||
sampleAndWrite<surfaceSymmTensorField>();
|
||||
sampleAndWrite<surfaceTensorField>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -159,8 +159,7 @@ class sampledSurfaces
|
||||
);
|
||||
|
||||
//- Sample and write all sampled fields
|
||||
template<class Type>
|
||||
void sampleAndWrite(const IOobjectList&);
|
||||
template<class Type> void sampleAndWrite();
|
||||
|
||||
//- Disallow default bitwise copy construct and assignment
|
||||
sampledSurfaces(const sampledSurfaces&);
|
||||
|
||||
@ -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-2013 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -166,20 +166,25 @@ void Foam::sampledSurfaces::sampleAndWrite
|
||||
|
||||
|
||||
template<class GeoField>
|
||||
void Foam::sampledSurfaces::sampleAndWrite(const IOobjectList& allObjects)
|
||||
void Foam::sampledSurfaces::sampleAndWrite()
|
||||
{
|
||||
DynamicList<wordRe> fields;
|
||||
bool found = false;
|
||||
forAll (fieldSelection_, fieldI)
|
||||
{
|
||||
const wordRe field = fieldSelection_[fieldI];
|
||||
IOobject* fieldIOPtr = allObjects.lookup(field);
|
||||
|
||||
if
|
||||
(
|
||||
fieldIOPtr != NULL
|
||||
&& fieldIOPtr->headerClassName() == GeoField::typeName
|
||||
)
|
||||
if (mesh_.thisDb().foundObject<GeoField>(field))
|
||||
{
|
||||
if (Pstream::master() && verbose_)
|
||||
found = true;
|
||||
fields.append(field);
|
||||
}
|
||||
}
|
||||
if (fields.size() && found)
|
||||
{
|
||||
forAll (fields, fieldI)
|
||||
{
|
||||
const wordRe field = fields[fieldI];
|
||||
if ((Pstream::master()) && verbose_)
|
||||
{
|
||||
Pout<< "sampleAndWrite: " << field << endl;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user