Case2 Output of a Regular Grid

 

The data files for the project are in directory: SpatVar_002\Exercises\Case 2\Data. Look for ! TODO  text in the datafile and follow the instructions.

 

Case2 example shows how to define a regular grid with rectangular cells and export the values at grid points. To do that first the Spatial_grid needs to be created (this will internally create an "empty" spatial grid). Then the Spatial_grid_output data structure may be assigned the created spatial grid to map variable values at grid nodes for output.

 

Spatial_grid

Data File

 

 

* Spatial_grid    NUM=1

! ---------------------------------

 Name      "Complete_Domain"

 Type                "Grid1"

 Grid_origin           IDM=3

  /MinX/  0.0

  /MinY/  0.0

  /MinZ/  0.0

 Num_cells_x               5

 Num_cells_y             100

 Num_cells_z               1

 Cell_division_x          20

 Cell_division_y          10

 Cell_division_z           0        

 

 

1Spatial_grid data structure is defined

2The name of the grid is set to "Complete_Domain"

3The type of grid is set to "Grid1" (grid with rectangular cells with same size in each direction. For more info on grid types see Spatial_grid)

4The grid origin is specified at (X, Y, Z) = (0, 0, 0)

5In X direction grid is discretized in 5 cells of 20 m each. In Y direction grid is discretized in 100 cells of 10 m each. In Z direction no discretization is made.

 

 

 

The Spatial_grid_output is defined after the second Control_data so that the exported results correspond to the end of the analysis.

 

Spatial_grid_output

Data File

 

 

* Spatial_grid_output  NUM=1

! ---------------------------------

 Name               "Complete_Domain"

 Grid_assignment    "Complete_Domain"

 File_name               "OutputGrid"

 Grid_name_flag                    1  

 Geometry_entity_flag              0  

 Element_variables       IDM=5

  "Strs_xx"  

 "Strs_yy"  

 "Strs_xy"

  "Press"    

 "Efstrs"

 

 

1The name of the exported grid is set to "Complete_Domain". Note that even though the previously created grid was named "Complete_Domain" a name for the exported grid may be defined (which may be different to the previously created grid name). If not defined the exported grid will be named with a generic name "Spat_grid".

2Previously created grid named "Complete_Domain" is assigned to map the values into it and export.

3File name is defined as "OutputGrid". Because Grid_name_flag is set to 1 the exported file name will be "OutputGrid_Complete_Domain.spat"

4Geometry_entity_flag is set to 0 so geometry entities at each grid point are not output.

5The element variables to be mapped to the grid and exported are specified. They are Stress in X and Y directions, Shear stress in XY plane, Effective Mean Stress (Press) and deviatoric stress (Efstrs).

 

 

 

 

Results

The result files for the project are in directory: SpatVar_002\Exercices\Case2\Results. Note that there are grid points for which the exported values are 0. This is because the grid points are outside of the model domain due to compaction. Optionally Boundary_map_flag may be set to 1 in the Spatial_grid data structure defined in the datafile prior to output. This will result in assigning the closest value to grid points outside model domain.

 

OutputGrid_Complete_Domain.spat

Data File

 

 

* Spatial_grid NUM=1

! ----------------------------------------

 Name                     "Complete_Domain"

 Type                     "Grid3"

 Groups                           IDM=1

    "Sandstone"

 Nodal_variables                  IDM=5

    "Strs_xx"

    "Strs_yy"

    "Strs_xy"

    "Press"

    "Efstrs"

 Num_cells_x                         5

 Num_cells_y                       100

 Num_cells_z                         1

 Grid_coordinates                 IDM=2  JDM=606

   0.00000        0.00000    

   20.0000        0.00000    

   40.0000        0.00000

    .

    .

    .

  100.000        1000.00

Point_values                     IDM=5  JDM=606

  -9.26258   -37.1111   -0.209789E-01   -18.5495   27.8424    

  -9.28407   -37.1973   -0.699227E-03   -18.5925   27.9071    

  -9.28177   -37.1952   -0.685243E-03   -18.5908   27.9066  

    .

    .

    .

  0.00000    0.00000    0.00000         0.00000    0.00000  

 Auto_delete_flag                    0

 

 

1Spatial_grid data is defined.

2Type is set to "Grid3" (Regular grid with constant number of divisions each direction but with optionally variable division size. For more information on grid types see Spatial_grid).

3Groups with grid data are defined. In this case there is only one group named "Sandstone".

4The Element_variables for which the grid contains values are specified.

5Number of cells in each direction are defined. In this case the grid is 5 x 100 x 1 cells.

6Grid_coordinates for every grid point are defined.

7Values at each grid point for the five specified variables are provided. Each column correspond to the variables specified in Element_variables following the same order. Each row correspond to each grid point with coordinates specified in Grid_coordinates following the same order.

8Auto_delete_flag = 0 means that grid will be automatically deleted after being used by ParaGeo for any other operation (if loaded to any other ParaGeo model).

 

 

 

 

SpatVar_002_Case2_Results

View of the defined grid.