libantioch/antioch — pull request #84 by SylvainPlessis (2014-10-27 02:28:19+00:00)
Title: Kin reset

Here is the branch for resetting the kinetics. This is the first step, the type of resetting @pbauman talked about, the wrapper method with paranoid checks will come in a future PR.

##### Resetting
To reset your kinetics, you need first to get to your kinetics object, then you reset. The tests (*kinetics_type*_unit.C) have been updated and provide nice examples on what to do once you have your rate object.
```
ReactionSet reac_set;
...do stuff...
// reinitialize reaction n
KineticsType & kinetics = reac_set.reaction(n).forward_rate();
VectorType new_values;
... fill new_values ...
kinetics.reset_coefs(new_values);
```
You can use at this level any method shown in the tests that uses the vector of values. If you want to reset a single parameter (say Cf in a Kooij model), you need to change the ```KineticsType``` into the appropriate rate, here ```KooijRate```:
```
ReactionSet reac_set;
...do stuff...
// reinitialize reaction n
KooijRate * kinetics = static_cast*> (&reac_set.reaction(n).forward_rate());
Scalar new_Cf_value;
... define new_Cf_value ...
kinetics->set_Cf(new_Cf_value);
```

The subtleties about units are dealt with the parameters ```Tref``` and ```rscale``` (which is the value of R in the unit of given activation energy). For details, see the doxygen documentation on the rate models (method ```reset_coefs```).

For third-body coefficients, the object ```Reaction``` already has what's necessary:
```
ReactionSet reac_set;
...do stuff...
// reinitialize third-body coefs of reaction n
Reaction & reac = reac_set.reaction(n);
... looping over species...
reac.set_efficiency(name_spec,id_spec,value_coef_spec);
```
And finally, for the falloff reactions, you can access the falloff model (Lindeman or Troe) using:
```
DesiredFalloffModel & falloff = reac_set.reaction(n).falloff()
... do whatever ...
```

##### For reviewers
Lots of lines, but always the same thing, mainly the ```reset_coefs``` method in the kinetics rates. Only the tests for the reset of the kinetics objects have so far been made (update of the already existing tests), except for the photochemistry. The falloff model fetch has not been added to the test (it's but a wrapper of the corresponding method in the ```FalloffReaction``` object).