Skip to content
Snippets Groups Projects
Commit 7bc0688c authored by sergio's avatar sergio
Browse files

BUG: sampleAndWrite reading fields on time folders and not on the

database
parent cb743778
Branches
Tags
No related merge requests found
......@@ -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>(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<volScalarField>();
sampleAndWrite<volVectorField>();
sampleAndWrite<volSphericalTensorField>();
sampleAndWrite<volSymmTensorField>();
sampleAndWrite<volTensorField>();
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))
{
found = true;
fields.append(field);
}
}
if (fields.size() && found)
{
forAll (fields, fieldI)
{
if (Pstream::master() && verbose_)
const wordRe field = fields[fieldI];
if ((Pstream::master()) && verbose_)
{
Pout<< "sampleAndWrite: " << field << endl;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment