/[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 3777 by caltinay, Thu Jan 19 06:17:38 2012 UTC revision 3781 by caltinay, Mon Jan 23 22:18:49 2012 UTC
# Line 29  using namespace std; Line 29  using namespace std;
29    
30  namespace ripley {  namespace ripley {
31    
32  Brick::Brick(int n0, int n1, int n2, double l0, double l1, double l2, int d0,  Brick::Brick(int n0, int n1, int n2, double x0, double y0, double z0,
33               int d1, int d2) :               double x1, double y1, double z1, int d0, int d1, int d2) :
34      RipleyDomain(3),      RipleyDomain(3),
35      m_gNE0(n0),      m_gNE0(n0),
36      m_gNE1(n1),      m_gNE1(n1),
37      m_gNE2(n2),      m_gNE2(n2),
38      m_l0(l0),      m_x0(x0),
39      m_l1(l1),      m_y0(y0),
40      m_l2(l2),      m_z0(z0),
41        m_l0(x1-x0),
42        m_l1(y1-y0),
43        m_l2(z1-z0),
44      m_NX(d0),      m_NX(d0),
45      m_NY(d1),      m_NY(d1),
46      m_NZ(d2)      m_NZ(d2)
# Line 108  bool Brick::operator==(const AbstractDom Line 111  bool Brick::operator==(const AbstractDom
111      if (o) {      if (o) {
112          return (RipleyDomain::operator==(other) &&          return (RipleyDomain::operator==(other) &&
113                  m_gNE0==o->m_gNE0 && m_gNE1==o->m_gNE1 && m_gNE2==o->m_gNE2                  m_gNE0==o->m_gNE0 && m_gNE1==o->m_gNE1 && m_gNE2==o->m_gNE2
114                    && m_x0==o->m_x0 && m_y0==o->m_y0 && m_z0==o->m_z0
115                  && m_l0==o->m_l0 && m_l1==o->m_l1 && m_l2==o->m_l2                  && m_l0==o->m_l0 && m_l1==o->m_l1 && m_l2==o->m_l2
116                  && m_NX==o->m_NX && m_NY==o->m_NY && m_NZ==o->m_NZ);                  && m_NX==o->m_NX && m_NY==o->m_NY && m_NZ==o->m_NZ);
117      }      }
# Line 697  IndexVector Brick::getNumSubdivisionsPer Line 701  IndexVector Brick::getNumSubdivisionsPer
701  pair<double,double> Brick::getFirstCoordAndSpacing(dim_t dim) const  pair<double,double> Brick::getFirstCoordAndSpacing(dim_t dim) const
702  {  {
703      if (dim==0)      if (dim==0)
704          return pair<double,double>((m_l0*m_offset0)/m_gNE0, m_l0/m_gNE0);          return pair<double,double>(m_x0+(m_l0*m_offset0)/m_gNE0, m_l0/m_gNE0);
705      else if (dim==1)      else if (dim==1)
706          return pair<double,double>((m_l1*m_offset1)/m_gNE1, m_l1/m_gNE1);          return pair<double,double>(m_y0+(m_l1*m_offset1)/m_gNE1, m_l1/m_gNE1);
707      else if (dim==2)      else if (dim==2)
708          return pair<double,double>((m_l2*m_offset2)/m_gNE2, m_l2/m_gNE2);          return pair<double,double>(m_z0+(m_l2*m_offset2)/m_gNE2, m_l2/m_gNE2);
709    
710      throw RipleyException("getFirstCoordAndSpacing(): invalid argument");      throw RipleyException("getFirstCoordAndSpacing(): invalid argument");
711  }  }

Legend:
Removed from v.3777  
changed lines
  Added in v.3781

  ViewVC Help
Powered by ViewVC 1.1.26