Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hybrid Rate Rules #583

Merged
merged 19 commits into from
Sep 23, 2021
Merged

Hybrid Rate Rules #583

merged 19 commits into from
Sep 23, 2021

Conversation

jtcooper10
Copy link
Collaborator

@jtcooper10 jtcooper10 commented Jul 21, 2021

NOTE: This implementation of rate rules is dependent on the Expression utility class implemented in PR #582. Please merge that one in first!

Implementation of SBML rate rules (represented with RateRule class) for the TauHybridCSolver class. Includes full support for math operations, as well as access to the point-in-time value t. Expressions are contextual to differential equations and make use of integrator state in the RHS function of the integrator.

Changes

  • Added support to the TauHybridCSolver class for SBML rate rules.
  • Added template_params.h header file to allow solver-specific template objects to access model parameters.
  • Added cmath include to provide access to math functions in propensity functions and rate rules
  • Implemented missing support for boundary conditions on species

- Restructure call order in constructor
- Add `use_*` methods for reactions to separate concerns
When calling `BuildEngine#prepare`, the `model` argument can be either a `Model` or `SanitizedModel`.
- Converts `Model` to `SanitizedModel`
- Hybrid solver overrides `_build` to pre-convert and add options
- Removed `__init__` call in hybrid solver, replaced with `_build`
- No classes accept `custom_definitions` as constructor arguments
- No functions accept `custom_definitions` as arguments
- Replaced `custom_definitions` with `SanitizedModel#get_options`
- Added template handling for rate rules in C++ templates
- Updated `DifferentialEquation` class to operate on rate rules
- Replaced `std::vector` usage with raw pointers
  - Allows passing integrator state from Sundials to rate rule object
- Pulls `name` property from `Species` object
- Converts from string to `Species` if necessary
- Moved reserved names to a separate dict
- Add new template header, `template_params.h`
  - Provides `extern` declarations to Gillespy params
- Remove `static` keyword from `template.cpp` params
Branch `feature/expression-validation` implements these already
Was preventing new options from being populated if no prior options
existed
- Changed call to use auxiliary method to generate options dict
- Explicit check added to the result of this method
- Added `boundary_conditions` property to C++ `HybridSpecies` class
- Added template parameter `boundary_mode` to `GPY_HYBRID_SPECIES_MODES`
- Added `boundary_conditions` check before state update
- Added `#include` for math operations in partial template header
- Added `std` namespace strip to be compatible with C operations
- Added `factorial()` definition
- Created `test_tau_hybrid_c_solver.py` test file with test cases for `TauHybridCSolver`
- Added test cases for models using rate rules and boundary conditions
- Fixed issue in RHS function not initializing boundary condition values
@jtcooper10 jtcooper10 marked this pull request as ready for review July 29, 2021 19:26
@jtcooper10 jtcooper10 requested a review from seanebum July 29, 2021 19:26
@briandrawert briandrawert added this to the 1.6.3 milestone Aug 17, 2021
Base automatically changed from feature/expression-validation to develop August 24, 2021 18:47
@briandrawert briandrawert modified the milestones: 1.6.3, 1.6.4 Aug 24, 2021
@BryanRumsey BryanRumsey self-requested a review September 21, 2021 20:17
@briandrawert briandrawert self-requested a review September 21, 2021 21:19
@seanebum seanebum merged commit cc39518 into develop Sep 23, 2021
@seanebum seanebum deleted the feature/cpp-hybrid-rate-rules branch September 23, 2021 16:21
@seanebum seanebum mentioned this pull request Sep 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants