/[escript]/branches/symbolic_from_3470/escript/src/AbstractTransportProblem.cpp
ViewVC logotype

Diff of /branches/symbolic_from_3470/escript/src/AbstractTransportProblem.cpp

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

revision 3867 by caltinay, Thu Feb 9 00:27:46 2012 UTC revision 3868 by caltinay, Thu Mar 15 06:07:08 2012 UTC
# Line 67  Data AbstractTransportProblem::solve(Dat Line 67  Data AbstractTransportProblem::solve(Dat
67       return out;       return out;
68  }  }
69    
70  void AbstractTransportProblem::insertConstraint(Data& source, Data& q, Data& r, const double factor) const  void AbstractTransportProblem::insertConstraint(Data& source, Data& q, Data& r) const
71  {  {
      if (factor <= 0.)  
           throw TransportProblemException("Error - weighting factor must be positive.");  
72       source.expand();       source.expand();
73       if (isEmpty())       if (isEmpty())
74            throw TransportProblemException("Error - transport problem is empty.");            throw TransportProblemException("Error - transport problem is empty.");
# Line 85  void AbstractTransportProblem::insertCon Line 83  void AbstractTransportProblem::insertCon
83    
84       if (r.isEmpty()) {       if (r.isEmpty()) {
85            Data r2=Data(0.,q.getDataPointShape(),getFunctionSpace());            Data r2=Data(0.,q.getDataPointShape(),getFunctionSpace());
86            copyConstraint(source,q2,r2, factor);            copyConstraint(source,q2,r2);
87       } else {       } else {
88          if (((getBlockSize()==1) && (r.getDataPointRank()>0)) || (r.getDataPointRank()>1))          if (((getBlockSize()==1) && (r.getDataPointRank()>0)) || (r.getDataPointRank()>1))
89               throw TransportProblemException("Error - illegal rank of constraint value.");               throw TransportProblemException("Error - illegal rank of constraint value.");
90          if (r.getDataPointSize()!=getBlockSize())          if (r.getDataPointSize()!=getBlockSize())
91               throw TransportProblemException("Error - block size of transport problem and constraint value don't match.");               throw TransportProblemException("Error - block size of transport problem and constraint value don't match.");
92          Data r2=Data(r,getFunctionSpace());          Data r2=Data(r,getFunctionSpace());
93          copyConstraint(source,q2,r2, factor);          copyConstraint(source,q2,r2);
94       }       }
95  }  }
96    
97  void AbstractTransportProblem::copyConstraint(Data& source, Data& q, Data& r, const double factor) const  void AbstractTransportProblem::copyConstraint(Data& source, Data& q, Data& r) const
98  {  {
99      throw TransportProblemException("Error - copyConstraint is not available");      throw TransportProblemException("Error - copyConstraint is not available");
100  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.26