1. Building a Hex Mesh

First, we are going to construct a structured hex mesh. The hex mesh will span from 0 meters to 4000 m, 4000 m, and 3000 m, for the x/y/z coordinates respectively.

For both consistency and rapid parameter manipulation, these can be stored in variables. In LaGriT, variables are assigned using the define keyword.

define / X0 / 0.
define / X1 / 4000.
define / Y0 / 0.
define / Y1 / 4000.
define / Z0 / 0.
define / Z1 / 3000.

define / NX / 51
define / NY / 51
define / NZ / 26

define / MONAME / mohex

Above, the spatial domain (X0,X1,Y0,...), element density (NX/NY/NZ), and mesh name (MONAME) have been defined.

Next, we will create an empty mesh object, with element type hex, using the cmo / create command:

cmo / create / MONAME / / / hex

Due to the variable assignment of MONAME <- mohex above, this command is translated internally as:

cmo / create / mohex / / / hex

This empty object can then be populated with nodes and elements. The createpts / brick command will generate a defined number of hex elements across a defined domain.

createpts / brick / xyz / NX NY NZ / X0 Y0 Z0 / X1 Y1 Z1 / 1 1 1

NX number of hex elements, along with their corresponding vertices, have been created in the spatial domain spanning X0->X1, along with NY elements in the Y domain and NZ elements in the Z domain.

Optionally, save the mesh object:

dump / avs / tmp_hex_01.inp / MONAME

This file can be rendered in certain scientific 3D visualization applications, such as ParaView.