rhdodds / warp3d

Open source code for nonlinear finite element analysis of 3D solids and structures
Other
99 stars 39 forks source link

Gmsh -> Warp Converter #6

Open Jacobfaib opened 4 years ago

Jacobfaib commented 4 years ago

Hello,

I am writing a python gmsh to warp format mesh converter. I have nodal coordinates working correctly, however I have hit a snag when building the element table. In gmsh v4.0+ elements are provided as such:

$Elements numEntityBlocks(size_t) numElements(size_t) minElementTag(size_t) maxElementTag(size_t) entityDim(int) entityTag(int) elementType(int) numElementsInBlock(size_t) elementTag(size_t) nodeTag(size_t) ... ... ... $EndElements

i.e.

45 199932 1 199932
0 1 15 1
1 1 

This means there are 45 entities (surfaces, cubes, circles, whatever you "mark" as an entity while creating the geometry), with 199932 total elements, with ID's ranging from 1 -> 199932. The first entity has dimension 0, ID 1, element type 15 (a single point), and 1 element. That element has ID 1 is made up of coordinate 1.

My question: what is the corresponding definition in warp3d language for points? I looked through setelb.f which as far as I could find was the place where these things are defined, and the closest identifier I could find was either bar2 or link2, but I'm not sure if this is correct. If not, should I just ignore points in the converter?

P.S. If there is interest, I would happily share the converter with the repo via a PR when it is completed.

rhdodds commented 4 years ago

Hello,

Glad you are attempting to write this code. I investigated GMESH again a few months ago but was disappointed that the user cannot define loading on the model (e.g. pressures on element faces). Maybe I don't understand GMESH capabilities well enough.

WARP3D has no concept of surfaces, points, cubes, circles. Those are just the geometry items in GMESH. You just need the nodal coordinates, element types such as 8-node hex, 20-node hex, 10-node tet,... and the incidences (that's what us old timers call the element-to-node connectivities).

A key point for WARP3D: the nodes must be numbered sequentially from 1 -> last node. Elements must be numbered sequentially from 1-> last element. If GMESH does not provide this capability, it can be done in your Python translator.

I would focus on getting a simple model with a few hex-8 elements converted to WARP3D. Then extend code from there.

I would be glad to help - this is much needed for WARP3D.

Also, make sure you are using Python 3.

You can use my direct email if you wish: rhdodds@gmail.com

Best

Bob Dodds

Jacobfaib commented 4 years ago

A key point for WARP3D: the nodes must be numbered sequentially from 1 -> last node. Elements must be numbered sequentially from 1-> last element. If GMESH does not provide this capability, it can be done in your Python translator.

I see, yeah this is handled in the code already. On a related note, does warp3d prescribe a specific ordering on the nodes that comprise the element (lexicographical, increasing)? How about handling different element types for different sets of nodes, say tets on boundaries and hexes elsewhere? Is it as simple as:

elements
 1 - 5 type tet4 6 - 10 type hex8

I would be glad to help - this is much needed for WARP3D.

I will go ahead and open a PR then, that way you can take a look at the src

rhdodds commented 4 years ago
  1. WARP3D prescribes the ordering of nodes on each element type. Manual Sections 3.1, 3.2 and 3.3 show these orderings. Example: Fig. 3.1.1 shows the ordering for isoparametric hex elements. I expect GMESH supports only the 8-node and 20-node elements. WARP3D has specialized hex transition elements that GMESH likely does not support. Fig. 3.1.1. notes that the WARP3D local node ordering for the 8 & 20 node elements is the same as used in Abaqus.

  2. Sequential numbering. Suppose the model has 10 elements. The elements must be numbered 1->10 w/o any "holes".

    But there is no requirement for sequential element numbering by element type. Thus the following input is fine:

    structure beam number of nodes 50 elements 10 elements 1 3 5 7 9 type l3disop material ... $ 8-node hex 2 4 6 8 10 type tet10 ... $ 10-node get ... ...

Bob