/[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 1872 by jfenwick, Mon Oct 13 00:18:55 2008 UTC revision 2100 by gross, Wed Nov 26 08:13:00 2008 UTC
# Line 23  Line 23 
23  #include "paso/Paso_MPI.h"  #include "paso/Paso_MPI.h"
24  #endif  #endif
25  extern "C" {  extern "C" {
26  #include "escript/blocktimer.h"  #include "esysUtils/blocktimer.h"
27  }  }
28  #include <vector>  #include <vector>
29    
# Line 86  int MeshAdapter::getMPIRank() const Line 86  int MeshAdapter::getMPIRank() const
86  {  {
87     return m_finleyMesh.get()->MPIInfo->rank;     return m_finleyMesh.get()->MPIInfo->rank;
88  }  }
89    void MeshAdapter::MPIBarrier() const
90    {
91    #ifdef PASO_MPI
92       MPI_Barrier(m_finleyMesh.get()->MPIInfo->comm);
93    #endif
94       return;
95    }
96    bool MeshAdapter::onMasterProcessor() const
97    {
98       return m_finleyMesh.get()->MPIInfo->rank == 0;
99    }
100    
101    
102  Finley_Mesh* MeshAdapter::getFinley_Mesh() const {  Finley_Mesh* MeshAdapter::getFinley_Mesh() const {
# Line 109  void MeshAdapter::Print_Mesh_Info(const Line 120  void MeshAdapter::Print_Mesh_Info(const
120  void MeshAdapter::dump(const std::string& fileName) const  void MeshAdapter::dump(const std::string& fileName) const
121  {  {
122  #ifdef USE_NETCDF  #ifdef USE_NETCDF
123     const NcDim* ncdims[12];     const NcDim* ncdims[12] = {NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL};
124     NcVar *ids;     NcVar *ids;
125     int *int_ptr;     int *int_ptr;
126     Finley_Mesh *mesh = m_finleyMesh.get();     Finley_Mesh *mesh = m_finleyMesh.get();
# Line 635  int MeshAdapter::getDiracDeltaFunctionCo Line 646  int MeshAdapter::getDiracDeltaFunctionCo
646  //  //
647  int MeshAdapter::getDim() const  int MeshAdapter::getDim() const
648  {  {
649     int numDim=Finley_Mesh_getDim(m_finleyMesh.get());     Finley_Mesh* mesh=m_finleyMesh.get();
650       int numDim=Finley_Mesh_getDim(mesh);
651     checkFinleyError();     checkFinleyError();
652     return numDim;     return numDim;
653  }  }
# Line 1224  void MeshAdapter::setToNormal(escript::D Line 1236  void MeshAdapter::setToNormal(escript::D
1236  //  //
1237  void MeshAdapter::interpolateACross(escript::Data& target,const escript::Data& source) const  void MeshAdapter::interpolateACross(escript::Data& target,const escript::Data& source) const
1238  {  {
1239     const MeshAdapter& targetDomain=dynamic_cast<const MeshAdapter&>(*(target.getFunctionSpace().getDomain()));     const_Domain_ptr targetDomain_p=target.getFunctionSpace().getDomain();
1240     if (targetDomain!=*this)     const MeshAdapter* targetDomain=dynamic_cast<const MeshAdapter*>(targetDomain_p.get());
1241       if (targetDomain!=this)
1242        throw FinleyAdapterException("Error - Illegal domain of interpolation target");        throw FinleyAdapterException("Error - Illegal domain of interpolation target");
1243    
1244     throw FinleyAdapterException("Error - Finley does not allow interpolation across domains yet.");     throw FinleyAdapterException("Error - Finley does not allow interpolation across domains yet.");

Legend:
Removed from v.1872  
changed lines
  Added in v.2100

  ViewVC Help
Powered by ViewVC 1.1.26