/[escript]/trunk/escript/src/AbstractTransportProblem.cpp
ViewVC logotype

Diff of /trunk/escript/src/AbstractTransportProblem.cpp

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

revision 2196 by jfenwick, Thu Nov 6 03:54:35 2008 UTC revision 2197 by gross, Thu Jan 8 05:49:16 2009 UTC
# Line 81  void AbstractTransportProblem::setInitia Line 81  void AbstractTransportProblem::setInitia
81       Data u2=Data(u,getFunctionSpace());       Data u2=Data(u,getFunctionSpace());
82       copyInitialValue(u2);       copyInitialValue(u2);
83  }  }
84  void AbstractTransportProblem::insertConstraint(Data& source, Data& q, Data& r) const  void AbstractTransportProblem::insertConstraint(Data& source, Data& q, Data& r, const double factor) const
85  {  {
86         if (factor <= 0.)
87              throw TransportProblemException("Error - weighting factor must be positive.");
88       source.expand();       source.expand();
89       if (isEmpty())       if (isEmpty())
90            throw TransportProblemException("Error - transport problem is empty.");            throw TransportProblemException("Error - transport problem is empty.");
# Line 97  void AbstractTransportProblem::insertCon Line 99  void AbstractTransportProblem::insertCon
99    
100       if (r.isEmpty()) {       if (r.isEmpty()) {
101            Data r2=Data(0.,q.getDataPointShape(),getFunctionSpace());            Data r2=Data(0.,q.getDataPointShape(),getFunctionSpace());
102            copyConstraint(source,q2,r2);            copyConstraint(source,q2,r2, factor);
103       } else {       } else {
104          if (((getBlockSize()==1) && (r.getDataPointRank()>0)) || (r.getDataPointRank()>1))          if (((getBlockSize()==1) && (r.getDataPointRank()>0)) || (r.getDataPointRank()>1))
105               throw TransportProblemException("Error - illegal rank of constraint value.");               throw TransportProblemException("Error - illegal rank of constraint value.");
106          if (r.getDataPointSize()!=getBlockSize())          if (r.getDataPointSize()!=getBlockSize())
107               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.");
108          Data r2=Data(r,getFunctionSpace());          Data r2=Data(r,getFunctionSpace());
109          copyConstraint(source,q2,r2);          copyConstraint(source,q2,r2, factor);
110       }       }
111  }  }
112    
113  void AbstractTransportProblem::copyConstraint(Data& source, Data& q, Data& r) const  void AbstractTransportProblem::copyConstraint(Data& source, Data& q, Data& r, const double factor) const
114  {  {
115      throw TransportProblemException("Error - copyConstraint is not available");      throw TransportProblemException("Error - copyConstraint is not available");
116  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.26