CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Error about missing file pointZones when using submesh

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 20, 2016, 21:16
Default Error about missing file pointZones when using submesh
  #1
Senior Member
 
Thomas Oliveira
Join Date: Apr 2015
Posts: 114
Rep Power: 12
t.oliveira is on a distinguished road
Dear all,

From a Foam::fvMesh object and a Foam::labelHashSet object, I create a submesh:
Code:
Foam::fvMeshSubset subsetter(mesh);
subsetter.setLargeCellSubset(voidCells);
Foam::fvMesh& subMesh = subsetter.subMesh();
From this submesh, I create a Foam::fvMesh object:
Code:
Foam::fvMesh mesh
(
    Foam::IOobject
    (
        Foam::fvMesh::defaultRegion,
        runTime.timeName(),
        runTime,
        Foam::IOobject::MUST_READ
    ),
    Xfer < pointField > (subMesh.points()),
    Xfer < faceList >   (subMesh.faces()),
    Xfer < labelList >  (subMesh.faceOwner()),
    Xfer < labelList >  (subMesh.faceNeighbour())
);
When I run, I receive the error
Code:
cannot find file /home/user/solver/case/constant/polyMesh/pointZones at line 0.
However, if replace it by
Code:
Foam::fvMesh mesh
(
    Foam::IOobject
    (
        Foam::fvMesh::defaultRegion,
        runTime.timeName(),
        runTime,
        Foam::IOobject::MUST_READ
    ),
);
I receive no error. Can you please help me identify the problem?

Best wishes,

Thomas
t.oliveira is offline   Reply With Quote

Old   September 20, 2016, 21:20
Default
  #2
Senior Member
 
Thomas Oliveira
Join Date: Apr 2015
Posts: 114
Rep Power: 12
t.oliveira is on a distinguished road
Dear Thomas,

When you use
Code:
Foam::fvMesh mesh
(
    Foam::IOobject
    (
        Foam::fvMesh::defaultRegion,
        runTime.timeName(),
        runTime,
        Foam::IOobject::MUST_READ
    ),
);
you call Foam::fvMesh::fvMesh(const IOobject& io), which calls Foam::polyMesh::polyMesh(const IOobject& io), which initialises pointZones_ using the read option Foam::IOobject::READ_IF_PRESENT.

When you use
Code:
Foam::fvMesh mesh
(
    Foam::IOobject
    (
        Foam::fvMesh::defaultRegion,
        runTime.timeName(),
        runTime,
        Foam::IOobject::MUST_READ
    ),
    Xfer < pointField > (subMesh.points()),
    Xfer < faceList >   (subMesh.faces()),
    Xfer < labelList >  (subMesh.faceOwner()),
    Xfer < labelList >  (subMesh.faceNeighbour())
);
you call Foam::fvMesh::fvMesh(const IOobject& io, const Xfer<pointField>& points, const Xfer<faceList>& faces, const Xfer<labelList>& allOwner, const Xfer<labelList>& allNeighbour, const bool syncPar), which calls Foam::polyMesh::polyMesh(const IOobject& io, const Xfer<pointField>& points, const Xfer<faceList>& faces, const Xfer<labelList>& owner, const Xfer<labelList>& neighbour, const bool syncPar), which initialises pointZones_ using the read option io.readOpt(), which is Foam::IOobject::MUST_READ in your case.

That is why you get the error if the file pointZones doesn't exist just in this second case. You may want to use this instead:
Code:
Foam::fvMesh mesh
(
    Foam::IOobject
    (
        Foam::fvMesh::defaultRegion,
        runTime.timeName(),
        runTime,
        Foam::IOobject::READ_IF_PRESENT
    ),
    Xfer < pointField > (subMesh.points()),
    Xfer < faceList >   (subMesh.faces()),
    Xfer < labelList >  (subMesh.faceOwner()),
    Xfer < labelList >  (subMesh.faceNeighbour())
);
so that io.readOpt() will be Foam::IOobject::READ_IF_PRESENT.

Best wishes,

Thomas
t.oliveira is offline   Reply With Quote

Reply

Tags
file missing, fvmesh, ioobject, mesh

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[swak4Foam] funkyDoCalc with OF2.3 massflow NiFl OpenFOAM Community Contributions 14 November 25, 2020 03:30
what is swap4foam ?? AB08 OpenFOAM 28 February 2, 2016 01:22
[Other] How to use finite area method in official OpenFOAM 2.2.0? Detian Liu OpenFOAM Meshing & Mesh Conversion 4 November 3, 2015 03:04
"parabolicVelocity" in OpenFoam 2.1.0 ? sawyer86 OpenFOAM Running, Solving & CFD 21 February 7, 2012 11:44
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51


All times are GMT -4. The time now is 22:10.