Numbering_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 NUMBERING_DH_H
00031 #define NUMBERING_DH_H
00032 
00033 
00034 /* code and algorithms in this class adopted from Edmond Chow's
00035    ParaSails
00036 */
00037 
00038 
00039 #include "euclid_common.h"
00040 
00041 #ifdef __cplusplus
00042 extern "C"
00043 {
00044 #endif
00045 
00046   struct _numbering_dh
00047   {
00048     int size;           /* max number of indices that can be stored;
00049                    (length of idx_ext[]) 
00050                  */
00051     int first;          /* global number of 1st local index (row) */
00052     int m;          /* number of local indices (number of local rows in mat) */
00053     int *idx_ext;       /* sorted list of external indices */
00054     int *idx_extLo;     /* sorted list of external indices that are < first */
00055     int *idx_extHi;     /* sorted list of external indices that are >= first+m */
00056     int num_ext;        /* number of external (non-local) indices = num_extLo+num_extHi */
00057     int num_extLo;      /* number of external indices < first */
00058     int num_extHi;      /* number of external indices >= first+num_loc */
00059     Hash_i_dh global_to_local;
00060 
00061     bool debug;
00062   };
00063 
00064   extern void Numbering_dhCreate (Numbering_dh * numb);
00065   extern void Numbering_dhDestroy (Numbering_dh numb);
00066 
00067   /* must be called before calling Numbering_dhGlobalToLocal() or
00068      Numbering_dhLocalToGlobal().
00069    */
00070   extern void Numbering_dhSetup (Numbering_dh numb, Mat_dh mat);
00071 
00072 
00073   /* input: global_in[len], which contains global row numbers.
00074      output: local_out[len], containing corresponding local numbers.
00075      note: global_in[] and local_out[] may be identical.
00076    */
00077   extern void Numbering_dhGlobalToLocal (Numbering_dh numb, int len,
00078                      int *global_in, int *local_out);
00079 
00080 #ifdef __cplusplus
00081 }
00082 #endif
00083 #endif
 All Classes Files Functions Variables Enumerations Friends
Generated on Wed Apr 13 10:05:23 2011 for IFPACK by  doxygen 1.6.3