/// <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; }
/// <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)); }
/// <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)); }
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)); }
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)); }
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)); }
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"); } }
public Solver(MinimisationParameters parameters, IRootFindingAlgorithm strategy) { this.parameters = parameters; this.rootFindingStrategy = strategy; }
public SquareRootOfNine(IRootFindingAlgorithm algorithm) : base(algorithm) { }
public YieldToMaturity(IEnumerable<double> stream, IRootFindingAlgorithm algorithm) : base(algorithm) { this.stream = stream.ToList(); }
protected MinimisationProblem(IRootFindingAlgorithm algorithm) { this.Algorithm = algorithm; this.objectiveFunction = this.CreateObjectiveFunction(); this.minimisationParameters = this.CreateMinimisationParameters(); }