Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
1390 GridGen Example
Parallel Grid Generation Example
The code for this example is located in
This example creates simple cubic or prismatic mesh
This example may run in both serial and parallel modes with
The virtual IJK-structure with user defined sizes is used to cover the unit cube
In parallel mode this structure is split into
NP rectangular superblocks.
Local IJK-structures are created in each superblock separately.
Depending on user defined choice in each IJK block either one cubical cell, or two triangular prismatic cells are created.
In the latter case the direction of diagonal plane is changed in staggered order.
Two images below show cuts through the generated volume meshes with prismatic and cubic cells.
Usage: ./GridGen ng nx ny nz [output.[p]vtk]
- First parameter
ng=3stands for Prismatic generator and
ng=4for Cubic one.
nzare the IJK-structure sizes.
- Last optional parameter – output file name, default:
grid.vtkfor serial runs and
grid.pvtkfor parallel runs.
If you compiled INMOST with
USE_MPI=ON you can generate and save mesh in parallel. The following line will create 32x32x32 cubic grid using 4 processes:
$ cd Examples/GridGen $ mpirun -np 4 ./GridGen 4 32 32 32 /tmp/grid-32-32-32.pvtk Cubic Grid: 32 x 32 x 32 Processors: 4 Mesh generator time: 0.14828 Save to file "/tmp/grid-32-32-32.pvtk" time: 0.060786
If you have ParaView installed, you can open pvtk file:
$ paraview --data=/tmp/grid-32-32-32.pvtk
You can view the following tags:
P_OWNER_PROCESSOR– partitioning to processors
GLOBAL_ID– global cell ID number