Documentation from the file



libstatmech/0.9/src/Libstatmech.h


Table of Contents

Structures
Name: Libstatmech__Fermion

Description: Libstatmech__Fermion is a structure that stores information about a fermion. The contents of the structure are not made public by the API but rather are accessed by API routines.

-top-


Name: Libstatmech__Boson

Description: Libstatmech__Boson is a structure that stores information about a boson. The contents of the structure are not made public by the API but rather are accessed through API routines.

-top-



User-Supplied Routines
Name: Libstatmech__Boson__Function()

Description: User-supplied routine to compute the desired thermodynamic function of a boson gas given the temperature and chemical potential/kT.

Syntax:
       double
       Libstatmech__Boson__Function(
         Libstatmech__Boson *self,
         double d_T,
         double d_mukT,
         void *p_user_data
       );
           
Input:

self: (required) A pointer to the Libstatmech__Boson structure.

d_T: (required) A double giving the temperature in K at which to compute the thermodynamic function.

d_mukT: (required) A double giving the chemical potential divided by kT at which to compute the thermodynamic function.

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

Output:

User's routine must return a double giving the desired thermodynamic function for the input temperature and chemical potential divided by Boltzmann's constant times the temperature.


-top-


Name: Libstatmech__Boson__Integrand()

Description: User-supplied routine to compute the integrand for the desired thermodynamic function of a boson gas given the temperature and chemical potential/kT.

Syntax:
       double
       Libstatmech__Boson__Integrand(
         Libstatmech__Boson *self,
         double d_x,
         double d_T,
         double d_mukT,
         void *p_user_data
       );
           
Input:

self: (required) A pointer to the Libstatmech__Boson structure.

d_x: (required) A double giving the value of the integration variable x.

d_T: (required) A double giving the temperature in K at which to compute the thermodynamic function.

d_mukT: (required) A double giving the chemical potential divided by kT at which to compute the thermodynamic function.

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

Output:

User's routine must return a double giving the integrand for the desired thermodynamic function for the input temperature and chemical potential divided by Boltzmann's constant times the temperature.


-top-


Name: Libstatmech__Fermion__Function()

Description: User-supplied routine to compute the desired thermodynamic function of a fermion gas given the temperature and chemical potential/kT.

Syntax:
       double
       Libstatmech__Fermion__Function(
         Libstatmech__Fermion *self,
         double d_T,
         double d_mukT,
         void *p_user_data
       );
           
Input:

self: (required) A pointer to the Libstatmech__Fermion structure.

d_T: (required) A double giving the temperature in K at which to compute the thermodynamic function.

d_mukT: (required) A double giving the chemical potential divided by kT at which to compute the thermodynamic function.

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

Output:

User's routine must return a double giving the desired thermodynamic function for the input temperature and chemical potential divided by Boltzmann's constant times the temperature.


-top-


Name: Libstatmech__Fermion__Integrand()

Description: User-supplied routine to compute the integrand for the desired thermodynamic function of a fermion gas given the temperature and chemical potential/kT.

Syntax:
       double
       Libstatmech__Fermion__Integrand(
         Libstatmech__Fermion *self,
         double d_x,
         double d_T,
         double d_mukT,
         void *p_user_data
       );
           
Input:

self: (required) A pointer to the Libstatmech__Fermion structure.

d_x: (required) A double giving the value of the integration variable x.

d_T: (required) A double giving the temperature in K at which to compute the thermodynamic function.

d_mukT: (required) A double giving the chemical potential divided by kT at which to compute the thermodynamic function.

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

Output:

User's routine must return a double giving the integrand for the desired thermodynamic function for the input temperature and chemical potential divided by Boltzmann's constant times the temperature.


-top-



Routines
Name: Libstatmech__Boson__computeChemicalPotential()

Description: Routine to compute the chemical potential divided by kT of a boson gas given the temperature and number density.

Syntax:
       double
       Libstatmech__Boson__computeChemicalPotential(
         Libstatmech__Boson *self,
         double d_T,
         double d_number_density,
         void *p_user_data
       );
           
Input:

self: (required) A pointer to the Libstatmech__Boson structure.

d_T: (required) A double giving the temperature in K at which to compute the chemical potential.

d_number_density: (required) A double giving the number density at which to compute the chemical potential.

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

Output:

Routine returns a double giving the chemical potential divided by kT for the input temperature and number density.

Example: Print the chemical potential divided by kT of a boson gas with d_T = 1.e5 K and d_number_density = 1.e18:

       fprintf(
         stdout,
         "mu / kT = %e\n",
         Libstatmech__Boson__computeChemicalPotential(
           p_boson, 
           1.e5,
           1.e18,
           NULL
         )
       );
             

-top-


Name: Libstatmech__Boson__computeIntegrandValue()

Description: Routine to compute the thermodynamic integrand values of a boson gas given the name of thermodynamic quantity, temperature and chemical potential/kT.

Syntax:
       double
       Libstatmech__Boson__computeIntegrandValue(
         Libstatmech__Boson *self,
         const char *s_quantity_name, 
         double d_x,
         double d_T,
         double d_mukT,
         void *p_user_data
       );
           
Input:

self: (required) A pointer to the Libstatmech__Boson structure.

s_quantity_name: (required) A string giving the quantity name.

d_x: (required) A double giving the value of the integration variable x.

d_T: (required) A double giving the temperature in K at which to compute the thermodynamic integrand.

d_mukT: (required) A double giving the chemical potential divided by kT at which to compute the thermodynamic integrand.

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

Output:

Routine returns a double giving the integrand for the input thermodynamic quantity at the input integration variable (x) value, temperature, and chemical potential divided by Boltzmann's constant times the temperature.

Example: Compute the pressure integrand of a boson gas with d_T = 1.e5 K and d_mukT = 1 at integration variable value d_x:

       Libstatmech__Boson__computeIntegrandValue(
         p_boson, 
         S_PRESSURE,
         d_x,
         1.e5,
         1.,
         NULL
       );
             

-top-


Name: Libstatmech__Boson__computeQuantity()

Description: Routine to compute the thermodynamic quantity values of a boson gas given the name of thermodynamic quantity, temperature and chemical potential/kT.

Syntax:
       double
       Libstatmech__Boson__computeQuantity(
         Libstatmech__Boson *self,
         const char *s_quantity_name,
         double d_T,
         double d_mukT,
         void *p_function_data,
         void *p_integrand_data
       );
           
Input:

self: (required) A pointer to the Libstatmech__Boson structure.

s_quantity_name: (required) A string giving the quantity name.

d_T: (required) A double giving the temperature in K at which to compute the thermodynamic quantity.

d_mukT: (required) A double giving the chemical potential divided by kT at which to compute the thermodynamic quantity.

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

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

Output:

Routine returns a double giving the thermodynamic quantity value for the input thermodynamic quantity name, temperature and chemical potential divided by Boltzmann's constant times the temperature. If input is invalid, error handling is invoked.

Example: Compute the pressure of a boson gas with d_T = 1.e5 K and d_mukT = 1.:

       Libstatmech__Boson__computeQuantity(
         p_boson, 
         S_PRESSURE,
         1.e5,
         1.,
         NULL,
         NULL
       );
             

-top-


Name: Libstatmech__Boson__computeTemperatureDerivative()

Description: Routine to compute the temperature derivatives of thermodynamic quatities of a boson gas given the temperature and number density.

Syntax:
       double
       Libstatmech__Boson__computeTemperatureDerivative(
         Libstatmech__Boson *self,
         const char *s_function,
         double d_T,
         double d_number_density,
         void *p_function_data,
         void *p_integrand_data
       );
           
Input:

self: (required) A pointer to the Libstatmech__Boson structure.

s_function: (required) A string giving the quantity name.

d_T: (required) A double giving the temperature in K at which to compute the chemical potential.

d_number_density: (required) A double giving the number density at which to compute the chemical potential.

p_function_data: (required) A pointer to a user-defined structure containing extra data for the already integrated part of the thermodynamic quantity.

p_integrand_data: (required) A pointer to a user-defined structure containing extra data for the integrand part of the thermodynamic quantity.

Output:

Routine returns a double giving the temperature derivative value of the thermodynamic quantity name, at the input temperature and number density.

