/[escript]/trunk/downunder/py_src/seismic.py
ViewVC logotype

Diff of /trunk/downunder/py_src/seismic.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 4548 by gross, Thu Nov 28 05:30:48 2013 UTC revision 4549 by gross, Fri Nov 29 05:24:40 2013 UTC
# Line 209  class SimpleSEGYWriter(object): Line 209  class SimpleSEGYWriter(object):
209              # object.  If these are not set, they will be autocreated with default              # object.  If these are not set, they will be autocreated with default
210              # values.              # values.
211              stream.stats = AttribDict()              stream.stats = AttribDict()
212              stream.stats.textual_file_header = 'C.. '+self.__text+'\nC.. with esys.escript.downunder r%s at %s'%(getVersion(),time.asctime())              stream.stats.textual_file_header = 'C.. '+self.__text+'\nC.. with esys.escript.downunder r%s\nC.. %s'%(getVersion(),time.asctime())
213              stream.stats.binary_file_header = SEGYBinaryFileHeader()              stream.stats.binary_file_header = SEGYBinaryFileHeader()
214    
215              if getMPIRankWorld()<1:              if getMPIRankWorld()<1:
# Line 311  class SonicWave(WaveBase): Line 311  class SonicWave(WaveBase):
311            
312      f(t) is wavelet acting at a point source term at positon s      f(t) is wavelet acting at a point source term at positon s
313      """      """
314      def __init__(self, domain, v_p, wavelet, source_tag, dt=None, p0=None, p0_t=None, absorption_zone=300*U.m, absorption_cut=1e-2):      def __init__(self, domain, v_p, wavelet, source_tag, dt=None, p0=None, p0_t=None, absorption_zone=300*U.m, absorption_cut=1e-2, lumping=True):
315             """             """
316             initialize the sonic wave solver             initialize the sonic wave solver
317                        
# Line 328  class SonicWave(WaveBase): Line 328  class SonicWave(WaveBase):
328             :param p0_t: initial solution change rate. If not present zero is used.                       :param p0_t: initial solution change rate. If not present zero is used.          
329             :param absorption_zone: thickness of absorption zone                       :param absorption_zone: thickness of absorption zone          
330             :param absorption_cut: boundary value of absorption decay factor             :param absorption_cut: boundary value of absorption decay factor
331               :param lumping: if True mass matrix lumping is being used. This is accelerates the computing but introduces some diffusion.
332             """             """
333             f=createAbsorbtionLayerFunction(Function(domain).getX(), absorption_zone, absorption_cut)             f=createAbsorbtionLayerFunction(Function(domain).getX(), absorption_zone, absorption_cut)
334             v_p=v_p*f             v_p=v_p*f
# Line 349  class SonicWave(WaveBase): Line 350  class SonicWave(WaveBase):
350                        
351             self.__wavelet=wavelet             self.__wavelet=wavelet
352             self.__mypde=LinearPDE(domain)             self.__mypde=LinearPDE(domain)
353             self.__mypde.getSolverOptions().setSolverMethod(self.__mypde.getSolverOptions().HRZ_LUMPING)             if lumping: self.__mypde.getSolverOptions().setSolverMethod(self.__mypde.getSolverOptions().HRZ_LUMPING)
354               self.__mypde.setSymmetryOn()
355             self.__mypde.setValue(D=1.)             self.__mypde.setValue(D=1.)
356         self.__source_tag=source_tag         self.__source_tag=source_tag
357             self.__r=Scalar(0., DiracDeltaFunctions(self.__mypde.getDomain()))             self.__r=Scalar(0., DiracDeltaFunctions(self.__mypde.getDomain()))
# Line 361  class SonicWave(WaveBase): Line 363  class SonicWave(WaveBase):
363               returns the acceleraton for time t and solution u at time t               returns the acceleraton for time t and solution u at time t
364               """               """
365               self.__r.setTaggedValue(self.__source_tag, self.__wavelet.getAcceleration(t))               self.__r.setTaggedValue(self.__source_tag, self.__wavelet.getAcceleration(t))
366               self.__mypde.setValue(X=-self.__vp2*grad(u), y_dirac= self.__r)               self.__mypde.setValue(X=-self.__vp2*grad(u,Function(self.__mypde.getDomain())), y_dirac= self.__r)
367               return self.__mypde.getSolution()               return self.__mypde.getSolution()
368    
369                            

Legend:
Removed from v.4548  
changed lines
  Added in v.4549

  ViewVC Help
Powered by ViewVC 1.1.26