/*============================================================================
*
*                    Code_Saturne version 1.3
*                    ------------------------
*
*
*     This file is part of the Code_Saturne Kernel, element of the
*     Code_Saturne CFD tool.
*
*     Copyright (C) 1998-2007 EDF S.A., France
*
*     contact: saturne-support@edf.fr
*
*     The Code_Saturne Kernel is free software; you can redistribute it
*     and/or modify it under the terms of the GNU General Public License
*     as published by the Free Software Foundation; either version 2 of
*     the License, or (at your option) any later version.
*
*     The Code_Saturne Kernel is distributed in the hope that it will be
*     useful, but WITHOUT ANY WARRANTY; without even the implied warranty
*     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
*     GNU General Public License for more details.
*
*     You should have received a copy of the GNU General Public License
*     along with the Code_Saturne Kernel; if not, write to the
*     Free Software Foundation, Inc.,
*     51 Franklin St, Fifth Floor,
*     Boston, MA  02110-1301  USA
*
*============================================================================*/

#ifndef __CS_MAILLAGE_GRD_H__
#define __CS_MAILLAGE_GRD_H__

/*============================================================================
 * Grandeurs associées à un maillage
 *============================================================================*/

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */


/*----------------------------------------------------------------------------
 *  Fichiers `include' locaux
 *----------------------------------------------------------------------------*/

#include "cs_base.h"
#include "cs_maillage.h"

/*=============================================================================
 * Définitions de macros
 *============================================================================*/


/*============================================================================
 * Définitions de types
 *============================================================================*/

/* Structure des grandeurs associée à un maillage */

typedef struct {

  cs_real_t  *cen_cel;    /* Coordonnées des centres des cellules  */
  cs_real_t  *vol_cel;    /* Volumes des cellules */
  cs_real_t  *surf_fac;   /* Vecteurs surface des faces internes */
  cs_real_t  *surf_fbr;   /* Vecteurs surface des faces de bord */
  cs_real_t  *cdg_fac;    /* Coordonnées des c.g. des faces internes */
  cs_real_t  *cdg_fbr;    /* Coordonnées des c.g. des faces de bord */

} cs_maillage_grd_t ;


/*=============================================================================
 * Variables globales_statiques
 *============================================================================*/

/* Pointeur sur les grandeurs associées au maillage principal */
extern cs_maillage_grd_t  *cs_glob_maillage_grd;


/*============================================================================
 *  Fonctions publiques pour API Fortran
 *============================================================================*/

/*----------------------------------------------------------------------------
 * Interrogation ou modification du choix de l'algorithme de calcul
 * des centres de gravité des cellules ;
 * Au retour, IOPT contient la valeur (1 à 2) correspondant à l'algorithme
 * choisi
 *
 * Interface Fortran :
 *
 * SUBROUTINE ALGCEN (IOPT)
 * *****************
 *
 * INTEGER          IOPT        : <-> : Choix de l'algorithme
 *                                      < 0 : interrogation
 *                                        0 : calcul basé sur les centres et
 *                                            surfaces des faces (par défaut)
 *                                        1 : calcul basé sur les sommets
 *----------------------------------------------------------------------------*/

void CS_PROCF (algcen, ALGCEN)
(
 cs_int_t  *const iopt
);


/*=============================================================================
 * Prototypes de fonctions publiques
 *============================================================================*/

/*----------------------------------------------------------------------------
 * Interrogation ou modification du choix de l'algorithme de calcul
 * des centres de gravité des cellules ;
 *  < 0 : interrogation
 *    0 : calcul basé sur les centres et surfaces des faces (choix par défaut)
 *    1 : calcul basé sur les sommets
 * Renvoie la valeur (1 à 2) correspondant à l'algorithme choisi
 *----------------------------------------------------------------------------*/

int cs_maillage_grd_choix_cdg_cel
(
 const int choix_algo
);


/*----------------------------------------------------------------------------
 * Création d'une structure grandeurs maillage
 *----------------------------------------------------------------------------*/

cs_maillage_grd_t  * cs_maillage_grd_cree
(
 void
);


/*----------------------------------------------------------------------------
 * Destruction d'une structure grandeurs maillage
 *----------------------------------------------------------------------------*/

cs_maillage_grd_t  * cs_maillage_grd_detruit
(
 cs_maillage_grd_t  * maillage_grd
);


/*----------------------------------------------------------------------------
 * Calcul des grandeurs associées à un maillage
 *----------------------------------------------------------------------------*/

void cs_maillage_grd_calc
(
 const cs_maillage_t      *const maillage,      /* -->  maillage utilisé      */
       cs_maillage_grd_t  *const maillage_grd   /* <-> grandeurs associées    */
);


/*----------------------------------------------------------------------------
 * Affichage d'informations relatives aux grandeurs associées à un maillage
 *----------------------------------------------------------------------------*/

void cs_maillage_grd_info
(
 const cs_maillage_t      *const maillage,      /* -->  maillage utilisé      */
       cs_maillage_grd_t  *const maillage_grd   /* <-> grandeurs associées    */
);


#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif /* __CS_MAILLAGE_GRD_H__ */


syntax highlighted by Code2HTML, v. 0.9.1