cloudy  trunk
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
parse_globule.cpp
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2022 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 : exp10(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 */
44  radius.sdrmax = radius.glbrad/25.;
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 */
72  optimize.vincr[optimize.nparm] = 0.2f;
73  ++optimize.nparm;
74  }
75  return;
76 }
bool lgDrMnOn
Definition: radius.h:142
void SetGasPhaseDensity(const long nelem, const realnum density)
Definition: dense.cpp:106
double FFmtRead(void)
Definition: parser.cpp:472
double exp10(double x)
Definition: cddefines.h:1368
t_input input
Definition: input.cpp:12
long int nvfpnt[LIMPAR]
Definition: optimize.h:198
long int nRead
Definition: input.h:105
double sdrmax
Definition: radius.h:159
char chVarFmt[LIMPAR][FILENAME_PATH_LENGTH_2]
Definition: optimize.h:267
FILE * ioQQQ
Definition: cddefines.cpp:7
realnum vparm[LIMEXT][LIMPAR]
Definition: optimize.h:192
Definition: parser.h:43
realnum glbpow
Definition: radius.h:134
bool lgVarOn
Definition: optimize.h:207
t_dense dense
Definition: global.cpp:15
realnum glbdst
Definition: radius.h:134
void ParseGlobule(Parser &p)
long int nparm
Definition: optimize.h:204
float realnum
Definition: cddefines.h:124
#define EXIT_FAILURE
Definition: cddefines.h:168
bool lgSdrmaxRel
Definition: radius.h:167
#define cdEXIT(FAIL)
Definition: cddefines.h:482
t_optimize optimize
Definition: optimize.cpp:6
t_radius radius
Definition: radius.cpp:5
realnum vincr[LIMPAR]
Definition: optimize.h:195
realnum gas_phase[LIMELM]
Definition: dense.h:76
realnum glbrad
Definition: radius.h:134
char chDenseLaw[5]
Definition: dense.h:176
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:723
bool lgEOL(void) const
Definition: parser.h:113
int fprintf(const Output &stream, const char *format,...)
Definition: service.cpp:1121
realnum glbden
Definition: radius.h:134
const int ipHYDROGEN
Definition: cddefines.h:349
long int nvarxt[LIMPAR]
Definition: optimize.h:198