Documentation from the file



wn_simple_gce/0.10/src/WnSimpleGce.h


Table of Contents

Structures
Name: WnSimpleGce

Description: A structure storing information for a GCE model. The contents of the structure are not made public by the API but rather are accessed through API routines.

-top-


Name: WnSimpleGce__Species

Description: A structure storing information for a species in a GCE model. The contents of the structure are not made public by the API but rather are accessed through API routines.

-top-



User-Supplied Routines
Name: WnSimpleGce__Species__infall_mass_fraction_function()

Description: User-supplied routine to calculate the mass fraction of a species in the infalling material.

Syntax:
       double
       WnSimpleGce__Species__infall_mass_fraction_function(
         double d_time,
         void *p_user_data
       );
           
Input:

d_time: (required) The time (in Gyr) at which to compute the infall rate.

p_user_data: (required) A pointer to a user-defined structure containing extra data for the infall mass fraction function.

Output:

User's routine must return a double giving the mass fraction of the species in the infalling material at the input time. The user sets the infall mass fraction function for the species for a model with WnSimpleGce__Species__setInfallMassFractionFunction(). The default is that the species has zero mass fraction in the infalling matter.


-top-


Name: WnSimpleGce__Species__yield_function()

Description: User-supplied routine to calculate the yield of a species for a given value of the primary metallicity.

Syntax:
       double
       WnSimpleGce__Species__yield_function(
         double d_primary_metallicity,
         void *p_user_data
       );
           
Input:

d_primary_metallicity: (required) The primary metallicity at which to compute the yield.

p_user_data: (required) A pointer to a user-defined structure containing extra data for the yield function.

Output:

User's routine must return a double giving the yield for the species at the input primary metallicity. The user sets the yield function for the species WnSimpleGce__Species__setYieldFunction(). The default is that the species yield is computed from the usual primary, secondary, ... power series with coefficients alpha, beta, ....


-top-


Name: WnSimpleGce__infallPrimaryMetallicityFunction()

Description: User-supplied routine to calculate the primary metallicity in the infalling material.

Syntax:
       double
       WnSimpleGce__infall_primary_metallicity_function(
         double d_time,
         void *p_user_data
       );
           
Input:

d_time: (required) The time (in Gyr) at which to compute the infall rate.

p_user_data: (required) A pointer to a user-defined structure containing extra data for the infall primary metallicity function.

Output:

User's routine must return a double giving the primary metallicity in the infalling material at the input time. The user sets the infall primary metallicity function for a model with WnSimpleGce__setInfallPrimaryMetallicityFunction(). The default is that the infalling material has zero metallicity.


-top-


Name: WnSimpleGce__infall_cycle_function()

Description: User-supplied routine to calculate the infall cycle number.

Syntax:
       double
       WnSimpleGce__infall_cycle_function(
         double d_time,
         void *p_user_data
       );
           
Input:

d_time: (required) The time (in Gyr) at which to compute the infall cycle number.

p_user_data: (required) A pointer to a user-defined structure containing extra data for the infall function.

Output:

User's routine must return a double giving the infall cycle number at the input time. The user sets the infall rate function for a model with WnSimpleGce__updateInfallCycleFunctionsAndData(). The default function is that for standard model 1 by Clayton (1985).


-top-


Name: WnSimpleGce__infall_cycle_integrand()

Description: User-supplied routine to calculate the infall cycle number integrand. This quantity is the current infall rate divided by the current gas mass.

Syntax:
       double
       WnSimpleGce__infall_cycle_integrand(
         double d_time,
         void *p_user_data
       );
           
Input:

d_time: (required) The time (in Gyr) at which to compute the infall cycle number integand.

p_user_data: (required) A pointer to a user-defined structure containing extra data for the infall integrand.

Output:

User's routine must return a double giving the infall cycle number integrand at the input time. The user sets the infall rate function for a model with WnSimpleGce__updateInfallCycleFunctionsAndData(). The default integrand is that for standard model 1 by Clayton (1985).


