cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rfield.cpp
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2013 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 #include "cddefines.h"
4 #include "rfield.h"
5 
6 #include "opacity.h"
7 
9 
11 {
12  // average opacity transmission coefficient fine to coarse
14  {
15  /* sum over coarse continuum */
16  for( long i=0; i < nflux-1; i++ )
17  {
18  // find transmission coefficient if lower and upper bounds
19  // of coarse continuum is within boundaries of fine continuum
20  // unity is default
21  if( ipnt_coarse_2_fine[i] && ipnt_coarse_2_fine[i+1] )
22  {
23  // first branch is normal case, where fine continuum is finer than
24  // coarse continuum. But, when end temp is very high, fine continuum is
25  // very coarse, so may be just one cell, and following will not pass
27  {
28  trans_coef_total[i] = 0.;
29  for( long j=ipnt_coarse_2_fine[i]; j<ipnt_coarse_2_fine[i+1]; ++j )
31  trans_coef_total[i] /= (ipnt_coarse_2_fine[i+1]-ipnt_coarse_2_fine[i]);
32  }
33  else
34  {
35  // in case where fine is coarser than coarse,
36  // just use first cell
38  }
39  }
40  }
41  trans_coef_total_stale = false;
42  }
43  return trans_coef_total;
44 }
realnum * fine_opt_depth
Definition: rfield.h:410
t_opac opac
Definition: opacity.cpp:5
bool lgScatON
Definition: opacity.h:183
sys_float sexp(sys_float x)
Definition: service.cpp:914
const realnum * getCoarseTransCoef()
Definition: rfield.cpp:10
bool trans_coef_total_stale
Definition: rfield.h:393
t_rfield rfield
Definition: rfield.cpp:8
float realnum
Definition: cddefines.h:107
long int * ipnt_coarse_2_fine
Definition: rfield.h:397
realnum * trans_coef_total
Definition: rfield.h:390
long int nflux
Definition: rfield.h:43