-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mesh Loader Attributes #32
Comments
Hello! I am interested in contributing to simit and this looks like a good place to start. I have experience with C and C++, but I am new to the simulation/FEA side of things. I would need some guidance on what attributes would be expected, and what file formats we would want to support. |
That's awesome! I think we might want an API similar to what libigl has with similar file format support. Two file formats we have partial support for are tetgen and wavefront obj. Tetgen supports providing attributes (set fields) as part of their element/vertex files, but I think we also need a way to specify them as a separate file (custom?). The reason for this is that you'd often want many different initial configurations of the same mesh for different simulations. Example APIs (design borrowed from lbigl):
In Simit Here's a list of file formats we want:
|
OK. I am starting on the custom format first. I have been reviewing the formats and any individual format should not be too hard to implement. I think the most bang for my effort is to allow for saving and restoring state of a simulation to a custom format. Once I have that established it should be easier to figure out how to incorporate attribute I/O into the other formats. Would it be OK to do an early pull request for review once I have a start on the interface? |
Sure, that would be great! It would also be nice if the API of our mesh loader could be brought closer to the design of the mesh loader in libigl since I think their design is better than what we currently have. By the way, are there any established formats for storing non-topological state? @desaic @dilevin maybe you have some information about this? We need to load/store a file containing initial configurations ( |
I don't know any established standard format for such information. People usually use use their own formats. E.g. Vega uses some format based on Abaqus' file formats, Nastran uses a relational database to store simulation info. The main problem is that there are too many possibilities for what information to store. In addition to velocity, we may want to store forces, indices for contact vertices, etc. Allowing such flexibility usually just leads one to using a generic file format such as our .fem file that allows arbitrary vector field input, or some xml-like format. |
Would there be any interest in an interface to HDF5? |
I don't know much about HDF5 to comment on that. |
I think there would be long term interest in HDF5. We're planning to make a distributed backend, and then it would be very useful. It's also very common in scientific computing, so it's nice to support. |
As far as I understand, then HDF5 is not a geometry-supported file in itself, but rather a convenient container to put large data sets in, with binary storage, compression and parallel read/write capabilities. The actual interpretation of the data varies widely from application to application. I.e. you could put the raw data of tetgen or obj files into a hdf5-wrapper and it would need two completely different parsers to get it out, even if they describe the same geometric object.
I very much like this. I think
valid simit-program for OBJ files:
valid simit-program for OBJ files and TetGen files:
Not a valid simit-program for OBJ files nor TetGen files
Both |
This is the start of an idea I had for a GMSH reader https://github.com/VikingScientist/simit/blob/meshreaders/src/gmshreader.cpp In particular I would like to draw attention to line 93-96, where I define the |
@VikingScientist I am planning to have meta-information about the names and types of fields stored in the simit custom format, and use that in creating the values on read. Conventions for these field names and types depends on the application that is built using simit. Likewise for HDF5, it is possible to have multiple data sets and I would put in a descriptive data set with field names and types, and a "data" data set with the actual data. I see HDF5 being a good alternative for either writing results for each iteration of the simulation or for checkpointing a long simulation. It should be easy to associate one "header" data set with multiple "data" data sets. |
All of this generality may cause us to need file loaders with a fair amount of choice, but good defaults. For example, if I have an obj file with positions then Also, I think our loaders should also provide an overloaded interface that takes an |
For the custom
The above suggestion does not have typing in the file format. So both
|
We could also consider CGNS format as an input file :
|
@Lugatod, That looks very interesting. I will look into what we need to do to use CGNS. |
The mesh loader currently supports loading topological data from tetgen
.ele
,.edge
and.node
files. It needs to be extended to load attributes, either from tetgen files, such as.node
files or from a separate file we specify so that we can load initial conditions and other fields.The text was updated successfully, but these errors were encountered: