[MOAB-dev] read polygon mesh from vtk file

Grindeanu, Iulian R. iulian at mcs.anl.gov
Sun Jun 29 10:38:39 CDT 2014


Hi,
How was the file generated?
our vtk reader is very simple, it does not support all vtk formats, and there is no plan to.
For general vtk files, you would need to configure with vtk , I think (I am not sure, I would have to try).
Vijay

What was your configure command?

Iulian

________________________________________
From: moab-dev-bounces at mcs.anl.gov [moab-dev-bounces at mcs.anl.gov] on behalf of Huayi Wei [huayiwei1984 at gmail.com]
Sent: Saturday, June 28, 2014 11:08 PM
To: MOAB Dev
Subject: [MOAB-dev] read polygon mesh from vtk file

Hi, Moab Dev,

I have a polygon mesh saved in vtk format, see attachment. I can show it
by paraview. But when loading it into moab, I meet `Segmentation fault
(core dumped)`
error. I don't know how to fixed it. Please help me, thanks very much.

Here is the cpp file.
```
#include "moab/Core.hpp"
#include <iostream>
#include <assert.h>

using namespace moab;
using namespace std;

int main(int argc, char ** argv)
{
     string file = s"/poly8-10.vtk";
     Interface * imesh = new Core;

     ErrorCode rval =  imesh->load_mesh(file.c_str());
     assert(rval == MB_SUCCESS);

     return 0;
}
```

And here is the information of core:
```
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Core was generated by `./readpolygon_test'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007f3fee79cd3b in moab::Range::front (this=0xffffffffffffffe0)
     at ./moab/Range.hpp:824
824      { return mHead.mNext->first; }
(gdb) list
819    inline Range::const_iterator
Range::const_iterator::start_of_block() const
820      { return Range::const_iterator( mNode, mNode->first ); }
821
822      //! get first entity in range
823    inline const EntityHandle& Range::front() const
824      { return mHead.mNext->first; }
825      //! get last entity in range
826    inline const EntityHandle& Range::back() const
827      { return mHead.mPrev->second; }
828
```

Best

Huayi


More information about the moab-dev mailing list