The issue is that Exodus blocks start numbering at 1 instead of  
zero....  You can loop over the elements and set their subdomain ID to  
one to fix that error... But unfortunately you will probably run into  
the next problem which is that Exodus boundary IDs start at 1 as well...

The real fix is not to use the internal mesh generation of libmesh...  
And instead read an exodus mesh in (which will have boundary ids and  
block ids starting at 1).

I have a hacked up version of libmesh's mesh generators that forces  
them to start at 1 for numbering... But its just that: a hack.  It  
won't be commited.  What I have on my list to do is to turn ids of 0  
to MAX_ID when output... That way the examples will work.  If I get a  
minute I'll try to do that today.

Sorry about the trouble.

Derek

Sent from my iPhone

On Jul 27, 2009, at 5:37 AM, Boyce Griffith <[email protected]>  
wrote:

> Hi, Folks --
>
> I am trying to get libMesh to output to an Exodus II file.  I am  
> using a
> recent pull of the SVN version of libMesh so that I can use libMesh  
> with
> PETSc 3.0.0.
>
> (By the way, I don't really care whether it is Exodus II or not ---  
> I am
> just trying to output data in a format which can be read by the VisIt
> visualization tool.)
>
> I tried modifying ex3.C to change the I/O from GMV to ExodusII,  
> i.e., I
> simply changed the I/O from:
>
>   // After solving the system write the solution
>   // to a GMV-formatted plot file.
>   GMVIO (mesh).write_equation_systems ("out.gmv", equation_systems);
>
> to:
>
>   // After solving the system write the solution
>   // to a Exodus II-formatted plot file.
>   ExodusII_IO (mesh).write("out.exd");
>
> This compiles fine but I get the following error at run time:
>
> [ex_put_block] Error: element block id 0 already exists in file id 13
>     exerrval = -1
> Error writing element block.
> [0] src/mesh/exodusII_io_helper.C, line 118, compiled Jul 27 2009 at
> 12:09:26
> terminate called after throwing an instance of 'libMesh::LogicError'
>   what():  Error in libMesh internal logic
> [griffith-macbook-pro:62440] *** Process received signal ***
> [griffith-macbook-pro:62440] Signal: Abort trap (6)
> [griffith-macbook-pro:62440] Signal code:  (0)
> [griffith-macbook-pro:62440] [ 0] 2   libSystem.B.dylib
>   0x912762bb _sigtramp + 43
> [griffith-macbook-pro:62440] [ 1] 3   ???
>   0xffffffff 0x0 + 4294967295
> [griffith-macbook-pro:62440] [ 2] 4   libSystem.B.dylib
>   0x912ea23a raise + 26
> [griffith-macbook-pro:62440] [ 3] 5   libSystem.B.dylib
>   0x912f6679 abort + 73
> [griffith-macbook-pro:62440] [ 4] 6   libstdc++.6.dylib
>   0x035b26ef _ZN9__gnu_cxx27__verbose_terminate_handlerEv + 335
> [griffith-macbook-pro:62440] [ 5] 7   libstdc++.6.dylib
>   0x035b02a9 _ZSt14set_unexpectedPFvvE + 41
> [griffith-macbook-pro:62440] [ 6] 8   libstdc++.6.dylib
>   0x035b02ec _ZSt9terminatev + 28
> [griffith-macbook-pro:62440] [ 7] 9   libstdc++.6.dylib
>   0x035b03eb __cxa_throw + 107
> [griffith-macbook-pro:62440] [ 8] 10  libmesh.dylib
>   0x0204bb03 _ZN18ExodusII_IO_Helper9check_errEiSs + 693
> [griffith-macbook-pro:62440] [ 9] 11  libmesh.dylib
>   0x02050b76 _ZN18ExodusII_IO_Helper14write_elementsERK8MeshBase + 786
> [griffith-macbook-pro:62440] [10] 12  libmesh.dylib
>   0x02048021 _ZN11ExodusII_IO5writeERKSs + 953
> [griffith-macbook-pro:62440] [11] 13  ex3-dbg
>   0x00002e06 main + 1353
> [griffith-macbook-pro:62440] [12] 14  ex3-dbg
>   0x0000275e start + 54
> [griffith-macbook-pro:62440] *** End of error message ***
>
> I get similar errors if I try to do similar things in ex4.
>
> What do I need to do to output to this format?
>
> Thanks,
>
> -- Boyce
>
> --- 
> --- 
> --- 
> ---------------------------------------------------------------------
> _______________________________________________
> Libmesh-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/libmesh-devel

------------------------------------------------------------------------------
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to