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

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

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

revision 4121 by gross, Wed Dec 19 00:24:50 2012 UTC revision 4125 by gross, Wed Jan 2 06:15:00 2013 UTC
# Line 610  class SyntheticDataBase(DataSource): Line 610  class SyntheticDataBase(DataSource):
610      k=self.getReferenceProperty(domain)      k=self.getReferenceProperty(domain)
611      # calculate the corresponding potential      # calculate the corresponding potential
612      z=x[DIM-1]      z=x[DIM-1]
613      m_psi_ref=whereZero(z-sup(z))+whereZero(z-inf(z))      m_psi_ref=whereZero(z-sup(z))
614      if self.getDataType()==DataSource.GRAVITY:      if self.getDataType()==DataSource.GRAVITY:
615          pde.setValue(A=kronecker(domain), Y=-4*np.pi*U.Gravitational_Constant*self._reference_data, q=m_psi_ref)          pde.setValue(A=kronecker(domain), Y=-4*np.pi*U.Gravitational_Constant*self._reference_data, q=m_psi_ref)
616      else:      else:
# Line 791  class SyntheticData(SyntheticDataBase): Line 791  class SyntheticData(SyntheticDataBase):
791              k=sin(self.__n_depth * np.pi  * z2) * whereNonNegative(z2) * whereNonPositive(z2-1.) * self.__amplitude              k=sin(self.__n_depth * np.pi  * z2) * whereNonNegative(z2) * whereNonPositive(z2-1.) * self.__amplitude
792              for i in xrange(DIM-1):              for i in xrange(DIM-1):
793             x_i=x[i]             x_i=x[i]
794             m=whereNonNegative(x_i)*whereNonNegative(self.length-x_i)             min_x=inf(x_i)
795             k*= sin(self.__n_length*np.pi /self.length * x_i)*m             max_x=sup(x_i)
796               k*= sin(self.__n_length*np.pi*(x_i-min_x)/(max_x-min_x))
797              self._reference_data= k              self._reference_data= k
798          return self._reference_data          return self._reference_data
799    

Legend:
Removed from v.4121  
changed lines
  Added in v.4125

  ViewVC Help
Powered by ViewVC 1.1.26