Giter Site home page Giter Site logo

interpolation2d3d's People

Contributors

arjenmarkus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

interpolation2d3d's Issues

Strided access with array views

I noticed that all the interpolation classes make copies of the x-, y-, and z-arrays (when applicable). This is of course a safe and pragmatic design choice, after-all memory is cheap today.

For large applications, one might not be able to afford the copies. In this case it might be preferable to have a network_view class, which only stores a reference to the data:

real, pointer :: x(:) => null(), y(:) => null()

What I've realized today is that such a class could access the coordinates in their natural storage layout:

subroutine create_mesh_2d( this, x, y )
    class(network_view_2d), intent(inout)  :: this
    real, intent(in), target          :: x(:)
    real, intent(in), target          :: y(:)

This would mean an application could support both Fortran- and C-like layouts,i.e.

    real, target :: x(4), y(4)

    x = [ 0.0, 0.0, 1.0, 1.0]
    y = [ 0.0, 1.0, 0.0, 1.0]

    call network%create_mesh( x, y )

or

    real, target :: xy(2,4)

    xy(1,:) = [ 0.0, 0.0, 1.0, 1.0]
    xy(2,:) = [ 0.0, 1.0, 0.0, 1.0]

    call network%create_mesh( xy(1,:), xy(2,:) )

I think the strided array access is a very cool Fortran feature. I haven't looked deeper into the original routines from Renka. Presumably those expect (contiguous) assumed-size arrays. Those would need to be modified to take assumed-shape arrays for the above to work

Note I have no urgent need for this, but the idea seemed worth documenting at least.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.