/[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 2842 by caltinay, Thu Jan 14 05:42:02 2010 UTC revision 2987 by gross, Tue Mar 16 01:32:43 2010 UTC
# Line 1  Line 1 
1    
2  /*******************************************************  /*******************************************************
3  *  *
4  * Copyright (c) 2003-2009 by University of Queensland  * Copyright (c) 2003-2010 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 220  void MeshAdapter::dump(const string& fil Line 220  void MeshAdapter::dump(const string& fil
220        throw DataException(msgPrefix+"add_att(Name)");        throw DataException(msgPrefix+"add_att(Name)");
221     if (!dataFile.add_att("numDim",numDim) )     if (!dataFile.add_att("numDim",numDim) )
222        throw DataException(msgPrefix+"add_att(order)");        throw DataException(msgPrefix+"add_att(order)");
223     if (!dataFile.add_att("order",mesh->order) )     if (!dataFile.add_att("order",mesh->integrationOrder) )
224        throw DataException(msgPrefix+"add_att(order)");        throw DataException(msgPrefix+"add_att(order)");
225     if (!dataFile.add_att("reduced_order",mesh->reduced_order) )     if (!dataFile.add_att("reduced_order",mesh->reducedIntegrationOrder) )
226        throw DataException(msgPrefix+"add_att(reduced_order)");        throw DataException(msgPrefix+"add_att(reduced_order)");
227     if (!dataFile.add_att("numNodes",numNodes) )     if (!dataFile.add_att("numNodes",numNodes) )
228        throw DataException(msgPrefix+"add_att(numNodes)");        throw DataException(msgPrefix+"add_att(numNodes)");
# Line 865  void MeshAdapter::addPDEToTransportProbl Line 865  void MeshAdapter::addPDEToTransportProbl
865     escriptDataC _y_contact=y_contact.getDataC();     escriptDataC _y_contact=y_contact.getDataC();
866    
867     Finley_Mesh* mesh=m_finleyMesh.get();     Finley_Mesh* mesh=m_finleyMesh.get();
868     Paso_FCTransportProblem* _tp = tp.getPaso_FCTransportProblem();     Paso_TransportProblem* _tp = tp.getPaso_TransportProblem();
869    
870     Finley_Assemble_PDE(mesh->Nodes,mesh->Elements,_tp->mass_matrix, &_source, 0, 0, 0, &_M, 0, 0 );     Finley_Assemble_PDE(mesh->Nodes,mesh->Elements,_tp->mass_matrix, &_source, 0, 0, 0, &_M, 0, 0 );
871     checkFinleyError();     checkFinleyError();
# Line 1638  SystemMatrixAdapter MeshAdapter::newSyst Line 1638  SystemMatrixAdapter MeshAdapter::newSyst
1638  // creates a TransportProblemAdapter  // creates a TransportProblemAdapter
1639  //  //
1640  TransportProblemAdapter MeshAdapter::newTransportProblem(  TransportProblemAdapter MeshAdapter::newTransportProblem(
1641                                                           const double theta,                                                           const bool useBackwardEuler,
1642                                                           const int blocksize,                                                           const int blocksize,
1643                                                           const escript::FunctionSpace& functionspace,                                                           const escript::FunctionSpace& functionspace,
1644                                                           const int type) const                                                           const int type) const
# Line 1660  TransportProblemAdapter MeshAdapter::new Line 1660  TransportProblemAdapter MeshAdapter::new
1660    
1661     Paso_SystemMatrixPattern* fsystemMatrixPattern=Finley_getPattern(getFinley_Mesh(),reduceOrder,reduceOrder);     Paso_SystemMatrixPattern* fsystemMatrixPattern=Finley_getPattern(getFinley_Mesh(),reduceOrder,reduceOrder);
1662     checkFinleyError();     checkFinleyError();
1663     Paso_FCTransportProblem* transportProblem;     Paso_TransportProblem* transportProblem;
1664     transportProblem=Paso_FCTransportProblem_alloc(theta,fsystemMatrixPattern,blocksize);     transportProblem=Paso_TransportProblem_alloc(useBackwardEuler,fsystemMatrixPattern,blocksize);
1665     checkPasoError();     checkPasoError();
1666     Paso_SystemMatrixPattern_free(fsystemMatrixPattern);     Paso_SystemMatrixPattern_free(fsystemMatrixPattern);
1667     return TransportProblemAdapter(transportProblem,theta,blocksize,functionspace);     return TransportProblemAdapter(transportProblem,useBackwardEuler,blocksize,functionspace);
1668  }  }
1669    
1670  //  //
# Line 1727  MeshAdapter::commonFunctionSpace(const v Line 1727  MeshAdapter::commonFunctionSpace(const v
1727     For classes with multiple members (eg class 2) we have vars to record if there is at least one instance.     For classes with multiple members (eg class 2) we have vars to record if there is at least one instance.
1728     eg hasnodes is true if we have at least one instance of Nodes.     eg hasnodes is true if we have at least one instance of Nodes.
1729     */     */
1730      if (fs.size()==0)      if (fs.empty())
1731      {      {
1732          return false;          return false;
1733      }      }
# Line 2030  int MeshAdapter::getSystemMatrixTypeId(c Line 2030  int MeshAdapter::getSystemMatrixTypeId(c
2030  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
2031  {  {
2032     Finley_Mesh* mesh=m_finleyMesh.get();     Finley_Mesh* mesh=m_finleyMesh.get();
2033     int out=Paso_FCTransportProblem_getTypeId(SystemMatrixAdapter::mapOptionToPaso(solver),SystemMatrixAdapter::mapOptionToPaso(preconditioner), SystemMatrixAdapter::mapOptionToPaso(package),symmetry?1:0, mesh->MPIInfo);     int out=Paso_TransportProblem_getTypeId(SystemMatrixAdapter::mapOptionToPaso(solver),SystemMatrixAdapter::mapOptionToPaso(preconditioner), SystemMatrixAdapter::mapOptionToPaso(package),symmetry?1:0, mesh->MPIInfo);
2034     checkPasoError();     checkPasoError();
2035     return out;     return out;
2036  }  }
# Line 2360  AbstractDomain::StatusType MeshAdapter:: Line 2360  AbstractDomain::StatusType MeshAdapter::
2360    return Finley_Mesh_getStatus(mesh);    return Finley_Mesh_getStatus(mesh);
2361  }  }
2362    
2363    int MeshAdapter::getApproximationOrder(const int functionSpaceCode) const
2364    {
2365      
2366      Finley_Mesh* mesh=m_finleyMesh.get();
2367      int order =-1;
2368      switch(functionSpaceCode) {
2369       case(Nodes):
2370       case(DegreesOfFreedom):
2371              order=mesh->approximationOrder;
2372              break;
2373       case(ReducedNodes):
2374       case(ReducedDegreesOfFreedom):
2375              order=mesh->reducedApproximationOrder;
2376              break;
2377       case(Elements):
2378       case(FaceElements):
2379       case(Points):
2380       case(ContactElementsZero):
2381       case(ContactElementsOne):
2382              order=mesh->integrationOrder;
2383              break;
2384       case(ReducedElements):
2385       case(ReducedFaceElements):
2386       case(ReducedContactElementsZero):
2387       case(ReducedContactElementsOne):
2388              order=mesh->reducedIntegrationOrder;
2389              break;
2390       default:
2391          stringstream temp;
2392          temp << "Error - Finley does not know anything about function space type " << functionSpaceCode;
2393          throw FinleyAdapterException(temp.str());
2394      }
2395      return order;
2396    }
2397    
2398    ReferenceElementSetWrapper::ReferenceElementSetWrapper(ElementTypeId id, index_t order, index_t reducedOrder)
2399    {
2400      m_refSet = Finley_ReferenceElementSet_alloc(id, order, reducedOrder);
2401    }
2402    
2403    ReferenceElementSetWrapper::~ReferenceElementSetWrapper()
2404    {
2405      Finley_ReferenceElementSet_dealloc(m_refSet);
2406    }
2407    
2408  }  // end of namespace  }  // end of namespace

Legend:
Removed from v.2842  
changed lines
  Added in v.2987

  ViewVC Help
Powered by ViewVC 1.1.26