-top-



Routines
Name: WnSimpleGce__Species__clearInfallMassFractionFunction()

Description: Clear the infall mass fraction function for the species. The routine is reset to the default--that is, zero mass fraction for the species in the infall.

Syntax:
       void
       WnSimpleGce__Species__clearInfallMassFractionFunction(
         WnSimpleGce *self
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

Output:

Upon successful return, the infall mass fraction function for the species been cleared and reset to the default. If the input species is invalid, error handling is invoked.

Example: Clear the infall mass fraction function for the species p_species:

       WnSimpleGce__Species__clearInfallMassFractionFunction(
         p_model
       );
             

-top-


Name: WnSimpleGce__Species__free()

Description: Free the memory for a species in a simple GCE model.

Syntax:
       void
       WnSimpleGce__Species__free( WnSimpleGce__Species *self );
           
Input:

self: (required) A pointer to a species in a simple GCE model.

Output:

Upon successful return, the memory for the species has been freed.

Example: Free the memory for the species pointed to by p_species:

       WnSimpleGce__Species__free( p_species );
             

-top-


Name: WnSimpleGce__Species__getName()

Description: Retrieve the name of a species.

Syntax:
       const char *
       WnSimpleGce__Species__getName(
         WnSimpleGce__Species *self
       );
           
Input:

self: (required) A pointer to the species whose name is desired.

Output:

Routine returns the name of the species. If the input species is invalid, error handling is invoked.

Example: Print the name of the species pointed to by p_species:

       printf(
         "The name of the species is %s\n",
         WnSimpleGce__Species__getName( p_species )
       );
             

-top-


Name: WnSimpleGce__Species__getYieldCoefficient()

Description: Retrieve the current yield coefficient for the default yield function.

Syntax:
       double
       WnSimpleGce__Species__getYieldCoefficient(
         WnSimpleGce__Species * self,
         unsigned int i_n
       );
           
Input:

self: (required) A pointer to a WnSimpleGce species.

i_n: (required) An unsigned integer giving the coefficient of the term in the default yield power series:

Output:

Routine returns current value for the coefficient. If the coefficient is not set, routine returns zero. If the species is invalid, error handling is invoked.

Example: Print the currently set primary yield coefficient for p_species:

       printf(
         "The alpha coefficient is: %g\n",
         WnSimpleGce__Species__getYieldCoefficient(
           p_species, 
           0
         )
       );
             

-top-


Name: WnSimpleGce__Species__new()

Description: Create a new species for a simple GCE model.

Syntax:
       WnSimpleGce__Species *
       WnSimpleGce__Species__new( const char *s_name );
           
Input:

s_name: (required) A string giving the name of the new species.

Output:

The routine returns a pointer to a new WnSimpleGce__Species structure, that is, a new species in a simple GCE model. The newly created species has a decay rate of zero. The decay rate can be updated with the routine WnSimpleGce__Species__updateDecayRate(). The newly created species also has yield coefficients of zero. These can be updated with the routine WnSimpleGce__Species__updateYieldCoefficient(). If it is not possible to allocate memory for the new structure, WnSimpleGce error handling is invoked.

Example: Create a new species, oxygen-16, for a simple GCE model:

       p_o16 = WnSimpleGce__Species__new( "o16" );
             

-top-


Name: WnSimpleGce__Species__setInfallMassFractionFunction()

Description: Set the infall mass fraction function for the species for the model. If the user does not set this function, the species is assumed to have zero mass fraction in the infalling matter.

Syntax:
       void
       WnSimpleGce__Species__setInfallMassFractionFunction(
         WnSimpleGce__Species *self,
         WnSimpleGce__Species__infall_mass_fraction_function pf_func,
         void *p_user_data
       );
           
Input:

self: (required) A pointer to a WnSimpleGce__Species structure.

pf_func: (required) The name of the user's infall mass fraction function for a species. This must be cast as a WnSimpleGce__Species__infall_mass_fraction_function.

p_user_data: (required) A pointer to a user-defined data structure containing extra data for the user's infall mass fraction function.

Output:

Upon successful return, the infall mass fraction function for the species been set to the input function. If the species is invalid, error handling is invoked.

Example: Set the infall mass fraction function for the species p_species to my_infall_mass_fraction_function and also pass the user-supplied data structure my_data containing the extra data to be applied by my_infall_mass_fraction_function:

       WnSimpleGce__Species__setInfallMassFractionFunction(
         p_species,
         (WnSimpleGce__Species__infall_mass_fraction_function)
            my_infall_mass_fraction_function,
         &my_data
       );
             

-top-


Name: WnSimpleGce__Species__updateDecayRate()

Description: Update the decay rate (per Gyr) for a species in a simple GCE model.

Syntax:
       void
       WnSimpleGce__Species__updateDecayRate(
         WnSimpleGce__Species *self,
         double d_decay_rate
       );
           
Input:

self: (required) A pointer to the species whose decay rate is to be updated.

d_decay_rate: (required) A double giving the decay rate (per Gyr) of the species.

Output:

Upon successful return, the decay rate of the species has been updated to the input value. If the species or the decay rate is invalid, error handling is invoked.

Example: Update the decay rate of al26 (pointed to by p_al26) to 1000. per Gyr:

       WnSimpleGce__Species__updateDecayRate( p_al26, 1000. );
             

-top-


Name: WnSimpleGce__Species__updateUserYieldFunctionData()

Description: Update the data for a user-defined species yield function.

Syntax:
       void
       WnSimpleGce__Species__updateUserYieldFunctionData(
         WnSimpleGce__Species * self,
         void * p_data
       );
           
Input:

self: (required) A pointer to a WnSimpleGce species.

p_data: (required) A pointer to the user-defined data structure.

Output:

On successful return, the yield function data for the species has been updated to the input value. If the species is invalid, error handling is invoked.

Example: Update the yield function data for p_species to p_my_data:

       WnSimpleGce__Species__updateUserYieldFunctionData(
         p_species, 
         p_data
       );
             

-top-


Name: WnSimpleGce__Species__updateYieldCoefficient()

Description: Update the yield coefficient for a species.

Syntax:
       int
       WnSimpleGce__Species__updateYieldCoefficient(
         WnSimpleGce__Species *self,
         unsigned int i_n,
         double d_coefficient
       );
           
Input:

self: (required) A pointer to the species whose yield coefficient is to be updated.

i_n: (required) An unsigned int giving the power of the primary metallicity for which the coefficient is being updated.

d_coefficient: (required) A double giving the value to which to update the coefficient.

Output:

Routine returns 0 if successful, -1 if not. Upon successful return, the yield coefficient for the term in the yield that is the primary metallicity raised to the power i_n has been updated to the input value. If the species is invalid, error handling is invoked.

Example: Update the primary metallicity part (n=0) of the yield of al27 (pointed to by p_al27) to 0.0034:

       WnSimpleGce__Species__updateYieldCoefficient( p_al27, 0, 0.0034 );
             

-top-


Name: WnSimpleGce__Species__updateYieldFunction()

Description: Update the yield function for a species to the input function.

Syntax:
       void
       WnSimpleGce__Species__updateYieldFunction(
         WnSimpleGce__Species * self,
         WnSimpleGce__Species__yield_function pf_func
       );
           
Input:

self: (required) A pointer to a WnSimpleGce species.

pf_func: (required) The user-defined function.

Output:

On successful return, the yield function for the species has been set to the input value. If the input yield function is NULL, the function has been reset to the default function. If the species is invalid, error handling is invoked.

Example: Set the yield function for p_species to my_yield_function:

       WnSimpleGce__Species__updateYieldFunction(
         p_species, 
         (WnSimpleGce__Species__yield_function) my_yield_function
       );
             

-top-


Name: WnSimpleGce__clearInfallCycleFunctionsAndData()

Description: Restore the infall cycle functions and data to their defaults.

Syntax:
       void
       WnSimpleGce__clearInfallCycleFunctionsAndData(
         WnSimpleGce *self
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

Output:

Upon successful return, the infall integrand and function and their associated data have reset to the default values. If the model is invalid, error handling is invoked.

Example: Reset the infall cycle functions and data for simple GCE model pointed to by p_gce:

       WnSimpleGce__clearInfallCycleFunctionsAndData(
         p_model
       );
             

-top-


Name: WnSimpleGce__clearInfallPrimaryMetallicityFunction()

Description: Clear the infall primary metallicity function for the model. The routine is reset to the default--that is, zero infall primary metallicity.

Syntax:
       void
       WnSimpleGce__clearInfallPrimaryMetallicityFunction(
         WnSimpleGce *self
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

Output:

Upon successful return, the infall primary metallicity function has been cleared and reset to the default. If the input model is invalid, error handling is invoked.

Example: Clear the infall primary metallicity function for the simple GCE model p_model:

       WnSimpleGce__clearInfallPrimaryMetallicityFunction(
         p_model
       );
             

-top-


Name: WnSimpleGce__computeGasMass()

Description: Compute the gas mass in the disk (or Solar annulus) for the given model at the input time.

Syntax:
       double
       WnSimpleGce__computeGasMass(
         WnSimpleGce *self,
         double d_time
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

d_time: (required) A double giving the time (in Gyr) at which to compute the gas mass.

Output:

Routine returns the total mass at the input time for the input model. If the model or time is invalid, error handling is invoked.

Example: For the simple GCE model pointed to by p_model, print the gas mass at 4.5 Gyr:

       d_time = 4.5;
       printf(
         "At %g Gyr, the gas mass is %g.\n",
         d_time,
         WnSimpleGce__computeGasMass( p_model, d_time )
       );
             

-top-


Name: WnSimpleGce__computeInfallCycleNumber()

Description: Compute the infall cycle number (integral of the infall rate divided by the gas mass from zero to the input time) for the given model at the input time.

Syntax:
       double
       WnSimpleGce__computeInfallCycleNumber(
         WnSimpleGce *self,
         double d_time
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

d_time: (required) A double giving the time (in Gyr) at which to compute the infall cycle number.

Output:

Routine returns the infall cycle number at the input time for the input model. If the model or time is invalid, error handling is invoked.

Example: For the simple GCE model pointed to by p_model, print the infall cycle number at 7.3 Gyr:

       d_time = 7.3;
       printf(
         "At %g Gyr, the infall cycle number is %g.\n",
         d_time,
         WnSimpleGce__computeCycleNumber( p_model, d_time )
       );
             

-top-


Name: WnSimpleGce__computeInfallRate()

Description: Compute the infall rate for the given model at the input time.

Syntax:
       double
       WnSimpleGce__computeInfallRate(
         WnSimpleGce *self,
         double d_time
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

d_time: (required) A double giving the time (in Gyr) at which to compute the infall rate.

Output:

Routine returns the infall rate at the input time for the input model. The infall rate is computed from the currently set infall cycle integrand. If the model or time is invalid, error handling is invoked.

Example: For the simple GCE model pointed to by p_model, print the infall rate at 8.5 Gyr:

       d_time = 8.5;
       printf(
         "At %g Gyr, the infall rate is %g.\n",
         d_time,
         WnSimpleGce__computeInfallRate( p_model, d_time )
       );
             

-top-


Name: WnSimpleGce__computeOmegaFromGasFraction()

Description: Compute the omega (in per Gyr) that gives the input gas fraction (ratio of gas mass to total mass) at the input time.

Syntax:
       int 
       WnSimpleGce__computeOmegaFromGasFraction(
         WnSimpleGce *self,
         double d_time,
         double d_gas_fraction
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

d_time: (required) A double giving the time (in Gyr) at which to compute the omega that gives the desired gas fraction.

Output:

Upon successful return, the omega for the model has been updated to the value that gives the desired gas fraction at the input time. and the routine returns 1 (true). If the model, time, or gas fraction is invalid, error handling is invoked. If the routine is unable to find the omega, the routine returns 0 (false).

Example: For the simple GCE model pointed to by p_model, find the omega that gives a gas fraction of 0.091 at 13 Gyr:

       d_time = 13.;
       d_gas_fraction = 0.091;
      
       WnSimpleGce__computeOmegaFromGasFraction(
         p_model, d_time, d_gas_fraction
        );
      
       printf(
         "To get a gas fraction of %g at %g Gyr, omega must be %g per Gyr.\n",
         d_gas_fraction,
         d_time,
         WnSimpleGce__getOmega( p_model )
       );
             

-top-


Name: WnSimpleGce__computePrimaryMetallicity()

Description: Compute the primary metallicity for the given model at the input time.

Syntax:
       double
       WnSimpleGce__computePrimaryMetallicity(
         WnSimpleGce *self,
         double d_time
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

d_time: (required) A double giving the time (in Gyr) at which to compute the primary metallicity.

Output:

Routine returns the primary metallicity at the input time for the input model. If the model or time is invalid, error handling is invoked.

Example: For the simple GCE model pointed to by p_model, print the primary metallicity at 7.3 Gyr:

       d_time = 7.3;
       printf(
         "At %g Gyr, the primary metallicity is %g.\n",
         d_time,
         WnSimpleGce__computePrimaryMetallicity( p_model, d_time )
       );
             

-top-


Name: WnSimpleGce__computeSpeciesMassFraction()

Description: Compute the mass fraction for the input species in the gas for the input model at the given time.

Syntax:
       double
       WnSimpleGce__computeSpeciesMassFraction(
         WnSimpleGce *self,
         WnSimpleGce__Species *p_species,
         double d_time
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

p_species: (required) A pointer to a WnSimpleGce__Species.

d_time: (required) A double giving the time (in Gyr) at which to compute the mass fraction in the gas of the species.

Output:

Routine returns the mass fraction of the species at the input time for the input model. If the model, species, or time is invalid, error handling is invoked.

Example: For the simple GCE model pointed to by p_model and the WnSimpleGce__Species p_species, print the mass fraction at 11 Gyr:

       d_time = 11.;
       printf(
         "At %g Gyr, the mass fraction of %s is %g.\n",
         d_time,
         WnSimpleGce__Species__getName( p_species ),
         WnSimpleGce__computeSpeciesMassFraction( p_model, p_species, d_time )
       );
             

-top-


Name: WnSimpleGce__computeSpeciesYield()

Description: Compute the yield for the input species for the input model at the given time.

Syntax:
       double
       WnSimpleGce__computeSpeciesYield(
         WnSimpleGce *self,
         WnSimpleGce__Species *p_species,
         double d_time
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

p_species: (required) A pointer to a WnSimpleGce__Species.

d_time: (required) A double giving the time (in Gyr) at which to compute the yield of the species.

Output:

Routine returns the yield of the species at the input time for the input model. If the model, species, or time is invalid, error handling is invoked.

Example: For the simple GCE model pointed to by p_model and the WnSimpleGce__Species p_species, print the yield at 11 Gyr:

       d_time = 11.;
       printf(
         "At %g Gyr, the yield of %s is %g.\n",
         d_time,
         WnSimpleGce__Species__getName( p_species ),
         WnSimpleGce__computeSpeciesYield( p_model, p_species, d_time )
       );
             

-top-


Name: WnSimpleGce__computeStarMass()

Description: Compute the mass in the disk (or Solar annulus) locked up in stars (and stellar remnants) for the given model at the input time.

Syntax:
       double
       WnSimpleGce__computeStarMass(
         WnSimpleGce *self,
         double d_time
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

d_time: (required) A double giving the time (in Gyr) at which to compute the mass in stars and stellar remnants.

Output:

Routine returns the mass in stars and remnants at the input time for the input model. If the model or time is invalid, error handling is invoked.

Example: For the simple GCE model pointed to by p_model, print the star mass at 3.2 Gyr:

       d_time = 3.2;
       printf(
         "At %g Gyr, the mass locked in stars is %g.\n",
         d_time,
         WnSimpleGce__computeStarMass( p_model, d_time )
       );
             

-top-


Name: WnSimpleGce__computeTotalMass()

Description: Compute the total mass in the disk (or Solar annulus) for the given model at the input time.

Syntax:
       double
       WnSimpleGce__computeTotalMass(
         WnSimpleGce *self,
         double d_time
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

d_time: (required) A double giving the time (in Gyr) at which to compute the total mass.

Output:

Routine returns the total mass at the input time for the input model. If the model or time is invalid, error handling is invoked.

Example: For the simple GCE model pointed to by p_model, print the total mass at 4.5 Gyr:

       d_time = 4.5;
       printf(
         "At %g Gyr, the total mass is %g.\n",
         d_time,
         WnSimpleGce__computeTotalMass( p_model, d_time )
       );
             

-top-


Name: WnSimpleGce__free()

Description: Free the memory for a simple GCE model.

Syntax:
       void
       WnSimpleGce__free( WnSimpleGce *self );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

Output:

Upon successful return, the memory for the model has been freed.

Example: Free the memory for the WnSimpleGce model pointed to by p_my_model:

       WnSimpleGce__free( p_my_model );
             

-top-


Name: WnSimpleGce__getInfallDelta()

Description: Retrieve the current value of Delta (in Gyr) for the input model.

Syntax:
       double
       WnSimpleGce__getInfallDelta(
         WnSimpleGce *self
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

Output:

Routine returns the current Delta (in Gyr) for the input model. If the model is invalid, error handling is invoked.

Example: Print the Delta for the simple GCE model pointed to by p_model:

       printf(
         "Delta for the model is %g per Gyr.\n",
         WnSimpleGce__getInfallDelta( p_model )
       );
             

-top-


Name: WnSimpleGce__getInfallKValue()

Description: Retrieve the current value of the infall k for the input model.

Syntax:
       unsigned int
       WnSimpleGce__getInfallKValue(
         WnSimpleGce *self
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

Output:

Routine returns the current infall k value for the input model. If the model is invalid, error handling is invoked.

Example: Print the k for the simple GCE model pointed to by p_model:

       printf(
         "The infall k for the model is %d per Gyr.\n",
         WnSimpleGce__getInfallKValue( p_model )
       );
             

-top-


Name: WnSimpleGce__getInitialGasMass()

Description: Retrieve the current value of the initial mass.

Syntax:
       double
       WnSimpleGce__getInitialGasMass(
         WnSimpleGce *self
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

Output:

Routine returns the current initial mass for the input model. If the model is invalid, error handling is invoked.

Example: Print the initial mass for the simple GCE model pointed to by p_model:

       printf(
         "The initial mass for the model is %g solar masses.\n",
         WnSimpleGce__getInitialGasMass( p_model )
       );
             

-top-


Name: WnSimpleGce__getOmega()

Description: Retrieve the current value of omega (per Gyr) for the input model.

Syntax:
       double
       WnSimpleGce__getOmega(
         WnSimpleGce *self
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

Output:

Routine returns the omega (in per Gyr) for the input model. If the model is invalid, error handling is invoked.

Example: Print the omega for the simple GCE model pointed to by p_model:

       printf(
         "Omega for the model is %g per Gyr.\n",
         WnSimpleGce__getOmega( p_model )
       );
             

-top-


Name: WnSimpleGce__new()

Description: Create a new simple GCE model.

Syntax:
       WnSimpleGce * WnSimpleGce__new( );
           
Output:

The routine returns a pointer to a new WnSimpleGce structure, that is, a new simple GCE model. If it is not possible to allocate memory for the new structure, WnSimpleGce error handling is invoked.

Example: Create a new simple GCE model pointed to by p_my_model:

       p_my_model = WnSimpleGce__new( );
             

-top-


Name: WnSimpleGce__setInfallPrimaryMetallicityFunction()

Description: Set the infall primary metallicity function for the model. If the user does not set this function, the infalling material is assumed to have zero metallicity.

Syntax:
       void
       WnSimpleGce__setInfallPrimaryMetallicityFunction(
         WnSimpleGce *self,
         WnSimpleGce__infall_primary_metallicity_function pf_func,
         void *p_user_data
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

pf_func: (required) The name of the user's infall primary metallicity function. This must be cast as a WnSimpleGce__infall_primary_metallicity_function.

p_user_data: (required) A pointer to a user-defined data structure containing extra data for the user's infall primary metallicity function.

Output:

Upon successful return, the infall primary metallicity function has been set to the input function. If the model is invalid, error handling is invoked.

Example: Set the infall primary metallicity function for the simple GCE model p_model to my_infall_primary_metallicity function and also pass the user-supplied data structure my_data containing the extra data to be applied by my_infall_primary_metallicity_function:

       WnSimpleGce__setInfallPrimaryMetallicityFunction(
         p_model,
         (WnSimpleGce__infall_primary_metallicity_function)
            my_infall_primary_metallicity_function,
         &my_data
       );
             

-top-


Name: WnSimpleGce__updateInfallCycleFunctionsAndData()

Description: Set the infall cycle number function and integrand for the model. If the user does not set these, the model uses the default model (Clayton's standard model 1).

Syntax:
       void
       WnSimpleGce__updateInfallCycleFunctionsAndData(
         WnSimpleGce *self,
         WnSimpleGce__infall_cycle_integrand pf_integrand,
         void *p_integrand_data,
         WnSimpleGce__infall_cycle_function pf_function,
         void *p_function_data
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

pf_integrand: (required) The name of the user's infall cycle number integrand.

p_user_data: (required) A pointer to a user-defined data structure containing extra data for the user's infall cycle number integrand.

pf_function: (required) The name of the user's infall cycle number function. This may be NULL if the user wants the integrand numerically integrated.

p_function_data: (required) A pointer to a user-defined data structure containing extra data for the user's infall cycle function.

Output:

Upon successful return, the infall integrand and function and their associated data have updated. If the model is invalid, error handling is invoked.

Example: Set the infall cycle integrand for the simple GCE model p_model to my_infall_cycle_integrand, the user-supplied data structure my_data containing the extra data to be applied by my_infall_cycle_integrand, the infall cycle function to my_infall_cycle_function, and the extra data to be applied by my_infall_cycle_function to my_data as well:

       WnSimpleGce__updateInfallCycleFunctionsAndData(
         p_model,
         (WnSimpleGce__infall_cycle_integrand) my_infall_cycle_integrand,
         &my_data,
         (WnSimpleGce__infall_cycle_function) my_infall_cycle_function,
         &my_data
       );
             

-top-


Name: WnSimpleGce__updateInfallDelta()

Description: Update the Delta (the time offset) for the default infall rate function (Clayton's standard model 1).

Syntax:
       void
       WnSimpleGce__updateInfallDelta(
         WnSimpleGce *self,
         double d_Delta
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

d_Delta: (required) A double giving the value to which the infall Delta value (in Gyr) is to be updated.

Output:

Upon successful return, the infall Delta value of the model has been updated to the input value. If the model is invalid, error handling is invoked.

Example: Update the infall Delta value of the simple GCE model p_my_model to 0.2 Gyr:

       WnSimpleGce__updateInfallDelta( p_my_model, 0.2 );
             

-top-


Name: WnSimpleGce__updateInfallKValue()

Description: Update the k value for the default infall rate function (Clayton's standard model 1).

Syntax:
       void
       WnSimpleGce__updateInfallKValue(
         WnSimpleGce *self,
         unsigned int i_k
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

i_k: (required) An unsigned int giving the value to which the infall k value is to be updated.

Output:

Upon successful return, the infall k value of the model has been updated to the input value. If the model is invalid, error handling is invoked.

Example: Update the infall k value of the simple GCE model p_my_model to 2:

       WnSimpleGce__updateInfallKValue( p_my_model, 2 );
             

-top-


Name: WnSimpleGce__updateInfallPrimaryMetallicity()

Description: Update the infall primary metallicity for the input model.

Syntax:
       void
       WnSimpleGce__updateInfallPrimaryMetallicity(
         WnSimpleGce *self,
         double d_infall_primary_metallicity
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

d_infall_primary_metallicity: (required) A double giving the value to which the infall primary metallicity is to be updated.

Output:

Upon successful return, the infall primary metallicity of the model has been updated to the input value. If the model is invalid, error handling is invoked.

Example: Update the infall primary metallicity of the simple GCE model p_my_model to 0.005:

       WnSimpleGce__updateInfallPrimaryMetallicity( p_my_model, 0.005 );
             

-top-


Name: WnSimpleGce__updateInitialGasMass()

Description: Update the initial gas mass for the input model.

Syntax:
       void
       WnSimpleGce__updateInitialGasMass(
         WnSimpleGce *self,
         double d_initial_gas_mass
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

d_initial_gas_mass: (required) A double giving the value to which the model's initial gas mass is to be updated. The units are arbitrary, but should be consistent with the infall rate.

Output:

Upon successful return, the initial gas mass of the model has been updated to the input value. If the model or the initial gas mass is invalid, error handling is invoked.

Example: Update the initial gas mass of the simple GCE model p_my_model to 1.e5 (Solar masses):

       WnSimpleGce__updateInitialGasMass( p_my_model, 1.e5 );
             

-top-


Name: WnSimpleGce__updateInitialPrimaryMetallicity()

Description: Update the initialprimary metallicity for the input model.

Syntax:
       void
       WnSimpleGce__updateInitialPrimaryMetallicity(
         WnSimpleGce *self,
         double d_initial_primary_metallicity
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

d_initial_primary_metallicity: (required) A double giving the value to which the primary metallicity yield is to be updated.

Output:

Upon successful return, the initial primary metallicity of the model has been updated to the input value. If the model is invalid, error handling is invoked.

Example: Update the initial primary metallicity of the simple GCE model p_my_model to 0.015:

       WnSimpleGce__updateInitialPrimaryMetallicity( p_my_model, 0.015 );
             

-top-


Name: WnSimpleGce__updateOmega()

Description: Update the omega (the gas consumption rate--in per Gyr) for the input model.

Syntax:
       void
       WnSimpleGce__updateOmega(
         WnSimpleGce *self,
         double d_omega
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

d_omega: (required) A double giving the value to which the omega (in per Gyr) is to be updated.

Output:

Upon successful return, the omega of the model has been updated to the input value. If the model is invalid, error handling is invoked.

Example: Update the omega of the simple GCE model p_my_model to 0.5 per Gyr:

       WnSimpleGce__updateOmega( p_my_model, 0.5 );
             

-top-


Name: WnSimpleGce__updatePrimaryMetallicityYield()

Description: Update the primary metallicity yield for the input model.

Syntax:
       void
       WnSimpleGce__updatePrimaryMetallicityYield(
         WnSimpleGce *self,
         double d_primary_metallicity_yield
       );
           
Input:

self: (required) A pointer to a WnSimpleGce model.

d_primary_metallicity_yield: (required) A double giving the value to which the primary metallicity yield is to be updated.

Output:

Upon successful return, the primary metallicity yield of the model has been updated to the input value. If the model is invalid, error handling is invoked.

Example: Update the primary metallicity yield of the simple GCE model p_my_model to 0.015:

       WnSimpleGce__updatePrimaryMetallicityYield( p_my_model, 0.015 );
             

-top-