Structures |
---|
Name: Libnucnet__Reaction__Element Description: Libnucnet__Reaction__Element is a structure that stores data for a reaction element in a nuclear reaction network. A reaction element is either a reactant or product in the reaction. The contents of the structure are not made public by the API. |
Name: Libnucnet__Reaction Description: Libnucnet__Reaction is a structure that stores data for a reaction in a nuclear reaction network. Routines act on the structure to retrieve data, update data, or use data to compute reaction rates based on the data. The contents of the structure are not made public by the API. |
Name: Libnucnet__Reac Description: Libnucnet__Reac is a structure that stores a collection of reactions for a nuclear network. Routines act on the structure to retrieve data, update data, or use data to compute reaction rates based on the data. The contents of the structure are not made public by the API. |
Name: Libnucnet__ReacView Description: Libnucnet__ReacView is a structure that stores a view of Libnucnet__Reac structure. A view is a subset of the parent Libnucnet__Reac with the reactions chosen by an XPath expression. The view structure contains a Libnucnet__Reac structure, which may be passed into all API routines that take such structures as input. It is important to note that the Libnucnet__Reac member of a view does not own the reaction, so modifying the data in the view modifies the data in the parent structure. |
User-Supplied Routines |
---|
Name: Libnucnet__Reaction__Element__iterateFunction() Description: User-supplied routine to be applied during an iteration over the reaction elements (reactants or products) in a reaction. Syntax: int Libnucnet__Reaction__Element__iterateFunction( Libnucnet__Reaction__Element *self, void *p_user_data );Input:
User's routine must return 1 to continue or 0 to stop. |
Name: Libnucnet__Reaction__compare_function() Description: User-supplied routine to sort reactions during a reaction iteration. Syntax: int Libnucnet__Reaction__compare_function( const Libnucnet__Reaction *p_reaction1, const Libnucnet__Reaction *p_reaction2 );Input:
User's routine must return -1 if reaction 1 is less than reaction 2, 0 if the two reactions are equal, and 1 if reaction 1 is greater than reaction 2. If this routine is not supplied through Libnucnet__Reac__setReactionCompareFunction, the default is not to sort the reactions but rather to iterate them in the order in which they are stored internally, which is not defined by the user. |
Name: Libnucnet__Reaction__iterateFunction() Description: User-supplied routine to be applied during an iteration over the reactions in the reaction collection. Syntax: int Libnucnet__Reaction__iterateFunction( Libnucnet__Reaction *self, void *p_user_data );Input:
User's routine must return 1 to continue or 0 to stop. |
Name: Libnucnet__Reaction__userRateFunction() Description: User-supplied routine to calculate the rate of a reaction. Syntax: double Libnucnet__Reaction__userRateFunction( Libnucnet__Reaction *self, double d_t9, void *p_user_data );Input:
User's routine must return the rate for the reaction at the given temperature and for the extra data. |
Name: Libnucnet__Reaction__user_rate_function_data_deallocator() Description: User-supplied routine to deallocate memory for extra data to a user-defined rate function. Syntax: void Libnucnet__Reaction__user_rate_function_data_deallocator( void * p_data );Input:
User's routine must free the memory for the extra data appropriate for the user's rate function. |
Name: Libnucnet__Reaction__user_rate_property_iterate_function() Description: User-supplied routine to be applied during an iteration over the properties for a user-defined rate function. Syntax: void Libnucnet__Reaction__user_rate_property_iterate_function( const char *s_name, const char *s_tag1, const char *s_tag2, const char *s_value, void *p_user_data );Input:
On successful return, the function has been applied. |
Routines |
---|
Name: Libnucnet__ReacView__free() Description: Free the memory allocated for a view of a Libnucnet reaction collection. Syntax: void Libnucnet__ReacView__free( Libnucnet__ReacView *self );Input:
Upon successful return, the memory for the view has been freed. Example: Free up memory used for Libnucnet__ReacView *p_my_view:Libnucnet__ReacView__free( p_my_view ); |
Name: Libnucnet__ReacView__getReac() Description: Get the reaction collection in a view. Syntax: Libnucnet__Reac * Libnucnet__ReacView__getReac( Libnucnet__ReacView *self );Input:
Routine returns the reaction collection from a Libnucnet__ReacView. If the input view is invalid, error handling is invoked. Example: Get the collection from Libnucnet__ReacView *p_my_view:p_reac = Libnucnet__ReacView__getReac( p_my_view ); |
Name: Libnucnet__ReacView__new() Description: Create a new Libnucnet__ReacView structure. Syntax: Libnucnet__ReacView * Libnucnet__ReacView__new( const Libnucnet__Reac * p_reac, const char * s_reac_xpath );Input:
The routine returns a pointer to a new Libnucnet__ReacView structure, that is, a view of a parent reaction collection. If it is not possible to allocate memory for the new structure, Libnucnet error handling is invoked. Example: Create a view of the reactions involving reactant carbon-12 in p_my_reactions:p_view = Libnucnet__ReacView__new( p_my_reactions, "[reactant = 'c12']" ); |
Name: Libnucnet__Reac__addReaction() Description: Add a reaction to a reaction collection. Syntax: int Libnucnet__Reac__addReaction( Libnucnet__Reac *self, Libnucnet__Reaction *p_reaction_to_add );Input:
Routine returns 1 for successful addition, 0 for failure. Upon successful return, the reaction pointed to by p_reaction_to_add has been added to self. If any input is invalid, error handling is invoked. Example: Add the reaction p_reaction_to_add to p_my_reactions:if( Libnucnet__Reac__addReaction( p_my_reactions, p_reaction_to_add ) ) printf( "Successful addition.\n" ); |
Name: Libnucnet__Reac__clearReactionCompareFunction() Description: Restore the default function to sort reactions during a reaction iteration. Syntax: void Libnucnet__Reac__clearReactionCompareFunction( Libnucnet__Reac *self );Input:
Upon successful return, the reaction compare function for the collection has been restored to the default function. If any input is invalid, error handling is invoked. Example: Clear the reaction compare function in p_my_reactions:Libnucnet__Reac__clearReactionCompareFunction( p_my_reactions ); |
Name: Libnucnet__Reac__extractSubset() Description: Extract a subset collection of reactions from another collection by an XPath expression. Syntax: Libnucnet__Reac * Libnucnet__Reac__extractSubset( const Libnucnet__Reac *self const char *s_xpath );Input:
For a valid Libnucnet__Reac structure, the routine returns a new Libnucnet__Reac structure containing reactions selected from the parent collection by the XPath expression. The user must free the structure with Libnucnet__Reac__free() when finished with it. If the input structure is not valid, Libnucnet__Reac error handling is invoked. Examples: Extract a complete copy of Libnucnet_Reac *p_parent and call it p_copy:p_copy = Libnucnet__Reac__extractSubset( p_parent, NULL );Extract a subset of Libnucnet__Reac *p_parent that includes only reactions with h2 as a reactant: p_copy = Libnucnet__Reac__extractSubset( p_parent, "[reactant = 'h2']" ); |
Name: Libnucnet__Reac__free() Description: Free the memory allocated for a Libnucnet reaction collection structure. Syntax: void Libnucnet__Reac__free( Libnucnet__Reac *self );Input:
Upon successful return, the memory for the network has been freed. If the input is invalid, Libnucnet__Reac error handling is invoked. Example: Free up memory used for Libnucnet__Reac *p_my_reac:Libnucnet__Reac__free( p_my_reac ); |
Name: Libnucnet__Reac__getDuplicateReactions() Description: Routine to get duplicate reactions in a structure. A duplicate reaction is one that either has the same reactants and products as another in the reaction collection. For example, c12 + h1 to n13 + gamma and h1 + c12 to n13 + gamma are duplicate reactions. Alternatively, a duplicate reaction may be the reverse of one already in the reaction collection since libnucnet computes reverse rates from detailed balance. For example, c14 + h1 to n14 + n and n14 + n to c14 + h1 are duplicate reactions. Syntax: Libnucnet__Reac * Libnucnet__Reac__getDuplicateReactions( const Libnucnet__Reac *self );Input:
Returns the pointer to a new Libnucnet__Reac structure. The new structure contains the duplicate reactions. If the input structure is invalid, error handling is invoked. Example: Given p_my_reactions, get Libnucnet__Reac structure p_my_duplicates containing the duplicate reactions.p_my_duplicates = Libnucnet__Reac__getDuplicateReactions( p_my_reactions ); |
Name: Libnucnet__Reac__getNumberOfReactions() Description: Retrieves the number of reactions. Syntax: size_t Libnucnet__Reac__getNumberOfReactions( const Libnucnet__Reac *self );Input:
Routine returns a size_t integer giving the number of reactions. If the input reaction pointer is invalid, error handling is invoked. Example: Retrieve the number of reactions stored in p_reaction_list:size_t i_num_reac; i_num_reac = Libnucnet__Reac__getNumberOfReactions( p_reaction_list ); |
Name: Libnucnet__Reac__getReactionByString() Description: Routine to retrieve a reaction by its string. Syntax: Libnucnet__Reaction * Libnucnet__Reac__getReactionByString( const Libnucnet__Reac * self, const char * s_reaction );Input:
For valid input, the routine returns a pointer to the requested reaction. If the reaction does not exist in the Libnucnet__Reac structure, the routine returns NULL. If the input Libnucnet__Reac structure is not valid, error handling is invoked. Example: Return a pointer to the reaction li7 + h1 -> he4 + he4 from the Libnucnet__Reac structure p_my_reactions:p_reaction = Libnucnet__Reac__getReactionByString( p_my_reactions, "li7 + h1 -> he4 + he4" ); |
Name: Libnucnet__Reac__isRegisteredRateFunction() Description: Determine whether a rate function is registered for the reaction collection. Syntax: int Libnucnet__Reac__isRegisteredRateFunction( const Libnucnet__Reac * self, const char * s_function_key );Input:
Routine returns 1 (true) if the rate function is registered and 0 (false) if not. If the input collection is invalid, error handling is invoked. Example: Determine whether the function with key "my rate function" is registered in the reaction collection p_my_reactions:if( Libnucnet__Reac__isRegistedRateFunction( p_my_reactions, "my rate function" ) ) fprintf( stdout, "Function is registered.\n" ); else fprintf( stdout, "Function is not registered.\n" ); |
Name: Libnucnet__Reac__is_valid_input_xml() Description: Validate an xml file for Libnucnet__Reac. Syntax: int Libnucnet__Reac__is_valid_input_xml( const char *s_xml_filename );Input:
For a valid input nuclear reaction data xml file, the routine returns 1 (true). For an invalid file, routine returns 0 (false). If the schema file is invalid, or if the schema file cannot be read over the web, routine stops and prints error message. Example: Validate the input xml file "reaction_data.xml":if( Libnucnet__Reac__is_valid_input_xml( "reaction_data.xml" ) ) { printf( "Valid xml!\" ); } |
Name: Libnucnet__Reac__iterateReactions() Description: Iterate through the reactions and apply the user-supplied iterate function. Syntax: void Libnucnet__Reac__iterateReactions( const Libnucnet__Reac *self, Libnucnet__Reaction__iterateFunction pfFunc, void *p_user_data );Input:
The routine iterates through the reaction collection and applies the user-supplied routine to each reaction. The reactions are iterated in the order defined by the user-defined comparison function set with Libnucnet__Reac__setReactionCompareFunction(). Example: Iterate through the reactions in p_my_reactions and apply the function my_iterate_function and the extra data in p_user_data:Libnucnet__Reac__iterateReactions( p_my_reactions, (Libnucnet__Reaction__iterateFunction) my_iterate_function, p_user_data ); |
Name: Libnucnet__Reac__new() Description: Create a new Libnucnet__Reac structure. Syntax: Libnucnet__Reac *Libnucnet__Reac__new( );Output: The routine returns a pointer to a Libnucnet reaction structure. If the routine cannot allocate memory for the structure, Libnucnet_Reac error handling is invoked. Example: Create a Libnucnet reaction structure p_my_reac:p_my_reac = Libnucnet__Reac__new(); |
Name: Libnucnet__Reac__new_from_xml() Description: Reads in nuclear network reaction data from xml file and stores the reactions in a structure. The reactions to be stored are selected with an xpath expression. Syntax: Libnucnet__Reac * Libnucnet__Reac__new_from_xml( const char *s_xml_filename, const char *s_xpath );Input:
If the input is valid, routine returns a pointer to a Libnucnet reaction structure containing reactions selected by the xpath expression. If no reactions were found, p_reactions_list is empty. If the input file or xpath expression is invalid, Libnucnet__Reac error handling is invoked. Examples: Store all the reactions from "reactions.xml" to p_reactions_list:p_reactions_list = Libnucnet__Reac__new_from_xml( "reactions.xml", NULL );Store the reactions from "reactions.xml" containing 'h1' as a reactant to p_h1_reactions_list: p_h1_reactions_list = Libnucnet__Reac__new_from_xml( "reactions.xml", "[reactant = 'h1']" ); |
Name: Libnucnet__Reac__new_from_xml_text_reader() Description: Reads in nuclear network reaction data from xml file and stores the reactions in a structure. This routine does not build a tree, so the memory overhead is greatly reduced. The reactions to be stored are selected with an xpath expression, but unlike the routine that builds with a tree, the xpath expression is relative to the individual reaction. Syntax: Libnucnet__Reac * Libnucnet__Reac__new_from_xml( const char *s_xml_filename, const char *s_xpath );Input:
If the input is valid, routine returns a pointer to a Libnucnet reaction structure containing reactions selected by the xpath expression. If no reactions were found, p_reactions_list is empty. If the input file or xpath expression(s) is invalid, Libnucnet__Reac error handling is invoked. Examples: Store all the reactions from "reactions.xml" to p_reactions_list:p_reactions_list = Libnucnet__Reac__new_from_xml( "reactions.xml", NULL );Store the reactions from "reactions.xml" containing 'h1' as a reactant and 'gamma' as a product to p_reactions_list: p_h1_reactions_list = Libnucnet__Reac__new_from_xml( "reactions.xml", ".//reactant[. = 'h1']/following-sibling::product[.='gamma']" ); |
Name: Libnucnet__Reac__registerUserRateFunction() Description: Register a function to be used in rate calculations. Syntax: int Libnucnet__Reac__registerUserRateFunction( Libnucnet__Reac *self, const char *s_function_key, Libnucnet__Reaction__userRateFunction pf_func );Input:
Routine returns 1 (true) if registration successful or 0 (false) if not. If the input structure is invalid, error handling is invoked. Example: Register the function my_function with key "my rate function" in p_my_reactions:Libnucnet__Reac__registerUserRateFunction( p_my_reactions, "my rate function", (Libnucnet__Reaction__userRateFunction) my_function ); |
Name: Libnucnet__Reac__removeReaction() Description: Remove a reaction from a Libnucnet__Reac structure. Syntax: int Libnucnet__Reac__removeReaction( Libnucnet__Reac *self, Libnucnet__Reaction *p_reaction );Input:
Routine returns 1 for successful removal and 0 for failure. Upon successful return, the reaction has been removed from the Libnucnet__Reac structure. Example: Remove the reaction p_reaction from Libnucnet__Reac *p_my_reac:if( Libnucnet__Reac__removeReaction( p_my_reac, p_reaction ) ) printf( "Reaction successfully removed.\n" ); |
Name: Libnucnet__Reac__setReactionCompareFunction() Description: Set the function to sort the reactions during a reaction iteration. Syntax: void Libnucnet__Reac__setReactionCompareFunction( Libnucnet__Reac *self, Libnucnet__Reaction__compare_function pfFunc );Input:
Upon successful return, the data compare function for reactions in the collection has been set to the input function. If any input is invalid, error handling is invoked. Example: Set the reaction compare function in p_my_reac to my_sort_function:Libnucnet__Reac__setReactionCompareFunction( p_my_reac, (Libnucnet__Reaction__compare_function) my_sort_function ); |
Name: Libnucnet__Reac__setUserRateFunctionDataDeallocator() Description: Routine to set the deallocator for the data for a user-defined rate function. Syntax: int Libnucnet__Reac__setUserRateFunctionDataDeallocator( Libnucnet__Reac * self, const char * s_function_key, Libnucnet__Reaction__user_rate_function_data_deallocator pf_deallocator );Input:
Routine returns 1 (true) if the deallocator was successfully set and 0 (false) if not. Example: Set the deallocator for the function with key "my rate function" in p_my_reactions to my_deallocator:Libnucnet__Reac__setUserRateFunctionDataDeallocator( p_my_reactions, "my rate function", (Libnucnet__Reaction__user_rate_function_data_deallocator) my_deallocator ); |
Name: Libnucnet__Reac__updateFromXml() Description: Updates nuclear network reaction data in a Libnucnet__Reac structure from and xml file. Syntax: void Libnucnet__Reac__updateFromXml( Libnucnet__Reac *self, const char *s_xml_filename, char *s_xpath );Input:
If the input is valid, the input Libnucnet__Reac structure is updated with the reaction data from the input file. Example: Update the reaction data in p_my_reaction, with data from the file "reactions_new.xml"Libnucnet__Reac__updateFromXml( p_my_reactions, "reactions_new.xml", NULL ); |
Name: Libnucnet__Reac__updateFromXmlTextReader() Description: Updates nuclear network reaction data in a Libnucnet__Reac structure from and xml file. This routine. This routine does not build a tree, so the memory overhead is greatly reduced. The reactions to be stored are selected with an xpath expression, but unlike the routine that builds with a tree, the xpath expression is relative to the individual reaction. Syntax: void Libnucnet__Reac__updateFromXmlTextReader( Libnucnet__Reac *self, const char *s_xml_filename, const char *s_xpath );Input:
If the input is valid, the input Libnucnet__Reac structure is updated with the reaction data from the input file. Example: Update the reaction data in p_my_reaction, with data from the file "reactions_new.xml"Libnucnet__Reac__updateFromXmlTextReader( p_my_reactions, "reactions_new.xml", NULL ); |
Name: Libnucnet__Reac__updateReaction() Description: Update a reaction in a reaction collection. Syntax: int Libnucnet__Reac__updateReaction( Libnucnet__Reac *self, Libnucnet__Reaction *p_reaction );Input:
Routine returns 1 for successful addition, 0 for failure. Upon successful return, the data for the reaction has been replaced with this new version if it previously existed in the collection or has been added if it did not. Example: Update the reaction p_reaction to in p_my_reactions:if( Libnucnet__Reac__updateReaction( p_my_reactions, p_reaction ) ) printf( "Successful update.\n" ); |
Name: Libnucnet__Reac__writeToXmlFile() Description: Output a Libnucnet__Reac structure to an xml file. Syntax: void Libnucnet__Reac__writeToXmlFile( const Libnucnet__Reac *self, const char *s_xml_filename );Input:
Upon successful return, the contents of the collection of reactions are written to s_xml_filename. Reactions are output in the order determined by the currently defined Libnucnet__Reaction__compare_function. Example: Dump the contents of Libnucnet__Reac *p_my_reactions to the xml file my.xml:Libnucnet__Reac__writeToXmlFile( p_my_reactions, "my.xml" ); |
Name: Libnucnet__Reac__writeToXmlFileWithTextWrter() Description: Output a Libnucnet__Reac structure to an xml file. Routine uses the text writer for output. Syntax: void Libnucnet__Reac__writeToXmlFileWithTextWriter( const Libnucnet__Reac *self, const char *s_xml_filename, int i_indent );Input:
Upon successful return, the contents of the collection of reactions are written to s_xml_filename. Reactions are output in the order determined by the currently defined Libnucnet__Reaction__compare_function. The routine does not build a tree, which saves on memory overhead. Example: Dump the contents of Libnucnet__Reac *p_my_reactions to the xml file my.xml without indenting:Libnucnet__Reac__writeToXmlFileWithTextWriter( p_my_reactions, "my.xml", 0 ); |
Name: Libnucnet__Reaction__Element__getName() Description: Retrieve the name of a reaction element. Syntax: const char * Libnucnet__Reaction__Element__getName( const Libnucnet__Reaction__Element *self );Input:
The routine returns a string containing the name of the reaction element. If the input is invalid, error handling is invoked. Example: Print the name of Libnucnet__Reaction__Element *p_element:printf( "The elements name is %s\n", Libnucnet__Reaction__Element__getName( p_element ) ); |
Name: Libnucnet__Reaction__Element__isNuclide() Description: Determine whether a reaction element is a nuclide (like c12) or not (like electron or neutrino_e). Syntax: int Libnucnet__Reaction__Element__isNuclide( const Libnucnet__Reaction__Element *self );Input:
The routine returns 1 (true) if the reactant is a nuclide or 0 (false) if not. If the input is invalid, error handling is invoked. Example: Determine whether Libnucnet__Reaction__Element *p_element is a nuclide or not:if( Libnucnet__Reaction__Element__isNuclide( p_element ) ) { printf( "%s is a nuclide!\n", Libnucnet__Reaction__Element__getName( p_element ) ); } else { printf( "%s is not a nuclide!\n", Libnucnet__Reaction__Element__getName( p_element ) ); } |
Name: Libnucnet__Reaction__addNonSmokerFit() Description: Add a non-smoker fit to a Libnucnet__Reaction structure. Syntax: void Libnucnet__Reaction__addNonSmokerFit( Libnucnet__Reaction *self, const char *s_note, double a[], double d_spint, double d_spinf, double d_tlowhf, double d_tlowfit, double d_thighfit, double d_acc );Input:
For valid input, the routine updates the Libnucnet__Reaction structure to include the new non-smoker reaction fit data. If the input is invalid or the reaction data cannot be added, Libnucnet__Reac error handling is invoked. Example: Add the non-smoker data to a Libnucnet__Reaction *p_reaction with non-smoker data values a, spint, spinf, tlowhf, tlowfit, thighfit, and acc:Libnucnet__Reac__addNonSmokerFit( p_reaction, "My fit data", a, spint, spinf, tlowhf, tlowfit, thighfit, acc ); |
Name: Libnucnet__Reaction__addProduct() Description: Add a product to a reaction. Syntax: void Libnucnet__Reaction__addProduct( Libnucnet__Reaction *self, const char *s_product );Input:
For valid input, the routine updates the Libnucnet__Reaction structure to include the product. If the input is invalid or the product cannot be added, Libnucnet__Reac error handling is invoked. Example: Add the product "n13" to the reaction p_reaction:Libnucnet__Reaction__addProduct( p_my_reaction, "n13" ); |
Name: Libnucnet__Reaction__addReactant() Description: Add a reactant to a reaction. Syntax: void Libnucnet__Reaction__addReactant( Libnucnet__Reaction *self, const char *s_reactant );Input:
For valid input, the routine updates the Libnucnet__Reaction structure to include the reactant. If the input is invalid or the reactant cannot be added, Libnucnet__Reac error handling is invoked. Example: Add the reactant "h1" to the reaction p_reaction:Libnucnet__Reaction__addReactant( p_my_reaction, "h1" ); |
Name: Libnucnet__Reaction__computeRate() Description: Computes the rate of the reaction at the input temperature. Syntax: double Libnucnet__Reaction__computeRate( Libnucnet__Reaction *self, double d_t9, void *p_extra_data );Input:
Routine returns the rate for the input temperature. If the input reaction or the temperature is invalid, Libnucnet__Reac error handling is invoked. Example: Print the rate for Libnucnet__Reaction * p_reaction at t9 = 3.:printf( "Rate = %e\n", Libnucnet__Reaction__computeRate( p_reaction, 3., NULL ) ); |
Name: Libnucnet__Reaction__copy() Description: Copy a Libnucnet__Reaction. Syntax: Libnucnet__Reaction * Libnucnet__Reaction__copy( const Libnucnet__Reaction *p_reaction );Input:
The routine returns a pointer to a new Libnucnet__Reaction structure that is a copy of the input structure. If it is not possible to allocate memory for the new structure, error handling is invoked. Example: Create a copy of p_reaction:p_copy = Libnucnet__Reaction__copy( p_reaction ); |
Name: Libnucnet__Reaction__free() Description: Free the memory allocated for a Libnucnet reaction. Syntax: void Libnucnet__Reaction__free( Libnucnet__Reaction *self );Input:
Upon successful return, the memory for the reaction has been freed. If the input is invalid, Libnucnet__Reac error handling is invoked. Example: Free up memory used for Libnucnet__Reaction *p_reaction:Libnucnet__Reaction__free( p_reaction ); |
Name: Libnucnet__Reaction__getDuplicateProductFactor() Description: Routine to retrieve the factor by which to divide a reverse reaction rate to account for duplicate products. Syntax: double Libnucnet__Reaction__getDuplicateProductFactor( const Libnucnet__Reaction * self );Input:
For valid input, the routine returns a double giving the appropriate duplicate product factor for the reaction. If the reaction does not exist in the Libnucnet__Reac structure, error handling is invoked. Example: Print the duplicate product factor for the reaction he3 + he3 -> h1 + h1 + he4 the Libnucnet__Reac structure p_my_reactions (the result is 2! = 2 since there are two h1 products):printf( "Duplicate product factor = %e\n", Libnucnet__Reaction__getDuplicateProductFactor( Libnucnet__Reac__getReactionByString( p_my_reactions, "he3 + he3 -> h1 + h1 + he4" ) ) ); |
Name: Libnucnet__Reaction__getDuplicateReactantFactor() Description: Routine to retrieve the factor by which to divide a forward reaction rate to account for duplicate reactants. Syntax: double Libnucnet__Reaction__getDuplicateReactantFactor( const Libnucnet__Reaction * self );Input:
For valid input, the routine returns a double giving the appropriate duplicate reactant factor for the reaction. If the reaction does not exist in the Libnucnet__Reac structure, error handling is invoked. Example: Print the duplicate reactant factor for the reaction he4 + he4 + he4 -> c12 + gamma from the Libnucnet__Reac structure p_my_reactions (the result is 3! = 6 since there are three he4 reactants):printf( "Duplicate reactant factor = %e\n", Libnucnet__Reaction__getDuplicateReactantFactor( Libnucnet__Reac__getReactionByString( p_my_reactions, "he4 + he4 + he4 -> c12 + gamma" ) ) ); |
Name: Libnucnet__Reaction__getParentDuplicate() Description: Get the reaction of which the current reaction is a duplicate. Syntax: Libnucnet__Reaction * Libnucnet__Reaction__getParentDuplicate( const Libnucnet__Reaction *self );Input:
The routine returns a pointer to the reaction the current reaction is a duplicate of (in the Libnucnet__Reac structure that was originally scanned for duplicates). If the parent reaction is no longer present, the routine returns NULL. If the input reaction is invalid, error handling is invoked. Example: Print the reaction of which p_reaction is a duplicate:printf( "%s is a duplicate of %s\n", Libnucnet__Reaction__getString( p_reaction ), Libnucnet__Reaction__getString( Libnucnet__Reaction__getParentDuplicate( p_reaction ) ) ); |
Name: Libnucnet__Reaction__getRateFunctionKey() Description: Get the key for a rate function for a reaction. Syntax: const char * Libnucnet__Reaction__getRateFunctionKey( const Libnucnet__Reaction *self );Input:
Routine returns a string giving the key for a rate function. If the input reaction structure is invalid, error handling is invoked. Example: Print the key for reaction p_my_reaction:printf( "%s\n", Libnucnet__Reaction__getRateFunctionKey( p_my_reaction ) ); |
Name: Libnucnet__Reaction__getSource() Description: Retrieves the string containing the message about the source of the data for the specified reaction. Syntax: const char * Libnucnet__Reaction__getSource( const Libnucnet__Reaction *self );Input:
Routine returns a char * containing the message about the source of the data for the reaction. If there is no information about the reaction's source, the routine returns an empty string. If the reaction is not found, error handling is invoked. Example: Print the data source for p_reaction:printf( "Data source: %s\n", Libnucnet__Reaction__getSource( p_reaction ) ); |
Name: Libnucnet__Reaction__getString() Description: Retrieves the reaction string of the specified reaction. Syntax: const char * Libnucnet__Reaction__getString( const Libnucnet__Reaction *self );Input:
Routine returns a char * representing the reaction string. If the reaction is not found, routine returns NULL. Example: Print reaction string for reaction p_reaction:printf( "%s\n", Libnucnet__Reaction__getString( p_reaction ) ); |
Name: Libnucnet__Reaction__getUserRateFunctionProperty() Description: Get a rate function property for a reaction. Syntax: const char * Libnucnet__Reaction__getUserRateFunctionProperty( const Libnucnet__Reaction *self, const char *s_name, const char *s_tag1, const char *s_tag2 );Input:
Routine returns the value of a rate function property. If the input reaction structure is invalid, error handling is invoked. Example: Print the value for the property with name "prop", tag1 "8", and no tag2 for reaction p_my_reaction:printf( "%s\n", Libnucnet__Reaction__getUserRateFunctionProperty( p_my_reaction, "prop", "8", NULL ) |
Name: Libnucnet__Reaction__isWeak() Description: Determine whether a reaction is weak (in either the forward or reverse direction). Syntax: int Libnucnet__Reaction__isWeak( const Libnucnet__Reaction * self );Input:
Routine returns 1 (true) if the reaction is weak and 0 (false) if not. If the input reaction is invalid, error handling is invoked. Example: Determine whether the reaction p_my_reaction is weak or not:if( Libnucnet__Reaction__isWeak( p_my_reaction ) ) fprintf( stdout, "Reaction is weak.\n" ); else fprintf( stdout, "Reaction is not weak.\n" ); |
Name: Libnucnet__Reaction__iterateNuclideProducts() Description: Iterate over the nuclide products in a reaction. Syntax: void Libnucnet__Reaction__iterateNuclideProducts( const Libnucnet__Reaction *self, Libnucnet__Reaction__Element__iterateFunction pf_func, void *p_user_data );Input:
The routine iterates over the nuclide products in order and applies the user-supplied function and data. If the input is invalid, error handling is invoked. Example: Iterate over the nuclide products in Libnucnet__Reaction *p_reaction and apply the function my_function and the data my_data:Libnucnet__Reaction__iterateNuclideProducts( p_reaction, ( Libnucnet__Reaction__Element__iterateFunction ) my_function, &my_data ); |
Name: Libnucnet__Reaction__iterateNuclideReactants() Description: Iterate over the nuclide reactants in a reaction. Syntax: void Libnucnet__Reaction__iterateNuclideReactants( const Libnucnet__Reaction *self, Libnucnet__Reaction__Element__iterateFunction pf_func, void *p_user_data );Input:
The routine iterates over the nuclide reactants in order and applies the user-supplied function and data. If the input is invalid, error handling is invoked. Example: Iterate over the nuclide reactants in Libnucnet__Reaction *p_reaction and apply the function my_function and the data my_data:Libnucnet__Reaction__iterateNuclideReactants( p_reaction, ( Libnucnet__Reaction__Element__iterateFunction ) my_function, &my_data ); |
Name: Libnucnet__Reaction__iterateProducts() Description: Iterate over all the products in a reaction. Syntax: void Libnucnet__Reaction__iterateProducts( const Libnucnet__Reaction *self, Libnucnet__Reaction__Element__iterateFunction pf_func, void *p_user_data );Input:
The routine iterates over all the products in order and applies the user-supplied function and data. If the input is invalid, error handling is invoked. Example: Iterate over the products in Libnucnet__Reaction *p_reaction and apply the function my_function and the data my_data:Libnucnet__Reaction__iterateProducts( p_reaction, ( Libnucnet__Reaction__Element__iterateFunction ) my_function, &my_data ); |
Name: Libnucnet__Reaction__iterateReactants() Description: Iterate over all the reactants in a reaction. Syntax: void Libnucnet__Reaction__iterateReactants( const Libnucnet__Reaction *self, Libnucnet__Reaction__Element__iterateFunction pf_func, void *p_user_data );Input:
The routine iterates over all the reactants in order and applies the user-supplied function and data. If the input is invalid, error handling is invoked. Example: Iterate over the reactants in Libnucnet__Reaction *p_reaction and apply the function my_function and the data my_data:Libnucnet__Reaction__iterateReactants( p_reaction, ( Libnucnet__Reaction__Element__iterateFunction ) my_function, &my_data ); |
Name: Libnucnet__Reaction__iterateUserRateFunctionProperties() Description: Iterate over the properties of a user-supplied rate function. Syntax: void Libnucnet__Reaction__iterateUserRateFunctionProperties( const Libnucnet__Reaction *self, const char *s_name, const char *s_tag1, const char *s_tag2, Libnucnet__Reaction__user_rate_property_iterate_function pf_func, void *p_user_data );Input:
Routine iterates over the rate function properties in the reaction and applies the user-supplied function. The properties iterated over are those that match s_name, s_tag1, and s_tag2. If any of these is NULL, the comparison is a match. The properties are iterated in the order in which they are internally stored. The user does not have control over this order. Examples: Iterate over the all rate function properties in p_reaction and apply my_func and the extra data pointed to by p_user_data:Libnucnet__Reaction__iterateUserRateFunctionProperties( p_reaction, NULL, NULL, NULL, (Libnucnet__Reaction__user_rate_property_iterate_function) my_func, p_user_data );Iterate over all the rate function properties that match "t9" as a name in p_reaction and apply my_func and the extra data pointed to by p_user_data: Libnucnet__Reaction__iterateUserRateFunctionProperties( p_reaction, "t9", NULL, NULL, (Libnucnet__Reaction__user_rate_property_iterate_function) my_func, p_user_data ); |
Name: Libnucnet__Reaction__new() Description: Create a new Libnucnet__Reaction structure. Syntax: Libnucnet__Reaction *Libnucnet__Reaction__new( );Output: The routine returns a pointer to a new Libnucnet reaction structure. If the routine cannot allocate memory for the structure, Libnucnet_Reac error handling is invoked. Example: Create a Libnucnet reaction p_my_reaction:p_my_reaction = Libnucnet__Reaction__new(); |
Name: Libnucnet__Reaction__printRateData() Description: Prints the rate data for a reaction. Syntax: void Libnucnet__Reaction__printRateData( Libnucnet__Reaction *self );Input:
Libnucnet__Reaction__printRateData( p_reaction ); |
Name: Libnucnet__Reaction__removeUserRateFunctionProperty() Description: Remove a rate function property for a reaction. Syntax: int Libnucnet__Reac__removeUserRateFunctionProperty( Libnucnet__Reaction *self, const char *s_name, const char *s_tag1, const char *s_tag2 );Input:
Routine returns 1 (true) if update successful and 0 (false) if not. If the input structure is invalid, error handling is invoked. Example: Remove the property with name "prop", tag1 "0", and no tag2 for reaction p_my_reaction:if( Libnucnet__Reaction__removeUserRateFunctionProperty( p_my_reaction, "prop", "0", NULL ) ) printf( "Successful removal!\n" ); |
Name: Libnucnet__Reaction__setUserRateFunctionKey() Description: Set the user-supplied rate function for a reaction. Syntax: void Libnucnet__Reaction__setUserRateFunctionKey( Libnucnet__Reaction *self, const char *s_function_key );Input:
Upon successful return, the rate function key for the reaction has been set to the input. If the input structure is invalid, error handling is invoked. Example: For p_reaction, set the rate function for the reaction to my_function with key "my rate function":Libnucnet__Reaction__setUserRateFunctionKey( p_reaction, "my rate function" ); |
Name: Libnucnet__Reaction__updateRateTable() Description: Update rate table for a reaction. Syntax: void Libnucnet__Reaction__updateRateTable( Libnucnet__Reaction *self, gsl_vector *p_t9, gsl_vector *p_rate, gsl_vector *p_sef );Input:
For valid input, the routine updates the rate table for the input Libnucnet__Reaction structure to include the new data. If the data are already in the structure, they are overwritten with these new data. If the input is invalid or the data cannot be added, Libnucnet__Reac error handling is invoked. Example: Update a Libnucnet__Reaction p_reaction table with the rate table values contained in the gsl_vectors p_t9, p_rate, and p_sef:Libnucnet__Reaction__updateRateTable( p_reaction, p_t9, p_rate, p_sef ); |
Name: Libnucnet__Reaction__updateSingleRate() Description: Update the single reaction rate for a reaction. Syntax: void Libnucnet__Reaction__updateSingleRate( Libnucnet__Reaction *self, double d_forward );Input:
For valid input, the routine updates the Libnucnet__Reaction structure to have the new single rate. If the reaction data are already in the structure, they are overwritten with this data. If the input is invalid, Libnucnet__Reac error handling is invoked. Example: Update Libnucnet__Reaction *p_my_reaction with a forward rate of 0.5:Libnucnet__Reaction__updateSingleRate( p_my_reaction, 0.5 ); |
Name: Libnucnet__Reaction__updateSource() Description: Update the source string for a reaction. Syntax: void Libnucnet__Reaction__updateSource( Libnucnet__Reaction *self, const char *s_source );Input:
For valid input, the routine updates the Libnucnet__Reaction structure to have the new source string. If the reaction source string is already in the structure, it is overwritten with this data. If the input is invalid, Libnucnet__Reac error handling is invoked. Example: Update the reaction Libnucnet__Reaction *p_my_reaction with a message "My data":Libnucnet__Reaction__updateSource( p_my_reaction, "My data" ); |
Name: Libnucnet__Reaction__updateUserRateFunctionProperty() Description: Update a rate function property for a reaction. Syntax: int Libnucnet__Reaction__updateUserRateFunctionProperty( Libnucnet__Reaction *self, const char *s_name, const char *s_tag1, const char *s_tag2, const char *s_value );Input:
Routine returns 1 (true) if update successful and 0 (false) if not. If the input structure is invalid, error handling is invoked. Example: Update the data for the property with name "prop", tag1 "0", and no tag2 for reaction p_my_reaction with "new value":if( Libnucnet__Reaction__updateUserRateFunctionProperty( p_my_reaction, "prop", "0", NULL, "new value" ) ) printf( "Successful update!\n" ); |