Coder Social home page Coder Social logo

yongpeng25 / topopt-fwi Goto Github PK

View Code? Open in Web Editor NEW

This project forked from juliano-fg/topopt-fwi

0.0 0.0 1.0 1.43 MB

Full Waveform Inversion (FWI) appoach based on Topology Optimizatin (TO) for the salt reconstruction problem.

License: GNU General Public License v3.0

Python 100.00%

topopt-fwi's Introduction

TopOptFWI

Full Waveform Inversion (FWI) approach based on Topology Optimization (TO) for the salt reconstruction problem.

Problem Description

  • The wave propagation problem in the frequency domain is solved using a Finite Element (FE) model.
  • Squared slowness model is split into two parts: background and salt structure.
  • The Solid Isotropic Material with Penalization (SIMP) model is used to interpolate the squared slowness.
  • A Helmholtz-type filter is used to smooth both control variables and gradient.
  • A Heaviside projection is used to ease the identification of sharp interfaces with strong velocity contrast.
  • Gradient calculation with respect to the control variables is aided by the dolfin-adjoint package.
  • Control variables are updated using an L-BFGS-B algorithm.

Dependencies and Installation

This code is based on Python 3, relies on the installation in a Linux environment, and requires the installation of the following packages:

Example

To run the example from the terminal:

python3 example.py 

Configuring the problem

The "input_data" class defines the problem to be solved:

class input_data:
    """Parameters to configure the FWI algorithm"""
    def __init__(self):
        # General Configuration ------------------------------------------------- #
              
        self.tofwi = True               # True = TO-based FWI
                                        # False = Traditional FWI
                                    
        self.example = 'b'              # Synthetic true model ('a','b','c' or 'd')
        
        self.true_salt_vel = 4.5        # Salt velocity for the true model (km/s)
        
        self.inverse_crime = True       # True = data from constant density model
                                        # False = data from variable density model
                                    
        self.r_s = 0.5                  # Filter radius for gradient smoothing (km)

        self.n_processes = 1            # Number of processes (int)
        
        # Initial Model --------------------------------------------------------- #   
        
        self.initial_slope = 0.8333     # Slope for the background velocity
                                        # (Exact slope is 0.8333)
        
        self.estimated_salt_vel = 4.5   # Salt velocity estimate (km/s)
        
        # TO-based FWI Configuration -------------------------------------------- #
        
        # (These variables have no influence on the inversion if the traditional 
        # FWI approach was chosen).
        
        self.update_background = False  # True = reconstruct background velocity
                                        # False = fixed background velocity

        self.r_a = 0.1                  # Filter radius for variable smoothing (km)

        self.q = 3                      # Penalty exponent for the interpolation 

        self.projection = True          # True = Heaviside projection active
                                        # False = Heaviside projection disabled
        # ----------------------------------------------------------------------- #

Solving the Inverse Problem

Importing the main module and the "input_data" class:

import TopOptFWI 
from input_data import input_data

Preprocessing step (create Mesh, Spaces, Absorbing layer, etc):

prep = TopOptFWI.PreProcessing(TopOptFWI.model_data(),input_data())
prep.initialize_model()

Solving the Forward Problem (to generate the observed data):

obs_data = TopOptFWI.ForwardProblem(prep)

Initializing Optimization Variables:

ai,bi,mi,opts,bds = TopOptFWI.InitializeOpt(prep)

Solving the Inverse Problem:

ai,bi,mi,outer_iter = TopOptFWI.Inversion(prep,obs_data,ai,bi,mi,opts,bds)

Saving Solutions and Evaluating Errors:

TopOptFWI.PlotVelocity([ai,bi,mi],prep,outer_iter)
TopOptFWI.EvalErrors([ai,bi,mi],prep,obs_data)

Results

True Model:

Synthetic model taken from Kadu et al. 2016 with a background velocity varying linearly with depth and salt bodies with constant velocity of 4.5 km/s. There are 21 sources with 15 Hz Ricker signature placed on top of the model and 101 receivers at 50 m depth. Frequency band between 2.5 and 3.5 Hz with a spacing of 0.125 Hz.

true

Initial Model:

The initial model is a velocity model with the exact linear background.

initial

Reconstructed Model:

Solution considering the TO-based FWI with fixed background.

recon

Other synthetic models

Synthetic models taken from Kadu et al. 2016 with a background velocity varying linearly with depth and salt bodies with constant velocity of 4.5 km/s. A different true model can be used by changing the instance variable "example" in the "input_data" class.

input_data.example = 'a'
a

input_data.example = 'c'
c

input_data.example = 'b'
b

input_data.example = 'd'
d

Citation

If our work is useful for your research, please consider citing:

@article{gonccalves2023salt,
  title={Salt reconstruction in full-waveform inversion using topology optimization techniques},
  author={Gon{\c{c}}alves, JF and Silva, ECN},
  journal={Geophysical Journal International},
  volume={234},
  number={2},
  pages={1484--1504},
  year={2023},
  publisher={Oxford University Press},
  doi={10.1093/gji/ggad150},
  url={https://doi.org/10.1093/gji/ggad150},
}
@article{gonccalves2020identification,
  title={Identification problem of acoustic media in the frequency domain based on the topology optimization method},
  author={Gon{\c{c}}alves, Juliano F and Moreira, Joao BD and Salas, Ruben A and Ghorbani, Mohammad M and Rubio, Wilfredo M and Silva, Em{\'\i}lio CN},
  journal={Structural and Multidisciplinary Optimization},
  volume={62},
  number={3},
  pages={1041--1059},
  year={2020},
  publisher={Springer},
  doi={10.1007/s00158-020-02638-9},
  url={https://doi.org/10.1007/s00158-020-02638-9},
}

Contact

If you have any questions, please feel free to message the authors: Juliano F. Gonçalves ([email protected]) or Emílio C.N. Silva ([email protected]).

topopt-fwi's People

Contributors

juliano-fg avatar

Forkers

tianwen220

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.