xp_comm_proj/rd_cgns/structured.c
/* reads vertex data for a structured field, and sets */
/* the multi-block structure, returns 0 if all OK, 1 otherwise */
reads vertex data for a structured field, and sets
the multi-block structure, returns 0 if all OK, 1 otherwise
reads vertex data for a structured field and sets the multi - block structure returns 0 if all OK 1 otherwise
int
add_structured_vrtx_data(OMobj_id DVread_cgns_id, char *file_name,
	int base, int zone, int fld_el_indx, int index_dim, int *vertex_size,
	int *rind, int solution)
{
	int	f_indx;
	OMobj_id	mb_id, fld_id, fld_el_id;
	int	stat;
	char	*cg_err_str;
	mb_id = OMfind_subobj(DVread_cgns_id, OMstr_to_name("Multi_Block"),
		OM_OBJ_RW);
	if(OMis_null_obj(mb_id))
	{
		ERRverror("DVread_cgns:add_structured_vrtx_data",ERR_INFO,
			"can't locate Multi_Block object\n");
		return (1);
	}
	fld_id = OMfind_subobj(mb_id, OMstr_to_name("fields"),
		OM_OBJ_RW);
	if(OMis_null_obj(fld_id))
	{
		ERRverror("DVread_cgns:add_structured_cell_data",ERR_INFO,
			"can't locate fields object\n");
		return (1);
	}
	if(OMget_array_val(fld_id, fld_el_indx, &fld_el_id, OM_OBJ_RW)
		!= OM_STAT_SUCCESS)
	{
		ERRverror("DVread_cgns:add_structured_vrtx_data",ERR_INFO,
			"can't get fld_el_id element object\n");
		return (0);
	}
	if(cg_open(file_name, MODE_READ, &f_indx))
	{
		OMset_name_str_val(DVread_cgns_id, OMstr_to_name("status"),
			cg_get_error());
		return (1);
	}
	stat = add_str_vrtx_data(fld_el_id, base, zone, index_dim, vertex_size,
		rind, solution, f_indx, &cg_err_str);
	if(stat)
	{
		if(cg_err_str != NULL)
			OMset_name_str_val(DVread_cgns_id, OMstr_to_name("status"), cg_err_str);
		cg_close(f_indx);
		return (1);
	}
	cg_close(f_indx);
	return (0);
}
int add_structured_vrtx_data ( OMobj_id DVread_cgns_id , char * file_name , int base , int zone , int fld_el_indx , int index_dim , int * vertex_size , int * rind , int solution ) { int f_indx ; OMobj_id mb_id , fld_id , fld_el_id ; int stat ; char * cg_err_str ; mb_id = OMfind_subobj ( DVread_cgns_id , OMstr_to_name ( " " ) , OM_OBJ_RW ) ; if ( OMis_null_obj ( mb_id ) ) { ERRverror ( " " , ERR_INFO , " \n " ) ; return ( 1 ) ; } fld_id = OMfind_subobj ( mb_id , OMstr_to_name ( " " ) , OM_OBJ_RW ) ; if ( OMis_null_obj ( fld_id ) ) { ERRverror ( " " , ERR_INFO , " \n " ) ; return ( 1 ) ; } if ( OMget_array_val ( fld_id , fld_el_indx , & fld_el_id , OM_OBJ_RW ) != OM_STAT_SUCCESS ) { ERRverror ( " " , ERR_INFO , " \n " ) ; return ( 0 ) ; } if ( cg_open ( file_name , MODE_READ , & f_indx ) ) { OMset_name_str_val ( DVread_cgns_id , OMstr_to_name ( " " ) , cg_get_error ( ) ) ; return ( 1 ) ; } stat = add_str_vrtx_data ( fld_el_id , base , zone , index_dim , vertex_size , rind , solution , f_indx , & cg_err_str ) ; if ( stat ) { if ( cg_err_str != NULL ) OMset_name_str_val ( DVread_cgns_id , OMstr_to_name ( " " ) , cg_err_str ) ; cg_close ( f_indx ) ; return ( 1 ) ; } cg_close ( f_indx ) ; return ( 0 ) ; }
reads vertex data for a structured field, and sets
the multi-block structure, returns 0 if all OK, 1 otherwise
reads vertex data for a structured field and sets the multi - block structure returns 0 if all OK 1 otherwise
/* find the Multi_Block object */ /* find the fields object */ /* CGNS open file */