hypre/struct_ls/sparse_msg.h

106 lines
3.6 KiB
C

/*BHEADER**********************************************************************
* Copyright (c) 2008, Lawrence Livermore National Security, LLC.
* Produced at the Lawrence Livermore National Laboratory.
* This file is part of HYPRE. See file COPYRIGHT for details.
*
* 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.
*
* $Revision$
***********************************************************************EHEADER*/
/******************************************************************************
*
* Header info for the SparseMSG solver
*
*****************************************************************************/
#ifndef hypre_SparseMSG_HEADER
#define hypre_SparseMSG_HEADER
/*--------------------------------------------------------------------------
* hypre_SparseMSGData:
*--------------------------------------------------------------------------*/
typedef struct
{
MPI_Comm comm;
double tol;
HYPRE_Int max_iter;
HYPRE_Int rel_change;
HYPRE_Int zero_guess;
HYPRE_Int jump;
HYPRE_Int relax_type; /* type of relaxation to use */
double jacobi_weight; /* weighted jacobi weight */
HYPRE_Int usr_jacobi_weight; /* indicator flag for user weight */
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 */
HYPRE_Int num_grids[3]; /* number of grids in each dim */
HYPRE_Int num_all_grids;
HYPRE_Int num_levels;
hypre_StructGrid **grid_array;
hypre_StructGrid **Px_grid_array;
hypre_StructGrid **Py_grid_array;
hypre_StructGrid **Pz_grid_array;
double *data;
hypre_StructMatrix **A_array;
hypre_StructMatrix **Px_array;
hypre_StructMatrix **Py_array;
hypre_StructMatrix **Pz_array;
hypre_StructMatrix **RTx_array;
hypre_StructMatrix **RTy_array;
hypre_StructMatrix **RTz_array;
hypre_StructVector **b_array;
hypre_StructVector **x_array;
/* temp vectors */
hypre_StructVector **t_array;
hypre_StructVector **r_array;
hypre_StructVector **e_array;
hypre_StructVector **visitx_array;
hypre_StructVector **visity_array;
hypre_StructVector **visitz_array;
HYPRE_Int *grid_on;
void **relax_array;
void **matvec_array;
void **restrictx_array;
void **restricty_array;
void **restrictz_array;
void **interpx_array;
void **interpy_array;
void **interpz_array;
/* log info (always logged) */
HYPRE_Int num_iterations;
HYPRE_Int time_index;
HYPRE_Int print_level;
/* additional log info (logged when `logging' > 0) */
HYPRE_Int logging;
double *norms;
double *rel_norms;
} hypre_SparseMSGData;
/*--------------------------------------------------------------------------
* Utility routines:
*--------------------------------------------------------------------------*/
#define hypre_SparseMSGMapIndex(lx, ly, lz, nl, index) \
index = (lx) + ((ly) * nl[0]) + ((lz) * nl[0] * nl[1])
#endif