cloudy
trunk
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
source
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
8
t_rfield
rfield
;
9
10
const
realnum
*
t_rfield::getCoarseTransCoef
()
11
{
12
// average opacity transmission coefficient fine to coarse
13
if
(
opac
.
lgScatON
&&
trans_coef_total_stale
)
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
26
if
(
ipnt_coarse_2_fine
[i+1]>
ipnt_coarse_2_fine
[i] )
27
{
28
trans_coef_total
[i] = 0.;
29
for
(
long
j=
ipnt_coarse_2_fine
[i]; j<
ipnt_coarse_2_fine
[i+1]; ++j )
30
trans_coef_total
[i] +=
sexp
(
fine_opt_depth
[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
37
trans_coef_total
[i] =
sexp
(
fine_opt_depth
[
ipnt_coarse_2_fine
[i]]);
38
}
39
}
40
}
41
trans_coef_total_stale
=
false
;
42
}
43
return
trans_coef_total
;
44
}
t_rfield::fine_opt_depth
realnum * fine_opt_depth
Definition:
rfield.h:410
opac
t_opac opac
Definition:
opacity.cpp:5
t_opac::lgScatON
bool lgScatON
Definition:
opacity.h:183
sexp
sys_float sexp(sys_float x)
Definition:
service.cpp:914
opacity.h
t_rfield::getCoarseTransCoef
const realnum * getCoarseTransCoef()
Definition:
rfield.cpp:10
t_rfield::trans_coef_total_stale
bool trans_coef_total_stale
Definition:
rfield.h:393
rfield
t_rfield rfield
Definition:
rfield.cpp:8
realnum
float realnum
Definition:
cddefines.h:107
cddefines.h
t_rfield::ipnt_coarse_2_fine
long int * ipnt_coarse_2_fine
Definition:
rfield.h:397
t_rfield::trans_coef_total
realnum * trans_coef_total
Definition:
rfield.h:390
t_rfield
Definition:
rfield.h:33
rfield.h
t_rfield::nflux
long int nflux
Definition:
rfield.h:43
Generated on Sat Oct 19 2013 10:43:13 for cloudy by
1.8.5