/[escript]/trunk/finley/src/CPPAdapter/TransportProblemAdapter.cpp
ViewVC logotype

Diff of /trunk/finley/src/CPPAdapter/TransportProblemAdapter.cpp

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

revision 2196 by gross, Wed Oct 8 03:03:37 2008 UTC revision 2197 by gross, Thu Jan 8 05:49:16 2009 UTC
# Line 89  void TransportProblemAdapter::resetTrans Line 89  void TransportProblemAdapter::resetTrans
89     Paso_FCTransportProblem_reset(transp);     Paso_FCTransportProblem_reset(transp);
90     checkPasoError();     checkPasoError();
91  }  }
92  void TransportProblemAdapter::copyConstraint(escript::Data& source, escript::Data& q, escript::Data& r) const  void TransportProblemAdapter::copyConstraint(escript::Data& source, escript::Data& q, escript::Data& r, const double factor) const
93  {  {
94      if ( q.getDataPointSize()  != getBlockSize()) {      if ( q.getDataPointSize()  != getBlockSize()) {
95       throw FinleyAdapterException("copyConstraint : block size does not match the number of components of constraint mask.");       throw FinleyAdapterException("copyConstraint : block size does not match the number of components of constraint mask.");
# Line 111  void TransportProblemAdapter::copyConstr Line 111  void TransportProblemAdapter::copyConstr
111      r2.copyWithMask(r,q);      r2.copyWithMask(r,q);
112    
113      /* source-=transp->mass_matrix*r2 */      /* source-=transp->mass_matrix*r2 */
     double* r2_dp=r2.getSampleData(0);  
     double* source_dp=source.getSampleData(0);  
114      r2.expand();      r2.expand();
115      source.expand();      source.expand();
     Paso_SystemMatrix_MatrixVector(-1., transp->mass_matrix, r2_dp, 1., source_dp);  
     checkPasoError();  
   
     /* insert 0 rows and cols into transport matrix */  
116      q.expand();      q.expand();
117        double* r2_dp=r2.getSampleData(0);
118        double* source_dp=source.getSampleData(0);
119      double* q_dp=q.getSampleData(0);      double* q_dp=q.getSampleData(0);
     Paso_SystemMatrix_nullifyRows(transp->transport_matrix,q_dp, 0.);  
     checkPasoError();  
   
     /* insert 0 rows amd 1 in main diagonal into mass matrix */  
     Paso_SystemMatrix_nullifyRowsAndCols(transp->mass_matrix,q_dp,q_dp,1.);  
     checkPasoError();  
120    
121      source.copyWithMask(escript::Data(0.,q.getDataPointShape(),q.getFunctionSpace()),q);      if (false) {
122           cout << "v1\n";
123           Paso_SystemMatrix_MatrixVector(-1., transp->mass_matrix, r2_dp, 1., source_dp);
124           checkPasoError();
125    
126           /* insert 0 rows into transport matrix */
127           Paso_SystemMatrix_nullifyRows(transp->transport_matrix,q_dp, 0.);
128           checkPasoError();
129    
130           /* insert 0 rows amd 1 in main diagonal into mass matrix */
131           Paso_SystemMatrix_nullifyRowsAndCols(transp->mass_matrix,q_dp,q_dp,1.);
132           checkPasoError();
133    
134           source.copyWithMask(escript::Data(0.,q.getDataPointShape(),q.getFunctionSpace()),q);
135       } else {
136           Paso_FCTransportProblem_setUpConstraint(transp, q_dp, factor);
137           checkPasoError();
138           Paso_FCTransportProblem_insertConstraint(transp,r2_dp, source_dp);
139           checkPasoError();
140       }
141  }  }
142    
143  void TransportProblemAdapter::copyInitialValue(escript::Data& u) const  void TransportProblemAdapter::copyInitialValue(escript::Data& u) const

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

  ViewVC Help
Powered by ViewVC 1.1.26