/[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 4753 by sshaw, Mon Mar 17 02:39:44 2014 UTC revision 4776 by caltinay, Wed Mar 19 23:31:00 2014 UTC
# Line 3002  void Brick::interpolateNodesOnFaces(escr Line 3002  void Brick::interpolateNodesOnFaces(escr
3002    
3003  namespace  namespace
3004  {  {
3005      // Calculates a guassian blur colvolution matrix for 3D      // Calculates a gaussian blur convolution matrix for 3D
3006      // See wiki article on the subject      // See wiki article on the subject
3007      double* get3DGauss(unsigned radius, double sigma)      double* get3DGauss(unsigned radius, double sigma)
3008      {      {
# Line 3112  that ripley has. Line 3112  that ripley has.
3112  */  */
3113  escript::Data Brick::randomFillWorker(const escript::DataTypes::ShapeType& shape, long seed, const boost::python::tuple& filter) const  escript::Data Brick::randomFillWorker(const escript::DataTypes::ShapeType& shape, long seed, const boost::python::tuple& filter) const
3114  {  {
     if (m_numDim!=3)  
     {  
         throw RipleyException("Brick must be 3D.");  
     }  
       
3115      unsigned int radius=0;  // these are only used by gaussian      unsigned int radius=0;  // these are only used by gaussian
3116      double sigma=0.5;      double sigma=0.5;
3117            
# Line 3143  escript::Data Brick::randomFillWorker(co Line 3138  escript::Data Brick::randomFillWorker(co
3138          boost::python::extract<double> ex2(filter[2]);          boost::python::extract<double> ex2(filter[2]);
3139          if (!ex2.check() || (sigma=ex2())<=0)          if (!ex2.check() || (sigma=ex2())<=0)
3140          {          {
3141              throw RipleyException("Sigma must be a postive floating point number.");              throw RipleyException("Sigma must be a positive floating point number.");
3142          }                      }            
3143      }      }
3144      else      else
3145      {      {
3146          throw RipleyException("Unsupported random filter");          throw RipleyException("Unsupported random filter");
3147      }      }
       
       
3148    
3149            // number of points in the internal region
3150      size_t internal[3];      // that is, the ones we need smoothed versions of
3151      internal[0]=m_NE[0]+1;  // number of points in the internal region      const dim_t internal[3] = { m_NN[0], m_NN[1], m_NN[2] };
     internal[1]=m_NE[1]+1;  // that is, the ones we need smoothed versions of  
     internal[2]=m_NE[2]+1;  // that is, the ones we need smoothed versions of  
3152      size_t ext[3];      size_t ext[3];
3153      ext[0]=internal[0]+2*radius;    // includes points we need as input      ext[0]=(size_t)internal[0]+2*radius;  // includes points we need as input
3154      ext[1]=internal[1]+2*radius;    // for smoothing      ext[1]=(size_t)internal[1]+2*radius;  // for smoothing
3155      ext[2]=internal[2]+2*radius;    // for smoothing      ext[2]=(size_t)internal[2]+2*radius;  // for smoothing
3156            
3157      // now we check to see if the radius is acceptable      // now we check to see if the radius is acceptable
3158      // That is, would not cross multiple ranks in MPI      // That is, would not cross multiple ranks in MPI
# Line 3188  escript::Data Brick::randomFillWorker(co Line 3179  escript::Data Brick::randomFillWorker(co
3179      {      {
3180      // since the dimensions are equal for all ranks, this exception      // since the dimensions are equal for all ranks, this exception
3181      // will be thrown on all ranks      // will be thrown on all ranks
3182      throw RipleyException("Random Data in Ripley requries at least five elements per side per rank.");      throw RipleyException("Random Data in Ripley requires at least five elements per side per rank.");
3183    
3184      }      }
3185      dim_t X=m_mpiInfo->rank%m_NX[0];      dim_t X=m_mpiInfo->rank%m_NX[0];

Legend:
Removed from v.4753  
changed lines
  Added in v.4776

  ViewVC Help
Powered by ViewVC 1.1.26