Package bs.bs2d.fea

Examples of bs.bs2d.fea.Node2D


               
                int ni = Integer.parseInt(vals[0]);
                float x = Float.parseFloat(vals[1]);
                float y = Float.parseFloat(vals[2]);
               
                mesh.addNode(new Node2D(ni, x, y));
            }
            index += nodes;
           
            // read elements
            for(int i=0; i < elems; i++){
View Full Code Here


               
                int ni = Integer.parseInt(vals[0]);
                float x = Float.parseFloat(vals[1]);
                float y = Float.parseFloat(vals[2]);
               
                mesh.addNode(new Node2D(ni, x, y));
            }
            index += nodes;
            // done
           
           
View Full Code Here

                vals = lines.get(iNodes + i).split(WHITESPACE_DELIMITER);
               
                float x = Float.parseFloat(vals[1]);
                float y = Float.parseFloat(vals[2]);
               
                mesh.addNode(new Node2D(i+1, x, y));
            }
           
            // read elements
            for(int i=0; i < nElems; i++){
                vals = lines.get(iElems + i).split(WHITESPACE_DELIMITER);
View Full Code Here

            throw new Exception("Empty mesh!");
       
        List<Node2D> nodes = mesh.getNodes();
        for (int i = 0; i < nodes.size(); i++) {
            // test manifold
            Node2D n = nodes.get(i);
            int d = 0;
            if(n.isOuter())
                d = 1;
           
            if(n.getEdgeCount()-n.getElementCount() > d){
                throw new Exception("Mesh is non-manifold!");
            }
           
            if(n.getElementCount() == 0){
                System.err.println("Mesh contains unused nodes");
            }
           
           
        }
View Full Code Here

    private void selectionChanged() {
        String info;
        if (selection.isEmpty()) {
            info = " - nothing selected - ";
        } else if (selection.size() == 1) {
            Node2D n = selection.iterator().next();
            info = String.format("Node %5d: [ %6.3f | %6.3f ]",
                                    n.getIndex(), n.getX(), n.getY());
        } else {
            info = selection.size() + " Nodes";
        }
       
        update(info);
View Full Code Here

                       
                        line[i] = getRelPointOnEdge(edge, scalar, thrsh);

                        if (edge.isOuter()) {// add line segments along outer edge
                            //find node above threshold
                            Node2D n = edge.getNode(0);
                            if (scalar[edge.getNode(1).getIndex()] >= thrsh) {
                                n = edge.getNode(1);
                            }

                            // add line from intersection to node
                            lines.add(new Point2f[]{line[i], n.getPoint2f()});
                        }

                        i++;
                    } else if(edge.isOuter()){ // min is also >= thrsh
                        lines.add(edge.getNodesAsPoints());
View Full Code Here

    private static Shape getElementSubShape(TriElement e, float[] scalar, float thrsh, Map<Edge, Point2f> intPoints){
        GeneralPath path = new GeneralPath();
       
        // find first node above threshold
        Point2f p = null;
        Node2D n = null;
        int i;
        for (i = 0; i < 3; i++) {
            n = e.getNode(i);
            if(scalar[n.getIndex()] >= thrsh){
                p = n.getPoint2f();
                break;
            }
        }
       
        // no node found --> return empty path
        if(p == null)
            return path;
       
        path.moveTo(p.x, p.y);
               
        boolean b, prevB = true; // was previous node above thrsh?
        Node2D prevN = n;
       
        int end = i + 3;
        for (i++; i <= end; i++) {
            n = e.getNode(i % 3);
           
View Full Code Here

TOP

Related Classes of bs.bs2d.fea.Node2D

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.