ViZiR 4 Samples

Single elements samples

Here are single elements samples (only one element):

To launch one of this mesh:

vizir4 -in name_of_the_mesh_file 

Single solutions samples

Here are single solutions samples (only one element):

A P0 solution

Download: P0SolOnTriangle.mesh (the simple mesh) and P0SolOnTriangle.sol (the P0 solution)

To launch this solution on this mesh, use

vizir4 -in P0SolOnTriangle 

solP0_triangle.jpg

A P1 solution

Download: P1SolOnTriangle.mesh (the simple mesh) and P1SolOnTriangle.sol (the P1 solution)

To launch this solution on this mesh, use

vizir4 -in P1SolOnTriangle 

solP1_triangle.jpg solP1_triangle_iso.jpg

A P3 solution

Download: P3SolOnTriangle.mesh (the simple mesh) and P3SolOnTriangle.sol (the P3 solution)

To launch this solution on this mesh, use

vizir4 -in P3SolOnTriangle 

solP3_triangle.jpg solP3_triangle_iso.jpg

List of meshes samples

To launch one of this mesh:

vizir4 -in name_of_the_mesh_file 
  • Download: cube_struct.mesh
    • Number Of Vertices 27
    • Number Of Quadrilaterals 24
    • Number Of Hexahedra 8
    cube_struct_mesh.jpg cube_struct_ref.jpg
  • Download: engrenage_hex.meshb
    • Number Of Vertices 285,809
    • Number Of Corners 181
    • Number Of Edges 7,190
    • Number Of Quadrilaterals 73,638
    • Number Of Hexahedra 248,052
    engrenage_mesh.jpg engrenage_ref.jpg
  • Download: tore.p2.meshb
    • Number Of Vertices 727,426
    • Number Of P2-Triangles 32,768
    • Number Of P2-Tetrahedra 521,624
    tore_mesh.jpg tore_ref.jpg
  • Download: falcon_surf.meshb
    • Number Of Vertices 319,942
    • Number Of Triangles 152,276
    falcon_surf_mesh.jpg falcon_surf_ref.jpg
  • Download: falcon.meshb
    • Number Of Vertices 319,942
    • Number Of Triangles 152,276
    falcon_mesh.jpg falcon_ref.jpg
  • Download: falcon-8.P3.curved.meshb
    • Number Of Vertices 1,194,486
    • Number Of Corners 679
    • Number Of P3-Edges 2,571
    • Number Of P3-Triangles 152,326
    • Number Of P3-Tetrahedra 183,702
falcon_cut_mesh.png

List of meshes/solutions samples

To launch one of this mesh with solution:

vizir4 -in name_of_the_mesh_file -sol name_of_the_sol_file

How to write files

Examples of meshes writing

We present some examples of meshes writing. The format is the Gamma Mesh Format (GMF) and follow the libMeshb format. More information about this format can be found at: https://github.com/LoicMarechal/libMeshb and in the user guide of ViZiR 4.

To sum up, a mesh file is composed of:
  • A mesh file version
  • The dimension (2 or 3)
  • The vertices: the number of points and the list of vertices (the coordinates x, y, z if 3D and an integer reference)
  • For each type of element: the number of given elements, the connectivity (the number of indexes depends on the element type) and an integer reference
  • The ordering is optional and can be given (otherwise a standard ordering is taken into account).

A triangular mesh

MeshVersionFormatted 3
				
Dimension
2

Vertices
3
0.0 0.0 1
1.0 0.0 1
0.0 1.0 1

Triangles
1
1 2 3 1

End
Here is an example of triangular mesh. Note that the dimension is two, then only the coordinates x and y are given with an integer reference (here equal to 1). The connectivity of the triangle is 1, 2, 3 and its reference 1.
tri_2d.jpg

A quadrilateral mesh

MeshVersionFormatted 3

Dimension
3

Vertices
4
0.0 0.0 0.0 1
1.0 0.0 0.0 1
1.0 1.0 0.0 1
0.0 1.0 0.0 1

