[][src]Struct ida::Ida

pub struct Ida<P, LS, NLS, TolC> where
    P: IdaProblem,
    LS: LSolver<P::Scalar>,
    NLS: NLSolver<P>,
    TolC: TolControl<P::Scalar>, 
{ /* fields omitted */ }

This structure contains fields to keep track of problem state.

Methods

impl<P, LS, NLS, TolC> Ida<P, LS, NLS, TolC> where
    P: IdaProblem,
    LS: LSolver<P::Scalar>,
    NLS: NLSolver<P>,
    TolC: TolControl<P::Scalar>, 
[src]

pub fn get_yy(&self) -> ArrayView1<P::Scalar>[src]

Return a view of the y vector

pub fn get_yp(&self) -> ArrayView1<P::Scalar>[src]

Return a view of the y' vector

pub fn get_last_order(&self) -> usize[src]

returns the integration method order used during the last internal step.

pub fn get_current_order(&self) -> usize[src]

returns the integration method order to be used on the next internal step.

pub fn get_actual_init_step(&self) -> P::Scalar[src]

returns the value of the integration step size used on the first step.

pub fn get_last_step(&self) -> P::Scalar[src]

returns the integration step size taken on the last internal step (if from solve()), or the last value of the artificial step size h (if from calc_ic()).

pub fn get_current_setp(&self) -> P::Scalar[src]

returns the integration step size to be attempted on the next internal step.

pub fn get_current_time(&self) -> P::Scalar[src]

returns the current internal time reached by the solver.

pub fn get_tol_scale_factor(&self) -> P::Scalar[src]

returns a suggested factor by which the user’s tolerances should be scaled when too much accuracy has been requested for some internal step.

pub fn get_num_steps(&self) -> usize[src]

returns the cumulative number of internal steps taken by the solver (total so far).

pub fn get_num_res_evals(&self) -> usize[src]

returns the number of calls to the user’s residual evaluation function. Note: does not account for calls made to res from a linear solver or preconditioner module

pub fn get_num_lin_solv_setups(&self) -> usize[src]

returns the cumulative number of calls made to the linear solver’s setup function (total so far).

pub fn get_num_err_test_fails(&self) -> usize[src]

returns the cumulative number of local error test failures that have occurred (total so far).

pub fn get_num_jac_evals(&self) -> usize[src]

returns the cumulative number of calls to the idals Jacobian approximation function.

pub fn get_num_nonlin_solv_iters(&self) -> usize[src]

pub fn get_num_lin_res_evals(&self) -> usize[src]

returns the number of calls to the DAE residual needed for the DQ Jacobian approximation or J*v product approximation

pub fn get_num_lin_iters(&self) -> usize[src]

returns the cumulative number of linear iterations.

pub fn get_num_nonlin_solv_conv_fails(&self) -> usize[src]

returns the cumulative number of linear convergence failures.

pub fn get_num_g_evals(&self) -> usize[src]

returns the cumulative number of calls to the user root function.

pub fn get_root_info(&self) -> ArrayView1<P::Scalar>[src]

returns an array showing which functions were found to have a root.

Note that, for the components gi for which a root was found, the sign of rootsfound[i] indicates the direction of zero-crossing. A value of +1 indicates that gi is increasing, while a value of −1 indicates a decreasing gi.

impl<P, LS, NLS, TolC> Ida<P, LS, NLS, TolC> where
    P: IdaProblem,
    LS: LSolver<P::Scalar>,
    NLS: NLSolver<P>,
    TolC: TolControl<P::Scalar>,
    <P as ModelSpec>::Scalar: Float + FloatConst + NumRef + NumAssignRef + ScalarOperand + Debug + LowerExp + IdaConst<Scalar = P::Scalar>, 
[src]

pub fn solve(
    &mut self,
    tout: P::Scalar,
    tret: &mut P::Scalar,
    itask: IdaTask
) -> Result<IdaSolveStatus, Error>
[src]

This routine is the main driver of the IDA package.

This is the central step in the solution process, the call to perform the integration of the DAE. One of the input arguments (itask) specifies one of two modes as to where ida is to return a solution. But these modes are modified if the user has set a stop time (with set_stop_time()) or requested rootfinding.

It integrates over an independent variable interval defined by the user, by calling step() to take internal independent variable steps.

The first time that solve() is called for a successfully initialized problem, it computes a tentative initial step size.

solve() supports two modes, specified by itask:

  • In the Normal mode, the solver steps until it passes tout and then interpolates to obtain y(tout) and yp(tout).
  • In the OneStep mode, it takes one internal step and returns.

Arguments

  • tout The next time at which a computed solution is desired.
  • tret The time reached by the solver (output).
  • itask A flag indicating the job of the solver for the next user step. The IDA NORMAL task is to have the solver take internal steps until it has reached or just passed the user specified tout parameter. The solver then interpolates in order to return approximate values of y(tout) and ˙y(tout). The IDA ONE STEP option tells the solver to just take one internal step and return the solution at the point reached by that step

