12#ifndef MFEM_HYPRE_PARCSR_HPP
13#define MFEM_HYPRE_PARCSR_HPP
22#include <_hypre_parcsr_mv.h>
24#if MFEM_HYPRE_VERSION < 30000
25#define hypre_GenerateDiagAndOffd GenerateDiagAndOffd
30#if MFEM_HYPRE_VERSION < 21600
32#define HYPRE_MPI_BIG_INT HYPRE_MPI_INT
39#if MFEM_HYPRE_VERSION < 21400
41#define mfem_hypre_TAlloc(type, size) hypre_TAlloc(type, size)
42#define mfem_hypre_CTAlloc(type, size) hypre_CTAlloc(type, size)
43#define mfem_hypre_TFree(ptr) hypre_TFree(ptr)
45#define mfem_hypre_TAlloc_host(type, size) hypre_TAlloc(type, size)
46#define mfem_hypre_CTAlloc_host(type, size) hypre_CTAlloc(type, size)
47#define mfem_hypre_TFree_host(ptr) hypre_TFree(ptr)
51#define mfem_hypre_TAlloc(type, size) \
52 hypre_TAlloc(type, size, mfem::GetHypreMemoryLocation())
53#define mfem_hypre_CTAlloc(type, size) \
54 hypre_CTAlloc(type, size, mfem::GetHypreMemoryLocation())
55#define mfem_hypre_TFree(ptr) hypre_TFree(ptr, mfem::GetHypreMemoryLocation())
57#define mfem_hypre_TAlloc_host(type, size) \
58 hypre_TAlloc(type, size, HYPRE_MEMORY_HOST)
59#define mfem_hypre_CTAlloc_host(type, size) \
60 hypre_CTAlloc(type, size, HYPRE_MEMORY_HOST)
61#define mfem_hypre_TFree_host(ptr) hypre_TFree(ptr, HYPRE_MEMORY_HOST)
113void hypre_ParCSRMatrixEliminateAXB(hypre_ParCSRMatrix *A,
114 HYPRE_Int num_rowscols_to_elim,
115 HYPRE_Int *rowscols_to_elim,
122void hypre_ParCSRMatrixEliminateAAe(hypre_ParCSRMatrix *A,
123 hypre_ParCSRMatrix **Ae,
124 HYPRE_Int num_rowscols_to_elim,
125 HYPRE_Int *rowscols_to_elim,
126 int ignore_rows = 0);
130void hypre_ParCSRMatrixEliminateRows(hypre_ParCSRMatrix *A,
131 HYPRE_Int num_rows_to_elim,
132 const HYPRE_Int *rows_to_elim);
140void hypre_ParCSRMatrixSplit(hypre_ParCSRMatrix *A,
141 HYPRE_Int nr, HYPRE_Int nc,
142 hypre_ParCSRMatrix **blocks,
143 int interleaved_rows,
int interleaved_cols);
145typedef int HYPRE_Bool;
146#define HYPRE_MPI_BOOL MPI_INT
149void hypre_CSRMatrixAbsMatvec(hypre_CSRMatrix *A,
156void hypre_CSRMatrixAbsMatvecT(hypre_CSRMatrix *A,
163void hypre_ParCSRMatrixAbsMatvec(hypre_ParCSRMatrix *A,
170void hypre_ParCSRMatrixAbsMatvecT(hypre_ParCSRMatrix *A,
178void hypre_CSRMatrixBooleanMatvec(hypre_CSRMatrix *A,
186void hypre_CSRMatrixBooleanMatvecT(hypre_CSRMatrix *A,
192hypre_ParCSRCommHandle *
193hypre_ParCSRCommHandleCreate_bool(HYPRE_Int job,
194 hypre_ParCSRCommPkg *comm_pkg,
195 HYPRE_Bool *send_data,
196 HYPRE_Bool *recv_data);
200void hypre_ParCSRMatrixBooleanMatvec(hypre_ParCSRMatrix *A,
208void hypre_ParCSRMatrixBooleanMatvecT(hypre_ParCSRMatrix *A,
217hypre_CSRMatrixSum(hypre_CSRMatrix *A,
221#if MFEM_HYPRE_VERSION >= 22200
224inline hypre_CSRMatrix *hypre_CSRMatrixAdd(hypre_CSRMatrix *A,
227 return ::hypre_CSRMatrixAdd(1.0, A, 1.0, B);
236hypre_ParCSRMatrixAdd(hypre_ParCSRMatrix *A,
237 hypre_ParCSRMatrix *B);
244hypre_ParCSRMatrixSum(hypre_ParCSRMatrix *A,
246 hypre_ParCSRMatrix *B);
250hypre_CSRMatrixSetConstantValues(hypre_CSRMatrix *A,
251 HYPRE_Complex value);
255hypre_ParCSRMatrixSetConstantValues(hypre_ParCSRMatrix *A,
256 HYPRE_Complex value);
Class used by MFEM to store pointers to host and/or device memory.