Difference between revisions of "Create 2D Mesh Connectivity"
(Add info on Hex connectivity creation.) |
m |
||
Line 12: | Line 12: | ||
1 0 1 3 2 | 1 0 1 3 2 | ||
2 2 3 5 4 | 2 2 3 5 4 | ||
− | |||
== Tet Mesh Using Custom MGEN Code == | == Tet Mesh Using Custom MGEN Code == |
Revision as of 09:56, 26 August 2020
This will overview the process of how to create 2D mesh connectivity for some of our more custom meshes. This is particularly useful for utilizing the bar2vtk tools in VTKpytools.
Hex Mesh Using makeHexConnectivity.py
If you're dealing with a tensor-product (ie. fully structured) hexahedral grid, you can use the makeHexConnectivity.py
script to create a connectivity array from it. makeHexConnectivity.py
can be found in the examples directory of the VTKpytools git repository. Simply copy the script to whatever directory you like and change the nx
and ny
variables to match the number of x and y nodes for your grid, add the name of your desired output file, and run via python makeHexConnectivity.py
.
The resulting file will have each cell in it's own line. The first number is the cell number, while the proceeding 4 are the index of the each point that makes up the cell. Note that the node index starts at 0.
As an example, for ny=2
and nx=3
, the following is output:
1 0 1 3 2 2 2 3 5 4