/** * Returns a tet that references the specified nodes. * @param na a node. * @param nb a node. * @return a tet that references the specified nodes; * or null, if a node is not in the mesh or the mesh * has no tets. */ public synchronized Tet findTet(Node na, Node nb) { Tet tet = findTet(na); if (tet!=null) { clearTetMarks(); tet = findTet(tet,na,nb); } return tet; }
/** * Returns a tet that references the specified nodes. * @param na a node. * @param nb a node. * @param nc a node. * @return a tet that references the specified nodes; * or null, if a node is not in the mesh or the mesh * has no tets. */ public synchronized Tet findTet(Node na, Node nb, Node nc) { Tet tet = findTet(na,nb); if (tet!=null) { clearTetMarks(); tet = findTet(tet,na,nb,nc); } return tet; }
/** * Returns a tet that references the specified nodes. * @param na a node. * @param nb a node. * @param nc a node. * @param nd a node. * @return a tet that references the specified nodes; * or null, if a node is not in the mesh or the mesh * has no tets. */ public synchronized Tet findTet(Node na, Node nb, Node nc, Node nd) { Tet tet = findTet(na,nb,nc); if (tet!=null) { clearTetMarks(); tet = findTet(tet,na,nb,nc,nd); } return tet; }
/** * Finds an edge of a tet in the mesh that references the specified nodes. * The nodes may be specified in any order. * @param na a node. * @param nb a node. * @return an edge of a tet that references the specified nodes. * If no such edge exists in this mesh, returns null. */ public synchronized Edge findEdge(Node na, Node nb) { Tet tet = findTet(na,nb); if (tet!=null) { return edgeOfTet(tet,na,nb); } else { return null; } }
/** * Finds a face of a tet in the mesh that references the specified nodes. * The nodes may be specified in any order. However, if not null, * the returned face always has a mate, and either the returned * face or its mate references the specified nodes in the specified * order. * @param na a node. * @param nb a node. * @param nc a node. * @return a face of a tet that references the specified nodes. * If no such face exists in this mesh, returns null. */ public synchronized Face findFace(Node na, Node nb, Node nc) { Tet tet = findTet(na,nb,nc); if (tet!=null) { return faceOfTet(tet,na,nb,nc); } else { return null; } }
if (na==n0) { if (nb==n1 || nb==n2 || nb==n3 || t1!=null && !isMarked(t1) && (tet=findTet(t1,na,nb))!=null || t2!=null && !isMarked(t2) && (tet=findTet(t2,na,nb))!=null || t3!=null && !isMarked(t3) && (tet=findTet(t3,na,nb))!=null) return tet; } else if (na==n1) { if (nb==n3 || nb==n2 || nb==n0 || t3!=null && !isMarked(t3) && (tet=findTet(t3,na,nb))!=null || t2!=null && !isMarked(t2) && (tet=findTet(t2,na,nb))!=null || t0!=null && !isMarked(t0) && (tet=findTet(t0,na,nb))!=null) return tet; } else if (na==n2) { if (nb==n3 || nb==n0 || nb==n1 || t3!=null && !isMarked(t3) && (tet=findTet(t3,na,nb))!=null || t0!=null && !isMarked(t0) && (tet=findTet(t0,na,nb))!=null || t1!=null && !isMarked(t1) && (tet=findTet(t1,na,nb))!=null) return tet; } else if (na==n3) { if (nb==n1 || nb==n0 || nb==n2 || t1!=null && !isMarked(t1) && (tet=findTet(t1,na,nb))!=null || t0!=null && !isMarked(t0) && (tet=findTet(t0,na,nb))!=null || t2!=null && !isMarked(t2) && (tet=findTet(t2,na,nb))!=null) return tet; } else {
if (nb==n1) { if (nc==n2 || nc==n3 || t2!=null && !isMarked(t2) && (tet=findTet(t2,na,nb,nc))!=null || t3!=null && !isMarked(t3) && (tet=findTet(t3,na,nb,nc))!=null) return tet; } else if (nb==n2) { if (nc==n1 || nc==n3 || t1!=null && !isMarked(t1) && (tet=findTet(t1,na,nb,nc))!=null || t3!=null && !isMarked(t3) && (tet=findTet(t3,na,nb,nc))!=null) return tet; } else if (nb==n3) { if (nc==n1 || nc==n2 || t1!=null && !isMarked(t1) && (tet=findTet(t1,na,nb,nc))!=null || t2!=null && !isMarked(t2) && (tet=findTet(t2,na,nb,nc))!=null) return tet; } else { if (nb==n0) { if (nc==n2 || nc==n3 || t2!=null && !isMarked(t2) && (tet=findTet(t2,na,nb,nc))!=null || t3!=null && !isMarked(t3) && (tet=findTet(t3,na,nb,nc))!=null) return tet; } else if (nb==n2) { if (nc==n0 || nc==n3 || t0!=null && !isMarked(t0) && (tet=findTet(t0,na,nb,nc))!=null || t3!=null && !isMarked(t3) && (tet=findTet(t3,na,nb,nc))!=null) return tet; } else if (nb==n3) { if (nc==n0 || nc==n2 ||
if (nc==n2) { if (nd==n3 || t3!=null && !isMarked(t3) && (tet=findTet(t3,na,nb,nc,nd))!=null) return tet; } else if (nc==n3) { if (nd==n2 || t2!=null && !isMarked(t2) && (tet=findTet(t2,na,nb,nc,nd))!=null) return tet; } else { if (nc==n1) { if (nd==n3 || t3!=null && !isMarked(t3) && (tet=findTet(t3,na,nb,nc,nd))!=null) return tet; } else if (nc==n3) { if (nd==n1 || t1!=null && !isMarked(t1) && (tet=findTet(t1,na,nb,nc,nd))!=null) return tet; } else { if (nc==n1) { if (nd==n2 || t2!=null && !isMarked(t2) && (tet=findTet(t2,na,nb,nc,nd))!=null) return tet; } else if (nc==n2) { if (nd==n1 || t1!=null && !isMarked(t1) && (tet=findTet(t1,na,nb,nc,nd))!=null) return tet; } else {
/** * Appends the tet nabors of the specified edge to the specified list. * @param edge the edge for which to get nabors. * @param nabors the list to which nabors are appended. */ public synchronized void getTetNabors(Edge edge, TetList nabors) { Node na = edge.nodeA(); Node nb = edge.nodeB(); Tet tet = edge.tet(); if (tet==null) tet = findTet(na,nb); if (tet==null) return; clearTetMarks(); getTetNabors(na,nb,tet,nabors); }
Node nb = nabors[inabor]; if (edgeSet.add(na,nb,null,null)) { Tet tet = findTet(na,nb); Edge edge = new Edge(tet,na,nb); edgeList.add(edge);
/** * Determines whether the specified edge is an inner edge. * @param edge an edge. * @return true, if inner; false, otherwise. */ public boolean isInner(Edge edge) { Tet tet = edge.tet(); if (tet==null) tet = findTet(edge.nodeA(),edge.nodeB()); if (tet==null) return false; if (tet.isInner()) return true; Tet[] tets = getTetNabors(edge); int ntet = tets.length; for (int itet=0; itet<ntet; ++itet) { if (isInner(tets[itet])) return true; } return false; }
tm.addNode(n4); TetMesh.Tet tet = tm.findTet(n0); assertTrue(tet!=null); assertTrue(tet==tm.findTet(n0,n1)); assertTrue(tet==tm.findTet(n0,n2)); assertTrue(tet==tm.findTet(n0,n3)); assertTrue(tet==tm.findTet(n0,n1,n3)); assertTrue(tet==tm.findTet(n0,n1,n3)); assertTrue(tet==tm.findTet(n0,n2,n3)); assertTrue(tet==tm.findTet(n0,n1,n2,n3)); assertTrue(null==tm.findTet(n0,n4)); assertTrue(null==tm.findTet(n0,n1,n4)); assertTrue(null==tm.findTet(n0,n2,n4)); assertTrue(null==tm.findTet(n0,n3,n4)); assertTrue(null==tm.findTet(n0,n1,n2,n4)); assertTrue(null==tm.findTet(n0,n1,n3,n4)); assertTrue(null==tm.findTet(n0,n2,n3,n4));
if (mesh.findTet(jnode,knode)==null) continue;
tet = findTet(ea,eb); if (tet==null) return;