1999-08-20 00:33:10 +08:00
|
|
|
/*BHEADER**********************************************************************
|
2008-07-18 09:34:48 +08:00
|
|
|
* Copyright (c) 2008, Lawrence Livermore National Security, LLC.
|
2006-07-28 07:26:57 +08:00
|
|
|
* Produced at the Lawrence Livermore National Laboratory.
|
2008-07-18 09:34:48 +08:00
|
|
|
* This file is part of HYPRE. See file COPYRIGHT for details.
|
1999-08-20 00:33:10 +08:00
|
|
|
*
|
2008-07-18 09:34:48 +08:00
|
|
|
* HYPRE is free software; you can redistribute it and/or modify it under the
|
|
|
|
|
* terms of the GNU Lesser General Public License (as published by the Free
|
|
|
|
|
* Software Foundation) version 2.1 dated February 1999.
|
1999-08-20 00:33:10 +08:00
|
|
|
*
|
|
|
|
|
* $Revision$
|
2006-07-28 07:26:57 +08:00
|
|
|
***********************************************************************EHEADER*/
|
|
|
|
|
|
2006-09-23 06:06:21 +08:00
|
|
|
|
|
|
|
|
|
2007-11-14 03:56:09 +08:00
|
|
|
|
1999-08-20 00:33:10 +08:00
|
|
|
/******************************************************************************
|
|
|
|
|
*
|
|
|
|
|
* Header info for the SparseMSG solver
|
|
|
|
|
*
|
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
|
|
#ifndef hypre_SparseMSG_HEADER
|
|
|
|
|
#define hypre_SparseMSG_HEADER
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
|
* hypre_SparseMSGData:
|
|
|
|
|
*--------------------------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
MPI_Comm comm;
|
|
|
|
|
|
|
|
|
|
double tol;
|
2010-12-23 09:25:40 +08:00
|
|
|
HYPRE_Int max_iter;
|
|
|
|
|
HYPRE_Int rel_change;
|
|
|
|
|
HYPRE_Int zero_guess;
|
|
|
|
|
HYPRE_Int jump;
|
1999-08-20 00:33:10 +08:00
|
|
|
|
2010-12-23 09:25:40 +08:00
|
|
|
HYPRE_Int relax_type; /* type of relaxation to use */
|
2007-03-10 02:05:37 +08:00
|
|
|
double jacobi_weight; /* weighted jacobi weight */
|
2010-12-23 09:25:40 +08:00
|
|
|
HYPRE_Int usr_jacobi_weight; /* indicator flag for user weight */
|
2007-03-10 02:05:37 +08:00
|
|
|
|
2010-12-23 09:25:40 +08:00
|
|
|
HYPRE_Int num_pre_relax; /* number of pre relaxation sweeps */
|
|
|
|
|
HYPRE_Int num_post_relax; /* number of post relaxation sweeps */
|
|
|
|
|
HYPRE_Int num_fine_relax; /* number of fine relaxation sweeps */
|
1999-08-20 00:33:10 +08:00
|
|
|
|
2010-12-23 09:25:40 +08:00
|
|
|
HYPRE_Int num_grids[3]; /* number of grids in each dim */
|
2010-12-21 03:27:44 +08:00
|
|
|
HYPRE_Int num_all_grids;
|
|
|
|
|
HYPRE_Int num_levels;
|
1999-08-20 00:33:10 +08:00
|
|
|
|
|
|
|
|
hypre_StructGrid **grid_array;
|
2000-04-20 00:23:11 +08:00
|
|
|
hypre_StructGrid **Px_grid_array;
|
|
|
|
|
hypre_StructGrid **Py_grid_array;
|
|
|
|
|
hypre_StructGrid **Pz_grid_array;
|
|
|
|
|
|
|
|
|
|
double *data;
|
1999-08-20 00:33:10 +08:00
|
|
|
hypre_StructMatrix **A_array;
|
2000-04-20 00:23:11 +08:00
|
|
|
hypre_StructMatrix **Px_array;
|
|
|
|
|
hypre_StructMatrix **Py_array;
|
|
|
|
|
hypre_StructMatrix **Pz_array;
|
|
|
|
|
hypre_StructMatrix **RTx_array;
|
|
|
|
|
hypre_StructMatrix **RTy_array;
|
|
|
|
|
hypre_StructMatrix **RTz_array;
|
1999-08-20 00:33:10 +08:00
|
|
|
hypre_StructVector **b_array;
|
|
|
|
|
hypre_StructVector **x_array;
|
|
|
|
|
|
|
|
|
|
/* temp vectors */
|
2000-04-20 00:23:11 +08:00
|
|
|
hypre_StructVector **t_array;
|
1999-08-20 00:33:10 +08:00
|
|
|
hypre_StructVector **r_array;
|
|
|
|
|
hypre_StructVector **e_array;
|
|
|
|
|
|
2000-04-20 00:23:11 +08:00
|
|
|
hypre_StructVector **visitx_array;
|
|
|
|
|
hypre_StructVector **visity_array;
|
|
|
|
|
hypre_StructVector **visitz_array;
|
2010-12-23 09:25:40 +08:00
|
|
|
HYPRE_Int *grid_on;
|
2000-04-20 00:23:11 +08:00
|
|
|
|
|
|
|
|
void **relax_array;
|
|
|
|
|
void **matvec_array;
|
|
|
|
|
void **restrictx_array;
|
|
|
|
|
void **restricty_array;
|
|
|
|
|
void **restrictz_array;
|
|
|
|
|
void **interpx_array;
|
|
|
|
|
void **interpy_array;
|
|
|
|
|
void **interpz_array;
|
1999-08-20 00:33:10 +08:00
|
|
|
|
|
|
|
|
/* log info (always logged) */
|
2010-12-23 09:25:40 +08:00
|
|
|
HYPRE_Int num_iterations;
|
|
|
|
|
HYPRE_Int time_index;
|
|
|
|
|
HYPRE_Int print_level;
|
1999-08-20 00:33:10 +08:00
|
|
|
|
|
|
|
|
/* additional log info (logged when `logging' > 0) */
|
2010-12-23 09:25:40 +08:00
|
|
|
HYPRE_Int logging;
|
1999-08-20 00:33:10 +08:00
|
|
|
double *norms;
|
|
|
|
|
double *rel_norms;
|
|
|
|
|
|
|
|
|
|
} hypre_SparseMSGData;
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
|
* Utility routines:
|
|
|
|
|
*--------------------------------------------------------------------------*/
|
|
|
|
|
|
2000-04-20 00:23:11 +08:00
|
|
|
#define hypre_SparseMSGMapIndex(lx, ly, lz, nl, index) \
|
|
|
|
|
index = (lx) + ((ly) * nl[0]) + ((lz) * nl[0] * nl[1])
|
1999-08-20 00:33:10 +08:00
|
|
|
|
|
|
|
|
#endif
|