Beispiel #1
0
 public void Add(Node node)
 {
     _nodes.Add(node);
 }
Beispiel #2
0
 public void AddNode(Node node)
 {
     if (_nodes.ContainsKey(node.nid))
         return;
     _nodes[node.nid] = node;
 }
Beispiel #3
0
        //you don't need to assign modelSetting.axis as it won't be used
        public static void BuildStraightModel(ModelSetting modelSetting, Model model)
        {
            SingleRingResult ringResult = new SingleRingResult();
            GenerateNodes.GenerateSingleRingNode(modelSetting, ringResult);
            GenerateElements.GenerateSingleRingElement(modelSetting, ringResult);

            //generate all nodes
            for(int i = 0; i < modelSetting.num_ring; i++)
            {
                for(int j = 0; j < modelSetting.num_node_all; j++)
                {
                    Node node = ringResult.nodes[j];
                    Node newNode = new Node(node.nid + i * modelSetting.num_node_all,
                        node.x, node.y, node.z + modelSetting.width * i);
                    model.AddNode(newNode);
                }
            }

            int elemenCount = 0;

            //generate all shells
            for (int i = 0; i < modelSetting.num_ring; i++)
            {
                foreach (Element element in ringResult.elements[1])
                {
                    elemenCount++;
                    ElementShell shell = element as ElementShell;
                    ElementShell newShell = new ElementShell(elemenCount,
                        shell.pid, shell.n1 + modelSetting.num_node_all * i, shell.n2 + modelSetting.num_node_all * i,
                        shell.n3 + modelSetting.num_node_all * i, shell.n4 + modelSetting.num_node_all * i);
                    model.AddElement(newShell);
                }
            }

            //generate radial ground spring
            for (int i = 0; i < modelSetting.num_ring; i++)
            {
                foreach (Element element in ringResult.elements[2])
                {
                    elemenCount++;
                    ElementLink link = element as ElementLink;
                    ElementLink newLink = new ElementLink(elemenCount,
                        link.pid, link.n1 + modelSetting.num_node_all * i, link.n2 + modelSetting.num_node_all * i);
                    model.AddElement(newLink);
                }
            }

            //generate tangential ground spring
            for (int i = 0; i < modelSetting.num_ring; i++)
            {
                foreach (Element element in ringResult.elements[3])
                {
                    elemenCount++;
                    ElementLink link = element as ElementLink;
                    ElementLink newLink = new ElementLink(elemenCount,
                        link.pid, link.n1 + modelSetting.num_node_all * i, link.n2 + modelSetting.num_node_all * i);
                    model.AddElement(newLink);
                }
            }

            //generate the longitudinal joint spring
            for (int i = 0; i < modelSetting.num_ring; i++)
            {
                for (int j = 0; j <= modelSetting.num_longit; j++)
                {
                    for (int k = 0; k < modelSetting.pos_joint.Count; k++)
                    {
                        elemenCount++;
                        ElementCombin combinZ = new ElementCombin(elemenCount, 5,
                            modelSetting.pos_joint[k] + 1 + j * modelSetting.num_node_face + i * modelSetting.num_node_all,
                            k + 1 + modelSetting.num_circum + j * modelSetting.num_node_face + i * modelSetting.num_node_all);
                        model.AddElement(combinZ);
                    }
                }
            }

            //generate circumferential joint spring
            for (int i = 1; i < modelSetting.num_ring; i++)
            {
                for (int j = 0; j < modelSetting.num_node_face; j++ )
                {
                    elemenCount++;
                    ElementCombin combinCircumZ = new ElementCombin(elemenCount, 4,
                         j + 1 + (i - 1) * modelSetting.num_node_all + modelSetting.num_node_face * modelSetting.num_longit,
                         j + 1 + i * modelSetting.num_node_all);
                    elemenCount++;
                    ElementCombin combinCircumX = new ElementCombin(elemenCount, 6,
                         j + 1 + (i - 1) * modelSetting.num_node_all + modelSetting.num_node_face * modelSetting.num_longit,
                         j + 1 + i * modelSetting.num_node_all);
                    elemenCount++;
                    ElementCombin combinCircumY = new ElementCombin(elemenCount, 7,
                        j + 1 + (i - 1) * modelSetting.num_node_all + modelSetting.num_node_face * modelSetting.num_longit,
                         j + 1 + i * modelSetting.num_node_all);
                    model.AddElement(combinCircumZ);
                    model.AddElement(combinCircumX);
                    model.AddElement(combinCircumY);
                }

            }

            //add longitudinal joint nodes couple-constrain
            for (int i = 0; i < modelSetting.num_ring; i++)
            {
                for (int j = 0; j <= modelSetting.num_longit; j++)
                {
                    for (int k = 0; k < modelSetting.pos_joint.Count; k++)
                    {
                        ConstrainedNodes constrain = new ConstrainedNodes();
                        constrain.nodes.Add(model.nodes[modelSetting.pos_joint[k] + 1 + j * modelSetting.num_node_face + i * modelSetting.num_node_all]);
                        constrain.nodes.Add(model.nodes[k + 1 + modelSetting.num_circum + j * modelSetting.num_node_face + i * modelSetting.num_node_all]);
                        constrain.ux = 1;
                        constrain.uy = 1;
                        model.AddConstrained(constrain);
                    }
                }
            }

            //add boundary
            for (int i = 0; i < modelSetting.num_node_face; i++)
            {
                BoundaryNode boundary = new BoundaryNode();
                boundary.node = model.nodes[i + 1];
                boundary.ux = 1;
                boundary.uy = 1;
                boundary.uz = 1;
                boundary.rx = 1;
                boundary.ry = 1;
                boundary.rz = 1;
                model.AddBoundary(boundary);
            }
            for (int i = 0; i < modelSetting.num_node_face; i++)
            {
                BoundaryNode boundary = new BoundaryNode();
                boundary.node = model.nodes[i + 1 + modelSetting.num_node_all * (modelSetting.num_ring - 1)
                    + modelSetting.num_longit * modelSetting.num_node_face];
                boundary.ux = 1;
                boundary.uy = 1;
                boundary.uz = 1;
                boundary.rx = 1;
                boundary.ry = 1;
                boundary.rz = 1;
                model.AddBoundary(boundary);
            }

            //apply load
        }