Returns

  • IdaSolveStatus::Success - general success.
  • IdaSolveStatus::TStop - solve() succeeded by reaching the stop point specified through the optional input function set_stop_time().
  • IdaSolveStatus::Root - solve() succeeded and found one or more roots. In this case, tret is the location of the root. If nrtfn > 1, call get_root_info() to see which gi were found to have a root.

Errors

IDA_ILL_INPUT IDA_TOO_MUCH_WORK IDA_MEM_NULL IDA_TOO_MUCH_ACC IDA_CONV_FAIL IDA_LSETUP_FAIL IDA_LSOLVE_FAIL IDA_CONSTR_FAIL IDA_ERR_FAIL IDA_REP_RES_ERR IDA_RES_FAIL

impl<P, LS, NLS, TolC> Ida<P, LS, NLS, TolC> where
    P: IdaProblem,
    LS: LSolver<P::Scalar>,
    NLS: NLSolver<P>,
    TolC: TolControl<P::Scalar>,
    <P as ModelSpec>::Scalar: Float + FloatConst + NumRef + NumAssignRef + ScalarOperand + Debug + LowerExp + IdaConst<Scalar = P::Scalar>, 
[src]

pub fn new(
    problem: P,
    yy0: Array<P::Scalar, Ix1>,
    yp0: Array<P::Scalar, Ix1>,
    tol_control: TolC
) -> Self
[src]

Creates a new IdaProblem given a ModelSpec, initial Arrays of yy0 and yyp

*Panics" if ModelSpec::Scalar is unable to convert any constant initialization value.

pub fn get_dky<S>(
    &mut self,
    t: P::Scalar,
    k: usize,
    dky: &mut ArrayBase<S, Ix1>
) -> Result<(), Error> where
    S: DataMut<Elem = P::Scalar>, 
[src]

IDAGetDky

This routine evaluates the k-th derivative of y(t) as the value of the k-th derivative of the interpolating polynomial at the independent variable t, and stores the results in the vector dky. It uses the current independent variable value, tn, and the method order last used, kused.

The return values are: IDA_SUCCESS if t is legal IDA_BAD_T if t is not within the interval of the last step taken IDA_BAD_DKY if the dky vector is NULL IDA_BAD_K if the requested k is not in the range [0,order used] IDA_VTolCTOROP_ERR if the fused vector operation fails

pub fn get_solution(&mut self, t: P::Scalar) -> Result<(), Error>[src]

This routine evaluates y(t) and y'(t) as the value and derivative of the interpolating polynomial at the independent variable t, and stores the results in the vectors yret and ypret. It uses the current independent variable value, tn, and the method order last used, kused. This function is called by solve with t = tout, t = tn, or t = tstop.

If kused = 0 (no step has been taken), or if t = tn, then the order used here is taken to be 1, giving yret = phi[0], ypret = phi[1]/psi[0].

Arguments

  • t - requested independent variable (time)

Returns

  • () if t was legal. Outputs placed into yy and yp, and can be accessed using get_yy() and get_yp().

Errors

  • IdaError::BadTimeValue if t is not within the interval of the last step taken.

pub fn wrms_norm<S1, S2>(
    &self,
    x: &ArrayBase<S1, Ix1>,
    w: &ArrayBase<S2, Ix1>,
    mask: bool
) -> P::Scalar where
    S1: Data<Elem = P::Scalar>,
    S2: Data<Elem = P::Scalar>, 
[src]

Returns the WRMS norm of vector x with weights w. If mask = SUNTRUE, the weight vector w is masked by id, i.e., nrm = N_VWrmsNormMask(x,w,id); Otherwise, nrm = N_VWrmsNorm(x,w);

mask = SUNFALSE when the call is made from the nonlinear solver. mask = suppressalg otherwise.

Trait Implementations

impl<P: Debug, LS: Debug, NLS: Debug, TolC: Debug> Debug for Ida<P, LS, NLS, TolC> where
    P: IdaProblem,
    LS: LSolver<P::Scalar>,
    NLS: NLSolver<P>,
    TolC: TolControl<P::Scalar>,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug
[src]

Auto Trait Implementations

impl<P, LS, NLS, TolC> Send for Ida<P, LS, NLS, TolC> where
    LS: Send,
    NLS: Send,
    P: Send,
    TolC: Send,
    <P as ModelSpec>::Scalar: Send

impl<P, LS, NLS, TolC> Sync for Ida<P, LS, NLS, TolC> where
    LS: Sync,
    NLS: Sync,
    P: Sync,
    TolC: Sync,
    <P as ModelSpec>::Scalar: Sync

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]