/[escript]/trunk/escript/py_src/linearPDEs.py
ViewVC logotype

Diff of /trunk/escript/py_src/linearPDEs.py

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

revision 2169 by caltinay, Wed Dec 17 03:08:58 2008 UTC revision 2197 by gross, Thu Jan 8 05:49:16 2009 UTC
# Line 2535  class TransportPDE(LinearProblem): Line 2535  class TransportPDE(LinearProblem):
2535       super(TransportPDE, self).__init__(domain,numEquations,numSolutions,debug)       super(TransportPDE, self).__init__(domain,numEquations,numSolutions,debug)
2536    
2537       self.__theta=theta       self.__theta=theta
2538         self.setConstraintWeightingFactor()
2539       #       #
2540       #   the coefficients of the transport problem       #   the coefficients of the transport problem
2541       #       #
# Line 2757  class TransportPDE(LinearProblem): Line 2758  class TransportPDE(LinearProblem):
2758                any time step size can be used.                any time step size can be used.
2759         """         """
2760         return self.getOperator().getSafeTimeStepSize()         return self.getOperator().getSafeTimeStepSize()
2761    
2762       def setConstraintWeightingFactor(self,value=1./util.sqrt(util.EPSILON)):
2763           """
2764           Sets the weighting factor used to insert the constraints into the problem
2765    
2766           @param value: value for the weighting factor
2767           @type value: large positive C{float}
2768           """
2769           if not value>0:
2770             raise ValueError,"weighting factor needs to be positive."
2771           self.__constraint_factor=value
2772           self.trace("Weighting factor for constraints is set to %e."%value)
2773    
2774       def getConstraintWeightingFactor(self):
2775           """
2776           returns the weighting factor used to insert the constraints into the problem
2777           @return: value for the weighting factor
2778           @rtype: C{float}
2779           """
2780           return self.__constraint_factor
2781     #====================================================================     #====================================================================
2782     def getSolution(self,dt,**options):     def getSolution(self,dt,**options):
2783         """         """
# Line 2815  class TransportPDE(LinearProblem): Line 2836  class TransportPDE(LinearProblem):
2836                              self.getCoefficient("y_reduced"),                              self.getCoefficient("y_reduced"),
2837                              self.getCoefficient("d_contact_reduced"),                              self.getCoefficient("d_contact_reduced"),
2838                              self.getCoefficient("y_contact_reduced"))                              self.getCoefficient("y_contact_reduced"))
2839            operator.insertConstraint(righthandside,self.getCoefficient("q"),self.getCoefficient("r"))            operator.insertConstraint(righthandside,self.getCoefficient("q"),self.getCoefficient("r"),self.getConstraintWeightingFactor())
2840            self.trace("New system has been built.")            self.trace("New system has been built.")
2841            self.validOperator()            self.validOperator()
2842            self.validRightHandSide()            self.validRightHandSide()

Legend:
Removed from v.2169  
changed lines
  Added in v.2197

  ViewVC Help
Powered by ViewVC 1.1.26