Beispiel #4
0
        public static void GenerateSingleRingNode(ModelSetting sett, SingleRingResult result)
        {
            double r = sett.outerRadius - sett.thickness / 2; // radius of the model

            double pi = Math.PI;

            //generate the nodes of front border
            //first segment
            for (int i = 0; i < sett.num_segment_element[0]; i++ )
            {
                double detal = sett.pos_joint[0] * 1.0 / sett.num_segment_element[0];
                double angle = pi / 180 * i * detal;
                Node node = new Node(i + 1, 0, Math.Sin(angle) * r, Math.Cos(angle) * r);
                result.nodes.Add(node);
            }
            //middle segment
            for (int i = 1; i < sett.pos_joint.Count; i++ )
            {
                for (int j = 0; j < (sett.num_segment_element[i] - sett.num_segment_element[i - 1]); j++)
                {
                    double detal = (sett.pos_joint[i] - sett.pos_joint[i - 1]) * 1.0 / (sett.num_segment_element[i] - sett.num_segment_element[i - 1]);
                    double angle = (sett.pos_joint[i - 1] + j * detal) * pi / 180;
                    Node node = new Node(sett.num_segment_element[i - 1] + j + 1, 0, Math.Sin(angle) * r, Math.Cos(angle) * r);
                    result.nodes.Add(node);
                }
            }
            //last segment
            for (int i = 0; i < sett.num_segment_element[0]; i++)
            {
                double detal = sett.pos_joint[0] * 1.0 / sett.num_segment_element[0];
                double angle = (sett.pos_joint.Last() + i * detal) * pi / 180;
                Node node = new Node(sett.num_segment_element.Last() + i + 1, 0, Math.Sin(angle) * r, Math.Cos(angle) * r);
                result.nodes.Add(node);
            }

            //joint node
            for(int i = 0; i < sett.pos_joint.Count; i++)
            {
                double angle = pi / 180 * sett.pos_joint[i];
                Node node = new Node(sett.num_circum + i + 1, 0, Math.Sin(angle) * r, Math.Cos(angle) * r);
                result.nodes.Add(node);
            }

            //generate the nodes of lining in longitudinal direction
            double width = sett.width * 0.97;
            double delta = width / sett.num_longit;

            for(int j = 0; j < sett.num_longit; j++)
            {
                for (int i = 0; i < sett.num_node_face; i++)
                {
                    Node tmp = result.nodes[i];
                    Node node = new Node(tmp.nid + (j + 1) * sett.num_node_face, delta * (j + 1), tmp.y, tmp.z);
                    result.nodes.Add(node);
                }
            }

            //generate the radial ground node
            for(int i = 0; i < sett.num_node_ring; i++)
            {
                Node slNode = result.nodes[i];
                Node node = new Node(slNode.nid + sett.num_node_ring, slNode.x, slNode.y * (1 + 1 / r),
                    slNode.z * (1 + 1 / r));
                result.nodes.Add(node);
            }

            //gegerate the tangential ground node
            for (int i = 0; i < sett.num_node_ring; i++)
            {
                Node slNode = result.nodes[i];
                Node node = new Node(slNode.nid + sett.num_node_ring * 2, slNode.x, slNode.y + slNode.z / r,
                    slNode.z - slNode.y / r);
                result.nodes.Add(node);
            }
        }
Beispiel #5
0
 private static void GetNodes(int ringNo, ModelSetting modelSetting, SingleRingResult ringResult, ShieldTunnel3DResult result)
 {
     for (int j = 0; j < modelSetting.num_node_all; j++)
     {
         Node node = ringResult.nodes[j];
         Node newNode = new Node(node.nid + ringNo * modelSetting.num_node_all,
             node.x, node.y, node.z);
         result.nodes.Add(newNode);
     }
 }