| 1 | /*BHEADER**********************************************************************
|
|---|
| 2 | * Copyright (c) 2008, Lawrence Livermore National Security, LLC.
|
|---|
| 3 | * Produced at the Lawrence Livermore National Laboratory.
|
|---|
| 4 | * This file is part of HYPRE. See file COPYRIGHT for details.
|
|---|
| 5 | *
|
|---|
| 6 | * HYPRE is free software; you can redistribute it and/or modify it under the
|
|---|
| 7 | * terms of the GNU Lesser General Public License (as published by the Free
|
|---|
| 8 | * Software Foundation) version 2.1 dated February 1999.
|
|---|
| 9 | *
|
|---|
| 10 | * $Revision: 2.4 $
|
|---|
| 11 | ***********************************************************************EHEADER*/
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 | /******************************************************************************
|
|---|
| 17 | *
|
|---|
| 18 | * Header info for Parallel Vector data structure
|
|---|
| 19 | *
|
|---|
| 20 | *****************************************************************************/
|
|---|
| 21 |
|
|---|
| 22 | #ifndef hypre_PAR_VECTOR_HEADER
|
|---|
| 23 | #define hypre_PAR_VECTOR_HEADER
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 | /*--------------------------------------------------------------------------
|
|---|
| 27 | * hypre_ParVector
|
|---|
| 28 | *--------------------------------------------------------------------------*/
|
|---|
| 29 |
|
|---|
| 30 | typedef struct
|
|---|
| 31 | {
|
|---|
| 32 | MPI_Comm comm;
|
|---|
| 33 |
|
|---|
| 34 | HYPRE_BigInt global_size;
|
|---|
| 35 | HYPRE_BigInt first_index;
|
|---|
| 36 | HYPRE_BigInt last_index;
|
|---|
| 37 | HYPRE_BigInt *partitioning;
|
|---|
| 38 | hypre_Vector *local_vector;
|
|---|
| 39 |
|
|---|
| 40 | /* Does the Vector create/destroy `data'? */
|
|---|
| 41 | int owns_data;
|
|---|
| 42 | int owns_partitioning;
|
|---|
| 43 |
|
|---|
| 44 | hypre_IJAssumedPart *assumed_partition; /* only populated if no_global_partition option
|
|---|
| 45 | is used (compile-time option) AND this partition
|
|---|
| 46 | needed
|
|---|
| 47 | (for setting off-proc elements, for example)*/
|
|---|
| 48 |
|
|---|
| 49 |
|
|---|
| 50 | } hypre_ParVector;
|
|---|
| 51 |
|
|---|
| 52 | /*--------------------------------------------------------------------------
|
|---|
| 53 | * Accessor functions for the Vector structure
|
|---|
| 54 | *--------------------------------------------------------------------------*/
|
|---|
| 55 |
|
|---|
| 56 | #define hypre_ParVectorComm(vector) ((vector) -> comm)
|
|---|
| 57 | #define hypre_ParVectorGlobalSize(vector) ((vector) -> global_size)
|
|---|
| 58 | #define hypre_ParVectorFirstIndex(vector) ((vector) -> first_index)
|
|---|
| 59 | #define hypre_ParVectorLastIndex(vector) ((vector) -> last_index)
|
|---|
| 60 | #define hypre_ParVectorPartitioning(vector) ((vector) -> partitioning)
|
|---|
| 61 | #define hypre_ParVectorLocalVector(vector) ((vector) -> local_vector)
|
|---|
| 62 | #define hypre_ParVectorOwnsData(vector) ((vector) -> owns_data)
|
|---|
| 63 | #define hypre_ParVectorOwnsPartitioning(vector) ((vector) -> owns_partitioning)
|
|---|
| 64 | #define hypre_ParVectorNumVectors(vector)\
|
|---|
| 65 | (hypre_VectorNumVectors( hypre_ParVectorLocalVector(vector) ))
|
|---|
| 66 |
|
|---|
| 67 | #define hypre_ParVectorAssumedPartition(vector) ((vector) -> assumed_partition)
|
|---|
| 68 |
|
|---|
| 69 |
|
|---|
| 70 | #endif
|
|---|