Example: Compute the temperature derivative of pressure of a boson gas with d_T = 1.e7 K and d_number_density = 1.e25 cm^-3:

       Libstatmech__Boson__computeTemperatureDerivative(
         p_boson, 
         S_PRESSURE,
         1.e7,
         1.e25,
         NULL,
         NULL
       );
             

-top-


Name: Libstatmech__Boson__copy()

Description: Creates a copy of a boson.

Syntax:
       Libstatmech_Boson *
       Libstatmech__Boson__copy(
         Libstatmech__Boson * self 
       );
           
Input:

self: (required) A pointer to the boson to be copied.

Output:

Routine returns a pointer to a new Libstatmech_Boson structure that has the same rest mass, multiplicity, and charge as the input structure. The new boson has the default quantity functions and integrands. If the input boson is not valid, Libstatmech error handling is invoked.

Example: Copy p_old_photon to p_photon:

       p_photon =
         Libstatmech__Boson__copy(
           p_old_photon
         );
             

-top-


Name: Libstatmech__Boson__free()

Description: Free the memory allocated for a Libstatmech boson.

Syntax:
       void 
       Libstatmech__Boson__free(
          Libstatmech__Boson *self
       );
           
Input:

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

Output:

Upon successful return, the memory for the boson has been freed. If the input pointer is not valid, Libstatmech error handling is invoked.

Example: Free the memory for the boson pointed to by p_boson:

       Libstatmech__Boson__free( p_boson );
             

-top-


Name: Libstatmech__Boson__getCharge()

Description: Returns the charge of a boson.

Syntax:
       double
       Libstatmech__Boson__getCharge(
          const Libstatmech__Boson *self
       );
           
Input:

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

Output:

Routine returns the charge of the boson. If the input pointer is not valid, Libstatmech error handling is invoked.

Example: Print the charge of the boson pointed to by p_boson:

       printf(
         "The charge of the boson is %e\n",
         Libstatmech__Boson__getCharge( p_boson )
       );
             

-top-


Name: Libstatmech__Boson__getMultiplicity()

Description: Returns the multiplicity of a boson.

Syntax:
       int 
       Libstatmech__Boson__getMultiplicity(
          const Libstatmech__Boson *self
       );
           
Input:

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

Output:

Routine returns the multiplicity of the boson. If the input pointer is not valid, Libstatmech error handling is invoked.

Example: Print the multiplicity of the boson pointed to by p_boson:

       printf(
         "The multiplicity of the boson is %d\n",
         Libstatmech__Boson__getMultiplicity( p_boson )
       );
             

-top-


Name: Libstatmech__Boson__getName()

Description: Returns the name of a boson.

Syntax:
       const char *
       Libstatmech__Boson__getName(
          const Libstatmech__Boson *self
       );
           
Input:

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

Output:

Routine returns the name of the boson. If the input pointer is not valid, Libstatmech error handling is invoked.

Example: Print the name of the boson pointed to by p_boson:

       printf(
         "The name of the boson is %s\n",
         Libstatmech__Boson__getName( p_boson )
       );
             

-top-


Name: Libstatmech__Boson__getRestMass()

Description: Returns the rest mass of a boson.

Syntax:
       double
       Libstatmech__Boson__getRestMass(
          const Libstatmech__Boson *self
       );
           
Input:

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

Output:

Routine returns the rest mass of the boson. If the input pointer is not valid, Libstatmech error handling is invoked.

Example: Print the rest mass of the boson pointed to by p_boson:

       printf(
         "The rest mass of the boson is %e\n",
         Libstatmech__Boson__getRestMass( p_boson )
       );
             

-top-


Name: Libstatmech__Boson__new()

Description: Creates a new Libstatmech__Boson structure.

Syntax:
       Libstatmech_Boson
       *Libstatmech__Boson__new(
          const char *s_boson_name,
          double d_rest_mass,
          int i_multiplicity,
          double d_charge
       );
           
Input:

s_boson_name: (required) A string giving the name of the new boson.

d_rest_mass: (required) A double giving the rest mass energy of the boson in MeV.

