|
IFPACK Development
|
00001 /*@HEADER 00002 // *********************************************************************** 00003 // 00004 // Ifpack: Object-Oriented Algebraic Preconditioner Package 00005 // Copyright (2002) Sandia Corporation 00006 // 00007 // Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive 00008 // license for use of this work by or on behalf of the U.S. Government. 00009 // 00010 // This library is free software; you can redistribute it and/or modify 00011 // it under the terms of the GNU Lesser General Public License as 00012 // published by the Free Software Foundation; either version 2.1 of the 00013 // License, or (at your option) any later version. 00014 // 00015 // This library is distributed in the hope that it will be useful, but 00016 // WITHOUT ANY WARRANTY; without even the implied warranty of 00017 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 // Lesser General Public License for more details. 00019 // 00020 // You should have received a copy of the GNU Lesser General Public 00021 // License along with this library; if not, write to the Free Software 00022 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 00023 // USA 00024 // Questions? Contact Michael A. Heroux (maherou@sandia.gov) 00025 // 00026 // *********************************************************************** 00027 //@HEADER 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 /* AZ_ifpack_solve*/
1.7.4