Beispiel #1
0
void NameCoef::PrintToFile(FILE *file, int spaces)
{
	String spaces_str(spaces, " ");

	fprintf(file, "%s%s\n", spaces_str.CharPtr(), name.CharPtr());
	fprintf(file, "%s  coef: %f\n", spaces_str.CharPtr(), coef);
}
void ElementOfSpecies::PrintToFile(FILE *file, int spaces)
{
	String spaces_str(spaces, " ");

	fprintf(file, "%s%s\n", spaces_str.CharPtr(), name.CharPtr());
	fprintf(file, "%s  coef: %f\n", spaces_str.CharPtr(), coef);
	if (e != NULL)
		fprintf(file, "%s  e: %s (%p)\n", spaces_str.CharPtr(), e->name, e);
}
void UnknownInfo::PrintToFile(FILE *file, int spaces)
{
	String spaces_str(spaces, " ");

	fprintf(file, "%s  coef: %f\n", spaces_str.CharPtr(), coef);
	fprintf(file, "%s  source: %f (%p)\n", spaces_str.CharPtr(), *source, source);
	fprintf(file, "%s  gamma_source: %f (%p)\n", spaces_str.CharPtr(), *gamma_source, gamma_source);
	
	if (u != NULL)
	{
		fprintf(file, "%s  u: %s (%p)\n", spaces_str.CharPtr(), u->name.CharPtr(), u);
		u->PrintToFile(file, spaces + 5);
	}
	else
		fprintf(file, "%s  u: NULL\n");
}
Beispiel #4
0
void Master::PrintToFile(FILE *file, int spaces)
{
	String spaces_str(spaces, " ");

	fprintf(file, "%s%s\n", spaces_str.CharPtr(), name.CharPtr());

	fprintf(file, "%s  number: %d\n", spaces_str.CharPtr(), number);
	fprintf(file, "%s  type: %d\n", spaces_str.CharPtr(), type);

	if (in)
		fprintf(file, "%s  IN: true\n", spaces_str.CharPtr());
	else
		fprintf(file, "%s  IN: false\n", spaces_str.CharPtr());
	if (rewrite)
		fprintf(file, "%s  REWRITE: true\n", spaces_str.CharPtr());
	else
		fprintf(file, "%s  REWRITE: false\n", spaces_str.CharPtr());
	if (primary)
		fprintf(file, "%s  PRIMARY: true\n", spaces_str.CharPtr());
	else
		fprintf(file, "%s  PRIMARY: false\n", spaces_str.CharPtr());

	fprintf(file, "%s  coef: %f\n", spaces_str.CharPtr(), coef);
	fprintf(file, "%s  total: %f\n", spaces_str.CharPtr(), total);
	fprintf(file, "%s  total_primary: %f\n", spaces_str.CharPtr(), total_primary);
	fprintf(file, "%s  alk: %f\n", spaces_str.CharPtr(), alk);
	fprintf(file, "%s  gfw: %f\n", spaces_str.CharPtr(), gfw);
	fprintf(file, "%s  gfw_formula: %s\n", spaces_str.CharPtr(), gfw_formula.CharPtr());

	if (e != NULL)
		fprintf(file, "%s  e: %s (%p)\n", spaces_str.CharPtr(), e->name.CharPtr(), e);
	else
		fprintf(file, "%s  e: NULL\n", spaces_str.CharPtr());  
	if (u != NULL && !u->name.IsEmpty())
		fprintf(file, "%s  u: %s (%p)\n", spaces_str.CharPtr(), u->name.CharPtr(), u);
	else if (u != NULL)
		fprintf(file, "%s  u: (%p)\n", spaces_str.CharPtr(), u->name.CharPtr(), u);
	else
		fprintf(file, "%s  u: NULL\n", spaces_str.CharPtr());  
	if (s != NULL)
		fprintf(file, "%s  s: %s (%p)\n", spaces_str.CharPtr(), s->name.CharPtr(), s);
	else
		fprintf(file, "%s  s: NULL\n", spaces_str.CharPtr()); 

	if(rxn_primary != NULL)
	{
		fprintf(file, "%s  RXN_PRIMARY: (%p)\n", spaces_str.CharPtr(), rxn_primary);
		rxn_primary->PrintToFile(file, spaces + 5);
	}
	else
		fprintf(file, "%s  RXN_PRIMARY: NULL\n", spaces_str.CharPtr());
	if(rxn_secondary != NULL)
	{
		fprintf(file, "%s  RXN_SECONDARY: (%p)\n", spaces_str.CharPtr(), rxn_secondary);
		rxn_secondary->PrintToFile(file, spaces + 5);
	}
	else
		fprintf(file, "%s  RXN_SECONDARY: NULL\n", spaces_str.CharPtr());
	if(pe_rxn != NULL && *pe_rxn)
	{
		fprintf(file, "%s  PE_RXN: (%p)\n", spaces_str.CharPtr(), *pe_rxn);
		(*pe_rxn)->PrintToFile(file, spaces + 5);
	}
	else
		fprintf(file, "%s  PE_RXN: NULL\n", spaces_str.CharPtr());
	fprintf(file, "=====================================\n");
}
Beispiel #5
0
void Species::PrintToFile(FILE *file, int spaces)
{
    String spaces_str(spaces, " ");
    int i;

    fprintf(file, "%s%s\n", spaces_str.CharPtr(), name.CharPtr());

    fprintf(file, "%s  number: %d\n", spaces_str.CharPtr(), number);
    fprintf(file, "%s  type: %d\n", spaces_str.CharPtr(), type);
    fprintf(file, "%s  gflag: %d\n", spaces_str.CharPtr(), gflag);
    fprintf(file, "%s  exch_gflag: %d\n", spaces_str.CharPtr(), exch_gflag);
    fprintf(file, "%s  original_units: %d\n", spaces_str.CharPtr(), original_units);

    if (in)
        fprintf(file, "%s  in: TRUE\n", spaces_str.CharPtr());
    else
        fprintf(file, "%s  in: FALSE\n", spaces_str.CharPtr());

    if (check_equation)
        fprintf(file, "%s  check_equation: TRUE\n", spaces_str.CharPtr());
    else
        fprintf(file, "%s  check_equation: FALSE\n", spaces_str.CharPtr());

    fprintf(file, "%s  gfw: %12.3e\n", spaces_str.CharPtr(), gfw);
    fprintf(file, "%s  z: %12.3e\n", spaces_str.CharPtr(), z);
    fprintf(file, "%s  dw: %12.3e\n", spaces_str.CharPtr(), dw);
    fprintf(file, "%s  equiv: %12.3e\n", spaces_str.CharPtr(), equiv);
    fprintf(file, "%s  alk: %12.3e\n", spaces_str.CharPtr(), alk);
    fprintf(file, "%s  co2: %12.3e\n", spaces_str.CharPtr(), co2);
    fprintf(file, "%s  carbon: %12.3e\n", spaces_str.CharPtr(), carbon);
    fprintf(file, "%s  h: %12.3e\n", spaces_str.CharPtr(), h);
    fprintf(file, "%s  o: %12.3e\n", spaces_str.CharPtr(), o);
    fprintf(file, "%s  dha: %12.3e\n", spaces_str.CharPtr(), dha);
    fprintf(file, "%s  dhb: %12.3e\n", spaces_str.CharPtr(), dhb);
    fprintf(file, "%s  lk: %12.3e\n", spaces_str.CharPtr(), lk);
    fprintf(file, "%s  lg: %12.3e\n", spaces_str.CharPtr(), lg);
    fprintf(file, "%s  lg_pitzer: %12.3e\n", spaces_str.CharPtr(), lg_pitzer);
    fprintf(file, "%s  lm: %12.3e\n", spaces_str.CharPtr(), lm);
    fprintf(file, "%s  la: %12.3e\n", spaces_str.CharPtr(), la);
    fprintf(file, "%s  dg: %12.3e\n", spaces_str.CharPtr(), dg);
    fprintf(file, "%s  dg_total_g: %12.3e\n", spaces_str.CharPtr(), dg_total_g);
    fprintf(file, "%s  moles: %12.3e\n", spaces_str.CharPtr(), moles);
    fprintf(file, "%s  tot_g_moles: %12.3e\n", spaces_str.CharPtr(), tot_g_moles);
    fprintf(file, "%s  tot_dh2o_moles: %12.3e\n", spaces_str.CharPtr(), tot_dh2o_moles);
    fprintf(file, "%s  logk: ", spaces_str.CharPtr());
    for (i = 0; i < 8; i++)
        fprintf(file, "%d:(%12.3e)  ",  i, logk[i]);
    fprintf(file, "\n");
    fprintf(file, "%s  cd_music: ", spaces_str.CharPtr());
    for (i = 0; i < 5; i++)
        fprintf(file, "%d:(%12.3e)  ",  i, cd_music[i]);
    fprintf(file, "\n");
    fprintf(file, "%s  dz: ", spaces_str.CharPtr());
    for (i = 0; i < 3; i++)
        fprintf(file, "%d:(%12.3e)  ",  i, dz[i]);
    fprintf(file, "\n");

    if (primary != NULL)
        fprintf(file, "%s  primary: %s (%p)\n", spaces_str.CharPtr(), primary->name.CharPtr(), primary);
    else
        fprintf(file, "%s  primary: NULL\n", spaces_str.CharPtr());
    if (secondary != NULL)
        fprintf(file, "%s  secondary: %s (%p)\n", spaces_str.CharPtr(), secondary->name.CharPtr(), secondary);
    else
        fprintf(file, "%s  secondary: NULL\n", spaces_str.CharPtr());

    if(diff_layer != NULL && diff_layer->Count() > 0)
    {
        fprintf(file, "%s  DIFF_LAYER: (%p)\n", spaces_str.CharPtr(), diff_layer);
        for (i = 0; i < diff_layer->Count(); i++)
            (*diff_layer)[i]->PrintToFile(file, spaces + 5);
    }
    else
        fprintf(file, "%s  DIFF_LAYER: NULL\n", spaces_str.CharPtr());

    if(rxn != NULL && rxn->token_list->Count() > 0)
    {
        fprintf(file, "%s  RXN: (%p)\n", spaces_str.CharPtr(), rxn);
        rxn->PrintToFile(file, spaces + 5);
    }
    else
        fprintf(file, "%s  RXN: NULL\n", spaces_str.CharPtr());
    if(rxn_s != NULL && rxn_s->token_list->Count() > 0)
    {
        fprintf(file, "%s  RXN_S: (%p)\n", spaces_str.CharPtr(), rxn_s);
        rxn_s->PrintToFile(file, spaces + 5);
    }
    else
        fprintf(file, "%s  RXN_S: NULL\n", spaces_str.CharPtr());
    if(rxn_x != NULL && rxn_x->token_list->Count() > 0)
    {
        fprintf(file, "%s  RXN_X: (%p)\n", spaces_str.CharPtr(), rxn_x);
        rxn_x->PrintToFile(file, spaces + 5);
    }
    else
        fprintf(file, "%s  RXN_X: NULL\n", spaces_str.CharPtr());

    if (eos_list != NULL && eos_list->Count() > 0)
    {
        fprintf(file, "%s  EOS_LIST: %d (%p)\n", spaces_str.CharPtr(), eos_list->Count(), eos_list);
        for(i = 0; i < eos_list->Count(); i++)
        {
            fprintf(file, "%s    %d:\n", spaces_str.CharPtr(), i);
            (*eos_list)[i]->PrintToFile(file, spaces + 5);
        }
    }
    else
        fprintf(file, "%s  EOS_LIST: NULL\n", spaces_str.CharPtr());
}