Fortran-FOSS-Programmers / WenOOF

WENO interpolation Object Oriented Fortran library
35 stars 17 forks source link

OOD refactored: discussion #14

Closed szaghi closed 7 years ago

szaghi commented 7 years ago

In the new v0.1.0 there is a new OOD with a strongly refactored design.

Something looks odd.

The OOD generates from base_object, mainly to exploit strong polymorphic-approach for future interpolators, but...

Integrator desing

Currently, the abstract integrator has

type, extends(base_object) :: interpolator
  !< Abstract interpolator object.
  !<
  !< @note Do not implement any actual interpolator: provide the interface for the different interpolators implemented.
  class(smoothness_indicators), allocatable :: is      !< Smoothness indicators.
  class(alpha_coefficients),    allocatable :: alpha   !< Alpha coefficients.
  class(optimal_weights),       allocatable :: weights !< Optimal weights.
  class(polynomials),           allocatable :: polynom !< Polynomilas.
  contains
    ! public deferred methods
    procedure, nopass     :: description !< Return interpolator string-description.
    procedure, pass(self) :: interpolate !< Interpolate values.
    ! public methods
    procedure, pass(self) :: create  !< Create interpolator.
    procedure, pass(self) :: destroy !< Destroy interpolator.
endtype interpolator

are all future integrators well represented by these objects? I think yes, but I do not know other than upwind-weno...

Constructors

All objects depend from the stencils number that for upwind coincides with stencils dimension. It looks like S could be inserted into the base object constructor. Are you agree?

giacrossi commented 7 years ago

Starting from the last question: I think yes, S could be inserted into the base object constructor.

The first question: I really don't know! In the home page of the project, some particular WENO schemes are mentioned, like Pirozzoli's one (hybrid WENO-compact): if we want to implement also that schemes (or other like Efficient implementation of nonlinear compact schemes on massively parallel platforms, D. Ghosh, E. M. Constantinescu and J. Brown, JSC, 2015, vol. 37, pp. C354-C383, doi:10.1137/140989261), maybe the four object that you've alluded to aren't enough...

So the question can be changed: Where we want to go ??? We want to include in this library also non conventional WENO schemes, or we want only to focus on weno upwind, central and so on?

szaghi commented 7 years ago

maybe the four object that you've alluded to aren't enough...

Aren't enough is agreed and, indeed, is very well: the polymorphis will be exploited to add new objects. I am complain that other interpolators do not need the already present objects. However, they are allocatable, thus if not necessary they will simply not allocated, but I am paranoiac...

giacrossi commented 7 years ago

Sometimes you're too much paranoic: these objects are allocatable, so where is the problem? In fact, at the beginning, I haven't understand your question :-D

But, admitting for just a second that you're right, how do you think this problem can be solved? Are you thinking to "join" some objects?

szaghi commented 7 years ago

done.