/[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 3675 by jfenwick, Thu Nov 17 00:53:38 2011 UTC revision 3911 by jfenwick, Thu Jun 14 01:01:03 2012 UTC
# Line 1  Line 1 
1    
2  /*******************************************************  /*******************************************************
3  *  *
4  * Copyright (c) 2003-2010 by University of Queensland  * Copyright (c) 2003-2012 by University of Queensland
5  * Earth Systems Science Computational Center (ESSCC)  * Earth Systems Science Computational Center (ESSCC)
6  * http://www.uq.edu.au/esscc  * http://www.uq.edu.au/esscc
7  *  *
# Line 779  void MeshAdapter::addPDEToSystem( Line 779  void MeshAdapter::addPDEToSystem(
779     SystemMatrixAdapter* smat=dynamic_cast<SystemMatrixAdapter*>(&mat);     SystemMatrixAdapter* smat=dynamic_cast<SystemMatrixAdapter*>(&mat);
780     if (smat==0)     if (smat==0)
781     {     {
782      throw FinleyAdapterException("finley only supports its own system matrices.");      throw FinleyAdapterException("finley only supports Paso system matrices.");
783     }     }
784     escriptDataC _rhs=rhs.getDataC();     escriptDataC _rhs=rhs.getDataC();
785     escriptDataC _A  =A.getDataC();     escriptDataC _A  =A.getDataC();
# Line 874  void MeshAdapter::addPDEToTransportProbl Line 874  void MeshAdapter::addPDEToTransportProbl
874                                             const escript::Data& d_contact,const escript::Data& y_contact,                                             const escript::Data& d_contact,const escript::Data& y_contact,
875                                             const escript::Data& d_dirac, const escript::Data& y_dirac) const                                             const escript::Data& d_dirac, const escript::Data& y_dirac) const
876  {  {
877     paso::TransportProblemAdapter* tpa=dynamic_cast<paso::TransportProblemAdapter*>(&tp);     TransportProblemAdapter* tpa=dynamic_cast<TransportProblemAdapter*>(&tp);
878     if (tpa==0)     if (tpa==0)
879     {     {
880      throw FinleyAdapterException("finley only supports its own transport problems.");      throw FinleyAdapterException("finley only supports Paso transport problems.");
881     }     }
882    
883    
# Line 1665  ASM_ptr MeshAdapter::newSystemMatrix( Line 1665  ASM_ptr MeshAdapter::newSystemMatrix(
1665  // creates a TransportProblemAdapter  // creates a TransportProblemAdapter
1666  //  //
1667  ATP_ptr MeshAdapter::newTransportProblem(  ATP_ptr MeshAdapter::newTransportProblem(
                                                          const bool useBackwardEuler,  
1668                                                           const int blocksize,                                                           const int blocksize,
1669                                                           const escript::FunctionSpace& functionspace,                                                           const escript::FunctionSpace& functionspace,
1670                                                           const int type) const                                                           const int type) const
# Line 1688  ATP_ptr MeshAdapter::newTransportProblem Line 1687  ATP_ptr MeshAdapter::newTransportProblem
1687     Paso_SystemMatrixPattern* fsystemMatrixPattern=Finley_getPattern(getFinley_Mesh(),reduceOrder,reduceOrder);     Paso_SystemMatrixPattern* fsystemMatrixPattern=Finley_getPattern(getFinley_Mesh(),reduceOrder,reduceOrder);
1688     checkFinleyError();     checkFinleyError();
1689     Paso_TransportProblem* transportProblem;     Paso_TransportProblem* transportProblem;
1690     transportProblem=Paso_TransportProblem_alloc(useBackwardEuler,fsystemMatrixPattern,blocksize);     transportProblem=Paso_TransportProblem_alloc(fsystemMatrixPattern,blocksize);
1691     checkPasoError();     checkPasoError();
1692     Paso_SystemMatrixPattern_free(fsystemMatrixPattern);     Paso_SystemMatrixPattern_free(fsystemMatrixPattern);
1693     TransportProblemAdapter* tpa=new TransportProblemAdapter(transportProblem,useBackwardEuler,blocksize,functionspace);     TransportProblemAdapter* tpa=new TransportProblemAdapter(transportProblem,blocksize,functionspace);
1694     return ATP_ptr(tpa);     return ATP_ptr(tpa);
1695  //   return TransportProblemAdapter(transportProblem,useBackwardEuler,blocksize,functionspace);  //   return TransportProblemAdapter(transportProblem, blocksize,functionspace);
1696  }  }
1697    
1698  //  //
# Line 2052  bool MeshAdapter::operator!=(const Abstr Line 2051  bool MeshAdapter::operator!=(const Abstr
2051  int MeshAdapter::getSystemMatrixTypeId(const int solver, const int preconditioner, const int package, const bool symmetry) const  int MeshAdapter::getSystemMatrixTypeId(const int solver, const int preconditioner, const int package, const bool symmetry) const
2052  {  {
2053     Finley_Mesh* mesh=m_finleyMesh.get();     Finley_Mesh* mesh=m_finleyMesh.get();
2054     int out=Paso_SystemMatrix_getSystemMatrixTypeId(SystemMatrixAdapter::mapOptionToPaso(solver),SystemMatrixAdapter::mapOptionToPaso(preconditioner), SystemMatrixAdapter::mapOptionToPaso(package),symmetry?1:0, mesh->MPIInfo);     return SystemMatrixAdapter::getSystemMatrixTypeId(solver, preconditioner,
2055     checkPasoError();             package, symmetry, mesh->MPIInfo);
    return out;  
2056  }  }
2057    
2058  int MeshAdapter::getTransportTypeId(const int solver, const int preconditioner, const int package, const bool symmetry) const  int MeshAdapter::getTransportTypeId(const int solver, const int preconditioner, const int package, const bool symmetry) const
2059  {  {
2060     Finley_Mesh* mesh=m_finleyMesh.get();     Finley_Mesh* mesh=m_finleyMesh.get();
2061     int out=Paso_TransportProblem_getTypeId(SystemMatrixAdapter::mapOptionToPaso(solver),SystemMatrixAdapter::mapOptionToPaso(preconditioner), SystemMatrixAdapter::mapOptionToPaso(package),symmetry?1:0, mesh->MPIInfo);     return TransportProblemAdapter::getTransportTypeId(solver, preconditioner,
2062     checkPasoError();             package, symmetry, mesh->MPIInfo);
    return out;  
2063  }  }
2064    
2065  escript::Data MeshAdapter::getX() const  escript::Data MeshAdapter::getX() const
# Line 2242  void MeshAdapter::setTagMap(const string Line 2240  void MeshAdapter::setTagMap(const string
2240  {  {
2241     Finley_Mesh* mesh=m_finleyMesh.get();     Finley_Mesh* mesh=m_finleyMesh.get();
2242     Finley_Mesh_addTagMap(mesh, name.c_str(),tag);     Finley_Mesh_addTagMap(mesh, name.c_str(),tag);
2243     checkPasoError();     checkFinleyError();
2244     // throwStandardException("MeshAdapter::set TagMap is not implemented.");     // throwStandardException("MeshAdapter::set TagMap is not implemented.");
2245  }  }
2246    
# Line 2251  int MeshAdapter::getTag(const string& na Line 2249  int MeshAdapter::getTag(const string& na
2249     Finley_Mesh* mesh=m_finleyMesh.get();     Finley_Mesh* mesh=m_finleyMesh.get();
2250     int tag=0;     int tag=0;
2251     tag=Finley_Mesh_getTag(mesh, name.c_str());     tag=Finley_Mesh_getTag(mesh, name.c_str());
2252     checkPasoError();     checkFinleyError();
2253     // throwStandardException("MeshAdapter::getTag is not implemented.");     // throwStandardException("MeshAdapter::getTag is not implemented.");
2254     return tag;     return tag;
2255  }  }
# Line 2466  void MeshAdapter:: addDiracPoints(const Line 2464  void MeshAdapter:: addDiracPoints(const
2464        }        }
2465                
2466        Finley_Mesh_addPoints(mesh, numPoints, points_ptr, tags_ptr);        Finley_Mesh_addPoints(mesh, numPoints, points_ptr, tags_ptr);
2467        checkPasoError();        checkFinleyError();
2468                
2469        TMPMEMFREE(points_ptr);        TMPMEMFREE(points_ptr);
2470        TMPMEMFREE(tags_ptr);        TMPMEMFREE(tags_ptr);

Legend:
Removed from v.3675  
changed lines
  Added in v.3911

  ViewVC Help
Powered by ViewVC 1.1.26