Interface c1¶
Interface CGNS/MLL functions¶
cg_nbases¶
fn |
int |
id of the file to use |
nbases |
int* |
number of bases in the file (output) |
Return non-null returned value means error
Remarks The nbase returned value is a single integer
API C int cg_nbases(int fn,int *nbases);
cg_base_read¶
fn |
int |
id of the file to use |
B |
int |
index of the target base |
name |
char* |
name of the target base (output) |
cdim |
int* |
CellDimension (output) |
pdim |
int* |
PhysicalDimension (output) |
Return non-null returned value means error
Remarks The CellDimension and PhysicalDimension are single integers.The name is an already allocated string of 33 chars (32+1)
API C int cg_base_read(int fn,int B,char *name,int *cdim,int *pdim);
cg_base_write¶
fn |
int |
id of the file to use |
name |
char* |
name of the new base (input) |
cdim |
int |
CellDimension (input) |
pdim |
int |
PhysicalDimension (input) |
B |
int* |
index of the new base |
Return non-null returned value means error
Remarks Creates a new base, there is no way to modify an existing base
API C int cg_base_write(int fn,char const *name,int cdim,int pdim,int *B);
cg_zone_write¶
fn |
int |
id of the file to use |
B |
int |
index of the target base |
name |
char* |
name of the new zone (input) |
zsize |
int* |
dimensions of the zone (input) |
ztype |
CG_ZoneType_t |
type of the new zone (input) |
Z |
int* |
index of the new zone |
Return non-null returned value means error
Remarks Creates a new zone, there is no way to modify an existing zone.Dimensions of the zsize array depends on the CGNSBase_t dimensions and the ZoneType_t (cf CGNS/SIDS).
API C int cg_zone_write(int fn, int B, char const *name,int const *zsize, CG_ZoneType_t ztype, int *Z);
cg_zone_type¶
fn |
int |
id of the file to use |
B |
int |
index of the target base |
Z |
int |
index of the target zone |
ztype |
CG_ZoneType_t* |
type of the zone (output) |
zsize |
int* |
dimensions of the zone (output) |
Return non-null returned value means error
API C int cg_zone_type(int fn, int B, int Z, CG_ZoneType_t *ztype);
cg_zone_read¶
fn |
int |
id of the file to use |
B |
int |
index of the target base |
Z |
int |
index of the target zone |
name |
char* |
name of the zone (output) |
zsize |
int* |
dimensions of the zone (output) |
Return non-null returned value means error
Remarks Dimensions of the zsize array depends on the CGNSBase_t dimensions and the ZoneType_t (cf CGNS/SIDS). It should be allocated before passed asarg to the function.
API C int cg_zone_read(int fn, int B, int Z, char *name, int *zsize);
cg_nzones¶
fn |
int |
id of the file to use |
B |
int |
index of the target base |
nzones |
int* |
number of Zone_t in the CGNSBase_t (output) |
Return non-null returned value means error
API C int cg_nzones(int fn,int B,int *nzones);
cg_ncoords¶
fn |
int |
id of the file to use |
B |
int |
index of the target base |
Z |
int |
index of the target zone |
ncoords |
int* |
number of GridCoordinates_t in the Zone_t (output) |
Return non-null returned value means error
API C int cg_ncoords(int fn, int B, int Z, int *ncoords);
cg_coord_info¶
fn |
int |
id of the file to use |
B |
int |
index of the target base |
Z |
int |
index of the target zone |
C |
int |
index of the target grid coordinates |
cgnstype |
CG_DataType_t* |
type of data in coords (output) |
name |
char* |
name of the grid coordinates |
Return non-null returned value means error
API C int cg_coord_info(int fn, int B, int Z, int C,CG_DataType_t *cgnstype, char *name);
cg_coord_read¶
fn |
int |
id of the file to use |
B |
int |
index of the target base |
Z |
int |
index of the target zone |
coordname |
char* |
name of the coordinate to read (input) |
cgnstype |
CG_DataType_t |
type of data in coords (input) |
rmin |
int* |
range min to load |
rmax |
int* |
range max to load |
Return non-null returned value means error
Remarks Skips the GridCoordinate node and gets the DataArray associated with it,then only the GridCoordinates node can be read using this function.Use DataArray read after a goto to get other grids.
API C int cg_coord_read(int fn, int B, int Z, char const * coordname,CG_DataType_t cgnstype, int const * rmin, int const * rmax,void *coord);
cg_coord_write¶
fn |
int |
id of the file to use |
B |
int |
index of the target base |
Z |
int |
index of the target zone |
cgnstype |
CG_DataType_t |
type of data in coords (input) |
coordname |
char* |
name of the coordinate to read (input) |
coord_ptr |
void* |
pointer to actual coordinates array (input) |
ZC |
int* |
index of the new grid coordinates node |
Return non-null returned value means error
Remarks Actual coordinates are referred to by a void* pointre. The type of thedata is set by the cgnstype arg.Data is copied, you can de-allocate arg array once the function returns.
API C int cg_coord_write(int fn, int B, int Z, CG_DataType_t cgnstype,char const * coordname, void const * coord_ptr, int *ZC);
Error Codes
1000
- Error on <pathname> level <level>
1001
- Name [<name>] not allowed
1002
- Child [<name>] already exists
1003
- Cannot find child [<index] of type [sidstype] in [name>]
1004
- Cannot find node [<path>]
1101
- No such Base index [<index>]
1102
- Base [<name] bad dimensions (cdim,pdim)=(cdim,pdim>)
1103
- Base write failed name [<name] (cdim,pdim)=(cdim,pdim>)
1201
- No such Zone index [<index>]
1202
- Zone [<name>] bad dimension
1203
- Zone [<name>] bad ZoneType
1204
- Zone write failed name [<name>]
1205
- Zone [<name>] type should be Structured/Unstructured
1301
- No such GridCoordinates index [<index>]
1302
- Create GridCoordinates failed for [<name>]