hypre/struct_mv/struct_vector.h
falgout 46488e8cbc Added HYPRE_Complex and HYPRE_Real types in place of double.
Added an example code to test CG on a 4D HYPRE_SSTRUCT complex problem.
Added regression tests for bigint, maxdim, and complex.
Added a test to make sure double types are not added to the source.
See [Issue995] in the tracker for more details.
2013-10-11 19:48:06 +00:00

82 lines
3.5 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 hypre_StructVector structures
*
*****************************************************************************/
#ifndef hypre_STRUCT_VECTOR_HEADER
#define hypre_STRUCT_VECTOR_HEADER
/*--------------------------------------------------------------------------
* hypre_StructVector:
*--------------------------------------------------------------------------*/
typedef struct hypre_StructVector_struct
{
MPI_Comm comm;
hypre_StructGrid *grid;
hypre_BoxArray *data_space;
HYPRE_Complex *data; /* Pointer to vector data */
HYPRE_Int data_alloced; /* Boolean used for freeing data */
HYPRE_Int data_size; /* Size of vector data */
HYPRE_Int *data_indices; /* num-boxes array of indices into
the data array. data_indices[b]
is the starting index of vector
data corresponding to box b. */
HYPRE_Int num_ghost[2*HYPRE_MAXDIM]; /* Num ghost layers in each
* direction */
HYPRE_Int bghost_not_clear; /* Are boundary ghosts clear? */
HYPRE_Int global_size; /* Total number coefficients */
HYPRE_Int ref_count;
} hypre_StructVector;
/*--------------------------------------------------------------------------
* Accessor macros: hypre_StructVector
*--------------------------------------------------------------------------*/
#define hypre_StructVectorComm(vector) ((vector) -> comm)
#define hypre_StructVectorGrid(vector) ((vector) -> grid)
#define hypre_StructVectorDataSpace(vector) ((vector) -> data_space)
#define hypre_StructVectorData(vector) ((vector) -> data)
#define hypre_StructVectorDataAlloced(vector) ((vector) -> data_alloced)
#define hypre_StructVectorDataSize(vector) ((vector) -> data_size)
#define hypre_StructVectorDataIndices(vector) ((vector) -> data_indices)
#define hypre_StructVectorNumGhost(vector) ((vector) -> num_ghost)
#define hypre_StructVectorBGhostNotClear(vector)((vector) -> bghost_not_clear)
#define hypre_StructVectorGlobalSize(vector) ((vector) -> global_size)
#define hypre_StructVectorRefCount(vector) ((vector) -> ref_count)
#define hypre_StructVectorNDim(vector) \
hypre_StructGridNDim(hypre_StructVectorGrid(vector))
#define hypre_StructVectorBox(vector, b) \
hypre_BoxArrayBox(hypre_StructVectorDataSpace(vector), b)
#define hypre_StructVectorBoxData(vector, b) \
(hypre_StructVectorData(vector) + hypre_StructVectorDataIndices(vector)[b])
#define hypre_StructVectorBoxDataValue(vector, b, index) \
(hypre_StructVectorBoxData(vector, b) + \
hypre_BoxIndexRank(hypre_StructVectorBox(vector, b), index))
#endif