~ubuntu-branches/ubuntu/precise/code-saturne/precise

« back to all changes in this revision

Viewing changes to include/base/cs_gradient.h

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-24 00:00:08 UTC
  • mfrom: (6.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20111124000008-2vo99e38267942q5
Tags: 2.1.0-3
Install a missing file

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*============================================================================
2
 
 *
3
 
 *     This file is part of the Code_Saturne Kernel, element of the
4
 
 *     Code_Saturne CFD tool.
5
 
 *
6
 
 *     Copyright (C) 1998-2009 EDF S.A., France
7
 
 *
8
 
 *     contact: saturne-support@edf.fr
9
 
 *
10
 
 *     The Code_Saturne Kernel is free software; you can redistribute it
11
 
 *     and/or modify it under the terms of the GNU General Public License
12
 
 *     as published by the Free Software Foundation; either version 2 of
13
 
 *     the License, or (at your option) any later version.
14
 
 *
15
 
 *     The Code_Saturne Kernel is distributed in the hope that it will be
16
 
 *     useful, but WITHOUT ANY WARRANTY; without even the implied warranty
17
 
 *     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 
 *     GNU General Public License for more details.
19
 
 *
20
 
 *     You should have received a copy of the GNU General Public License
21
 
 *     along with the Code_Saturne Kernel; if not, write to the
22
 
 *     Free Software Foundation, Inc.,
23
 
 *     51 Franklin St, Fifth Floor,
24
 
 *     Boston, MA  02110-1301  USA
25
 
 *
26
 
 *============================================================================*/
27
 
 
28
 
#ifndef __CS_GRADIENT_H__
29
 
#define __CS_GRADIENT_H__
30
 
 
31
 
/*============================================================================
32
 
 * Gradient reconstruction.
33
 
 *============================================================================*/
34
 
 
35
 
/*----------------------------------------------------------------------------
36
 
 *  Local headers
37
 
 *----------------------------------------------------------------------------*/
38
 
 
39
 
#include "cs_base.h"
40
 
 
41
 
/*----------------------------------------------------------------------------*/
42
 
 
43
 
BEGIN_C_DECLS
44
 
 
45
 
/*=============================================================================
46
 
 * Local Macro definitions
47
 
 *============================================================================*/
48
 
 
49
 
/*============================================================================
50
 
 * Type definition
51
 
 *============================================================================*/
52
 
 
53
 
/*============================================================================
54
 
 * Public function definitions for Fortran API
55
 
 *============================================================================*/
56
 
 
57
 
/*----------------------------------------------------------------------------
58
 
 * Encapsulation of the call to GRADMC (Fortran routine for the computation of
59
 
 * gradients by the least squares method). Add data for taking into account
60
 
 * the extended neighborhood.
61
 
 *
62
 
 * Fortran Interface :
63
 
 *
64
 
 * SUBROUTINE CGRDMC
65
 
 * *****************
66
 
 *
67
 
 *   ( NCELET , NCEL   , NFAC   , NFABOR , NCELBR ,
68
 
 *     INC    , ICCOCG , NSWRGP , IDIMTE , ITENSO , IPHYDP , IMRGRA ,
69
 
 *     IWARNP , NFECRA , EPSRGP , EXTRAP ,
70
 
 *     IFACEL , IFABOR , IA(IICELB) , IA(IISYMP) ,
71
 
 *     VOLUME , SURFAC , SURFBO , RA(ISRFBN) , RA(IPOND)   ,
72
 
 *     RA(IDIST)   , RA(IDISTB) ,
73
 
 *                   RA(IDIJPF) , RA(IDIIPB)  ,
74
 
 *     FEXTX  , FEXTY  , FEXTZ  ,
75
 
 *     XYZCEN , CDGFAC , CDGFBO , COEFAP , COEFBP , PVAR   ,
76
 
 *     RA(ICOCGB)  , RA(ICOCG)  ,
77
 
 *     DPDX   , DPDY   , DPDZ   ,
78
 
 *     DPDXA  , DPDYA  , DPDZA  )
79
 
 *
80
 
 *----------------------------------------------------------------------------*/
81
 
 
82
 
void CS_PROCF (cgrdmc, CGRDMC)
83
 
(
84
 
 const cs_int_t   *const ncelet,      /* --> number of extended cells         */
85
 
 const cs_int_t   *const ncel,        /* --> number of cells                  */
86
 
 const cs_int_t   *const nfac,        /* --> number of internal faces         */
87
 
 const cs_int_t   *const nfabor,      /* --> number of boundary faces         */
88
 
 const cs_int_t   *const ncelbr,      /* --> number of cells on boundary      */
89
 
 const cs_int_t   *const inc,         /* --> 0 or 1: increment or not         */
90
 
 const cs_int_t   *const iccocg,      /* --> 1 or 0: recompute COCG or not    */
91
 
 const cs_int_t   *const nswrgp,      /* --> >1: with reconstruction          */
92
 
 const cs_int_t   *const idimte,      /* --> 0, 1, 2: scalar, vector, tensor  */
93
 
 const cs_int_t   *const itenso,      /* --> for rotational periodicity       */
94
 
 const cs_int_t   *const iphydp,      /* --> use hydrosatatic pressure        */
95
 
 const cs_int_t   *const imrgra,      /* --> gradient computation mode        */
96
 
 const cs_int_t   *const iwarnp,      /* --> verbosity level                  */
97
 
 const cs_int_t   *const nfecra,      /* --> standard output unit             */
98
 
 const cs_real_t  *const epsrgp,      /* --> precision for iterative gradient
99
 
                                             calculation                      */
100
 
 const cs_real_t  *const extrap,      /* --> extrapolate gradient at boundary */
101
 
 const cs_int_t          ifacel[],    /* --> interior face->cell connectivity */
102
 
 const cs_int_t          ifabor[],    /* --> boundary face->cell connectivity */
103
 
 const cs_int_t          icelbr[],    /* --> list of cells on boundary        */
104
 
 const cs_int_t          isympa[],    /* --> indicator for symmetry faces     */
105
 
 const cs_real_t         volume[],    /* --> cell volumes                     */
106
 
 const cs_real_t         surfac[],    /* --> surfaces of internal faces       */
107
 
 const cs_real_t         surfbo[],    /* --> surfaces of boundary faces       */
108
 
 const cs_real_t         surfbn[],    /* --> norm of surfbo                   */
109
 
 const cs_real_t         pond[],      /* --> interior faces geometric weight  */
110
 
 const cs_real_t         dist[],      /* --> interior faces I' to J' distance */
111
 
 const cs_real_t         distbr[],    /* --> boundary faces I' to J' distance */
112
 
 const cs_real_t         dijpf[],     /* --> interior faces I'J' vector       */
113
 
 const cs_real_t         diipb[],     /* --> boundary faces II' vector        */
114
 
       cs_real_t         fextx[],     /* --> components of the exterior force */
115
 
       cs_real_t         fexty[],     /*     generating the hydrostatic       */
116
 
       cs_real_t         fextz[],     /*     pressure                         */
117
 
 const cs_real_t         xyzcen[],    /* --> cell centers                     */
118
 
 const cs_real_t         cdgfac[],    /* --> interior face centers of gravity */
119
 
 const cs_real_t         cdgfbo[],    /* --> boundary face centers of gravity */
120
 
 const cs_real_t         coefap[],    /* --> boundary condition term          */
121
 
 const cs_real_t         coefbp[],    /* --> boundary condition term          */
122
 
       cs_real_t         pvar[],      /* --> gradient's base variable         */
123
 
       cs_real_t         cocgb[],     /* <-> contribution to COCG of cells
124
 
                                             on boundary's internal faces     */
125
 
       cs_real_t         cocg[],      /* <-> contribution to COCG of cells
126
 
                                             on boundary's boundary faces     */
127
 
       cs_real_t         dpdx[],      /* <-- gradient x component             */
128
 
       cs_real_t         dpdy[],      /* <-- gradient y component             */
129
 
       cs_real_t         dpdz[],      /* <-- gradient z component             */
130
 
       cs_real_t         bx[],        /* --- local work array                 */
131
 
       cs_real_t         by[],        /* --- local work array                 */
132
 
       cs_real_t         bz[]         /* --- local work array                 */
133
 
);
134
 
 
135
 
/*----------------------------------------------------------------------------
136
 
 * Clip the gradient if necessary. This function deals with the standard or
137
 
 * extended neighborhood.
138
 
 *
139
 
 * Fortran Interface :
140
 
 *
141
 
 * SUBROUTINE CLMGRD
142
 
 * *****************
143
 
 *
144
 
 *    & ( IMRGRA , IMLIGP , IWARNP , CLIMGP ,
145
 
 *    &   VAR    , DPDX   , DPDY   , DPDZ   )
146
 
 *
147
 
 * parameters:
148
 
 *   imrgra         --> type of computation for the gradient
149
 
 *   imligp         --> type of clipping for the computation of the gradient
150
 
 *   idimte         --> dimension of the variable
151
 
 *                      0: scalar, 1: vector, 2: tensor
152
 
 *   itenso         --> only for periodicity when there is a rotation
153
 
 *   iwarnp         --> output level
154
 
 *   itenso         --> for rotational periodicity
155
 
 *   climgp         --> clipping coefficient for the computation of the gradient
156
 
 *   var            --> variable
157
 
 *   dpdx           --> X component of the pressure gradient
158
 
 *   dpdy           --> Y component of the pressure gradient
159
 
 *   dpdz           --> Z component of the pressure gradient
160
 
 *----------------------------------------------------------------------------*/
161
 
 
162
 
void
163
 
CS_PROCF (clmgrd, CLMGRD)(const cs_int_t   *imrgra,
164
 
                          const cs_int_t   *imligp,
165
 
                          const cs_int_t   *iwarnp,
166
 
                          const cs_int_t   *itenso,
167
 
                          const cs_real_t  *climgp,
168
 
                          cs_real_t         var[],
169
 
                          cs_real_t         dpdx[],
170
 
                          cs_real_t         dpdy[],
171
 
                          cs_real_t         dpdz[]);
172
 
 
173
 
/*----------------------------------------------------------------------------*/
174
 
 
175
 
END_C_DECLS
176
 
 
177
 
#endif /* __CS_GRADIENT__ */