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
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -171,19 +171,17 @@ void Foam::sampledSurfaces::write()
|
|||||||
writeGeometry();
|
writeGeometry();
|
||||||
}
|
}
|
||||||
|
|
||||||
const IOobjectList objects(mesh_, mesh_.time().timeName());
|
sampleAndWrite<volScalarField>();
|
||||||
|
sampleAndWrite<volVectorField>();
|
||||||
|
sampleAndWrite<volSphericalTensorField>();
|
||||||
|
sampleAndWrite<volSymmTensorField>();
|
||||||
|
sampleAndWrite<volTensorField>();
|
||||||
|
|
||||||
sampleAndWrite<volScalarField>(objects);
|
sampleAndWrite<surfaceScalarField>();
|
||||||
sampleAndWrite<volVectorField>(objects);
|
sampleAndWrite<surfaceVectorField>();
|
||||||
sampleAndWrite<volSphericalTensorField>(objects);
|
sampleAndWrite<surfaceSphericalTensorField>();
|
||||||
sampleAndWrite<volSymmTensorField>(objects);
|
sampleAndWrite<surfaceSymmTensorField>();
|
||||||
sampleAndWrite<volTensorField>(objects);
|
sampleAndWrite<surfaceTensorField>();
|
||||||
|
|
||||||
sampleAndWrite<surfaceScalarField>(objects);
|
|
||||||
sampleAndWrite<surfaceVectorField>(objects);
|
|
||||||
sampleAndWrite<surfaceSphericalTensorField>(objects);
|
|
||||||
sampleAndWrite<surfaceSymmTensorField>(objects);
|
|
||||||
sampleAndWrite<surfaceTensorField>(objects);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -159,8 +159,7 @@ class sampledSurfaces
|
|||||||
);
|
);
|
||||||
|
|
||||||
//- Sample and write all sampled fields
|
//- Sample and write all sampled fields
|
||||||
template<class Type>
|
template<class Type> void sampleAndWrite();
|
||||||
void sampleAndWrite(const IOobjectList&);
|
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct and assignment
|
//- Disallow default bitwise copy construct and assignment
|
||||||
sampledSurfaces(const sampledSurfaces&);
|
sampledSurfaces(const sampledSurfaces&);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -166,20 +166,25 @@ void Foam::sampledSurfaces::sampleAndWrite
|
|||||||
|
|
||||||
|
|
||||||
template<class GeoField>
|
template<class GeoField>
|
||||||
void Foam::sampledSurfaces::sampleAndWrite(const IOobjectList& allObjects)
|
void Foam::sampledSurfaces::sampleAndWrite()
|
||||||
{
|
{
|
||||||
|
DynamicList<wordRe> fields;
|
||||||
|
bool found = false;
|
||||||
forAll (fieldSelection_, fieldI)
|
forAll (fieldSelection_, fieldI)
|
||||||
{
|
{
|
||||||
const wordRe field = fieldSelection_[fieldI];
|
const wordRe field = fieldSelection_[fieldI];
|
||||||
IOobject* fieldIOPtr = allObjects.lookup(field);
|
if (mesh_.thisDb().foundObject<GeoField>(field))
|
||||||
|
|
||||||
if
|
|
||||||
(
|
|
||||||
fieldIOPtr != NULL
|
|
||||||
&& fieldIOPtr->headerClassName() == GeoField::typeName
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
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;
|
Pout<< "sampleAndWrite: " << field << endl;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user