hypre/struct_mv/struct_vector.h
falgout b365889e9f Completed the implementation of SetNeighborBox for all variable types:
- Generalized the Struct communication routines to handle data transformations
- Added more flexibility to Set(Box)Values routines for efficiency.
- Inter-part shared boundary data is now updated appropriately
- Added SetNeighborPart function (to replace SetNeighborBox)
- Added a finite-element-style input file capability for the sstruct driver
- The Split solver can now be used standalone (added to struct/sstruct drivers)
- Added a Jacobi block solver to Split (useful for regression testing)
- Added regression tests for the new SetNeighborPart features
2008-01-23 01:14:45 +00:00

92 lines
3.9 KiB
C

/*BHEADER**********************************************************************
* Copyright (c) 2007, Lawrence Livermore National Security, LLC.
* Produced at the Lawrence Livermore National Laboratory.
* Written by the HYPRE team. UCRL-CODE-222953.
* All rights reserved.
*
* This file is part of HYPRE (see http://www.llnl.gov/CASC/hypre/).
* Please see the COPYRIGHT_and_LICENSE file for the copyright notice,
* disclaimer, contact information and the GNU Lesser General Public License.
*
* HYPRE is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License (as published by the Free Software
* Foundation) version 2.1 dated February 1999.
*
* HYPRE is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the IMPLIED WARRANTY OF MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the terms and conditions of the GNU General
* Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*
* $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;
double *data; /* Pointer to vector data */
int data_alloced; /* Boolean used for freeing data */
int data_size; /* Size of vector data */
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. */
int num_ghost[6]; /* Num ghost layers in each direction */
int global_size; /* Total number coefficients */
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_StructVectorGlobalSize(vector) ((vector) -> global_size)
#define hypre_StructVectorRefCount(vector) ((vector) -> ref_count)
#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