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

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

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

revision 5087 by sshaw, Mon Jun 23 04:36:14 2014 UTC revision 5088 by jduplessis, Tue Jul 1 00:32:22 2014 UTC
# Line 876  class MT2DModelTEMode(ForwardModel): Line 876  class MT2DModelTEMode(ForwardModel):
876      frequency omega.      frequency omega.
877      It defines a cost function:      It defines a cost function:
878    
879        *  defect = 1/2 integrate( sum_s w^s * ( E_x - Z_XY^s * H_y ) ) ** 2 ) *        *  defect = 1/2 integrate( sum_s w^s * ( E_x - Z_XY^s * H_y ) ) ** 2  *
880    
881      where E_x is the horizontal electric field perpendicular to the YZ-domain,      where E_x is the horizontal electric field perpendicular to the YZ-domain,
882      horizontal magnetic field H_y=1/(i*omega*mu) * E_{x,z} with complex unit      horizontal magnetic field H_y=1/(i*omega*mu) * E_{x,z} with complex unit
# Line 895  class MT2DModelTEMode(ForwardModel): Line 895  class MT2DModelTEMode(ForwardModel):
895      where E_x is set to E_0 on the top of the domain. Homogeneous Neuman      where E_x is set to E_0 on the top of the domain. Homogeneous Neuman
896      conditions are assumed elsewhere.      conditions are assumed elsewhere.
897      """      """
898      def __init__(self, domain, omega, x, Z_XY, eta, w0=1., mu=4*PI*1e-7, E_x0=1, coordinates=None, fixAtBottom=False, tol=1e-8, saveMemory=True):      def __init__(self, domain, omega, x, Z_XY, eta, w0=1., mu=4*PI*1e-7, E_x0=1,
899            coordinates=None, fixAtBottom=False, tol=1e-8, saveMemory=True, directSolver=False):
900          """          """
901          initializes a new forward model.          initializes a new forward model.
902    
# Line 989  class MT2DModelTEMode(ForwardModel): Line 990  class MT2DModelTEMode(ForwardModel):
990          #=======================          #=======================
991          self.__tol=tol          self.__tol=tol
992          self.__fixAtBottom=fixAtBottom          self.__fixAtBottom=fixAtBottom
993            self.__directSolver=directSolver
994          self.__pde=None          self.__pde=None
995          if not saveMemory:          if not saveMemory:
996              self.__pde=self.setUpPDE()              self.__pde=self.setUpPDE()
# Line 1017  class MT2DModelTEMode(ForwardModel): Line 1019  class MT2DModelTEMode(ForwardModel):
1019          """          """
1020          if self.__pde is None:          if self.__pde is None:
1021              pde=LinearPDE(self.__domain, numEquations=2)              pde=LinearPDE(self.__domain, numEquations=2)
1022                if(directSolver == True):
1023                    pde.getSolverOptions().setSolverMethod(SolverOptions.DIRECT)
1024              D=pde.createCoefficient('D')              D=pde.createCoefficient('D')
1025              A=pde.createCoefficient('A')              A=pde.createCoefficient('A')
1026              Y=pde.createCoefficient('Y')              Y=pde.createCoefficient('Y')
# Line 1028  class MT2DModelTEMode(ForwardModel): Line 1032  class MT2DModelTEMode(ForwardModel):
1032              z = self.__domain.getX()[DIM-1]              z = self.__domain.getX()[DIM-1]
1033              q=whereZero(z-sup(z))              q=whereZero(z-sup(z))
1034              if self.__fixAtBottom:              if self.__fixAtBottom:
1035                      q+=whereZero(z-inf(z))                  q+=whereZero(z-inf(z))
1036              pde.setValue(q=q*[1,1])              pde.setValue(q=q*[1,1])
1037              pde.getSolverOptions().setTolerance(self.__tol)              pde.getSolverOptions().setTolerance(self.__tol)
1038              pde.setSymmetryOff()              pde.setSymmetryOff()

Legend:
Removed from v.5087  
changed lines
  Added in v.5088

  ViewVC Help
Powered by ViewVC 1.1.26