cloudy trunk
Loading...
Searching...
No Matches
parse_globule.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/*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 "parser.h"
10
12{
13 DEBUG_ENTRY( "ParseGlobule()" );
14
15 if( dense.gas_phase[ipHYDROGEN] > 0. )
16 {
17 fprintf( ioQQQ, " PROBLEM DISASTER More than one density command was entered.\n" );
19 }
20
21 /* globule with density increasing inward
22 * parameters are outer density, radius of globule, and density power */
24 radius.glbden = p.lgEOL() ? 1.f : (realnum)pow((realnum)10.f,radius.glbden);
26
27 if( dense.gas_phase[ipHYDROGEN] <= 0. )
28 {
29 fprintf( ioQQQ, " PROBLEM DISASTER Hydrogen density must be > 0.\n" );
31 }
32
34 if( p.lgEOL() )
35 {
36 radius.glbrad = 3.086e18f;
37 }
38 else
39 {
41 }
42
43 /* this is largest zone thickness, used to set first zone thickness */
45 radius.lgSdrmaxRel = false;
46
47 /* turn off min dr checking in NEXTDR */
48 radius.lgDrMnOn = false;
50 if( p.lgEOL() )
51 radius.glbpow = 1.;
52 strcpy( dense.chDenseLaw, "GLOB" );
53
54 /* this is distance to globule */
56
57 /* vary option */
58 if( optimize.lgVarOn )
59 {
60 /* pointer to where to write */
62
63 /* this is the number of parameters to feed onto the input line */
65 // the keyword LOG is not used above, but is checked elsewhere
66 strcpy( optimize.chVarFmt[optimize.nparm], "GLOBULE %f LOG %f %f" );
67
68 /* param is log of abundance by number relative to hydrogen */
74 }
75 return;
76}
FILE * ioQQQ
Definition: cddefines.cpp:7
#define EXIT_FAILURE
Definition: cddefines.h:140
#define cdEXIT(FAIL)
Definition: cddefines.h:434
float realnum
Definition: cddefines.h:103
const int ipHYDROGEN
Definition: cddefines.h:305
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:684
Definition: parser.h:32
double FFmtRead(void)
Definition: parser.cpp:353
bool lgEOL(void) const
Definition: parser.h:98
t_dense dense
Definition: dense.cpp:24
t_input input
Definition: input.cpp:12
t_optimize optimize
Definition: optimize.cpp:5
void ParseGlobule(Parser &p)
t_radius radius
Definition: radius.cpp:5
char chDenseLaw[5]
Definition: dense.h:158
realnum gas_phase[LIMELM]
Definition: dense.h:71
void SetGasPhaseDensity(const long nelem, const realnum density)
Definition: dense.cpp:86
long int nRead
Definition: input.h:49
long int nparm
Definition: optimize.h:201
realnum vincr[LIMPAR]
Definition: optimize.h:191
realnum vparm[LIMEXT][LIMPAR]
Definition: optimize.h:188
bool lgVarOn
Definition: optimize.h:203
long int nvarxt[LIMPAR]
Definition: optimize.h:194
char chVarFmt[LIMPAR][FILENAME_PATH_LENGTH_2]
Definition: optimize.h:263
long int nvfpnt[LIMPAR]
Definition: optimize.h:195
bool lgSdrmaxRel
Definition: radius.h:161
double sdrmax
Definition: radius.h:153
realnum glbrad
Definition: radius.h:130
realnum glbpow
Definition: radius.h:132
realnum glbdst
Definition: radius.h:133
realnum glbden
Definition: radius.h:128
bool lgDrMnOn
Definition: radius.h:136