forked from pybamm-team/PyBaMM
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request pybamm-team#3217 from jsbrittain/solver
Idaklu solver can be given a list of variables to calculate during the solve
- Loading branch information
Showing
29 changed files
with
3,211 additions
and
1,188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#include "CasadiSolver.hpp" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
#ifndef PYBAMM_IDAKLU_CASADI_SOLVER_HPP | ||
#define PYBAMM_IDAKLU_CASADI_SOLVER_HPP | ||
|
||
#include <casadi/casadi.hpp> | ||
using Function = casadi::Function; | ||
|
||
#include "casadi_functions.hpp" | ||
#include "common.hpp" | ||
#include "options.hpp" | ||
#include "solution.hpp" | ||
#include "sundials_legacy_wrapper.hpp" | ||
|
||
/** | ||
* Abstract base class for solutions that can use different solvers and vector | ||
* implementations. | ||
* @brief An abstract base class for the Idaklu solver | ||
*/ | ||
class CasadiSolver | ||
{ | ||
public: | ||
|
||
/** | ||
* @brief Default constructor | ||
*/ | ||
CasadiSolver() = default; | ||
|
||
/** | ||
* @brief Default destructor | ||
*/ | ||
~CasadiSolver() = default; | ||
|
||
/** | ||
* @brief Abstract solver method that returns a Solution class | ||
*/ | ||
virtual Solution solve( | ||
np_array t_np, | ||
np_array y0_np, | ||
np_array yp0_np, | ||
np_array_dense inputs) = 0; | ||
|
||
/** | ||
* Abstract method to initialize the solver, once vectors and solver classes | ||
* are set | ||
* @brief Abstract initialization method | ||
*/ | ||
virtual void Initialize() = 0; | ||
}; | ||
|
||
#endif // PYBAMM_IDAKLU_CASADI_SOLVER_HPP |
Oops, something went wrong.