source: CIVL/examples/mpi-omp/AMG2013/struct_mv/HYPRE_struct_stencil.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.3 KB
RevLine 
[2aa6644]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 * HYPRE_StructStencil interface
17 *
18 *****************************************************************************/
19
20#include "headers.h"
21
22/*--------------------------------------------------------------------------
23 * HYPRE_StructStencilCreate
24 *--------------------------------------------------------------------------*/
25
26int
27HYPRE_StructStencilCreate( int dim,
28 int size,
29 HYPRE_StructStencil *stencil )
30{
31 hypre_Index *shape;
32
33 shape = hypre_CTAlloc(hypre_Index, size);
34
35 *stencil = hypre_StructStencilCreate(dim, size, shape);
36
37 return 0;
38}
39
40/*--------------------------------------------------------------------------
41 * HYPRE_StructStencilSetElement
42 *--------------------------------------------------------------------------*/
43
44int
45HYPRE_StructStencilSetElement( HYPRE_StructStencil stencil,
46 int element_index,
47 int *offset )
48{
49 int ierr = 0;
50
51 hypre_Index *shape;
52 int d;
53
54 shape = hypre_StructStencilShape(stencil);
55 hypre_ClearIndex(shape[element_index]);
56 for (d = 0; d < hypre_StructStencilDim(stencil); d++)
57 {
58 hypre_IndexD(shape[element_index], d) = offset[d];
59 }
60
61 return ierr;
62}
63
64/*--------------------------------------------------------------------------
65 * HYPRE_StructStencilDestroy
66 *--------------------------------------------------------------------------*/
67
68int
69HYPRE_StructStencilDestroy( HYPRE_StructStencil stencil )
70{
71 return ( hypre_StructStencilDestroy(stencil) );
72}
73
Note: See TracBrowser for help on using the repository browser.