Пример #1
0
        public void ConvergenceStudy()
        {
            StartResultsFile(FilePaths.Output3dResults);
            string dofCount = "";

            for (int i = 40; i >= 0; i--)
            {
                Codend.MeshSettings.ElemAcrossPanel = 10 + i;
                Codend.MeshSettings.ElemAlongPanel  = 10 + i;

                if (SolverSettings.InitialShape.Contains("Axi") && Codend.SameLengthPanels())
                {
                    Codend.SetAxiInitialShape(FilePaths, Catch, i, Towing);
                }
                else
                {
                    Codend.SetCylInitialShape();
                }

                Codend.RestrainEntrance();
                CalculateBoundaryDOF();

                ApplyTowing();
                Catch.Apply(Codend, 0);

                Solve();
                dofCount += String.Format(" {0}", totalDOFcount);

                AppendResults(FilePaths.Output3dResults);
            }
            Console.WriteLine(dofCount);
        }
Пример #2
0
        //public void LabelCatchBoundary(NetTriangle Tri, int label)
        //{
        //    if (Tri.HasCatch)
        //    {
        //        double min = new double[3] { Tri.n1.Y, Tri.n2.Y, Tri.n3.Y }.Min();
        //        if(Tri.n1.Y == min)
        //        {
        //            Tri.n1.Label = label;
        //        }
        //        if (Tri.n2.Y == min)
        //        {
        //            Tri.n2.Label = label;
        //        }
        //        if (Tri.n3.Y == min)
        //        {
        //            Tri.n3.Label = label;
        //        }
        //    }
        //}

        public void Apply(Codend Codend, int catchNumber)
        {
            int nTri = Codend.TriangleList.Count;

            if (nTri == 0)
            {
                throw new ArgumentException("Codend should be meshed in order to apply catch. Provide initial shape");
            }

            // Apply by blocked meshes
            if (applyMethod.Equals(method1, StringComparison.InvariantCultureIgnoreCase))
            {
                if (Codend.SameLengthPanels())
                {
                    double CodendLengthInMeshes = Codend.PanelList[0].LengthInMeshes;
                    double NumBlockedMeshes     = BlockedMeshes[catchNumber];


                    if (Codend.PanelList[0].Material.MeshType.Equals("Diamond", StringComparison.InvariantCultureIgnoreCase))
                    {
                        for (int i = 0; i < nTri; i++)
                        {
                            ApplyToDiamondByBlockedMeshes(Codend.TriangleList[i], CodendLengthInMeshes, NumBlockedMeshes);
                        }
                    }
                    else if (Codend.PanelList[0].Material.MeshType.Equals("Square", StringComparison.InvariantCultureIgnoreCase))
                    {
                        for (int i = 0; i < nTri; i++)
                        {
                            ApplyToSquareByBlockedMeshes(Codend.TriangleList[i], CodendLengthInMeshes, NumBlockedMeshes);
                        }
                    }
                }
                else
                {
                    throw new ArgumentException("Panels must have same amount of meshes along to apply catch by blocked meshes method");
                }
            }
            // Apply by length ratios
            else if (applyMethod.Equals(method2, StringComparison.InvariantCultureIgnoreCase))
            {
                if (BlockingRatio[catchNumber] != 0)
                {
                    double blockingRatio = BlockingRatio[catchNumber];
                    for (int i = 0; i < nTri; i++)
                    {
                        ApplyByBlockingRatio(Codend.TriangleList[i], Codend.Length, blockingRatio);
                    }
                }
                else
                {
                    throw new ArgumentException("Blocking ration cannot be 0 to apply catch by blocking ratio method");
                }
            }
        }