/[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 4432 by jfenwick, Fri May 17 02:32:33 2013 UTC revision 4433 by gross, Fri May 31 12:09:58 2013 UTC
# Line 117  class ForwardModelWithPotential(ForwardM Line 117  class ForwardModelWithPotential(ForwardM
117          self.diameter=1./sqrt(sum(1./self.edge_lengths**2))          self.diameter=1./sqrt(sum(1./self.edge_lengths**2))
118    
119          if not  self.__trafo.isCartesian():          if not  self.__trafo.isCartesian():
120              fd=1./self.__trafo().getScalingFactors()              fd=1./self.__trafo.getScalingFactors()
121              fw=self.__trafo().getScalingFactors()*sqrt(self.__trafo().getVolumeFactor())              fw=self.__trafo.getScalingFactors()*sqrt(self.__trafo.getVolumeFactor())
122              for s in range(len(self.__weight)):              for s in range(len(self.__weight)):
123                  self.__weight[s] = fw * self.__weight[s]                  self.__weight[s] = fw * self.__weight[s]
124                  self.__data[s]   = fd * self.__data[s]                  self.__data[s]   = fd * self.__data[s]
# Line 231  class GravityModel(ForwardModelWithPoten Line 231  class GravityModel(ForwardModelWithPoten
231              self.__G = 4*PI*gravity_constant * self.getCoordinateTransformation().getVolumeFactor()              self.__G = 4*PI*gravity_constant * self.getCoordinateTransformation().getVolumeFactor()
232    
233              fw=self.getCoordinateTransformation().getScalingFactors()**2*self.getCoordinateTransformation().getVolumeFactor()              fw=self.getCoordinateTransformation().getScalingFactors()**2*self.getCoordinateTransformation().getVolumeFactor()
234              A=self.getPDE().createCoeffiecient("A")              A=self.getPDE().createCoefficient("A")
235              for i in range(self.getDomain().getDim()): A[i,i]=fw[i]              for i in range(self.getDomain().getDim()): A[i,i]=fw[i]
236              self.getPDE().setValue(A=A)              self.getPDE().setValue(A=A)
237          else: # cartesian          else: # cartesian
# Line 332  class MagneticModel(ForwardModelWithPote Line 332  class MagneticModel(ForwardModelWithPote
332          :type B: ``Vector`` or list of ``Vector``          :type B: ``Vector`` or list of ``Vector``
333          :param tol: tolerance of underlying PDE          :param tol: tolerance of underlying PDE
334          :type tol: positive ``float``          :type tol: positive ``float``
335            :param background_magnetic_flux_density: background magnetic flux density (in Teslar) with components (B_east, B_north, B_vertical)
336            :type background_magnetic_flux_density: ``Vector`` or list of `float`
337          :param coordinates: defines coordinate system to be used          :param coordinates: defines coordinate system to be used
338          :type coordinates: ReferenceSystem` or `SpatialCoordinateTransformation`          :type coordinates: ReferenceSystem` or `SpatialCoordinateTransformation`
339          :param fixPotentialAtBottom: if true potential is fixed to zero at the bottom of the domain          :param fixPotentialAtBottom: if true potential is fixed to zero at the bottom of the domain
# Line 346  class MagneticModel(ForwardModelWithPote Line 348  class MagneticModel(ForwardModelWithPote
348              self.__B_r=self.__background_magnetic_flux_density*self.getCoordinateTransformation().getScalingFactors()*self.getCoordinateTransformation().getVolumeFactor()              self.__B_r=self.__background_magnetic_flux_density*self.getCoordinateTransformation().getScalingFactors()*self.getCoordinateTransformation().getVolumeFactor()
349              self.__B_b=self.__background_magnetic_flux_density/self.getCoordinateTransformation().getScalingFactors()              self.__B_b=self.__background_magnetic_flux_density/self.getCoordinateTransformation().getScalingFactors()
350    
351              A=self.getPDE().createCoeffiecient("A")              A=self.getPDE().createCoefficient("A")
352              fw=self.getCoordinateTransformation().getScalingFactors()**2*self.getCoordinateTransformation().getVolumeFactor()              fw=self.getCoordinateTransformation().getScalingFactors()**2*self.getCoordinateTransformation().getVolumeFactor()
353              for i in range(self.getDomain().getDim()): A[i,i]=fw[i]              for i in range(self.getDomain().getDim()): A[i,i]=fw[i]
354              self.getPDE().setValue(A=A)              self.getPDE().setValue(A=A)

Legend:
Removed from v.4432  
changed lines
  Added in v.4433

  ViewVC Help
Powered by ViewVC 1.1.26