コード例 #1
0
ファイル: LineSegment.cs プロジェクト: rohitvuppala/BoSSS
        /// <summary>
        /// Constructs a new segment with the given start and end points
        /// </summary>
        /// <param name="spatialDimension">
        /// The spatial dimension of start and end points
        /// </param>
        /// <param name="start">
        /// The start point of the segment
        /// </param>
        /// <param name="end">
        /// The end point of the segment
        /// </param>
        /// <param name="iVertexStart">
        /// Optional vertex index of the start point in some list of vertices
        /// containing <paramref name="start"/>. Used by some callers to evade
        /// equality comparisons of double values.
        /// </param>
        /// <param name="iVertexEnd">
        /// Optional vertex index of the end point in some list of vertices
        /// containing <paramref name="end"/>. Used by some callers to evade
        /// equality comparisons of double values.
        /// </param>
        /// <param name="Kräf">
        /// Reference element.
        /// </param>
        /// <param name="rootFindingAlgorithm">
        /// The desired root finding algorithm. By default,
        /// <see cref="DefaultRootFindingAlgorithm"/> will be used.
        /// </param>
        public LineSegment(
            int spatialDimension,
            RefElement Kräf,
            Vector start,
            Vector end,
            int iVertexStart = -1,
            int iVertexEnd   = -1,
            IRootFindingAlgorithm rootFindingAlgorithm = null)
        {
            if (start.Dim != spatialDimension)
            {
                throw new ArgumentException();
            }
            if (end.Dim != spatialDimension)
            {
                throw new ArgumentException();
            }

            this.m_Kref          = Kräf;
            this.iVertexStart    = iVertexStart;
            this.iVertexEnd      = iVertexEnd;
            this.Start           = start;
            this.End             = end;
            RootFindingAlgorithm = rootFindingAlgorithm ?? DefaultRootFindingAlgorithm;
        }
コード例 #2
0
        /// <summary>
        /// Gauss rules for \f$ \oint_{\frakI \cap K_j } \ldots \dS \f$ in the 3D case
        /// </summary>
        ///
        public static IQuadRuleFactory <QuadRule> SayeGaussRule_Volume3D(
            LevelSetTracker.LevelSetData _lsData,
            IRootFindingAlgorithm RootFinder)
        {
            ISayeGaussRule rule = new SayeFactory_Cube(
                _lsData,
                RootFinder,
                SayeFactory_Cube.QuadratureMode.Volume);

            return(new SayeGaussRuleFactory(rule));
        }
コード例 #3
0
        /// <summary>
        /// Gauss rules for \f$ \oint_{\frakI \cap K_j } \ldots \dS \f$ in the 2D case
        /// </summary>
        public static IQuadRuleFactory <QuadRule> SayeGaussRule_LevelSet2D(
            LevelSetTracker.LevelSetData _lsData,
            IRootFindingAlgorithm RootFinder)
        {
            ISayeGaussRule rule = new SayeFactory_Square(
                _lsData,
                RootFinder,
                SayeFactory_Square.QuadratureMode.Surface);

            return(new SayeGaussRuleFactory(rule));
        }
コード例 #4
0
 public SayeFactory_Cube(
     LevelSetTracker.LevelSetData _lsData,
     IRootFindingAlgorithm RootFinder,
     QuadratureMode Mode)
 {
     this.lsData     = _lsData;
     this.rootFinder = RootFinder;
     mode            = Mode;
     grid            = lsData.GridDat;
     iKref           = lsData.GridDat.iGeomCells.RefElements.IndexOf(this.RefElement, (A, B) => object.ReferenceEquals(A, B));
 }
コード例 #5
0
        public static SayeGaussComboRuleFactory SayeGaussRule_Combo3D(
            LevelSetTracker.LevelSetData _lsData,
            IRootFindingAlgorithm RootFinder
            )
        {
            ISayeGaussComboRule rule = new SayeFactory_Cube(
                _lsData,
                RootFinder,
                SayeFactory_Cube.QuadratureMode.Combo
                );

            return(new SayeGaussComboRuleFactory(
                       rule,
                       SayeGaussComboRuleFactory.Mode.CalculateOnceAfterInstantiation));
        }
コード例 #6
0
        public static SayeGaussComboRuleFactory SayeGaussRule_Combo3D(
            LevelSetTracker.LevelSetData lsData,
            IRootFindingAlgorithm RootFinder
            )
        {
            ISayeGaussComboRule rule = new SayeFactory_Cube(
                lsData,
                RootFinder,
                SayeFactory_Cube.QuadratureMode.Combo
                );
            CellMask maxGrid = lsData.GridDat.Cells.GetCells4Refelement(rule.RefElement).Intersect(
                lsData.Region.GetCutCellMask().ToGeometicalMask());

            return(new SayeGaussComboRuleFactory(
                       rule,
                       maxGrid));
        }
コード例 #7
0
        public static SayeGaussComboRuleFactory SayeGaussRule_Combo(
            LevelSetTracker.LevelSetData _lsData,
            IRootFindingAlgorithm RootFinder)
        {
            RefElement refElem = _lsData.GridDat.Grid.GetRefElement(0);

            if (refElem is Grid.RefElements.Square)
            {
                return(SayeGaussRule_Combo2D(_lsData, RootFinder));
            }
            else if (refElem is Grid.RefElements.Cube)
            {
                return(SayeGaussRule_Combo3D(_lsData, RootFinder));
            }
            else
            {
                throw new NotImplementedException("Saye quadrature not available for this RefElement");
            }
        }
コード例 #8
0
ファイル: Solver.cs プロジェクト: CatchemAl/QPTests
 public Solver(MinimisationParameters parameters, IRootFindingAlgorithm strategy)
 {
     this.parameters          = parameters;
     this.rootFindingStrategy = strategy;
 }
コード例 #9
0
 public SquareRootOfNine(IRootFindingAlgorithm algorithm)
     : base(algorithm)
 {
 }
コード例 #10
0
 public Solver(MinimisationParameters parameters, IRootFindingAlgorithm strategy)
 {
     this.parameters = parameters;
     this.rootFindingStrategy = strategy;
 }
コード例 #11
0
        public YieldToMaturity(IEnumerable<double> stream, IRootFindingAlgorithm algorithm)
            : base(algorithm)
        {
            this.stream = stream.ToList();

        }
コード例 #12
0
 protected MinimisationProblem(IRootFindingAlgorithm algorithm)
 {
     this.Algorithm = algorithm;
     this.objectiveFunction = this.CreateObjectiveFunction();
     this.minimisationParameters = this.CreateMinimisationParameters();
 }