1 // Copyright (c) 2010, Lawrence Livermore National Security, LLC. Produced at
2 // the Lawrence Livermore National Laboratory. LLNL-CODE-443211. All Rights
3 // reserved. See file COPYRIGHT for details.
4 //
5 // This file is part of the MFEM library. For more information and source code
6 // availability see http://mfem.org.
7 //
8 // MFEM is free software; you can redistribute it and/or modify it under the
9 // terms of the GNU Lesser General Public License (as published by the Free
10 // Software Foundation) version 2.1 dated February 1999.
11
12 #ifndef MOAB_HYPRE_PARCSR
13 #define MOAB_HYPRE_PARCSR
14
15 #include "moab/MOABConfig.h"
16
17 #ifdef MOAB_HAVE_MPI
18
19 #include "_hypre_parcsr_mv.h"
20
21 namespace moab
22 {
23
24 namespace internal
25 {
26
27 // This module contains functions that are logically part of HYPRE, and might
28 // become part of HYPRE at some point. In the meantime the module can be
29 // thought of as an extension of HYPRE.
30
31 /** Parallel essential BC elimination from the system A*X = B.
32 (Adapted from hypre_ParCSRMatrixEliminateRowsCols.) */
33 void hypre_ParCSRMatrixEliminateAXB( hypre_ParCSRMatrix* A,
34 HYPRE_Int num_rowscols_to_elim,
35 HYPRE_Int* rowscols_to_elim,
36 hypre_ParVector* X,
37 hypre_ParVector* B );
38
39 /** Parallel essential BC elimination from matrix A only. The eliminated
40 elements are stored in a new matrix Ae, so that (A + Ae) equals the original
41 matrix A. */
42 void hypre_ParCSRMatrixEliminateAAe( hypre_ParCSRMatrix* A,
43 hypre_ParCSRMatrix** Ae,
44 HYPRE_Int num_rowscols_to_elim,
45 HYPRE_Int* rowscols_to_elim );
46
47 /** Split matrix 'A' into nr x nc blocks, return nr x nc pointers to
48 new parallel matrices. The array 'blocks' needs to be preallocated to hold
49 nr x nc pointers. If 'interleaved' == 0 the matrix is split into contiguous
50 blocks (AAABBBCCC) otherwise the blocks are interleaved (ABCABCABC).
51 The local number of rows of A must be divisible by nr. The local number of
52 columns of A must be divisible by nc. */
53 void hypre_ParCSRMatrixSplit( hypre_ParCSRMatrix* A,
54 HYPRE_Int nr,
55 HYPRE_Int nc,
56 hypre_ParCSRMatrix** blocks,
57 int interleaved_rows,
58 int interleaved_cols );
59
60 typedef int HYPRE_Bool;
61 #define HYPRE_MPI_BOOL MPI_INT
62
63 /** The "Boolean" analog of y = alpha * A * x + beta * y, where elements in the
64 sparsity pattern of the CSR matrix A are treated as "true". */
65 void hypre_CSRMatrixBooleanMatvec( hypre_CSRMatrix* A,
66 HYPRE_Bool alpha,
67 HYPRE_Bool* x,
68 HYPRE_Bool beta,
69 HYPRE_Bool* y );
70
71 hypre_ParCSRCommHandle* hypre_ParCSRCommHandleCreate_bool( HYPRE_Int job,
72 hypre_ParCSRCommPkg* comm_pkg,
73 HYPRE_Bool* send_data,
74 HYPRE_Bool* recv_data );
75
76 /** The "Boolean" analog of y = alpha * A * x + beta * y, where elements in the
77 sparsity pattern of the ParCSR matrix A are treated as "true". */
78 void hypre_ParCSRMatrixBooleanMatvec( hypre_ParCSRMatrix* A,
79 HYPRE_Bool alpha,
80 HYPRE_Bool* x,
81 HYPRE_Bool beta,
82 HYPRE_Bool* y );
83
84 } // namespace internal
85
86 } // namespace moab
87
88 #endif // MOAB_HAVE_MPI
89
90 #endif