Factor_dh.h

00001 /*@HEADER
00002 // ***********************************************************************
00003 //
00004 //       Ifpack: Object-Oriented Algebraic Preconditioner Package
00005 //                 Copyright (2009) 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 #ifndef FACTOR_DH
00031 #define FACTOR_DH
00032 
00033 #include "euclid_common.h"
00034 
00035 #ifdef __cplusplus
00036 extern "C"
00037 {
00038 #endif
00039 
00040   struct _factor_dh
00041   {
00042     /* dimensions of local rectangular submatrix; global matrix is n*n */
00043     int m, n;
00044 
00045     int id;         /* this subdomain's id after reordering */
00046     int beg_row;        /* global number of 1st locally owned row */
00047     int first_bdry;     /* local number of first boundary row */
00048     int bdry_count;     /* m - first_boundary */
00049 
00050     /* if true, factorization was block jacobi, in which case all
00051        column indices are zero-based; else, they are global.
00052      */
00053     bool blockJacobi;
00054 
00055     /* sparse row-oriented storage for locally owned submatrix */
00056     int *rp;
00057     int *cval;
00058     REAL_DH *aval;
00059     int *fill;
00060     int *diag;
00061     int alloc;          /* currently allocated length of cval, aval, and fill arrays */
00062 
00063     /* used for PILU solves (Apply) */
00064     int num_recvLo, num_recvHi;
00065     int num_sendLo, num_sendHi; /* used in destructor */
00066     double *work_y_lo;      /* recv values from lower nabors; also used as
00067                    work vector when solving Ly=b for y.
00068                  */
00069     double *work_x_hi;      /* recv values from higher nabors; also used as
00070                    work vector when solving Ux=y for x.
00071                  */
00072     double *sendbufLo, *sendbufHi;
00073     int *sendindLo, *sendindHi;
00074     int sendlenLo, sendlenHi;
00075     bool solveIsSetup;
00076     Numbering_dh numbSolve;
00077 
00078     MPI_Request recv_reqLo[MAX_MPI_TASKS], recv_reqHi[MAX_MPI_TASKS];   /* used for persistent comms */
00079     MPI_Request send_reqLo[MAX_MPI_TASKS], send_reqHi[MAX_MPI_TASKS];   /* used for persistent comms */
00080     MPI_Request requests[MAX_MPI_TASKS];
00081     MPI_Status status[MAX_MPI_TASKS];
00082 
00083     bool debug;
00084   };
00085 
00086   extern void Factor_dhCreate (Factor_dh * mat);
00087   extern void Factor_dhDestroy (Factor_dh mat);
00088 
00089   extern void Factor_dhTranspose (Factor_dh matIN, Factor_dh * matOUT);
00090 
00091   extern void Factor_dhInit (void *A, bool fillFlag, bool avalFlag,
00092                  double rho, int id, int beg_rowP, Factor_dh * F);
00093 
00094   extern void Factor_dhReallocate (Factor_dh F, int used, int additional);
00095   /* ensures fill, cval, and aval arrays can accomodate
00096      at least "c" additional entrie
00097    */
00098 
00099   /* adopted from ParaSails, by Edmond Chow */
00100   extern void Factor_dhSolveSetup (Factor_dh mat, SubdomainGraph_dh sg);
00101 
00102 
00103   extern void Factor_dhSolve (double *rhs, double *lhs, Euclid_dh ctx);
00104   extern void Factor_dhSolveSeq (double *rhs, double *lhs, Euclid_dh ctx);
00105 
00106   /* functions for monitoring stability */
00107   extern double Factor_dhCondEst (Factor_dh mat, Euclid_dh ctx);
00108   extern double Factor_dhMaxValue (Factor_dh mat);
00109   extern double Factor_dhMaxPivotInverse (Factor_dh mat);
00110 
00111   extern int Factor_dhReadNz (Factor_dh mat);
00112   extern void Factor_dhPrintTriples (Factor_dh mat, char *filename);
00113 
00114   extern void Factor_dhPrintGraph (Factor_dh mat, char *filename);
00115   /* seq only */
00116 
00117 
00118   extern void Factor_dhPrintDiags (Factor_dh mat, FILE * fp);
00119   extern void Factor_dhPrintRows (Factor_dh mat, FILE * fp);
00120   /* prints local matrix to logfile, if open */
00121 
00122 #ifdef __cplusplus
00123 }
00124 #endif
00125 #endif
 All Classes Files Functions Variables Enumerations Friends
Generated on Wed Apr 13 10:05:22 2011 for IFPACK by  doxygen 1.6.3