/[escript]/branches/diaplayground/ripley/src/Brick.cpp
ViewVC logotype

Diff of /branches/diaplayground/ripley/src/Brick.cpp

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

revision 4816 by caltinay, Fri Mar 28 06:16:02 2014 UTC revision 4817 by caltinay, Fri Mar 28 08:04:09 2014 UTC
# Line 204  Brick::Brick(int n0, int n1, int n2, dou Line 204  Brick::Brick(int n0, int n1, int n2, dou
204  Brick::~Brick()  Brick::~Brick()
205  {  {
206      paso::SystemMatrixPattern_free(m_pattern);      paso::SystemMatrixPattern_free(m_pattern);
     paso::Connector_free(m_connector);  
207      delete assembler;      delete assembler;
208  }  }
209    
# Line 2050  void Brick::nodesToDOF(escript::Data& ou Line 2049  void Brick::nodesToDOF(escript::Data& ou
2049  void Brick::dofToNodes(escript::Data& out, const escript::Data& in) const  void Brick::dofToNodes(escript::Data& out, const escript::Data& in) const
2050  {  {
2051      const dim_t numComp = in.getDataPointSize();      const dim_t numComp = in.getDataPointSize();
2052      paso::Coupler* coupler = paso::Coupler_alloc(m_connector, numComp);      paso::Coupler_ptr coupler(new paso::Coupler(m_connector, numComp));
2053      // expand data object if necessary to be able to grab the whole data      // expand data object if necessary to be able to grab the whole data
2054      const_cast<escript::Data*>(&in)->expand();      const_cast<escript::Data*>(&in)->expand();
2055      paso::Coupler_startCollect(coupler, in.getSampleDataRO(0));      coupler->startCollect(in.getSampleDataRO(0));
2056    
2057      const dim_t numDOF = getNumDOF();      const dim_t numDOF = getNumDOF();
2058      out.requireWrite();      out.requireWrite();
2059      const double* buffer = paso::Coupler_finishCollect(coupler);      const double* buffer = coupler->finishCollect();
2060    
2061  #pragma omp parallel for  #pragma omp parallel for
2062      for (index_t i=0; i<getNumNodes(); i++) {      for (index_t i=0; i<getNumNodes(); i++) {
# Line 2066  void Brick::dofToNodes(escript::Data& ou Line 2065  void Brick::dofToNodes(escript::Data& ou
2065                  : &buffer[(m_dofMap[i]-numDOF)*numComp]);                  : &buffer[(m_dofMap[i]-numDOF)*numComp]);
2066          copy(src, src+numComp, out.getSampleDataRW(i));          copy(src, src+numComp, out.getSampleDataRW(i));
2067      }      }
     paso::Coupler_free(coupler);  
2068  }  }
2069    
2070  //private  //private
# Line 2569  void Brick::createPattern() Line 2567  void Brick::createPattern()
2567      paso::SharedComponents_ptr rcv_shcomp(new paso::SharedComponents(      paso::SharedComponents_ptr rcv_shcomp(new paso::SharedComponents(
2568              numDOF, neighbour.size(), &neighbour[0], &recvShared[0],              numDOF, neighbour.size(), &neighbour[0], &recvShared[0],
2569              &offsetInShared[0], 1, 0, m_mpiInfo));              &offsetInShared[0], 1, 0, m_mpiInfo));
2570      m_connector = paso::Connector_alloc(snd_shcomp, rcv_shcomp);      m_connector.reset(new paso::Connector(snd_shcomp, rcv_shcomp));
2571    
2572      // create main and couple blocks      // create main and couple blocks
2573      paso::Pattern *mainPattern = createMainPattern();      paso::Pattern *mainPattern = createMainPattern();

Legend:
Removed from v.4816  
changed lines
  Added in v.4817

  ViewVC Help
Powered by ViewVC 1.1.26