Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

BUG: solve problem with sampledSurfaces load from files

  • Loading branch information...
commit 323adf949037f2bdfb5aeff628a66879587c82d3 1 parent faacffd
sergio authored
View
25 src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.C
@@ -192,18 +192,19 @@ void Foam::sampledSurfaces::write()
writeGeometry();
}
-
- sampleAndWrite<volScalarField>(mesh_);
- sampleAndWrite<volVectorField>(mesh_);
- sampleAndWrite<volSphericalTensorField>(mesh_);
- sampleAndWrite<volSymmTensorField>(mesh_);
- sampleAndWrite<volTensorField>(mesh_);
-
- sampleAndWrite<surfaceScalarField>(mesh_);
- sampleAndWrite<surfaceVectorField>(mesh_);
- sampleAndWrite<surfaceSphericalTensorField>(mesh_);
- sampleAndWrite<surfaceSymmTensorField>(mesh_);
- sampleAndWrite<surfaceTensorField>(mesh_);
+ 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);
}
}
View
2  src/sampling/sampledSurface/sampledSurfaces/sampledSurfaces.H
@@ -159,7 +159,7 @@ class sampledSurfaces
//- Sample and write all sampled fields
template<class Type>
- void sampleAndWrite(const fvMesh&);
+ void sampleAndWrite(const IOobjectList&);
//- Disallow default bitwise copy construct and assignment
sampledSurfaces(const sampledSurfaces&);
View
25 src/sampling/sampledSurface/sampledSurfaces/sampledSurfacesTemplates.C
@@ -165,13 +165,18 @@ void Foam::sampledSurfaces::sampleAndWrite
template<class GeoField>
-void Foam::sampledSurfaces::sampleAndWrite(const fvMesh& mesh)
+void Foam::sampledSurfaces::sampleAndWrite(const IOobjectList& allObjects)
{
forAll (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_)
{
@@ -180,17 +185,25 @@ void Foam::sampledSurfaces::sampleAndWrite(const fvMesh& mesh)
if (loadFromFiles_)
{
- const GeoField& geoField =
- mesh.thisDb().lookupObject<GeoField>(field);
+ const GeoField geoField
+ (
+ IOobject
+ (
+ field,
+ mesh_.time().timeName(),
+ mesh_,
+ IOobject::MUST_READ
+ ),
+ mesh_
+ );
- const_cast<GeoField&>(geoField).readOpt() = IOobject::MUST_READ;
sampleAndWrite(geoField);
}
else
{
sampleAndWrite
(
- mesh.thisDb().lookupObject<GeoField>(field)
+ mesh_.thisDb().lookupObject<GeoField>(field)
);
}
}
View
47 tutorials/combustion/fireFoam/les/oppositeBurningPanels/0/panelRegion/Ydefault
@@ -1,47 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| ========= | |
-| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
-| \\ / O peration | Version: 2.1.x |
-| \\ / A nd | Web: www.OpenFOAM.org |
-| \\/ M anipulation | |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
- version 2.0;
- format ascii;
- class volScalarField;
- location "0";
- object Ydefault;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-dimensions [0 0 0 0 0 0 0];
-
-internalField uniform 0;
-
-boundaryField
-{
-
- ".*"
- {
- type zeroGradient;
- }
-
- fRight_zone_side
- {
- type wedge;
- }
-
- fLeft_zone_side
- {
- type wedge;
- }
-
- "(region0_to.*)"
- {
- type zeroGradient;
- }
-}
-
-
-// ************************************************************************* //
Please sign in to comment.
Something went wrong with that request. Please try again.