[MOAB-dev] How can I prepare a .h5m file base on my own calculation

Grindeanu, Iulian R. iulian at mcs.anl.gov
Thu Jun 2 22:55:26 CDT 2016


Hi,
So you need a vtu writer too, not only a vtu reader; is there a document that explains the format in detail? or is there a version number?
Do you plan to use an xml parser ?

Thanks,
Iulian

________________________________
From: Vijay S. Mahadevan [vijay.m at gmail.com]
Sent: Thursday, June 02, 2016 9:28 PM
To: Jie Wu
Cc: moab-dev at mcs.anl.gov; Luc Berger; Grindeanu, Iulian R.
Subject: Re: [MOAB-dev] How can I prepare a .h5m file base on my own calculation


Hi Jie,

Thanks for detailing your workflow so that we understand your requirements better. I've considered adding support for vtu before but wasn't sure if we could do it without adding dependency on vtk. Our configuration already includes vtk support however, for our Paraview visualization plugin. So this may simplify things a bit. If you have the time to write the text/binary VTU I/O implementations (as an add-on to VTK I/O), we would be more than happy to take a PR submission for it. We can also help you along the way to get the implementation refined and tested.

Regarding your workflow, we are attempting something similar with a spectral element code right now with conforming quad/hex local refinements, in combination with mesh optimization. This would be the task where you are using Gmsh in your step 2.

I would be interested to know how your workflow is progressing and what difficulties, if any, you encounter in the mesh regeneration stages, especially with propagating deformations back to the geometry model. Perhaps with simpler domains, this may not prove to be a bottleneck.

Anyway, do let us know if you have more questions.

Best,
Vijay

On Jun 2, 2016 5:24 PM, "Jie Wu" <jie.voo at gmail.com<mailto:jie.voo at gmail.com>> wrote:
Hi Iulian,

Thank you very much for your instruction. After talking about this with my colleagues, we think about writing a .vtu reader for MOAB.

And the overall workflow looks like this:

  1.  Use python to call Gmsh to generate finite element mesh;
  2.  Prepare input files for FEAP (Finite Element Analysis Program);
  3.  While load steps not yet finished, Do:
     *   Use python to call FEAP to run the calculation, and generate .vtu file based on the calculation results;
     *   Generate a new mesh, with Gmsh, based on the deformed configuration;
     *   Use the MOAB .vtu reader to read .vtu file and pass the information to mbcoupler;
     *   Transfer data from old to new mesh by mbcoupler, and write the data on the new mesh into a .vtu file.
     *   Prepare input files for FEAP based on the new .vtu file;

Run simulation using a mesh generated with GMSH and write vtu files to export the solution of the simulation.
When the mesh is too distorted, stop the simulation, generate a new mesh with GMSH and transfer the data from the last vtu file to the new mesh.
mbcoupler would be used to perform the transfer of the data from the last vtu to the new mesh.

Any suggestion about this work is greatly appreciated!

Best,
Jie



On Jun 1, 2016, at 7:44 PM, Grindeanu, Iulian R. <iulian at mcs.anl.gov<mailto:iulian at mcs.anl.gov>> wrote:

Hi
vtk can be unstructured too;
the issue is that the vtk file converted from your vtu file using VisIt cannot be read directly by MOAB.
It would make more sense to make a vtu reader in MOAB, or make a h5m writer in VisIt.
Actually, I am working on that (h5m writer) , but it is in a branch now, it is not part of visit yet.

I am not sure what is the best solution to your problem now.
How do you plan to use the coupler?

Iulian

________________________________
From: Jie Wu [jie.voo at gmail.com<mailto:jie.voo at gmail.com>]
Sent: Wednesday, June 01, 2016 5:07 PM
To: Grindeanu, Iulian R.
Cc: moab-dev at mcs.anl.gov<mailto:moab-dev at mcs.anl.gov>
Subject: Re: [MOAB-dev] How can I prepare a .h5m file base on my own calculation

Hi Iulian,

I will try to convert from .vtu to .vtk by the tools you mentioned.

But as I know, .vtk file is usually used for structured mesh, while .vtu for unstructured mesh. I was just wondering if the conversion from .vtu to .vtk make sense?

Here is a small vtu file I used to store mesh and solution information.

On the nodes, we have displacements and a scaler damage parameter. We also have some other solution variables on the Integration nodes.

Thank you so much for your help.

Best,
Jie


On Jun 1, 2016, at 5:31 PM, Grindeanu, Iulian R. <iulian at mcs.anl.gov<mailto:iulian at mcs.anl.gov>> wrote:

Hi,
You can try paraview to convert from vtu format to vtk;
Moab vtk reader is not very robust, in the sense that there are vtk files it cannot read.
You can also try VisIt to convert from vtu to vtk

Do you have a small vtu file that you can share? I can try to look at it, to see how it goes.
What kind of data do you have at nodes?

Iulian

________________________________
From: Jie Wu [jie.voo at gmail.com<mailto:jie.voo at gmail.com>]
Sent: Wednesday, June 01, 2016 2:42 PM
To: Grindeanu, Iulian R.
Cc: moab-dev at mcs.anl.gov<mailto:moab-dev at mcs.anl.gov>
Subject: Re: [MOAB-dev] How can I prepare a .h5m file base on my own calculation

Hi Iulian,

Thank you very much for your help. The format we use to store mesh and solution information is .vtu file.

I tried to run function ./mbconvert. It can successfully transfer from .h5m to .vtk, and vice versa.

