/[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 4941 by caltinay, Thu May 15 01:49:48 2014 UTC revision 4949 by caltinay, Mon May 19 05:54:58 2014 UTC
# Line 203  Brick::Brick(int n0, int n1, int n2, dou Line 203  Brick::Brick(int n0, int n1, int n2, dou
203      populateSampleIds();      populateSampleIds();
204      createPattern();      createPattern();
205            
     assembler = new DefaultAssembler3D(this, m_dx, m_NX, m_NE, m_NN);  
206      for (map<string, int>::const_iterator i = tagnamestonums.begin();      for (map<string, int>::const_iterator i = tagnamestonums.begin();
207              i != tagnamestonums.end(); i++) {              i != tagnamestonums.end(); i++) {
208          setTagMap(i->first, i->second);          setTagMap(i->first, i->second);
# Line 214  Brick::Brick(int n0, int n1, int n2, dou Line 213  Brick::Brick(int n0, int n1, int n2, dou
213    
214  Brick::~Brick()  Brick::~Brick()
215  {  {
     delete assembler;  
216  }  }
217    
218  string Brick::getDescription() const  string Brick::getDescription() const
# Line 3289  cout << "basex=" << basex << " basey=" < Line 3287  cout << "basex=" << basex << " basey=" <
3287      }      }
3288  }  }
3289    
3290    int Brick::findNode(const double *coords) const
3291    {
   
   
   
 int Brick::findNode(const double *coords) const {  
3292      const int NOT_MINE = -1;      const int NOT_MINE = -1;
3293      //is the found element even owned by this rank      //is the found element even owned by this rank
3294      // (inside owned or shared elements but will map to an owned element)      // (inside owned or shared elements but will map to an owned element)
# Line 3349  int Brick::findNode(const double *coords Line 3343  int Brick::findNode(const double *coords
3343      return closest;      return closest;
3344  }  }
3345    
3346  void Brick::setAssembler(std::string type, std::map<std::string,  Assembler_ptr Brick::createAssembler(std::string type, std::map<std::string,
3347          escript::Data> constants) {          escript::Data> constants) const
3348      if (type.compare("WaveAssembler") == 0) {  {
3349          if (assembler_type != WAVE_ASSEMBLER && assembler_type != DEFAULT_ASSEMBLER)      if (type.compare("DefaultAssembler") == 0) {
3350              throw RipleyException("Domain already using a different custom assembler");          return Assembler_ptr(new DefaultAssembler3D(shared_from_this(), m_dx, m_NX, m_NE, m_NN));
3351          assembler_type = WAVE_ASSEMBLER;      } else if (type.compare("WaveAssembler") == 0) {
3352          delete assembler;          return Assembler_ptr(new WaveAssembler3D(shared_from_this(), m_dx, m_NX, m_NE, m_NN, constants));
         assembler = new WaveAssembler3D(this, m_dx, m_NX, m_NE, m_NN, constants);  
3353      } else if (type.compare("LameAssembler") == 0) {      } else if (type.compare("LameAssembler") == 0) {
3354          if (assembler_type != LAME_ASSEMBLER && assembler_type != DEFAULT_ASSEMBLER)          return Assembler_ptr(new LameAssembler3D(shared_from_this(), m_dx, m_NX, m_NE, m_NN));
             throw RipleyException("Domain already using a different custom assembler");  
         assembler_type = LAME_ASSEMBLER;  
         delete assembler;  
         assembler = new LameAssembler3D(this, m_dx, m_NX, m_NE, m_NN);  
3355      } else { //else ifs would go before this for other types      } else { //else ifs would go before this for other types
3356          throw RipleyException("Ripley::Brick does not support the"          throw RipleyException("Ripley::Brick does not support the"
3357                                  " requested assembler");                                  " requested assembler");

Legend:
Removed from v.4941  
changed lines
  Added in v.4949

  ViewVC Help
Powered by ViewVC 1.1.26