Пример #1
0
        private static string CalcOneMethod(SemiSpaceParameters parameters)
        {
            var bound12 = new Parallelepiped(-1, 1, -1, 1, FunctionsForSemiSpace.H, 1, 4, 4, 4)
            {
                Name = BoundNumber.Bound12
            };
            var bound2 = new Parallelepiped(-1, 1, -1, 1, FunctionsForSemiSpace.H, 1, 4, 4, 4)
            {
                Name = BoundNumber.Bound2
            };
            var bound13 = new Parallelepiped(-1, 1, 0, 1, -1, FunctionsForSemiSpace.H, 4, 4, 4)
            {
                Name = BoundNumber.Bound13
            };
            var bound3 = new Parallelepiped(-1, 1, 0, 1, -1, FunctionsForSemiSpace.H, 4, 4, 4)
            {
                Name = BoundNumber.Bound3
            };
            //   var bound12 = new Sphere(new Point3D(5, 0, FunctionsForSemiSpace.H)) { Name = BoundNumber.Bound12 };
            //var bound2 = new Sphere(new Point3D(5, 0, FunctionsForSemiSpace.H)) { Name = BoundNumber.Bound2 };
            //  var bound13 = new Sphere(new Point3D(5, 0, FunctionsForSemiSpace.H)) { Name = BoundNumber.Bound13 };
            //  var bound3 = new Sphere(new Point3D(5, 0, FunctionsForSemiSpace.H)) { Name = BoundNumber.Bound3 };
            var boundWithCondition = ConditionSetter.SetBoundSphere(bound12, bound2, bound13, bound3).ToList();
            //   var boundWithCondition = ConditionSetter.SetBoundSphere(bound12, bound2).ToList();
            var method = MethodFactory.GetSphereMethod(boundWithCondition, null, parameters);

            method.Solve();
            var plotter = PlotterFactory.GetPlotter(method.U, parameters);

            plotter.Plot();
            return(plotter.FormatedFileName);
        }
Пример #2
0
        public PaperKirghoff1UmovaProgram(Bound <Point3D> bound, List <InnerSourceWithFunction <Point3D> > source)
        {
            var boundWithCondition = ConditionSetter.SetDirichletConditionSphere(bound);

            method = MethodFactory.GetCollocationKirghoffMethod(
                boundWithCondition,
                source,
                KirghoffTransformation.Pow,
                KirghoffTransformation.ConversePow);
            method.Solve();
        }
Пример #3
0
        public void DoWork()
        {
            var sw = new Stopwatch();

            sw.Start();
            //  var bound = new ParallelepipedNearBound();
            var bound = new Parallelepiped();
            var boundWithCondition = ConditionSetter.SetKirghoffCondition(bound);
            var source             = new InnerSourcePlate();
            //  var innerSource = new List<InnerSourceWithFunction<Point3D>>(); //no innersors CollocationKirghoffMethod
            var innerSource = InnerSourceFactory.GetSourcesParalelepiped(source);

            var eps = 1;

            var    paperKirghoff = new PaperKirghoff1UmovaProgram(bound, innerSource);
            var    dPrevious     = paperKirghoff.GetSolutionVector();
            Vector dCurrent;

            while (true)
            {
                var method1 = MethodFactory.GetJakobiMethod(boundWithCondition, innerSource, dPrevious);
                method1.Solve();
                dCurrent  = dPrevious + method1.Solution;
                dPrevious = dCurrent;
                Console.WriteLine("d: " + method1.Solution.Norma());
                if (method1.Solution.Norma() < eps)
                {
                    break;
                }
            }
            var method = MethodFactory.GetCollocationKirghoffMethod(
                boundWithCondition,
                innerSource,
                KirghoffTransformation.Pow,
                KirghoffTransformation.ConversePow);

            method.Solution = dCurrent;

            var plotter = PlotterFactory.GetPlotter(bound, method.U);

            plotter.Plot();
            // Console.WriteLine("Total time: " + sw.ElapsedMilliseconds);

            /*f-1*f(d0)=x
             * d1=d0-x,
             * f-1*f(d1)=x
             * d2=d1-x*/
        }
Пример #4
0
        public void DoWork()
        {
            var bound = new Circle(800, 2)
            {
                IsOuter = true
            };

            ////var bound = new Rectangle(new Point2D(-1, -1), new Point2D(1, 1), 160) { IsOuter = true };
            var segment1 = new Segment(new Point2D(-1.1, -1.1), new Point2D(1.1, 1.1), 160);
            ////var segment1 = new Segment(new Point2D(-0.75, 0.1), new Point2D(0, 0.9), 80);
            ////var segment2 = new Segment(new Point2D(-0.75, -0.1), new Point2D(0, -0.9), 80);
            ////var segment3 = new Segment(new Point2D(0.75, 0.1), new Point2D(0, 0.9), 80);
            ////var segment4 = new Segment(new Point2D(0.75, -0.1), new Point2D(0, -0.9), 80);
            var boundWithCondition = ConditionSetter.SetDirichletCondition(segment1, bound);
            var method             = MethodFactory.GetCollocationPaper6Method(boundWithCondition, 1);

            method.Solve();
            var plotter = PlotterFactory.GetPlotter(bound, method.U, 40);

            plotter.Plot();
        }
Пример #5
0
        public void DoWork()
        {
            var bound = new ParallelepipedNearBound();
            // var bound = new Parallelepiped();
            // Writer.OutputIfAllowed(bound, "bound.txt");
            //var boundWithCondition = ConditionSetter.SetMixedCondition(bound);
            var boundWithCondition = ConditionSetter.SetKirghoffCondition(bound);
            // var source = new InnerSourcePlate();
            var source = new List <InnerSourceWithFunction <Point3D> >(); //no innersors CollocationKirghoffMethod
            // var innerSource = InnerSourceFactory.GetSourcesPlate(source);
            //var method = MethodFactory.GetCollocationMethodNearBoundary(boundWithCondition);//, innerSource);
            var method = MethodFactory.GetCollocationKirghoffMethod(
                boundWithCondition,
                source,
                KirghoffTransformation.Exp,
                KirghoffTransformation.ConverseExp);

            method.Solve();
            method.PlotErrorOnBound();
            var plotter = PlotterFactory.GetPlotter(bound, method.U);

            plotter.Plot();
        }
Пример #6
0
        public void DoWork()
        {
            double lambda1 = 10, lambda2 = 1;
            int    circleN = 128, squareN = 32;
            var    circle = new Circle(circleN, 1)
            {
                IsOuter = true
            };
            var square             = new Rectangle(squareN / 4, squareN / 4);
            var boundWithCondition = ConditionSetter.SetDirichletCondition(square, circle);
            var method             = MethodFactory.GetCollocationPaper4Method(boundWithCondition, lambda1, lambda2);

            method.Solve();
            string fileName = string.Format("plot2D;Lambda1={0};Lambda2={1};f=0;g=x2;.txt", lambda1, lambda2);
            var    plotter  = PlotterFactory.GetPlotter(circle, method.U, fileName, 40);

            plotter.Plot();
            var lineFileName = string.Format(
                "NCircle={0};NSquare={1};L1=10;L2=1;f=0;g=x2;.txt", circleN, squareN);
            var linePloter = new LinePlotter2D(circle, method.U, lineFileName);

            linePloter.Plot();
        }