/[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 4116 by gross, Fri Dec 14 07:21:14 2012 UTC revision 4121 by gross, Wed Dec 19 00:24:50 2012 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))      m_psi_ref=whereZero(z-sup(z))+whereZero(z-inf(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:
617          pde.setValue(A=kronecker(domain), X=self._reference_data*self.__B_b, q=m_psi_ref)          pde.setValue(A=kronecker(domain), X=self._reference_data*self.__B_b, q=m_psi_ref)
618      pde.setSymmetryOn()      pde.setSymmetryOn()
619        #pde.getSolverOptions().setTolerance(1e-13)
620      psi_ref=pde.getSolution()      psi_ref=pde.getSolution()
621      del pde      del pde
622      if self.getDataType()==DataSource.GRAVITY:      if self.getDataType()==DataSource.GRAVITY:
623          data = -grad(psi_ref, ReducedFunction(domain))          data = -grad(psi_ref, ReducedFunction(domain))
624      else:      else:
625          data = self._reference_data*self.__B_b-grad(psi_ref, ReducedFunction(domain))          data = self._reference_data*self.__B_b-grad(psi_ref, ReducedFunction(domain))
626          
627      x=ReducedFunction(domain).getX()          x=ReducedFunction(domain).getX()    
628      if self.__full_knowledge:      if self.__full_knowledge:
629          sigma = whereNegative(x[DIM-1])          sigma = whereNegative(x[DIM-1])

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

  ViewVC Help
Powered by ViewVC 1.1.26