i_multiplicity: (required) An int giving the multiplicity of the boson. This is usually twice the spin plus unity (that is, 2J+1, where J is the spin).

d_charge: (required) A double giving the charge of the boson.

Output:

Routine returns a pointer to a new Libstatmech_Boson structure. If the routine cannot allocate sufficient memory, Libstatmech error handling is invoked.

Example: Create a new boson, a photon, with mass 0. Mev, multiplicity 2, and charge 0.:

       p_photon =
         Libstatmech__Boson__new(
           "photon", 0., 2, 0.
         );
             

-top-


Name: Libstatmech__Boson__updateIntegralLowerLimit()

Description: Routine to update the integral lower limit of a thermodynamic quantity of a boson gas.

Syntax:
       int 
       Libstatmech__Boson__updateIntegralLowerLimit(
         Libstatmech__Boson *self,
         const char *s_quantity_name,
         double d_lower_limit 
       );
           
Input:

self: (required) A pointer to the Libstatmech__Boson structure.

s_quantity_name: (required) A string giving the quantity name.

d_lower_limit: (required) A double giving the integral lower limit.

Output:

Routine returns 1 (true) if the update succeeded and 0 (false) if not. Upon successful return, the integral lower limit has been updated. If the input thermodynamic quantity is not valid, Libstatmech error handling is invoked.

Example: Update the integral lower limit of number density to d_x0 = 20.:

       d_x0 = 20.;
       Libstatmech__Boson__updateIntegralLowerLimit(
         p_boson, 
         S_NUMBER_DENSITY,
         d_x0 
       );
             

-top-


Name: Libstatmech__Boson__updateIntegralUpperLimit()

Description: Routine to update the integral upper limit of a thermodynamic quantity of a boson gas.

Syntax:
       int 
       Libstatmech__Boson__updateIntegralUpperLimit(
         Libstatmech__Boson *self,
         const char *s_quantity_name,
         double d_upper_limit 
       );
           
Input:

self: (required) A pointer to the Libstatmech__Boson structure.

s_quantity_name: (required) A string giving the quantity name.

d_upper_limit: (required) A double giving the integral upper limit.

Output:

Routine returns 1 (true) if the update succeeded and 0 (false) if not. Upon successful return, the integral upper limit has been updated. If the input thermodynamic quantity is not valid, Libstatmech error handling is invoked.

Example: Update the integral upper limit of number density to d_x0 = 20.:

       d_x0 = 20.;
       Libstatmech__Boson__updateIntegralUpperLimit(
         p_boson, 
         S_NUMBER_DENSITY,
         d_x0 
       );
             

-top-


Name: Libstatmech__Boson__updateQuantity()

Description: Routine to update a thermodynamic quantity.

Syntax:
       int 
       Libstatmech__Boson__updateQuantity(
         Libstatmech__Boson *self,
         const char *s_quantity_name,
         Libstatmech__Boson__Function pf_function,
         Libstatmech__Boson__Integrand pf_integrand
       );
           
Input:

self: (required) A pointer to the Libstatmech__Boson structure.

s_quantity_name: (required) A string giving the quantity name.

pf_function: (required) A pointer to a Libstatmech__Boson__Function. If set to NULL, the quantity will be computed only from the integral.

pf_integrand: (required) A pointer to a Libstatmech__Boson__Integrand. If set to NULL, the quantity will be computed only from the function. If set to DEFAULT_INTEGRAND, the quantity will be computed from the default integral.

Output:

Routine returns 1 (true) if the quantity update was successful and 0 (false) if not. On successful return, if the quantity previously existed, its function and integrand have been updated, while if the quantity did not previously exist, it has been added. If any input is not valid, error handling is invoked.

