_faceSet = new FaceSet(256,0.25); _edgeSet = new EdgeSet(256,0.25); _nodeList = new NodeList(); _nmin = null; _dmin = 0.0;
/** * Constructs an interpolator with specified method and samples. * This constructor is provided primarily for testing. * The default Hale-Liang method is accurate and fast. * @param method the implementation method. * @param f array of sample values f(x1,x2,x3). * @param x1 array of sample x1 coordinates. * @param x2 array of sample x2 coordinates. * @param x3 array of sample x3 coordinates. */ public SibsonInterpolator3( Method method, float[] f, float[] x1, float[] x2, float[] x3) { makeMesh(f,x1,x2,x3); _nodeList = new TetMesh.NodeList(); _tetList = new TetMesh.TetList(); if (method==Method.WATSON_SAMBRIDGE) { _va = new WatsonSambridge(); } else if (method==Method.BRAUN_SAMBRIDGE) { _va = new BraunSambridge(); } else if (method==Method.HALE_LIANG) { _va = new HaleLiang(); } }
private void getDelaunayFacesOpposite( Node node, Node na, Node nb, Node nc, Tet ta, Tet tb, Tet tc) { if (!isMarked(na)) { mark(na); _nodeList.add(na); } if (!isMarked(nb)) { mark(nb); _nodeList.add(nb); } if (!isMarked(nc)) { mark(nc); _nodeList.add(nc); } getDelaunayFacesOpposite(node,ta); getDelaunayFacesOpposite(node,tb); getDelaunayFacesOpposite(node,tc); }
private float interpolate0(double vsum) { double vfsum = 0.0; int nnode = _nodeList.nnode(); TetMesh.Node[] nodes = _nodeList.nodes(); for (int inode=0; inode<nnode; ++inode) { TetMesh.Node node = nodes[inode]; float f = f(node); double v = volume(node); vfsum += v*f; } return (float)(vfsum/vsum); }
private void addNode(TetMesh.Node node) { if (_mesh.isMarked(node)) return; _mesh.mark(node); _nodeList.add(node); NodeData data = data(node); data.volume = 0.0; } private boolean needTet(double xp, double yp, double zp, TetMesh.Tet tet) {
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) {