/[escript]/branches/symbolic_from_3470/escript/py_src/nonlinearPDE.py
ViewVC logotype

Diff of /branches/symbolic_from_3470/escript/py_src/nonlinearPDE.py

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

revision 3868 by caltinay, Mon Mar 12 05:18:16 2012 UTC revision 3869 by gross, Thu Mar 15 06:21:42 2012 UTC
# Line 1079  class VariationalProblem(object): Line 1079  class VariationalProblem(object):
1079          if self._parameter == None:          if self._parameter == None:
1080              U=u              U=u
1081          else:          else:
1082              self._lagrangean=Symbol("lambda%s"%id(self), self._unknown.getShape())              self._lagrangean=Symbol("lambda%s"%id(self), self._unknown.getShape(), dim=self.dim)
1083              U=concatenateRow(self._parameter, self._unknown, self._lagrangean)              U=concatenateRow(self._parameter, self._unknown, self._lagrangean)
1084          self.__PDE=NonlinearPDE(domain, u=U, debug=debug)          self.__PDE=NonlinearPDE(domain, u=U, debug=debug)
1085    
# Line 1264  class VariationalProblem(object): Line 1264  class VariationalProblem(object):
1264    
1265          Z=0          Z=0
1266          if self._set_coeffs.has_key(H_key): Z+=self._set_coeffs[H_key]          if self._set_coeffs.has_key(H_key): Z+=self._set_coeffs[H_key]
1267            print self._set_coeffs[X_key]
1268            print util.grad(self._lagrangean)
1269          if self._set_coeffs.has_key(X_key): Z+=util.inner(self._set_coeffs[X_key], util.grad(self._lagrangean))          if self._set_coeffs.has_key(X_key): Z+=util.inner(self._set_coeffs[X_key], util.grad(self._lagrangean))
1270          if self._set_coeffs.has_key(Y_key): Z+=util.inner(self._set_coeffs[Y_key], self._lagrangean)          if self._set_coeffs.has_key(Y_key): Z+=util.inner(self._set_coeffs[Y_key], self._lagrangean)
1271    
# Line 1511  class VariationalProblem(object): Line 1513  class VariationalProblem(object):
1513    
1514          if numParams > 0:          if numParams > 0:
1515              # return parameter, solution, lagrangean multiplier              # return parameter, solution, lagrangean multiplier
1516              return Ui[:numParams], Ui[numParams:numParams+numSol], Ui[numParams+numSol:]              if numParams == 1:
1517                     p=Ui[0]
1518                else:
1519                     p=Ui[:numParams]
1520                if numSol == 1:
1521                     u=Ui[numParams]
1522                     l=Ui[numParams+1]
1523                else:
1524                     u=Ui[numParams:numParams+numSol]
1525                     l= Ui[numParams+numSol:]
1526                return p,u,l
1527          else:          else:
1528              return Ui              return Ui
1529    

Legend:
Removed from v.3868  
changed lines
  Added in v.3869

  ViewVC Help
Powered by ViewVC 1.1.26