Integer

Definition

List 107 Example of a integer type grid attribute
1<Item name="obst" caption="Obstacle">
2  <Definition valueType="integer" position="cell">
3    <Enumeration value="0" caption="Normal cell" />
4    <Enumeration value="1" caption="Obstacle" />
5  </Definition>
6</Item>

Display example

../_images/grid_att_example_int_object_browser.png

Figure 65 Example of integer type grid attribute defined at cells

../_images/grid_att_example_int_edit_dialog.png

Figure 66 Dialog to edit value of integer type grid attribute defined at cells

Example code to read data

FORTRAN

List 108 Code example to load a integer type grid attribute defined at cells FORTRAN
1integer:: ier, cellcount
2integer, dimension(:), allocatable:: obst
3
4! Read size
5call cg_iRIC_Read_Grid_CellCount(fid, cellcount, ier)
6! Allocate memory
7allocate(roughness(cellcount))
8! Load values into the allocated memory
9call cg_iRIC_Read_Grid_Integer_Cell(fid, "obst", obst, ier)

C/C++

List 109 Code example to load a integer type grid attribute defined at cells C++
1int ier, cellcount;
2std::vector<int> obst;
3
4// Read size
5ier = cg_iRIC_Read_Grid_CellCount(fid, &cellcount);
6// Allocate memory
7obst.assign(cellcout, 0);
8// Load values into the allocated memory
9ier = cg_iRIC_Read_Grid_Integer_Cell(fid, "obst", obst.data());

Python

List 110 Code example to load a integer type grid attribute defined at cells Python
1obst = cg_iRIC_Read_Grid_Integer_Cell(fid, "obst")