00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include <stdio.h>
00031 #include <stdlib.h>
00032 #include <math.h>
00033 #include <string.h>
00034 #include "az_aztec.h"
00035 #include "az_ifpack.h"
00036
00037 void AZ_ifpack_solve(double x[], double b[], int options[], double params[],
00038 int indx[], int bindx[], int rpntr[], int cpntr[], int bpntr[],
00039 double val[], int data_org[], double status[], int proc_config[])
00040 {
00041 AZ_MATRIX *Amat;
00042
00043 Amat = AZ_matrix_create(data_org[AZ_N_internal]+data_org[AZ_N_border]);
00044
00045 options[AZ_output] = 1;
00046 if (data_org[AZ_matrix_type] == AZ_MSR_MATRIX)
00047 AZ_set_MSR(Amat, bindx, val, data_org, 0, NULL, AZ_LOCAL);
00048 else if (data_org[AZ_matrix_type] == AZ_VBR_MATRIX)
00049 AZ_set_VBR(Amat, rpntr, cpntr, bpntr, indx, bindx, val,
00050 data_org, 0, NULL, AZ_LOCAL);
00051 else {
00052 fprintf(stderr,"Unknown matrix type (%d)\n",data_org[AZ_matrix_type]);
00053 fprintf(stderr,"Matrix-free is now available via AZ_iterate()\n");
00054 exit(1);
00055 }
00056
00057 AZ_ifpack_iterate(x, b, options, params, status, proc_config, Amat);
00058
00059 AZ_matrix_destroy(&Amat);
00060
00061 }
00062