/[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 3675 by jfenwick, Thu Nov 17 00:53:38 2011 UTC revision 3914 by jfenwick, Wed Jun 20 04:51:47 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 1512  void MeshAdapter::setNewX(const escript: Line 1512  void MeshAdapter::setNewX(const escript:
1512         tmp = new_x.getDataC();         tmp = new_x.getDataC();
1513         Finley_Mesh_setCoordinates(mesh,&tmp);         Finley_Mesh_setCoordinates(mesh,&tmp);
1514     } else {     } else {
1515         escript::Data new_x_inter=escript::Data( new_x,  continuousFunction(*this) );         throw FinleyAdapterException("As of version escript3.3 - SetNewX only accepts ContinuousFunction arguments please interpolate.");    
1516    /*       escript::Data new_x_inter=escript::Data( new_x,  continuousFunction(*this) );
1517         tmp = new_x_inter.getDataC();         tmp = new_x_inter.getDataC();
1518         Finley_Mesh_setCoordinates(mesh,&tmp);         Finley_Mesh_setCoordinates(mesh,&tmp);*/
1519     }     }
1520     checkFinleyError();     checkFinleyError();
1521  }  }
# Line 1665  ASM_ptr MeshAdapter::newSystemMatrix( Line 1666  ASM_ptr MeshAdapter::newSystemMatrix(
1666  // creates a TransportProblemAdapter  // creates a TransportProblemAdapter
1667  //  //
1668  ATP_ptr MeshAdapter::newTransportProblem(  ATP_ptr MeshAdapter::newTransportProblem(
                                                          const bool useBackwardEuler,  
1669                                                           const int blocksize,                                                           const int blocksize,
1670                                                           const escript::FunctionSpace& functionspace,                                                           const escript::FunctionSpace& functionspace,
1671                                                           const int type) const                                                           const int type) const
# Line 1688  ATP_ptr MeshAdapter::newTransportProblem Line 1688  ATP_ptr MeshAdapter::newTransportProblem
1688     Paso_SystemMatrixPattern* fsystemMatrixPattern=Finley_getPattern(getFinley_Mesh(),reduceOrder,reduceOrder);     Paso_SystemMatrixPattern* fsystemMatrixPattern=Finley_getPattern(getFinley_Mesh(),reduceOrder,reduceOrder);
1689     checkFinleyError();     checkFinleyError();
1690     Paso_TransportProblem* transportProblem;     Paso_TransportProblem* transportProblem;
1691     transportProblem=Paso_TransportProblem_alloc(useBackwardEuler,fsystemMatrixPattern,blocksize);     transportProblem=Paso_TransportProblem_alloc(fsystemMatrixPattern,blocksize);
1692     checkPasoError();     checkPasoError();
1693     Paso_SystemMatrixPattern_free(fsystemMatrixPattern);     Paso_SystemMatrixPattern_free(fsystemMatrixPattern);
1694     TransportProblemAdapter* tpa=new TransportProblemAdapter(transportProblem,useBackwardEuler,blocksize,functionspace);     TransportProblemAdapter* tpa=new TransportProblemAdapter(transportProblem,blocksize,functionspace);
1695     return ATP_ptr(tpa);     return ATP_ptr(tpa);
1696  //   return TransportProblemAdapter(transportProblem,useBackwardEuler,blocksize,functionspace);  //   return TransportProblemAdapter(transportProblem, blocksize,functionspace);
1697  }  }
1698    
1699  //  //
# Line 2052  bool MeshAdapter::operator!=(const Abstr Line 2052  bool MeshAdapter::operator!=(const Abstr
2052  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
2053  {  {
2054     Finley_Mesh* mesh=m_finleyMesh.get();     Finley_Mesh* mesh=m_finleyMesh.get();
2055     int out=Paso_SystemMatrix_getSystemMatrixTypeId(SystemMatrixAdapter::mapOptionToPaso(solver),SystemMatrixAdapter::mapOptionToPaso(preconditioner), SystemMatrixAdapter::mapOptionToPaso(package),symmetry?1:0, mesh->MPIInfo);     return SystemMatrixAdapter::getSystemMatrixTypeId(solver, preconditioner,
2056     checkPasoError();             package, symmetry, mesh->MPIInfo);
    return out;  
2057  }  }
2058    
2059  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
2060  {  {
2061     Finley_Mesh* mesh=m_finleyMesh.get();     Finley_Mesh* mesh=m_finleyMesh.get();
2062     int out=Paso_TransportProblem_getTypeId(SystemMatrixAdapter::mapOptionToPaso(solver),SystemMatrixAdapter::mapOptionToPaso(preconditioner), SystemMatrixAdapter::mapOptionToPaso(package),symmetry?1:0, mesh->MPIInfo);     return TransportProblemAdapter::getTransportTypeId(solver, preconditioner,
2063     checkPasoError();             package, symmetry, mesh->MPIInfo);
    return out;  
2064  }  }
2065    
2066  escript::Data MeshAdapter::getX() const  escript::Data MeshAdapter::getX() const
# Line 2242  void MeshAdapter::setTagMap(const string Line 2241  void MeshAdapter::setTagMap(const string
2241  {  {
2242     Finley_Mesh* mesh=m_finleyMesh.get();     Finley_Mesh* mesh=m_finleyMesh.get();
2243     Finley_Mesh_addTagMap(mesh, name.c_str(),tag);     Finley_Mesh_addTagMap(mesh, name.c_str(),tag);
2244     checkPasoError();     checkFinleyError();
2245     // throwStandardException("MeshAdapter::set TagMap is not implemented.");     // throwStandardException("MeshAdapter::set TagMap is not implemented.");
2246  }  }
2247    
# Line 2251  int MeshAdapter::getTag(const string& na Line 2250  int MeshAdapter::getTag(const string& na
2250     Finley_Mesh* mesh=m_finleyMesh.get();     Finley_Mesh* mesh=m_finleyMesh.get();
2251     int tag=0;     int tag=0;
2252     tag=Finley_Mesh_getTag(mesh, name.c_str());     tag=Finley_Mesh_getTag(mesh, name.c_str());
2253     checkPasoError();     checkFinleyError();
2254     // throwStandardException("MeshAdapter::getTag is not implemented.");     // throwStandardException("MeshAdapter::getTag is not implemented.");
2255     return tag;     return tag;
2256  }  }
# Line 2466  void MeshAdapter:: addDiracPoints(const Line 2465  void MeshAdapter:: addDiracPoints(const
2465        }        }
2466                
2467        Finley_Mesh_addPoints(mesh, numPoints, points_ptr, tags_ptr);        Finley_Mesh_addPoints(mesh, numPoints, points_ptr, tags_ptr);
2468        checkPasoError();        checkFinleyError();
2469                
2470        TMPMEMFREE(points_ptr);        TMPMEMFREE(points_ptr);
2471        TMPMEMFREE(tags_ptr);        TMPMEMFREE(tags_ptr);

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

  ViewVC Help
Powered by ViewVC 1.1.26