Quadrilaterals
1
1 2 3 4 1

End
Here is an example of quadrilateral mesh. The dimension is 3. For each vertex, the coordinates (x, y, z) are given with an integer reference here equal to 1. The quadrilateral element is defined by its connectivity here 1, 2, 3 and 4 and a reference integer equal to 1.
qua_3d.jpg

All the meshes in the Single elements samples section section are in ACSII and give examples for each type of element.

Examples of solutions writing

We present how to render different solutions on a simple triangle. The mesh file is given below and is composed of the unit triangle. On the same triangle, 3 solutions are defined hereafter:

  • A P0 solution (i.e. constant) with the keyword SolAtTriangles.
  • A P1 solution (i.e. affine) with the keyword SolAtVertices.
  • A P3 solution (i.e. of degree 3) with the keyword HOSolAtTrianglesP1.
The mesh is defined by:
MeshVersionFormatted 3

Dimension
2

Vertices
3
0.0 0.0 1
1.0 0.0 1
0.0 1.0 1

Triangles
1
1 2 3 1

End

A P0 solution

The solution is defined by:
MeshVersionFormatted 3
		
Dimension 2

SolAtTriangles
1
1 1
2.0

End
	

Download: P0SolOnTriangle.mesh (the simple mesh) and P0SolOnTriangle.sol (the P0 solution)

To launch this solution on this mesh, use

vizir4 -in P0SolOnTriangle	

solP0_triangle.jpg

A P1 solution

The solution is defined by:
MeshVersionFormatted 3
		
Dimension
2

SolAtVertices
3
1 1
2.0
6.0
4.0

End
	

Download: P1SolOnTriangle.mesh (the simple mesh) and P1SolOnTriangle.sol (the P1 solution)

To launch this solution on this mesh, use

vizir4 -in P1SolOnTriangle 

solP1_triangle.jpg solP1_triangle_iso.jpg

A P3 solution

The solution is defined by:
MeshVersionFormatted 3
		
Dimension
2

HOSolAtTrianglesP1
1
1 1
3 10
-1 1 1 1 0 -1 0 1 -1 1

End

Download: P3SolOnTriangle.mesh (the simple mesh) and P3SolOnTriangle.sol (the P3 solution)

To launch this solution on this mesh, use

vizir4 -in P3SolOnTriangle 

solP3_triangle.jpg solP3_triangle_iso.jpg

Reordering for High-Order solutions

If we want to use Gauss Lobatto points of degree 3 in a quadrilateral, where 16 degrees of freedom (see the figure below) are introduced, the keyword HOSolAtQuadrilateralsQ1NodesPositions is used.

/quadQL3.pdf

The mesh file is simply:
MeshVersionFormatted 3
						
Dimension 2

Vertices
4
0 0 1
1 0 1
1 1 1
0 1 1

Quadrilaterals
1
1 2 3 4 1

End
The solution file is defined by:
MeshVersionFormatted 3
						
Dimension 2

HOSolAtQuadrilateralsQ1NodesPositions
16
0.000000 0.000000
0.276393 0.000000
0.723607 0.000000
1.000000 0.000000
0.000000 0.276393
0.276393 0.276393
0.723607 0.276393
1.000000 0.276393
0.000000 0.723607
0.276393 0.723607
0.723607 0.723607
1.000000 0.723607
0.000000 1.000000
0.276393 1.000000
0.723607 1.000000
1.000000 1.000000

HOSolAtQuadrilateralsQ1
1
1 1
3 16
0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0

End

Then, a high-order solution is defined on this quadrilateral:

GL.png

Using the libMeshb library

Using the libMeshb library to write meshes/solutions is by far the best way (in term of performance in particular). In the github of the library, there is an examples directory with several examples to write meshes (some in C, others in Fortran).

Have a look at the gitlab of cgns2meshb, a tool to convert CGNS files to GMF (i.e. .mesh[b], .sol[b]), can be useful as there are functions to write meshes and solutions using the libMeshb library.