cloudy
trunk
Main Page
Related Pages
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
source
parse_globule.cpp
Go to the documentation of this file.
1
/* This file is part of Cloudy and is copyright (C)1978-2008 by Gary J. Ferland and
2
* others. For conditions of distribution and use see copyright notice in license.txt */
3
/*ParseGlobule parse parameters off the globule command */
4
#include "
cddefines.h
"
5
#include "
radius.h
"
6
#include "
dense.h
"
7
#include "
optimize.h
"
8
#include "
input.h
"
9
#include "
parse.h
"
10
11
void
ParseGlobule
(
char
*chCard)
12
{
13
bool
lgEOL;
14
long
int
i;
15
16
DEBUG_ENTRY
(
"ParseGlobule()"
);
17
18
if
(
dense
.
gas_phase
[
ipHYDROGEN
] > 0. )
19
{
20
fprintf(
ioQQQ
,
" PROBLEM DISASTER More than one density command was entered.\n"
);
21
cdEXIT
(EXIT_FAILURE);
22
}
23
24
/* globule with density increasing inward
25
* parameters are outer density, radius of globule, and density power */
26
i = 5;
27
radius
.
glbden
= (
realnum
)
FFmtRead
(chCard,&i,
INPUT_LINE_LENGTH
,&lgEOL);
28
radius
.
glbden
= lgEOL ? 1.f : (
realnum
)pow((
realnum
)10.f,
radius
.
glbden
);
29
dense
.
gas_phase
[
ipHYDROGEN
] =
radius
.
glbden
;
30
31
if
(
dense
.
gas_phase
[
ipHYDROGEN
] <= 0. )
32
{
33
fprintf(
ioQQQ
,
" PROBLEM DISASTER Hydrogen density must be > 0.\n"
);
34
cdEXIT
(EXIT_FAILURE);
35
}
36
37
radius
.
glbrad
= (
realnum
)
FFmtRead
(chCard,&i,
INPUT_LINE_LENGTH
,&lgEOL);
38
if
( lgEOL )
39
{
40
radius
.
glbrad
= 3.086e18f;
41
}
42
else
43
{
44
radius
.
glbrad
= (
realnum
)pow((
realnum
)10.f,
radius
.
glbrad
);
45
}
46
47
/* this is largest zone thickness, used to set first zone thickness */
48
radius
.
sdrmax
=
radius
.
glbrad
/25.;
49
50
/* turn off min dr checking in NEXTDR */
51
radius
.
lgDrMnOn
=
false
;
52
radius
.
glbpow
= (
realnum
)
FFmtRead
(chCard,&i,
INPUT_LINE_LENGTH
,&lgEOL);
53
if
( lgEOL )
54
radius
.
glbpow
= 1.;
55
strcpy(
dense
.
chDenseLaw
,
"GLOB"
);
56
57
/* this is distance to globule */
58
radius
.
glbdst
=
radius
.
glbrad
;
59
60
/* vary option */
61
if
(
optimize
.
lgVarOn
)
62
{
63
/* pointer to where to write */
64
optimize
.
nvfpnt
[
optimize
.
nparm
] =
input
.
nRead
;
65
66
/* this is the number of parameters to feed onto the input line */
67
optimize
.
nvarxt
[
optimize
.
nparm
] = 3;
68
strcpy(
optimize
.
chVarFmt
[
optimize
.
nparm
],
"GLOBULE %f %f %f"
);
69
70
/* param is log of abundance by number relative to hydrogen */
71
optimize
.
vparm
[0][
optimize
.
nparm
] = (
realnum
)log10(
radius
.
glbden
);
72
optimize
.
vparm
[1][
optimize
.
nparm
] = (
realnum
)log10(
radius
.
glbrad
);
73
optimize
.
vparm
[2][
optimize
.
nparm
] =
radius
.
glbpow
;
74
optimize
.
vincr
[
optimize
.
nparm
] = 0.2f;
75
++
optimize
.
nparm
;
76
}
77
return
;
78
}
Generated for cloudy by
1.8.1.1