devitocodes / notebooks

BSD 3-Clause "New" or "Revised" License
1 stars 3 forks source link

General Case #7

Closed navjotk closed 8 years ago

navjotk commented 8 years ago

@ggorman @mlange05 I have some doubts about how the general case might look for running this sort of analysis using opesci.

  1. True Velocity: Here a numpy array is handcrafted to be passed to the Forward function later. If we allow for any matrix to be provided as input, generating C code to initialise this matrix in the C program might make the generated code too messy. The other option might be to pass the matrix from python to C in-memory (Is this what you mentioned @mlange05 ?). This imposes the limitation that the C code is no longer stand-alone and always needs to be called using a python wrapper. Another option would be to let the user provide the initialisation matrix as a mathematical function in x and y. This way we could just pass that function as a kernel and keep things simple software engineering wise. The matrix used here could possibly be represented as a function in x and y using Dirac-Delta or Heaviside functions, for example.
  2. Source: The Ricker wavelet source is provided here as a python function. Converting an arbitrary python function to generated C code would be a tough challenge. However in the case of sources, we could probably maintain a library of sources from which the user can can choose a source.
  3. Damping function: While a similar approach as above could be taken here as well, I see that the damping function has changed between the two examples posted here (Visco-Acoustic and Acoustic). Would a library-of-damping-functions approach work here?

Edit: After posting it I realise that this question is more related to the Opesci-fd repository than this one. Remove and repost?

ggorman commented 8 years ago

Its not clear at this point what you mean by "this kind of analysis"

  1. But as we are generating code why cannot we just generate bespoke code for a given API. For now, focusing on a python API is not a bad thing as the outer loop is being written in python.
  2. In general, the wavelet (source) is also read from a file into an array. For tests the python function could create a numpy array for the time series and pass this into the propagator.
  3. Can we not just generate a kernel that gets passed in as an argument to the function?

Yes - relocate..

mlange05 commented 8 years ago

This issue was moved to opesci/opesci-fd#67