Warning: This is no longer the latest available version of this module. Please see the releases page for the most recent version. The Webnucleo group strongly recommends the use of the latest version of any of its online modules.
Documentation from the file
Table of Contents
-
Structures
-
User-Supplied Routines
-
Routines
| Structures |
|---|
Name: Libstatmech__FermionDescription: 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. |
|
|
Name: Libstatmech__BosonDescription: 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. |
|
|
| 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:
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. |
|
|
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:
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. |
|
|
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:
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. |
|
|
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:
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. |
|
|
| Routines |
|---|
Name: Libstatmech__Boson__computeChemicalPotential()Description: Routine to compute the chemical potential 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:
Routine returns a double giving the chemical potential for the input temperature and number density. Example: Compute the chemical potential of a boson gas with d_T = 1.e5 K and d_number_density = 1.e18:
Libstatmech__Boson__computeChemicalPotential(
p_boson,
1.e5,
1.e18,
NULL
);
|
|
|
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:
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
);
|
|
|
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:
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
);
|
|
|
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:
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
);
|
|
|
Name: Libstatmech__Boson__free()Description: Free the memory allocated for a Libstatmech boson. Syntax:
void
Libstatmech__Boson__free(
Libstatmech__Boson *self
);
Input:
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 );
|
|
|
Name: Libstatmech__Boson__getCharge()Description: Returns the charge of a boson. Syntax:
double
Libstatmech__Boson__getCharge(
const Libstatmech__Boson *self
);
Input:
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 )
);
|
|
|
Name: Libstatmech__Boson__getMultiplicity()Description: Returns the multiplicity of a boson. Syntax:
int
Libstatmech__Boson__getMultiplicity(
const Libstatmech__Boson *self
);
Input:
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 )
);
|
|
|
Name: Libstatmech__Boson__getName()Description: Returns the name of a boson. Syntax:
const char *
Libstatmech__Boson__getName(
const Libstatmech__Boson *self
);
Input:
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 )
);
|
|
|
Name: Libstatmech__Boson__getRestMass()Description: Returns the rest mass of a boson. Syntax:
double
Libstatmech__Boson__getRestMass(
const Libstatmech__Boson *self
);
Input:
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 )
);
|
|
|
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:
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.
);
|
|
|
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:
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
);
|
|
|
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:
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
);
|
|
|
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:
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" );
|
|
|
Name: Libstatmech__Fermion__computeChemicalPotential()Description: Routine to compute the chemical potential 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:
Routine returns a double giving the chemical potential for the input temperature and number density. Example: Compute the chemical potential of a fermion gas with d_T = 1.e7 K and d_number_density = 1.e25 cm^-3:
Libstatmech__Fermion__computeChemicalPotential(
p_fermion,
1.e7,
1.e25,
NULL,
NULL
);
|
|
|
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:
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
);
|
|
|
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:
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
);
|
|
|
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:
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
);
|
|
|
Name: Libstatmech__Fermion__free()Description: Free the memory allocated for a Libstatmech fermion. Syntax:
void
Libstatmech__Fermion__free(
Libstatmech__Fermion *self
);
Input:
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 );
|
|
|
Name: Libstatmech__Fermion__getCharge()Description: Returns the charge of a fermion. Syntax:
double
Libstatmech__Fermion__getCharge(
const Libstatmech__Fermion *self
);
Input:
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 )
);
|
|
|
Name: Libstatmech__Fermion__getMultiplicity()Description: Returns the multiplicity of a fermion. Syntax:
int
Libstatmech__Fermion__getMultiplicity(
const Libstatmech__Fermion *self
);
Input:
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 )
);
|
|
|
Name: Libstatmech__Fermion__getName()Description: Returns the name of a fermion. Syntax:
const char *
Libstatmech__Fermion__getName(
const Libstatmech__Fermion *self
);
Input:
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 )
);
|
|
|
Name: Libstatmech__Fermion__getRestMass()Description: Returns the rest mass of a fermion. Syntax:
double
Libstatmech__Fermion__getRestMass(
const Libstatmech__Fermion *self
);
Input:
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 )
);
|
|
|
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:
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.
);
|
|
|
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:
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
);
|
|
|
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:
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" );
|
|
|
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__updateIntegralLowerLimit(
Libstatmech__Fermion *self,
const char *s_quantity_name,
double d_eps_absolute,
double d_eps_relative
);
Input:
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" );
|
|
|