Example: Create a new thermodynamic quantity called "my quantity" for Libstatmech__Boson *p_boson with function my_function and integrand my_integrand:

       if(
         Libstatmech__Boson__updateQuantity(
           p_boson, 
           "my quantity",
           (Libstatmech__Boson__Function) my_function,
           (Libstatmech__Boson__Integrand) my_integrand
       );
             

-top-


Name: Libstatmech__Boson__updateQuantityIntegralAccuracy()

Description: Routine to update the accuracy parameters for the integral of a thermodynamic quantity of a boson gas.

Syntax:
       int 
       Libstatmech__Boson__updateIntegralLowerLimit(
         Libstatmech__Boson *self,
         const char *s_quantity_name,
         double d_eps_absolute,
         double d_eps_relative
       );
           
Input:

self: (required) A pointer to the Libstatmech__Boson structure.

s_quantity_name: (required) A string giving the quantity name.

d_eps_absolute: (required) A double giving the absolute accuracy desired for the integral. The default is 1.e-8.

d_eps_relative: (required) A double giving the relative accuracy desired for the integral. The default is 1.e-8.

Output:

Routine returns 1 (true) if the update succeeded and 0 (false) if not. Upon successful return, the absolute and relative accuracies for the integral have been updated. If the input thermodynamic quantity is not valid, Libstatmech error handling is invoked.

Example: Update the integral absolute accuracy to 1.e-4 and the relative accuracy to 1.e-12 for the number density:

       if(
          Libstatmech__Boson__updateQuantityIntegralAccuracy(
            p_boson, 
            S_NUMBER_DENSITY,
            1.e-4,
            1.e-12
          )
       )
         fprintf(stdout, "Update succeeded.\n" );
             

-top-


Name: Libstatmech__Fermion__computeChemicalPotential()

Description: Routine to compute the chemical potential divided by kT of a fermion gas given the temperature and number density.

Syntax:
       double
       Libstatmech__Fermion__computeChemicalPotential(
         Libstatmech__Fermion *self,
         double d_T,
         double d_number_density,
         void *p_function_data,
         void *p_integrand_data
       );
           
Input:

self: (required) A pointer to the Libstatmech__Fermion structure.

d_T: (required) A double giving the temperature in K at which to compute the chemical potential.

d_number_density: (required) A double giving the number density at which to compute the chemical potential.

p_function_data: (required) A pointer to a user-defined structure containing extra data for the already integrated part of the thermodynamic quantity.

p_integrand_data: (required) A pointer to a user-defined structure containing extra data for the integrand part of the thermodynamic quantity.

Output:

Routine returns a double giving the chemical potential divided by kT for the input temperature and number density.

Example: Print the chemical potential divided by kT of a fermion gas with d_T = 1.e7 K and d_number_density = 1.e25 cm^-3:

       fprintf(
         stdout,
         "mu / kT = %e\n",
         Libstatmech__Fermion__computeChemicalPotential(
           p_fermion, 
           1.e7,
           1.e25,
           NULL,
           NULL
         )
       );
             

-top-


Name: Libstatmech__Fermion__computeIntegrandValue()

Description: Routine to compute the thermodynamic integrand values of a fermion gas given the name of thermodynamic quantity, temperature and chemical potential/kT.

Syntax:
       double
       Libstatmech__Fermion__computeIntegrandValue(
         Libstatmech__Fermion *self,
         const char *s_integrand_name,
         double d_x,
         double d_T,
         double d_mukT,
         void *p_user_data
       );
           
Input:

self: (required) A pointer to the Libstatmech__Fermion structure.

s_integrand_name: (required) A string giving the name associated to the integrand.

d_x: (required) A double giving the value of the integration variable x.

d_T: (required) A double giving the temperature in K at which to compute the thermodynamic integrand.

d_mukT: (required) A double giving the chemical potential divided by kT at which to compute the thermodynamic integrand.

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

Output:

Routine returns a double giving the integrand for the input thermodynamic quantity at the input integration variable (x) value, temperature, and chemical potential divided by Boltzmann's constant times the temperature.

Example: Compute the pressure integrand of a fermion gas with d_T = 1.e7 K and d_mukT = 1 at integration variable value d_x:

       Libstatmech__Fermion__computeIntegrandValue(
         p_fermion, 
         S_PRESSURE,
         d_x,
         1.e7,
         1.,
         NULL
       );
             

-top-


Name: Libstatmech__Fermion__computeQuantity()

Description: Routine to compute the thermodynamic quantity values of a fermion gas given the name of thermodynamic quantity, temperature and chemical potential/kT.

Syntax:
       double
       Libstatmech__Fermion__computeQuantity(
         Libstatmech__Fermion *self,
         const char *s_quantity_name,
         double d_T,
         double d_mukT,
         void *p_function_data,
         void *p_integrand_data
       );
           
Input:

self: (required) A pointer to the Libstatmech__Fermion structure.

s_quantity_name: (required) A string qiving the quantity name.

d_T: (required) A double giving the temperature in K at which to compute the thermodynamic quantity.

d_mukT: (required) A double giving the chemical potential divided by kT at which to compute the thermodynamic quantity.

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

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

Output:

Routine returns a double giving the thermodynamic quantity value for the input thermodynamic quantity name, temperature and chemical potential divided by Boltzmann's constant times the temperature. If input is invalid, error handling is invoked.

Example: Compute the pressure of a fermion gas with d_T = 1.e7 K and d_mukT = 1.:

       Libstatmech__Fermion__computeQuantity(
         p_fermion, 
         S_PRESSURE,
         1.e7,
         1.,
         NULL,
         NULL
       );
             

-top-


Name: Libstatmech__Fermion__computeTemperatureDerivative()

Description: Routine to compute the temperature derivatives of input thermodynamic quatities of a fermion gas given the temperature and number density.

Syntax:
       double
       Libstatmech__Fermion__computeTemperatureDerivative(
         Libstatmech__Fermion *self,
         const char *s_function,
         double d_T,
         double d_number_density,
         void *p_function_data,
         void *p_integrand_data
       );
           
Input:

self: (required) A pointer to the Libstatmech__Fermion structure.

s_function: (required) A string giving the quantity name.

d_T: (required) A double giving the temperature in K at which to compute the chemical potential.

d_number_density: (required) A double giving the number density at which to compute the chemical potential.

p_function_data: (required) A pointer to a user-defined structure containing extra data for the already integrated part of the thermodynamic quantity.

p_integrand_data: (required) A pointer to a user-defined structure containing extra data for the integrand part of the thermodynamic quantity.

Output:

Routine returns a double giving the temperature derivative of the input thermodynamic quantity, at the input temperature and number density.

Example: Compute the temperature derivative of pressure of a fermion gas with d_T = 1.e7 K and d_number_density = 1.e25 cm^-3:

       Libstatmech__Fermion__computeTemperatureDerivative(
         p_fermion, 
         S_PRESSURE,
         1.e7,
         1.e25,
         NULL,
         NULL
       );
             

-top-


Name: Libstatmech__Fermion__copy()

Description: Creates a copy of a fermion.

Syntax:
       Libstatmech_Fermion *
       Libstatmech__Fermion__copy(
         Libstatmech__Fermion * self
       );
           
Input:

self: (required) A pointer to the fermion to be copied.

Output:

Routine returns a pointer to a new Libstatmech_Fermion structure that has the same rest mass, multiplicity, and charge as the input structure. The new fermion has the default quantity functions and integrands. If the input fermion is not valid, Libstatmech error handling is invoked.

Example: Copy p_old_fermion to p_fermion:

       p_fermion =
         Libstatmech__Fermion__copy(
           p_old_fermion
         );
             

-top-


Name: Libstatmech__Fermion__free()

Description: Free the memory allocated for a Libstatmech fermion.

Syntax:
       void 
       Libstatmech__Fermion__free(
          Libstatmech__Fermion *self
       );
           
Input:

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

Output:

Upon successful return, the memory for the fermion has been freed. If the input pointer is not valid, Libstatmech error handling is invoked.

Example: Free the memory for the fermion pointed to by p_fermion:

       Libstatmech__Fermion__free( p_fermion );
             

-top-


Name: Libstatmech__Fermion__getCharge()

Description: Returns the charge of a fermion.

Syntax:
       double
       Libstatmech__Fermion__getCharge(
          const Libstatmech__Fermion *self
       );
           
Input:

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

Output:

Routine returns the charge of the fermion. If the input pointer is not valid, Libstatmech error handling is invoked.

Example: Print the charge of the fermion pointed to by p_fermion:

       printf(
         "The charge of the fermion is %e\n",
         Libstatmech__Fermion__getCharge( p_fermion )
       );
             

-top-


Name: Libstatmech__Fermion__getMultiplicity()

Description: Returns the multiplicity of a fermion.

Syntax:
       int 
       Libstatmech__Fermion__getMultiplicity(
          const Libstatmech__Fermion *self
       );
           
Input:

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

Output:

Routine returns the multiplicity of the fermion. If the input pointer is not valid, Libstatmech error handling is invoked.

Example: Print the multiplicity of the fermion pointed to by p_fermion:

       printf(
         "The multiplicity of the fermion is %d\n",
         Libstatmech__Fermion__getMultiplicity( p_fermion )
       );
             

-top-


Name: Libstatmech__Fermion__getName()

Description: Returns the name of a fermion.

Syntax:
       const char *
       Libstatmech__Fermion__getName(
          const Libstatmech__Fermion *self
       );
           
Input:

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

Output:

Routine returns the name of the fermion. If the input pointer is not valid, Libstatmech error handling is invoked.

Example: Print the name of the fermion pointed to by p_fermion:

       printf(
         "The name of the fermion is %s\n",
         Libstatmech__Fermion__getName( p_fermion )
       );
             

-top-


Name: Libstatmech__Fermion__getRestMass()

Description: Returns the rest mass of a fermion.

Syntax:
       double
       Libstatmech__Fermion__getRestMass(
          const Libstatmech__Fermion *self
       );
           
Input:

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

Output:

Routine returns the rest mass of the fermion. If the input pointer is not valid, Libstatmech error handling is invoked.

Example: Print the rest mass of the fermion pointed to by p_fermion:

       printf(
         "The rest mass of the fermion is %e\n",
         Libstatmech__Fermion__getRestMass( p_fermion )
       );
             

-top-


Name: Libstatmech__Fermion__new()

Description: Creates a new Libstatmech__Fermion structure.

Syntax:
       Libstatmech__Fermion
       *Libstatmech__Fermion__new(
          const char *s_fermion_name,
          double d_rest_mass,
          int i_multiplicity,
          double d_charge
       );
           
Input:

s_fermion_name: (required) A string giving the name of the new fermion.

d_rest_mass: (required) A double giving the rest mass energy of the fermion in MeV.

i_multiplicity: (required) An int giving the multiplicity of the fermion. This is usually twice the spin plus unity (that is, 2J+1, where J is the spin).

d_charge: (required) A double giving the charge of the fermion.

Output:

Routine returns a pointer to a new Libstatmech__Fermion structure. If the routine cannot allocate sufficient memory, Libstatmech error handling is invoked.

Example: Create a new fermion, an electron, with mass 0.511 Mev, multiplicity 2, and charge -1.:

       p_electron =
         Libstatmech__Fermion__new(
           "electron", 0.511, 2, -1.
         );
             

-top-


Name: Libstatmech__Fermion__updateIntegralLowerLimit()

Description: Routine to update the integral lower limit of a thermodynamic quantity of a fermion gas.

Syntax:
       int 
       Libstatmech__Fermion__updateIntegralLowerLimit(
         Libstatmech__Fermion *self,
         const char *s_quantity_name,
         double d_lower_limit 
       );
           
Input:

self: (required) A pointer to the Libstatmech__Fermion structure.

s_quantity_name: (required) A string giving the quantity name.

d_lower_limit: (required) A double giving the integral lower limit.

Output:

Routine returns 1 (true) if the update succeeded and 0 (false) if not. Upon successful return, the integral lower limit has been updated. If the input thermodynamic quantity is not valid, Libstatmech error handling is invoked.

Example: Update the integral lower limit of number density to d_x0 = 20.:

       d_x0 = 20.;
       Libstatmech__Fermion__updateIntegralLowerLimit(
         p_fermion, 
         S_NUMBER_DENSITY,
         d_x0 
       );
             

-top-


Name: Libstatmech__Fermion__updateIntegralUpperLimit()

Description: Routine to update the integral upper limit of a thermodynamic quantity of a fermion gas.

Syntax:
       int 
       Libstatmech__Fermion__updateIntegralUpperLimit(
         Libstatmech__Fermion *self,
         const char *s_quantity_name,
         double d_upper_limit 
       );
           
Input:

self: (required) A pointer to the Libstatmech__Fermion structure.

s_quantity_name: (required) A string giving the quantity name.

d_upper_limit: (required) A double giving the integral upper limit.

Output:

Routine returns 1 (true) if the update succeeded and 0 (false) if not. Upon successful return, the integral upper limit has been updated. If the input thermodynamic quantity is not valid, Libstatmech error handling is invoked.

Example: Update the integral upper limit of number density to d_x0 = 20.:

       d_x0 = 20.;
       Libstatmech__Fermion__updateIntegralUpperLimit(
         p_fermion, 
         S_NUMBER_DENSITY,
         d_x0 
       );
             

-top-


Name: Libstatmech__Fermion__updateQuantity()

Description: Routine to update a thermodynamic quantity.

Syntax:
       int 
       Libstatmech__Fermion__updateQuantity(
         Libstatmech__Fermion *self,
         const char *s_quantity_name,
         Libstatmech__Fermion__Function pf_function,
         Libstatmech__Fermion__Integrand pf_integrand
       );
           
Input:

self: (required) A pointer to the Libstatmech__Fermion structure.

s_quantity_name: (required) A string giving the quantity name.

pf_function: (required) A pointer to a Libstatmech__Fermion__Function. If set to NULL, the quantity will be computed only from the integral.

pf_integrand: (required) A pointer to a Libstatmech__Fermion__Integrand. If set to NULL, the quantity will be computed only from the function. If set to DEFAULT_INTEGRAND, the quantity will be computed from the default integral.

Output:

Routine returns 1 (true) if the quantity update was successful and 0 (false) if not. On successful return, if the quantity previously existed, its function and integrand have been updated, while if the quantity did not previously exist, it has been added. If any input is not valid, error handling is invoked.

Examples: Update the pressure for Libstatmech__Fermion *p_fermion with function my_pressure_function and integrand my_pressure_integrand:

       if(
         Libstatmech__Fermion__updateQuantity(
           p_fermion, 
           S_PRESSURE,
           (Libstatmech__Fermion__Function) my_pressure_function,
           (Libstatmech__Fermion__Integrand) my_pressure_integrand
         )
       )
         fprintf( stdout, "Update succeeded.\n" );
             
Create a new thermodynamic quantity called "my quantity" for Libstatmech__Fermion *p_fermion with function my_function and integrand my_integrand:

       if(
         Libstatmech__Fermion__updateQuantity(
           p_fermion, 
           "my quantity",
           (Libstatmech__Fermion__Function) my_function,
           (Libstatmech__Fermion__Integrand) my_integrand
         )
       )
         fprintf( stdout, "Update succeeded.\n" );
             

-top-


Name: Libstatmech__Fermion__updateQuantityIntegralAccuracy()

Description: Routine to update the accuracy parameters for the integral of a thermodynamic quantity of a fermion gas.

Syntax:
       int 
       Libstatmech__Fermion__updateQuantityIntegralAccuracy(
         Libstatmech__Fermion *self,
         const char *s_quantity_name,
         double d_eps_absolute,
         double d_eps_relative
       );
           
Input:

self: (required) A pointer to the Libstatmech__Fermion structure.

s_quantity_name: (required) A string giving the quantity name.

d_eps_absolute: (required) A double giving the absolute accuracy desired for the integral. The default is 1.e-8.

d_eps_relative: (required) A double giving the relative accuracy desired for the integral. The default is 1.e-8.

Output:

Routine returns 1 (true) if the update succeeded and 0 (false) if not. Upon successful return, the absolute and relative accuracies for the integral have been updated. If the input thermodynamic quantity is not valid, Libstatmech error handling is invoked.

Example: Update the integral absolute accuracy to 1.e-4 and the relative accuracy to 1.e-12 for the number density:

       if(
          Libstatmech__Fermion__updateQuantityIntegralAccuracy(
            p_fermion, 
            S_NUMBER_DENSITY,
            1.e-4,
            1.e-12
          )
       )
         fprintf(stdout, "Update succeeded.\n" );
             

-top-