Struct Discontinuity

Struct Documentation

struct Discontinuity

Data structure to store some state of a simulation at a discontinuity.

Public Functions

inline explicit Discontinuity(realtype const time, std::vector<int> const &root_info = std::vector<int>(), AmiVector const &x_pre = AmiVector(), AmiVector const &xdot_pre = AmiVector(), AmiVector const &x_post = AmiVector(), AmiVector const &xdot_post = AmiVector(), std::vector<realtype> const &h_pre = std::vector<realtype>(), std::vector<realtype> const &total_cl_pre = std::vector<realtype>(0))

Constructor.

Parameters:
  • time

  • root_info

  • x_pre

  • xdot_pre

  • x_post

  • xdot_post

  • h_pre

  • total_cl_pre

Public Members

realtype time

Time of discontinuity.

AmiVector x_post

Post-event state vector (dimension nx).

AmiVector x_pre

Pre-event state vector (dimension nx).

AmiVector xdot_post

Post-event differential state vectors (dimension nx).

AmiVector xdot_pre

Pre-event differential state vectors (dimension nx).

std::vector<int> root_info

Array of flags indicating which root has been found.

Array of length nr (ne) with the indices of the user functions gi found to have a root. For i = 0, …, nr: 1 or -1 if gi has a root, and = 0 if not. See CVodeGetRootInfo for details.

std::vector<realtype> h_pre

Flag indicating whether a certain Heaviside function should be active or not, pre-event value (dimension: ne)

AmiVector dx_post

time derivative of state (DAE only) post-event

std::vector<realtype> total_cl_pre

Total abundances for conservation laws (dimension: nx_rdata - nx_solver)