⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 demo.tex

📁 国外免费地震资料处理软件包
💻 TEX
字号:
\title{Guide to programming using RSF}\email{paul.sava@beg.utexas.edu}\author{Paul Sava}\lefthead{Sava}\righthead{RSF DEMO}\maketitle\begin{abstract}  This guide demonstrates a simple time-domain  finite-differences modeling code in RSF.\end{abstract}\section{Introduction}This section presents time-domain finite-difference modeling \footnote{``Hello world'' of seismic imaging.}written with the RSF library.The program is demonstrated with the C, C++ and Fortran 90 interfaces.The acoustic wave-equation\begin{equation}\Delta U - \frac{1}{v^2} \frac{\partial^2 U}{\partial t^2} = f(t)\end{equation}can be written as\begin{equation}\left[ \Delta U - f(t) \right] v^2 =\frac{\partial^2 U}{\partial t^2} \;.\end{equation}$\Delta$ is the Laplacian symbol,$f(t)$ is the source wavelet,$v$ is the velocity, and$U$ is a scalar wavefield.A discrete time-step involves the following computations:\begin{equation}U_{i+1} = \left[ \Delta U -f(t) \right] v^2 \Delta t^2 + 2 U_{i} - U_{i-1} \;,\end{equation}where $U_{i-1}$, $U_{i}$ and $U_{i+1}$represent the propagating wavefield at various time steps.% ------------------------------------------------------------\newpage\section{C program}\lstset{language=c,numbers=left,numberstyle=\tiny,showstringspaces=false}\tiny\lstinputlisting[frame=single]{\RSF/user/psava/rsfdemo/AFDMc__.c}\normalsize\begin{itemize}\item Declare input, output and auxiliary file tags:\texttt{Fw} for input wavelet, \texttt{Fv} for velocity,\texttt{Fr} for reflectivity, and\texttt{Fo} for output wavefield.\tiny\lstinputlisting[firstline=9,lastline=9,frame=single]{\RSF/user/psava/rsfdemo/AFDMc__.c}\normalsize\item Declare RSF cube axes:\texttt{at} time axis,\texttt{ax} space axis,\texttt{az} depth axis.\tiny\lstinputlisting[firstline=10,lastline=10,frame=single]{\RSF/user/psava/rsfdemo/AFDMc__.c}\normalsize\item Declare multi-dimensional arrays for input, output and computations.\tiny\lstinputlisting[firstline=14,lastline=15,frame=single]{\RSF/user/psava/rsfdemo/AFDMc__.c}\normalsize\item Open files for input/output.\tiny\lstinputlisting[firstline=22,lastline=25,frame=single]{\RSF/user/psava/rsfdemo/AFDMc__.c}\normalsize\item Read axes from input files; write axes to output file.\tiny\lstinputlisting[firstline=28,lastline=34,frame=single]{\RSF/user/psava/rsfdemo/AFDMc__.c}\normalsize\item Allocate arrays and read wavelet, velocity and reflectivity.\tiny\lstinputlisting[firstline=41,lastline=43,frame=single]{\RSF/user/psava/rsfdemo/AFDMc__.c}\normalsize\item Allocate temporary arrays.\tiny\lstinputlisting[firstline=46,lastline=49,frame=single]{\RSF/user/psava/rsfdemo/AFDMc__.c}\normalsize\item Loop over time.\tiny\lstinputlisting[firstline=62,lastline=62,frame=single]{\RSF/user/psava/rsfdemo/AFDMc__.c}\normalsize\item Compute Laplacian: $\Delta U$.\tiny\lstinputlisting[firstline=66,lastline=75,frame=single]{\RSF/user/psava/rsfdemo/AFDMc__.c}\normalsize\item Inject source wavelet: $\left[ \Delta U - f(t) \right]$\tiny\lstinputlisting[firstline=78,lastline=82,frame=single]{\RSF/user/psava/rsfdemo/AFDMc__.c}\normalsize\item Scale by velocity: $\left[ \Delta U - f(t) \right] v^2$\tiny\lstinputlisting[firstline=85,lastline=89,frame=single]{\RSF/user/psava/rsfdemo/AFDMc__.c}\normalsize\item Time step: $U_{i+1} = \left[ \Delta U -f(t) \right] v^2 \Delta t^2 + 2 U_{i} - U_{i-1}$\tiny\lstinputlisting[firstline=92,lastline=102,frame=single]{\RSF/user/psava/rsfdemo/AFDMc__.c}\normalsize\end{itemize}% ------------------------------------------------------------\newpage\section{C++ program}\lstset{language=c++,numbers=left,numberstyle=\tiny,showstringspaces=false}\tiny\lstinputlisting[frame=single]{\RSF/user/psava/rsfdemo/AFDMc++.cc}\normalsize\newpage\begin{enumerate}\item Declare input, output and auxiliary file cubes (of type \texttt{CUB}).\tiny\lstinputlisting[firstline=19,lastline=22,frame=single]{\RSF/user/psava/rsfdemo/AFDMc++.cc}\normalsize\item Declare, read and write RSF cube axes:\texttt{at} time axis,\texttt{ax} space axis,\texttt{az} depth axis.\tiny\lstinputlisting[firstline=25,lastline=32,frame=single]{\RSF/user/psava/rsfdemo/AFDMc++.cc}\normalsize\item Declare multi-dimensional \texttt{valarrays} for input, output and read data.\tiny\lstinputlisting[firstline=39,lastline=41,frame=single]{\RSF/user/psava/rsfdemo/AFDMc++.cc}\normalsize\item Declare multi-dimensional \texttt{valarrays} for temporary storage.\tiny\lstinputlisting[firstline=44,lastline=47,frame=single]{\RSF/user/psava/rsfdemo/AFDMc++.cc}\normalsize\item Initialize multidimensional \texttt{valarray} index counter (of type \texttt{VAI}).\tiny\lstinputlisting[firstline=50,lastline=50,frame=single]{\RSF/user/psava/rsfdemo/AFDMc++.cc}\normalsize\item Loop over time.\tiny\lstinputlisting[firstline=54,lastline=54,frame=single]{\RSF/user/psava/rsfdemo/AFDMc++.cc}\normalsize\item Compute Laplacian: $\Delta U$.\tiny\lstinputlisting[firstline=58,lastline=67,frame=single]{\RSF/user/psava/rsfdemo/AFDMc++.cc}\normalsize\item Inject source wavelet: $\left[ \Delta U - f(t) \right]$\tiny\lstinputlisting[firstline=70,lastline=70,frame=single]{\RSF/user/psava/rsfdemo/AFDMc++.cc}\normalsize\item Scale by velocity: $\left[ \Delta U - f(t) \right] v^2$\tiny\lstinputlisting[firstline=73,lastline=73,frame=single]{\RSF/user/psava/rsfdemo/AFDMc++.cc}\normalsize\item Time step: $U_{i+1} = \left[ \Delta U -f(t) \right] v^2 \Delta t^2 + 2 U_{i} - U_{i-1}$\tiny\lstinputlisting[firstline=76,lastline=78,frame=single]{\RSF/user/psava/rsfdemo/AFDMc++.cc}\normalsize\end{enumerate}% ------------------------------------------------------------\newpage\section{Fortran 90 program}\lstset{language=fortran,numbers=left,numberstyle=\tiny,showstringspaces=false}\tiny\lstinputlisting[frame=single]{\RSF/user/psava/rsfdemo/AFDMf90.f90}\normalsize\newpage\begin{itemize}\item Declare input, output and auxiliary file tags.\tiny\lstinputlisting[firstline=11,lastline=11,frame=single]{\RSF/user/psava/rsfdemo/AFDMf90.f90}\normalsize\item Declare RSF cube axes:\texttt{at} time axis,\texttt{ax} space axis,\texttt{az} depth axis.\tiny\lstinputlisting[firstline=12,lastline=12,frame=single]{\RSF/user/psava/rsfdemo/AFDMf90.f90}\normalsize\item Declare multi-dimensional arrays for input, output and computations.\tiny\lstinputlisting[firstline=16,lastline=17,frame=single]{\RSF/user/psava/rsfdemo/AFDMf90.f90}\normalsize\item Open files for input/output.\tiny\lstinputlisting[firstline=23,lastline=26,frame=single]{\RSF/user/psava/rsfdemo/AFDMf90.f90}\normalsize\item Read axes from input files; write axes to output file.\tiny\lstinputlisting[firstline=29,lastline=30,frame=single]{\RSF/user/psava/rsfdemo/AFDMf90.f90}\normalsize\item Allocate arrays and read wavelet, velocity and reflectivity.\tiny\lstinputlisting[firstline=37,lastline=39,frame=single]{\RSF/user/psava/rsfdemo/AFDMf90.f90}\normalsize\item Allocate temporary arrays.\tiny\lstinputlisting[firstline=42,lastline=45,frame=single]{\RSF/user/psava/rsfdemo/AFDMf90.f90}\normalsize\item Loop over time.\tiny\lstinputlisting[firstline=48,lastline=48,frame=single]{\RSF/user/psava/rsfdemo/AFDMf90.f90}\normalsize\item Compute Laplacian: $\Delta U$.\tiny\lstinputlisting[firstline=52,lastline=61,frame=single]{\RSF/user/psava/rsfdemo/AFDMf90.f90}\normalsize\item Inject source wavelet: $\left[ \Delta U - f(t) \right]$\tiny\lstinputlisting[firstline=64,lastline=64,frame=single]{\RSF/user/psava/rsfdemo/AFDMf90.f90}\normalsize\item Scale by velocity: $\left[ \Delta U - f(t) \right] v^2$\tiny\lstinputlisting[firstline=67,lastline=67,frame=single]{\RSF/user/psava/rsfdemo/AFDMf90.f90}\normalsize\item Time step: $U_{i+1} = \left[ \Delta U -f(t) \right] v^2 \Delta t^2 + 2 U_{i} - U_{i-1}$\tiny\lstinputlisting[firstline=70,lastline=72,frame=single]{\RSF/user/psava/rsfdemo/AFDMf90.f90}\normalsize\end{itemize}% ------------------------------------------------------------%%\bibliographystyle{segnat}%\bibliography{api}%%% Local Variables: %%% mode: latex%%% TeX-master: t%%% End: 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -