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

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

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

revision 1388 by trankine, Fri Jan 11 07:45:58 2008 UTC revision 1407 by gross, Mon Feb 4 06:45:48 2008 UTC
# Line 814  void MeshAdapter::addPDEToRHS( escript:: Line 814  void MeshAdapter::addPDEToRHS( escript::
814  //  //
815  void MeshAdapter::addPDEToTransportProblem(  void MeshAdapter::addPDEToTransportProblem(
816                       TransportProblemAdapter& tp, escript::Data& source, const escript::Data& M,                       TransportProblemAdapter& tp, escript::Data& source, const escript::Data& M,
817                       const escript::Data& A, const escript::Data& B, const escript::Data& C,const  escript::Data& D,const  escript::Data& X,const  escript::Data& Y,                       const escript::Data& A, const escript::Data& B, const escript::Data& C,
818                         const  escript::Data& D,const  escript::Data& X,const  escript::Data& Y,
819                       const escript::Data& d, const escript::Data& y,                       const escript::Data& d, const escript::Data& y,
820                       const escript::Data& d_contact,const escript::Data& y_contact) const                       const escript::Data& d_contact,const escript::Data& y_contact) const
821  {  {
822     DataArrayView::ShapeType shape;     DataArrayView::ShapeType shape;
823     source.expand();     source.expand();
    escript:: Data tmp(0.0,M.getDataPointShape(),tp.getFunctionSpace(),true);  
824     escriptDataC _source=source.getDataC();     escriptDataC _source=source.getDataC();
    escriptDataC _tmp=tmp.getDataC();  
825     escriptDataC _M=M.getDataC();     escriptDataC _M=M.getDataC();
826     escriptDataC _A=A.getDataC();     escriptDataC _A=A.getDataC();
827     escriptDataC _B=B.getDataC();     escriptDataC _B=B.getDataC();
# Line 838  void MeshAdapter::addPDEToTransportProbl Line 837  void MeshAdapter::addPDEToTransportProbl
837     Finley_Mesh* mesh=m_finleyMesh.get();     Finley_Mesh* mesh=m_finleyMesh.get();
838     Paso_FCTransportProblem* _tp = tp.getPaso_FCTransportProblem();     Paso_FCTransportProblem* _tp = tp.getPaso_FCTransportProblem();
839        
840       Finley_Assemble_PDE(mesh->Nodes,mesh->Elements,_tp->mass_matrix, &_source, 0, 0, 0, &_M, 0, 0 );
    Finley_Assemble_LumpedSystem(mesh->Nodes,mesh->Elements,&_tmp, &_M);  
    checkFinleyError();  
    /* add mass matix to lumped mass matrix of transport problem */  
    double* tmp_prt=getSampleData(&_tmp,0);  
    int i;  
    int n=Paso_FCTransportProblem_getTotalNumRows(_tp);  
    #pragma omp parallel for private(i) schedule(static)  
    for (i=0;i<n ;++i) _tp->lumped_mass_matrix[i]+=tmp_prt[i];  
   
    Finley_Assemble_PDE(mesh->Nodes,mesh->Elements,_tp->transport_matrix, &_source, &_A, 0, 0, &_D, &_X, &_Y );  
841     checkFinleyError();     checkFinleyError();
842    
843     Finley_Assemble_PDE(mesh->Nodes,mesh->Elements,_tp->flux_matrix, &_source, 0, &_B, &_C, 0, 0, 0 );     Finley_Assemble_PDE(mesh->Nodes,mesh->Elements,_tp->transport_matrix, &_source, &_A, &_B, &_C, &_D, &_X, &_Y );
844     checkFinleyError();     checkFinleyError();
845    
846     Finley_Assemble_PDE(mesh->Nodes,mesh->FaceElements, _tp->transport_matrix, &_source, 0, 0, 0, &_d, 0, &_y );     Finley_Assemble_PDE(mesh->Nodes,mesh->FaceElements, _tp->transport_matrix, &_source, 0, 0, 0, &_d, 0, &_y );
# Line 1601  SystemMatrixAdapter MeshAdapter::newSyst Line 1590  SystemMatrixAdapter MeshAdapter::newSyst
1590  // creates a TransportProblemAdapter  // creates a TransportProblemAdapter
1591  TransportProblemAdapter MeshAdapter::newTransportProblem(  TransportProblemAdapter MeshAdapter::newTransportProblem(
1592                        const double theta,                        const double theta,
                       const double dt_max,  
1593                        const int blocksize,                        const int blocksize,
1594                        const escript::FunctionSpace& functionspace,                        const escript::FunctionSpace& functionspace,
1595                        const int type) const                        const int type) const
# Line 1624  TransportProblemAdapter MeshAdapter::new Line 1612  TransportProblemAdapter MeshAdapter::new
1612      Paso_SystemMatrixPattern* fsystemMatrixPattern=Finley_getPattern(getFinley_Mesh(),reduceOrder,reduceOrder);      Paso_SystemMatrixPattern* fsystemMatrixPattern=Finley_getPattern(getFinley_Mesh(),reduceOrder,reduceOrder);
1613      checkFinleyError();      checkFinleyError();
1614      Paso_FCTransportProblem* transportProblem;      Paso_FCTransportProblem* transportProblem;
1615      transportProblem=Paso_FCTransportProblem_alloc(theta,dt_max,fsystemMatrixPattern,blocksize);      transportProblem=Paso_FCTransportProblem_alloc(theta,fsystemMatrixPattern,blocksize);
1616      checkPasoError();      checkPasoError();
1617      Paso_SystemMatrixPattern_free(fsystemMatrixPattern);      Paso_SystemMatrixPattern_free(fsystemMatrixPattern);
1618      return TransportProblemAdapter(transportProblem,theta,dt_max,blocksize,functionspace);      return TransportProblemAdapter(transportProblem,theta,blocksize,functionspace);
1619  }  }
1620    
1621  //  //

Legend:
Removed from v.1388  
changed lines
  Added in v.1407

  ViewVC Help
Powered by ViewVC 1.1.26