But I cannot convert either these 2 format to/from .vtu file.

An example error message is like following.

Is there any solution for this problem? Any suggestion is greatly appreciated!

Best,
Jie

dyn-160-39-11-225:tools jiewu$ ./mbconvert in.vtu out.h5m
[0]MOAB ERROR: --------------------- Error Message ------------------------------------
[0]MOAB ERROR: in.vtu: File is not HDF5!
[0]MOAB ERROR: set_up_read() line 472 in src/io/ReadHDF5.cpp
[0]MOAB ERROR: --------------------- Error Message ------------------------------------
[0]MOAB ERROR: NULL file handle.!
[0]MOAB ERROR: is_error() line 133 in src/io/ReadHDF5.hpp
[0]MOAB ERROR: --------------------- Error Message ------------------------------------
[0]MOAB ERROR: ReadNCDF:: problem opening Netcdf/Exodus II file in.vtu!
[0]MOAB ERROR: load_file() line 303 in src/io/ReadNCDF.cpp
[0]MOAB ERROR: --------------------- Error Message ------------------------------------
[0]MOAB ERROR: Trouble opening file in.vtu!
[0]MOAB ERROR: load_file() line 68 in src/io/ReadNC.cpp
[0]MOAB ERROR: --------------------- Error Message ------------------------------------
[0]MOAB ERROR: Expected Keyword!
[0]MOAB ERROR: load_file() line 178 in src/io/ReadABAQUS.cpp
0x0 hahhahahah
[0]MOAB ERROR: --------------------- Error Message ------------------------------------
[0]MOAB ERROR: This doesn't appear to be a .cub file!
[0]MOAB ERROR: load_file() line 310 in src/io/Tqdcfr.cpp
[0]MOAB ERROR: --------------------- Error Message ------------------------------------
[0]MOAB ERROR: Parsing error at line 1: expected one of { $NOD $MeshFormat } got "<?xml"!
[0]MOAB ERROR: match_token() line 378 in src/io/FileTokenizer.cpp
[0]MOAB ERROR: --------------------- Error Message ------------------------------------
[0]MOAB ERROR: in.vtu: No such file or directory!
[0]MOAB ERROR: ascii_read_triangles() line 201 in src/io/ReadSTL.cpp
[0]MOAB ERROR: --------------------- Error Message ------------------------------------
[0]MOAB ERROR: in.vtu: not a binary STL file!
[0]MOAB ERROR: binary_read_triangles() line 312 in src/io/ReadSTL.cpp
[0]MOAB ERROR: --------------------- Error Message ------------------------------------
[0]MOAB ERROR: in.vtu.node: cannot read file!
[0]MOAB ERROR: open_file() line 59 in src/io/ReadTetGen.cpp
[0]MOAB ERROR: --------------------- Error Message ------------------------------------
[0]MOAB ERROR: in.vtu: Trouble reading vertices!
[0]MOAB ERROR: read_vertices() line 129 in src/io/ReadTemplate.cpp
[0]MOAB ERROR: --------------------- Error Message ------------------------------------
[0]MOAB ERROR: Failed to load file after trying all possible readers!
[0]MOAB ERROR: serial_load_file() line 635 in src/Core.cpp
[0]MOAB ERROR: load_file() line 526 in src/Core.cpp
Failed to load "in.vtu".
Error code: MB_INDEX_OUT_OF_RANGE (1)
Error message: Failed to load file after trying all possible readers



On Jun 1, 2016, at 12:26 PM, Grindeanu, Iulian R. <iulian at mcs.anl.gov<mailto:iulian at mcs.anl.gov>> wrote:

Hello,
Coupler.cpp depends on a moab instance, so even if you do not use h5m format, if you want to use the coupler, your model has to reside inside a moab instance.
Do you care about parallelism or not? Then h5m format is required, otherwise it will be hard to employ parallelism

there are several converters available, to h5m format, you can do tools/mbconvert -l to see what is available based on your configuration

What format do you use?

Iulian
________________________________
From: moab-dev-bounces at mcs.anl.gov<mailto:moab-dev-bounces at mcs.anl.gov> [moab-dev-bounces at mcs.anl.gov<mailto:moab-dev-bounces at mcs.anl.gov>] on behalf of Jie Wu [jie.voo at gmail.com<mailto:jie.voo at gmail.com>]
Sent: Wednesday, June 01, 2016 9:17 AM
To: moab-dev at mcs.anl.gov<mailto:moab-dev at mcs.anl.gov>
Subject: [MOAB-dev] How can I prepare a .h5m file base on my own calculation

Hi All,

In order to transfer variables from a Source mesh to a Target mesh, I am studying the use of function mbcoupler_test.cpp these days.

The stuff confusing me is the .h5m file. From the MOAB user guide, I know that .h5m is theMOAB’s native file format.

But I don’t know how to prepare a .h5m file based on my own calculation results (which usually contains node coordinates, node connectivities, and nodal variables). As a result, I cannot employ a function like ./mbcoupler_test to help me to transfer the mesh variables.

Any instruction is deeply appreciated!

Best,
Jie


Jie Wu, Ph.D. candidate
Department of Geotechnical Engineering, Tongji University
Visiting student at Civil Engineering & Engineering Mechanics, Columbia University
Add: 500 West 120th Street 641 S.W. Mudd New York, NY  10027
Ph: +1(917)822-0942<tel:%2B1%28917%29822-0942>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/moab-dev/attachments/20160603/c190be35/attachment.html>


More information about the moab-dev mailing list