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

Diff of /branches/diaplayground/finley/src/CPPAdapter/MeshAdapter.cpp

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

revision 1366 by gross, Tue Dec 18 05:49:17 2007 UTC revision 1370 by gross, Wed Jan 2 09:21:43 2008 UTC
# Line 809  void MeshAdapter::addPDEToRHS( escript:: Line 809  void MeshAdapter::addPDEToRHS( escript::
809     Finley_Assemble_PDE(mesh->Nodes,mesh->ContactElements, 0, &_rhs , 0, 0, 0, 0, 0, &_y_contact );     Finley_Assemble_PDE(mesh->Nodes,mesh->ContactElements, 0, &_rhs , 0, 0, 0, 0, 0, &_y_contact );
810     checkFinleyError();     checkFinleyError();
811  }  }
812    //
813    // adds PDE of second order into a transport problem
814    //
815    void MeshAdapter::addPDEToTransportProblem(
816                         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,
818                         const escript::Data& d, const escript::Data& y,
819                         const escript::Data& d_contact,const escript::Data& y_contact) const
820    {
821       DataArrayView::ShapeType shape;
822       source.expand();
823       escript:: Data tmp(0.0,M.getDataPointShape(),tp.getFunctionSpace(),true);
824       escriptDataC _source=source.getDataC();
825       escriptDataC _tmp=tmp.getDataC();
826       escriptDataC _M=M.getDataC();
827       escriptDataC _A=A.getDataC();
828       escriptDataC _B=B.getDataC();
829       escriptDataC _C=C.getDataC();
830       escriptDataC _D=D.getDataC();
831       escriptDataC _X=X.getDataC();
832       escriptDataC _Y=Y.getDataC();
833       escriptDataC _d=d.getDataC();
834       escriptDataC _y=y.getDataC();
835       escriptDataC _d_contact=d_contact.getDataC();
836       escriptDataC _y_contact=y_contact.getDataC();
837    
838       Finley_Mesh* mesh=m_finleyMesh.get();
839       Paso_FCTransportProblem* _tp = tp.getPaso_FCTransportProblem();
840      
841    
842       Finley_Assemble_LumpedSystem(mesh->Nodes,mesh->Elements,&_tmp, &_M);
843       checkFinleyError();
844       /* add mass matix to lumped mass matrix of transport problem */
845       double* tmp_prt=getSampleData(&_tmp,0);
846       int i;
847       int n=Paso_FCTransportProblem_getTotalNumRows(_tp);
848       #pragma omp parallel for private(i) schedule(static)
849       for (i=0;i<n ;++i) _tp->lumped_mass_matrix[i]+=tmp_prt[i];
850    
851       Finley_Assemble_PDE(mesh->Nodes,mesh->Elements,_tp->transport_matrix, &_source, &_A, 0, 0, &_D, &_X, &_Y );
852       checkFinleyError();
853    
854       Finley_Assemble_PDE(mesh->Nodes,mesh->Elements,_tp->flux_matrix, &_source, 0, &_B, &_C, 0, 0, 0 );
855       checkFinleyError();
856    
857       Finley_Assemble_PDE(mesh->Nodes,mesh->FaceElements, _tp->transport_matrix, &_source, 0, 0, 0, &_d, 0, &_y );
858       checkFinleyError();
859    
860       Finley_Assemble_PDE(mesh->Nodes,mesh->ContactElements, _tp->transport_matrix, &_source , 0, 0, 0, &_d_contact, 0, &_y_contact );
861       checkFinleyError();
862    }
863    
864  //  //
865  // interpolates data between different function spaces:  // interpolates data between different function spaces:

Legend:
Removed from v.1366  
changed lines
  Added in v.1370

  ViewVC Help
Powered by ViewVC 1.1.26