示例#1
0
IMatrix3d InterfaceRBF::hess(const Box<double>&  b)
{
  IMatrix3d g;
  IMatrix3d temp;

  for (unsigned int i = 0; i < centers.size(); i++)
	  g = g + _phiFunction->hessphi(Box3d(b - Box3d(centers[i].c))) * Intervald(centers[i].w);

  return g;
}
示例#2
0
/**
 * Gradient of the sum of radial basis functions.
 * This is the Intefvald/Box3d version.
 */
Box3d InterfaceRBF::grad(const Box<double>&  b)
{
  Box3d g;

  for (unsigned int i = 0; i < centers.size(); i++)
    g = g + _phiFunction->gradphi(Box3d(b - Box3d(centers[i].c))) * Intervald(centers[i].w);

  g = g + Box3d(Intervald(m_p[1]),Intervald(m_p[2]),Intervald(m_p[3]));

  return g;
}
示例#3
0
/** 
 * Evaluate the variational implicit surface.  This is the
 * Interval version of proc.
 * @param b The Box3d region over which to evaluate the function.
 */
Intervald InterfaceRBF::proc(const Box<double>&  b) 
{
  Intervald fVal(0.0);
  
  for (unsigned int i = 0; i < centers.size(); i++)
    fVal += Intervald(centers[i].w) * _phiFunction->phi(Box3d(b - Box3d(centers[i].c)));

  fVal += Intervald(m_p[3]) * b[2];
  fVal += Intervald(m_p[2]) * b[1];
  fVal += Intervald(m_p[1]) * b[0];
  fVal += Intervald(m_p[0]);

  return fVal; 
};
示例#4
0
LocalH :: LocalH (const Point3d & pmin, const Point3d & pmax, double agrading)
{
  double x1[3], x2[3];
  double hmax;
  int i;

  boundingbox = Box3d (pmin, pmax);
  grading = agrading;

  // a small enlargement, non-regular points 
  double val = 0.0879;
  for (i = 1; i <= 3; i++)
    {

      x1[i-1] = (1 + val * i) * pmin.X(i) - val * i * pmax.X(i);
      x2[i-1] = 1.1 * pmax.X(i) - 0.1 * pmin.X(i);
    }

  hmax = x2[0] - x1[0];
  for (i = 1; i <= 2; i++)
    if (x2[i] - x1[i] > hmax)
      hmax = x2[i] - x1[i];

  for (i = 0; i <= 2; i++)
    x2[i] = x1[i] + hmax;

  root = new GradingBox (x1, x2);
  boxes.Append (root);
}
示例#5
0
Box3d ImpList::grad(const Box<double>& x) 
{
  Box3d result = Box3d(0.0);
  
  for (i_it = this->begin(); i_it != this->end(); i_it++) 
    result = result + (*i_it)->grad(x);
  
  return result;
}
 Box3d
 Circle3d::bounds() const {
     double nx2 = normalVector().x() * normalVector().x();
     double ny2 = normalVector().y() * normalVector().y();
     double nz2 = normalVector().z() * normalVector().z();
     double dx = radius() * sqrt(ny2 + nz2);
     double dy = radius() * sqrt(nx2 + nz2);
     double dz = radius() * sqrt(nx2 + ny2);
     return Box3d(
         Interval(centerPoint().x() - dx, centerPoint().x() + dx),
         Interval(centerPoint().y() - dy, centerPoint().y() + dy),
         Interval(centerPoint().z() - dz, centerPoint().z() + dz)
     );
 }
示例#7
0
  void VisualSceneSpecPoints :: BuildScene (int zoomall)
  {
    if (!mesh) 
      {
	VisualScene::BuildScene(zoomall);
	return;
      }
  
    Box3d box;
  
    if (mesh->GetNSeg())
      {
	box.SetPoint (mesh->Point (mesh->LineSegment(1)[0]));
	for (int i = 1; i <= mesh->GetNSeg(); i++)
	  {
	    box.AddPoint (mesh->Point (mesh->LineSegment(i)[0]));
	    box.AddPoint (mesh->Point (mesh->LineSegment(i)[1]));
	  }
      }
    else if (specpoints.Size() >= 2)
      {
	box.SetPoint (specpoints.Get(1).p);
	for (int i = 2; i <= specpoints.Size(); i++)
	  box.AddPoint (specpoints.Get(i).p);
      }
    else
      {
	box = Box3d (Point3d (0,0,0), Point3d (1,1,1));
      }
  
    if (zoomall == 2 && ((vispar.centerpoint >= 1 && vispar.centerpoint <= mesh->GetNP()) ||
			 vispar.use_center_coords))
      {
	if (vispar.use_center_coords)
	  {
	    center.X() = vispar.centerx; center.Y() = vispar.centery; center.Z() = vispar.centerz; 
	  }
	else
	  center = mesh->Point (vispar.centerpoint);
      }
    else
      center = Center (box.PMin(), box.PMax());
        

    rad = 0.5 * Dist (box.PMin(), box.PMax());
  
  
    CalcTransformationMatrices();
  }
示例#8
0
Box3d Sphere::grad(const Box<double>& x)
{
  Box3d x1;
  Box3d center;
  Box3d g;

  if (x.size() == 3)
    {
      x1 = x;
      center = Box<double>(convert(m_x));
    }
  else
    {
      x1 = Box3d(x[0],x[1],x[2]);
      center = m_xlrp(x[3]);
    }

  g = x1 - center;
  Intervald l = g.lengthSquared();
  if (l.isZero())
    return Box3d(0.0);
  else
    return g / l.sqrt();
}
示例#9
0
IMatrix3d Sphere::hess(const Box<double>& x)
{
  IMatrix3d h = IMatrix3d(0.0);
  Box3d x1 = Box3d(x[0],x[1],x[2]);
  Intervald l = x1.lengthSquared();

  if (!l.isZero())  
    {
      Intervald li  = Intervald(1.0) / l.sqrt();
      Intervald li3 = li.pow(3);

      h[0][0] = l - x[0].squared() * li3;
      h[1][1] = l - x[1].squared() * li3;
      h[2][2] = l - x[2].squared() * li3;
      h[0][1] = h[1][0] = -x[0] * x[1] * li3;
      h[0][2] = h[2][0] = -x[0] * x[2] * li3;
      h[1][2] = h[2][1] = -x[1] * x[2] * li3;
    }

  return h;
}
示例#10
0
Intervald Sphere::proc(const Box<double>& x) 
{
  Box3d x1;
  Box3d center;
  Box3d diff;
  Intervald m_rtemp;

  if (x.size() == 3)
    {
      x1 = x;
      center = Box<double>(convert(m_x));
      m_rtemp = Intervald(m_r);
    }
  else
    {
      x1 = Box3d(x[0],x[1],x[2]);
      center =  m_xlrp(x[3]);
      m_rtemp = m_rlrp(x[3]);
    }

  diff = x1 - center;
  return diff.length() - m_rtemp;
} 
示例#11
0
/**
 * @todo Fix me!
 */
Box3d Sphere::gradt(const Box<double>& x)
{
  return Box3d(0.0);
}
示例#12
0
 inline
 Box3d
 Box3d::scaledAbout(const Point3d& point, double scale) const {
     return Box3d(point + scale * (*this - point));
 }