/* intg_problem - a menagerie of ODE integration tests. */ /* Last edited on 2004-08-17 23:06:04 by stolfi */ #ifndef intg_problem_H #define intg_problem_H #include #include #include typedef void Intg_Solution(Time t, State *s); /* A procedure that returns in {s} the value at time {t} of the correct solution of some ODE problem. */ typedef struct Intg_Problem { char *tag; /* A tag that identifies the problem. */ unsigned n; /* Dimension of state vector. */ Intg_RHS *rhs; /* Right-hand side of the equation. */ Time t0; /* Integraton start time. */ Time t1; /* Integraton stopping time. */ Time dt; /* Initial time step. */ Time dtMin; /* Minimum time step for adaptive integration. */ Time dtMax; /* Maximum time step for adaptive integration. */ Intg_Solution *sol; /* The correct solution. */ } Intg_Problem; /* Vectors of {Intg_Problem}: */ typedef struct Intg_Problem_vec_t { nat nel; Intg_Problem *el; } Intg_Problem_vec_t; Intg_Problem_vec_t Intg_Problem_vec_new(nat nel); #define Intg_Problem_vec_expand(nv,index) \ vec_expand(vec_cast_ref(nv), index, sizeof(Intg_Problem)) #define Intg_Problem_vec_trim(nv,nel) \ vec_trim(vec_cast_ref(nv), nel, sizeof(Intg_Problem)) Intg_Problem_vec_t Intg_Problem_Sample(void); /* Returns a sample of ODE integration problems. */ #endif