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

WIP: removing bits which should go into packages #5

Closed
wants to merge 2 commits into from
Closed

Conversation

mauro3
Copy link
Contributor

@mauro3 mauro3 commented Nov 16, 2016

This PR removes bits which I think should be in packages. In particular the all the algorithms needen't and shouldn't be defined here. If I understood correctly, this is my answer to SciML/Roadmap#9.

Note that this of course also necessitates changes in downstream pkgs.

Copy link
Contributor Author

@mauro3 mauro3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few comments with context.

abstract AbstractHeatProblem <: DEProblem
"`PdeSolution`: Wrapper for the objects obtained from a solver"
abstract AbstractPDEProblem <: DEProblem
"`DSolution`: type to hold the objects obtained from a solver"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this package we should only define the abstract types of broad categories of equations, I think. A heat-problem seems to specific.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense.

abstract DESolution
abstract AbstractODESolution <: DESolution
abstract AbstractSDESolution <: AbstractODESolution # Needed for plot recipes
abstract AbstractDDESolution <: AbstractODESolution # Needed for plot recipes
abstract AbstractFEMSolution <: DESolution
abstract AbstractSensitivitySolution
"`Mesh`: An abstract type which holds a (node,elem) pair and other information for a mesh"
abstract Mesh
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A mesh seems like an implementation detail which should go elsewhere.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then there should be a FEMMeshes.jl for holding meshing functionality common to PDEs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, let's leave it here. (At some later stage, a PDE related interface package might make sense.)

abstract Tableau

"`ODERKTableau`: A Runge-Kutta Tableau for an ODE integrator"
abstract ODERKTableau <: Tableau

"`DEIntegrator`: A DifferentialEquations Integrator type, used to initiate a solver."
abstract DEIntegrator
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know what this does.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing anymore. Good find.

abstract DEIntegrator

abstract ParameterizedFunction <: Function
abstract SensitivityFunction <: ParameterizedFunction
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we follow PR #2 then this is not needed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does that PR handle Sensitivity functions?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind, I see. SensitivityFunction didn't really need to subtype ParameterizedFunction after all.

alg,extra_kwargs = default_algorithm(prob;kwargs...)
solve(prob,alg,args...;default_set=true,kwargs...,extra_kwargs...)
end
# function solve(prob::DEProblem,args...;default_set=false,kwargs...)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how to do a default solver best. I think it has to be done package-wise: the first package providing Algs which gets loaded can set a default solver. But not sure how to implement it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's definitely not package-wise because the default solver for different cases is many times in different packages. For example, if you're trying to solve a stiff equation on Float64's, Sundials's CVODE_BDF and ODEInterface's radau tend to do best, while both of those package don't provide excellent methods for non-stiff equations, and don't work on odd number types.

Also, if it was package-wise it would clash.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this decision belongs into this interface package. I think this pkg should just provide an interface to hook into the JuliaDiffEq universe but not make judgment calls which solver is best for what. That is maybe something for DifferentialEquations.jl to do.

How about a system like so: DiffEqBase provides a dictionary (or some other datastructure) where each package hooking into DiffEqBase puts its solvers. Then there is some rating of the solvers on how suitable they are for one type of equation and say tolerances. Then the default algo will be picked from that list based on best suitability. I'll make an example PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The defaults code could just move to DifferentialEquations.jl if you think that's best.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Package-based default-choosing algorithms could still be available by the user passing in the package-wide abstract type?

@@ -1,158 +0,0 @@
abstract AbstractODEAlgorithm
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having these here definitely breaks encapsulation. And there shouldn't be any problem defining them in their respective packages.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then how do you do defaults?

@@ -1,11 +1,3 @@
macro def(name, definition)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what this does.

@mauro3 mauro3 mentioned this pull request Nov 16, 2016
@@ -1,158 +0,0 @@
abstract AbstractODEAlgorithm
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then how do you do defaults?

@ChrisRackauckas
Copy link
Member

I'm implementing these changes by hand to make sure everything (that is used) finds the right home and tests pass locally before merging.

@ChrisRackauckas
Copy link
Member

Note that I will be pushing to finish the SDE stuff today as well so that way those tests don't get in the way.

@mauro3
Copy link
Contributor Author

mauro3 commented Nov 17, 2016

Sounds good. I don't have time today and tomorrow I will be on a long haul flight. So I will not give much feedback.

@ChrisRackauckas
Copy link
Member

It's okay. The SDE stuff will intentionally look almost exactly like the ODE stuff (taking into account your changes) except the SDE problems will take two functions and a NoiseProcess.

For the noise process I think it might be easiest to throw the draft to master and make sure everything is all working, and if you have any comments from there handle that. For now it's far too small to be its own thing.

@ChrisRackauckas
Copy link
Member

This should all be done by 8f23efa . You might want to double check (it has the stochastic changes in there too. Again, nothing big except the noise process). I'll have to put in some minor tags all around for everything to reflect this (until then, tests fail almost everywhere because two package pretty much both export the same thing somewhere).

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.

None yet

2 participants