hypre/struct_mv/HYPRE_struct_grid.c

75 lines
2.3 KiB
C
Raw Normal View History

/*BHEADER**********************************************************************
* (c) 1997 The Regents of the University of California
*
* See the file COPYRIGHT_and_DISCLAIMER for a complete copyright
* notice, contact person, and disclaimer.
*
* $Revision$
*********************************************************************EHEADER*/
/******************************************************************************
*
1998-02-18 01:56:00 +08:00
* HYPRE_StructGrid interface
*
*****************************************************************************/
#include "headers.h"
/*--------------------------------------------------------------------------
1998-02-18 01:56:00 +08:00
* HYPRE_NewStructGrid
*--------------------------------------------------------------------------*/
int
HYPRE_NewStructGrid( MPI_Comm comm,
int dim,
HYPRE_StructGrid *grid )
{
*grid = ( (HYPRE_StructGrid) hypre_NewStructGrid( comm, dim ) );
return 0;
}
/*--------------------------------------------------------------------------
1998-02-18 01:56:00 +08:00
* HYPRE_FreeStructGrid
*--------------------------------------------------------------------------*/
int
1998-02-18 01:56:00 +08:00
HYPRE_FreeStructGrid( HYPRE_StructGrid grid )
{
return ( hypre_FreeStructGrid( (hypre_StructGrid *) grid ) );
}
/*--------------------------------------------------------------------------
1998-02-18 01:56:00 +08:00
* HYPRE_SetStructGridExtents
*--------------------------------------------------------------------------*/
int
1998-02-18 01:56:00 +08:00
HYPRE_SetStructGridExtents( HYPRE_StructGrid grid,
int *ilower,
int *iupper )
{
1998-02-18 01:56:00 +08:00
hypre_Index new_ilower;
hypre_Index new_iupper;
int d;
hypre_ClearIndex(new_ilower);
hypre_ClearIndex(new_iupper);
1998-02-18 01:56:00 +08:00
for (d = 0; d < hypre_StructGridDim((hypre_StructGrid *) grid); d++)
{
1998-02-18 01:56:00 +08:00
hypre_IndexD(new_ilower, d) = ilower[d];
hypre_IndexD(new_iupper, d) = iupper[d];
}
return ( hypre_SetStructGridExtents( (hypre_StructGrid *) grid,
new_ilower, new_iupper ) );
}
/*--------------------------------------------------------------------------
1998-02-18 01:56:00 +08:00
* HYPRE_AssembleStructGrid
*--------------------------------------------------------------------------*/
int
1998-02-18 01:56:00 +08:00
HYPRE_AssembleStructGrid( HYPRE_StructGrid grid )
{
1999-01-08 07:35:07 +08:00
return ( hypre_AssembleStructGrid( (hypre_StructGrid *) grid ) );
}