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

Implement non uniform grid spacing support #9

Closed
szaghi opened this issue Oct 15, 2015 · 6 comments
Closed

Implement non uniform grid spacing support #9

szaghi opened this issue Oct 15, 2015 · 6 comments

Comments

@szaghi
Copy link
Member

szaghi commented Oct 15, 2015

Allow the usage of non uniform grid spacing, e.g. modify the interpolate method with something like

pure subroutine interpolate(self, S, stencil, location, interpolation, nodes, coefficients)
  class(weno_interpolator_upwind), intent(IN)  :: self 
  integer,                         intent(IN)  :: S                         
  real(R_P),                       intent(IN)  :: stencil(1:, 1 - S:)
  character(*),                    intent(IN)  :: location         
  real(R_P),                       intent(OUT) :: interpolation(1:)
  real(R_P),  optional,            intent(IN) :: nodes(1-S:)
  real(R_P),  optional,            intent(IN) :: coefficients(1-S:)
endsubroutine interpolate

where

  • if the nodes dummy argument is passed then the interpolation coefficients must be recomputed on-the-fly;
  • else if the coefficients dummy argument is passed then used those coefficients instead of the default defined;
  • else if neither nodes nor coefficients are passed (the default current call) use the default defined coefficients.

For more details see [1]

[1] Essentially Non-Oscillatory and Weighted Essentially Non-Oscillatory Schemes for Hyperbolic Conservation Laws, Chi-Shu, Wang, 1997.

@giacrossi
Copy link
Collaborator

This could be a very very nice feature!!! Just a little question (maybe I'm working on the code...): how do you think the coefficients are stored in memory? As a one-dimensional array, so, for example, for the 3rd order reconstruction we have coefficients(4) and for the 5th order reconstruction coefficients(18)?

I think that nodes could be a one-dimensional array.

@szaghi
Copy link
Member Author

szaghi commented Oct 27, 2015

@giacombum

The pseudo-code above depicted is slightly misleading. The nodes dummy argument should be a rank 1 array as the interpolation is 1D, while the reference to coefficients is really misleading because the polynomial coefficients that for the upwind-weno interpolator is a rank 3 array. The memory mapping of these dummy arguments must be taken into account by clients codes, WenOOF is unaware of that.

This is just an idea, when I (we?) will implement it, concrete issues will arise. The interpolation is now 1D (ND will be N-times 1D interpolation...) thus the nodes could be defined as vertex abscissa of cell-spacing with something like:

| cell 1    | cell 2  | cell 3 | cell 4 | cell 5            |  
|-----------|---------|--------|--------|-------------------|
|  h1       |   h2    |   h3   | h4     |        h5         |
|-----------|---------|--------|--------|-------------------|
|           |         |        |        |                   | 
v           v         v        v        v                   v 
x0          x1        x2       x3       x4                  x5 

Thus nodes could be real :: nodes(1:5) or real :: nodes(0:5) depending on if we use grid spacings or nodes abscissa.

For the coefficients the exact definition is delayed to the future implementation time.

See you soon.

@giacrossi
Copy link
Collaborator

Following this intresting work, I've tried to write a possible algorithm for a generalized one dimensional WENO interpolation, based on ADT:

  • after choosing an r, r Lagrange polynomials will be created (the coefficients of these polynomials can be symbolically evaluated using cantor or matlab);
  • the r linear weights will be evaluated solving the system 3.12 of the paper and using all the values in the equation 3.6;
  • the smoothness indicators can be evaluated from the equation 3.4, where all the derivatives can be pre-computed using an abstract data type (of the same type of the lagrange interpolator);
  • finally the weno weights can be computed from the smoothness indicators.

@szaghi
Copy link
Member Author

szaghi commented Feb 1, 2016

I have not access to the paper you are referencing to. Anyhow, sounds interesting. The crucial point is, obviously, the smoothness indicator algorithm. Go on.

@giacrossi
Copy link
Collaborator

@szaghi do you think this issue can be closed?

@szaghi
Copy link
Member Author

szaghi commented Apr 10, 2017

yes.

@szaghi szaghi closed this as completed Apr 10, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants