... Vec b; ... VecCreate(PETSC_COMM_WORLD,&b); VecSetSizes(b,PETSC_DECIDE,dim); VecSetFromOptions(b); ... VecSetValue(b,0,val,INSERT_VALUES); //les tableaux commencent à l'indice 0 VecView(b,PETSC_VIEWER_STDOUT_SELF); ... VecDestroy(b); ...