return new PointLocation(n0); } else if (x==x1 && y==y1 && z==z1) { return new PointLocation(n1); } else if (x==x2 && y==y2 && z==z2) { return new PointLocation(n2); } else if (x==x3 && y==y3 && z==z3) { return new PointLocation(n3); return locatePoint(tetNabor,x,y,z); } else { return new PointLocation(tet,false); return locatePoint(tetNabor,x,y,z); } else { return new PointLocation(tet,false); return locatePoint(tetNabor,x,y,z); } else { return new PointLocation(tet,false); return locatePoint(tetNabor,x,y,z); } else { return new PointLocation(tet,false); return new PointLocation(tet); return new PointLocation(new Edge(tet,n2,n3)); } else if (d0==0.0 && d2==0.0) { return new PointLocation(new Edge(tet,n3,n1));
float zg = z[ig]; TetMesh.PointLocation pl = _mesh.locatePoint(xg,yg,zg); if (pl.isOutside()) { TetMesh.Node n = new TetMesh.Node(xg,yg,zg); n.index = -1-ig; // ghost nodes have negative indices
/** * Locates a point. */ private PointLocation locatePoint(double x, double y, double z) { // If no tets yet, search the node list for an exact match. // Here, we use unperturbed node coordinates. if (_troot==null) { if (_nroot!=null) { Node node = _nroot; do { if (x==node.x() && y==node.y() && z==node.z()) return new PointLocation(node); node = node._next; } while (node!=_nroot); } return new PointLocation(null,false); } // Otherwise, find a good tet in which to begin the recursive search. Node nmin = _nroot; double dmin = distanceSquared(nmin,x,y,z); for (Node n:_sampledNodes) { double d = distanceSquared(n,x,y,z); if (d<dmin) { dmin = d; nmin = n; } } Tet tet = nmin._tet; return locatePoint(tet,x,y,z); }
private void addGhostNodes(float[] x, float[] y, float[] z) { int ng = x.length; for (int ig=0; ig<ng; ++ig) { float xg = x[ig]; float yg = y[ig]; float zg = z[ig]; TetMesh.PointLocation pl = _mesh.locatePoint(xg,yg,zg); if (pl.isOutside()) { TetMesh.Node n = new TetMesh.Node(xg,yg,zg); n.data = new NodeData(); n.index = -1-ig; // ghost nodes have negative indices _mesh.addNode(n); } } }
private boolean getNaturalNabors(float x, float y, float z) { _mesh.clearNodeMarks(); _mesh.clearTetMarks(); _nodeList.clear(); _tetList.clear(); TetMesh.PointLocation pl = _mesh.locatePoint(x,y,z); if (pl.isOutside()) return false; addTet(x,y,z,pl.tet()); return true; } private void addTet(double xp, double yp, double zp, TetMesh.Tet tet) {