Comments (4)
Ok, got it.
2nd iteration: we take the logic currently used to deliver the order p
, but instead return a derived data type called properties with all we might need:
type :: properties
integer :: p
integer :: ncache
character(:), allocatable :: name
...
end type
We add a get_properties method to rk_class
(which will replace the order
method for variable step methods)
type,abstract,public :: rk_class
...
procedure(properties_func), deferred :: get_properties
end type
For each method, we define a properties function (replacing what is done today for order):
pure module function rkbs32_properties(me) result(res)
implicit none
class(rkbs32_class), intent(in) :: me
type(properties) :: res
end function rkbs32_properties
and update rklib_variable_orders
accordingly:
submodule(rklib_module) rklib_properties
implicit none
contains
module procedure rkbs32_properties
!! Returns the properties of the [[rkbs32]] method
res%p = 3
res%ncache = 1
res%name = "rkbs32: Bogacki-Shampine 3(2) method"
end procedure rkbs32_order
...
I suppose this would work because it is just an extension/generalization of what is done currently.
from rklib.
This is a good idea. I'm going to work on it.
Actually, I'm working on a script to generate all this boilerplate code (interfaces, include files, etc.) automatically. I can add these to that. So we just specify the properties of the methods in a table and the code is autogenerated by a python script.
from rklib.
There are some problems with that though. For example the value of p
is used in the stepping algorithm, so it needs to be able to get the value from all the methods. As a type-bound procedure, it is always available, If it was just a variable in all the extended classes, we would have to add a million select type (me); class is (...)
statements to access it, which seems not ideal.
If we put these variable in the abstract class, then we'd need to set their values in some initialization step, which also would probably mean a select type
there. So neither way seems great.
from rklib.
Addressed in #24.
from rklib.
Related Issues (20)
- Runge-Kutta Nystrom
- More unit tests
- Add github doc website to the About section HOT 1
- Unused parameters in `rklib_variable_steps.f90` HOT 1
- Is check `if (h==zero)` required? HOT 1
- Plot line style/color
- Structure of the files HOT 2
- Notation in readme example
- Notation `terr`
- Cache for auxiliary variables in step procedures
- Selectable root finder HOT 1
- Other root finder inputs
- Merge `x` and `xf` into single inout argument in step procedures HOT 1
- Check results of order test HOT 6
- Error in DVERK65 HOT 2
- Discrepancy between some rational number coefficients and their decimal values HOT 2
- possible issue in the relative step error computations in case of variable step-size integrators HOT 2
- Non-constant variables
- Selection of integration method HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rklib.