daniel-koehn / DENISE-Black-Edition

2D time-domain isotropic (visco)elastic FD modeling and full waveform inversion (FWI) code for P/SV-waves
GNU General Public License v2.0
121 stars 66 forks source link

DENISE Modularization #6

Closed daniel-koehn closed 8 years ago

daniel-koehn commented 8 years ago

This major update contains a general reorganization of the DENISE source code. The very messy structure of the old code with limited to non use of sub-programs, code redundancies especially in case of the forward modelling engine and the implementation of new features via complex parameter combinations and nested IF-Statements finally lead to a state where the addition of new stuff became nearly impossible. Therefore, I reorganized the whole source code.

To simplify the transfer of variables from the main to the sub-programs, variables related to forward modelling, material parameters, acquisition geometry and FWI are assembled in data structures (see fd.h). This allows an easy modularization of the source code, starting with the choice of the underlying PHYSICS of the forward problem (2D PSV) in denise.c, branching to modules for pure forward modelling, FWI and elastic RTM in physics_PSV.c, down to the core of the modelling engine, uniquely defined in psv.c. Hopefully, this structure is future proof enough for an easy extension of the code to the SH, Acoustic and VTI formulations and addition of new features.

Finally, unnecessary or outdated variables and parameters are removed from the code and input files.