예제 #1
0
  bool operator()(const NODE& node1, const NODE& node2) const {
   double distance1 = norm(node1.position() - p_);
   double distance2 = norm(node2.position() - p_);
   if (distance1 < distance2)
     return true;
   else
     return false;
 }
예제 #2
0
 force_type operator()(NODE n, double t) {
   (void) t;
   force_type force = force_type(0,0,0);
   Node node2;
   double distance; 
   double initial_spring_length;
   double sprint_const_this_edge;
   
   // iterate through each neighboring node and add spring forces
   for(auto it = n.edge_begin(); it != n.edge_end(); ++it)
   {
       node2 = (*it).node2();
       
       sprint_const_this_edge = (*it).value().spring_constant; 
       initial_spring_length = (*it).value().initial_length;
       
       distance = norm(n.position()-node2.position()); // Euclidean distance
       force += (-1)*sprint_const_this_edge*(n.position()-node2.position())*(distance-initial_spring_length)/distance;
   }
   return force;
 }
예제 #3
0
 Point operator()(const NODE& n) {
   return {n.position().x, n.position().y, n.value().h};
 }
예제 #4
0
 Point operator()(const NODE& node) {
   return node.position();
 }
  bool operator()(const NODE& node1, const NODE& node2) const {
    Point diff1 = node1.position() - p_;
    Point diff2 = node2.position() - p_;
    if (norm(diff1) < norm(diff2)) return true;
   return false;
 }
예제 #6
0
 Point operator()(const NODE& n) {
   // HW4B: You may change this to plot something other than the
   // positions of the nodes
   return Point(n.position().x, n.position().y, n.value().Q.h);
   //return n.position();
 }
예제 #7
0
 Point operator()(const NODE& node) {
   return (Point(node.position().x, node.position().y, u_[node.index()]));
 }
예제 #8
0
 Point operator()(const NODE& n) {
   return Point(n.position().x, n.position().y, n.value().q.h);
 }
예제 #9
0
  Point operator()(const NODE& n) {
	// return the height stored in node value as the z direction
    return Point(n.position().x, n.position().y, n.value().h);
  }