/[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 4800 by caltinay, Wed Mar 26 01:50:04 2014 UTC revision 4801 by caltinay, Wed Mar 26 03:26:58 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);
207      Paso_Connector_free(m_connector);      paso::Connector_free(m_connector);
208      delete assembler;      delete assembler;
209  }  }
210    
# Line 2050  void Brick::nodesToDOF(escript::Data& ou Line 2050  void Brick::nodesToDOF(escript::Data& ou
2050  void Brick::dofToNodes(escript::Data& out, const escript::Data& in) const  void Brick::dofToNodes(escript::Data& out, const escript::Data& in) const
2051  {  {
2052      const dim_t numComp = in.getDataPointSize();      const dim_t numComp = in.getDataPointSize();
2053      Paso_Coupler* coupler = Paso_Coupler_alloc(m_connector, numComp);      paso::Coupler* coupler = paso::Coupler_alloc(m_connector, numComp);
2054      // 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
2055      const_cast<escript::Data*>(&in)->expand();      const_cast<escript::Data*>(&in)->expand();
2056      Paso_Coupler_startCollect(coupler, in.getSampleDataRO(0));      paso::Coupler_startCollect(coupler, in.getSampleDataRO(0));
2057    
2058      const dim_t numDOF = getNumDOF();      const dim_t numDOF = getNumDOF();
2059      out.requireWrite();      out.requireWrite();
2060      const double* buffer = Paso_Coupler_finishCollect(coupler);      const double* buffer = paso::Coupler_finishCollect(coupler);
2061    
2062  #pragma omp parallel for  #pragma omp parallel for
2063      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 2066  void Brick::dofToNodes(escript::Data& ou
2066                  : &buffer[(m_dofMap[i]-numDOF)*numComp]);                  : &buffer[(m_dofMap[i]-numDOF)*numComp]);
2067          copy(src, src+numComp, out.getSampleDataRW(i));          copy(src, src+numComp, out.getSampleDataRW(i));
2068      }      }
2069      Paso_Coupler_free(coupler);      paso::Coupler_free(coupler);
2070  }  }
2071    
2072  //private  //private
# Line 2569  void Brick::createPattern() Line 2569  void Brick::createPattern()
2569      Paso_SharedComponents *rcv_shcomp = Paso_SharedComponents_alloc(      Paso_SharedComponents *rcv_shcomp = Paso_SharedComponents_alloc(
2570              numDOF, neighbour.size(), &neighbour[0], &recvShared[0],              numDOF, neighbour.size(), &neighbour[0], &recvShared[0],
2571              &offsetInShared[0], 1, 0, m_mpiInfo);              &offsetInShared[0], 1, 0, m_mpiInfo);
2572      m_connector = Paso_Connector_alloc(snd_shcomp, rcv_shcomp);      m_connector = paso::Connector_alloc(snd_shcomp, rcv_shcomp);
2573      Paso_SharedComponents_free(snd_shcomp);      Paso_SharedComponents_free(snd_shcomp);
2574      Paso_SharedComponents_free(rcv_shcomp);      Paso_SharedComponents_free(rcv_shcomp);
2575    

Legend:
Removed from v.4800  
changed lines
  Added in v.4801

  ViewVC Help
Powered by ViewVC 1.1.26