source: CIVL/examples/mpi-omp/AMG2013/IJ_mv/IJMatrix.c

main
Last change on this file was ea777aa, checked in by Alex Wilton <awilton@…>, 3 years ago

Moved examples, include, build_default.properties, common.xml, and README out from dev.civl.com into the root of the repo.

git-svn-id: svn://vsl.cis.udel.edu/civl/trunk@5704 fb995dde-84ed-4084-dfe6-e5aef3e2452c

  • Property mode set to 100644
File size: 2.9 KB
Line 
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 * hypre_IJMatrix interface
18 *
19 *****************************************************************************/
20
21#include "./IJ_mv.h"
22
23#include "../HYPRE.h"
24
25/*--------------------------------------------------------------------------
26 * hypre_IJMatrixGetRowPartitioning
27 *--------------------------------------------------------------------------*/
28
29/**
30Returns a pointer to the row partitioning
31
32@return integer error code
33@param IJMatrix [IN]
34The ijmatrix to be pointed to.
35*/
36
37int
38hypre_IJMatrixGetRowPartitioning( HYPRE_IJMatrix matrix ,
39 HYPRE_BigInt **row_partitioning )
40{
41 hypre_IJMatrix *ijmatrix = (hypre_IJMatrix *) matrix;
42
43 if (!ijmatrix)
44 {
45 printf("Variable ijmatrix is NULL -- hypre_IJMatrixGetRowPartitioning\n");
46 exit(1);
47 }
48
49 if ( hypre_IJMatrixRowPartitioning(ijmatrix))
50 *row_partitioning = hypre_IJMatrixRowPartitioning(ijmatrix);
51 else
52 return -1;
53
54 return -99;
55}
56/*--------------------------------------------------------------------------
57 * hypre_IJMatrixGetColPartitioning
58 *--------------------------------------------------------------------------*/
59
60/**
61Returns a pointer to the column partitioning
62
63@return integer error code
64@param IJMatrix [IN]
65The ijmatrix to be pointed to.
66*/
67
68int
69hypre_IJMatrixGetColPartitioning( HYPRE_IJMatrix matrix ,
70 HYPRE_BigInt **col_partitioning )
71{
72 hypre_IJMatrix *ijmatrix = (hypre_IJMatrix *) matrix;
73
74 if (!ijmatrix)
75 {
76 printf("Variable ijmatrix is NULL -- hypre_IJMatrixGetColPartitioning\n");
77 exit(1);
78 }
79
80 if ( hypre_IJMatrixColPartitioning(ijmatrix))
81 *col_partitioning = hypre_IJMatrixColPartitioning(ijmatrix);
82 else
83 return -1;
84
85 return -99;
86}
87/*--------------------------------------------------------------------------
88 * hypre_IJMatrixSetObject
89 *--------------------------------------------------------------------------*/
90
91int
92hypre_IJMatrixSetObject( HYPRE_IJMatrix matrix,
93 void *object )
94{
95 hypre_IJMatrix *ijmatrix = (hypre_IJMatrix *) matrix;
96
97 if (hypre_IJMatrixObject(ijmatrix) != NULL)
98 {
99 printf("Referencing a new IJMatrix object can orphan an old -- ");
100 printf("hypre_IJMatrixSetObject\n");
101 exit(1);
102 }
103
104 hypre_IJMatrixObject(ijmatrix) = object;
105
106 return 0;
107}
Note: See TracBrowser for help on using the repository browser.