コード例 #1
0
        private bool AreEdgeTrackingBoundaryConditionsFullfilled(
            IntersectionParametrisation?previousParametrisation,
            IntersectionParametrisation?currentIntersectionParametrisation
            )
        {
            if (!(currentIntersectionParametrisation?.IsValid() ?? false))
            {
                return(true);
            }

            if (!previousParametrisation.HasValue)
            {
                return(false);
            }

            Debug.Assert(
                currentIntersectionParametrisation != null,
                "currentIntersectionParametrisation != null"
                );

            if (MinimumStepLength >=
                IntersectionParametrisation.DistanceNormMax(
                    previousParametrisation.Value,
                    currentIntersectionParametrisation.Value
                    ))
            {
                return(true);
            }

            return(false);
        }
コード例 #2
0
        private IntersectionParametrisation?GetNextInitialGuess(
            IntersectionParametrisation previousGuess
            )
        {
            var previousPoint = ((Vector3D)_surfaces[0].Evaluate(
                                     previousGuess.First
                                     )).ToMathVector();

            var tangent = EvaluateTangent(previousGuess).ToMathVector();

            var iterationNumber        = 0;
            var currentParametrisation = previousGuess;

            do
            {
                var nextParametrisation = EvaluateNextGuessNewtonStep(
                    currentParametrisation,
                    previousPoint,
                    tangent
                    );

                if (!nextParametrisation.IsValid())
                {
                    return(null);
                }

                if (MinimumStepLength >=
                    IntersectionParametrisation.DistanceNormMax(
                        nextParametrisation,
                        currentParametrisation
                        ))
                {
                    return(nextParametrisation);
                }

                currentParametrisation = nextParametrisation;
            } while (++iterationNumber < MaximumNewtonIterations);

            return(null);
        }
コード例 #3
0
        private IntersectionParametrisation?FindFirstIntersection(
            Parametrisation startingParametersFirstSurface,
            Parametrisation startingParametersSecondSurface
            )
        {
            var currentParametrisation = new IntersectionParametrisation(
                startingParametersFirstSurface,
                startingParametersSecondSurface
                );

            var iterationNumber = 0;

            do
            {
                var nextParametrisation = EvaluateTwoSurfacesNewtonStep(
                    currentParametrisation
                    );

                if (!nextParametrisation.IsValid())
                {
                    return(null);
                }

                if (MinimumStepLength >=
                    IntersectionParametrisation.DistanceNormMax(
                        nextParametrisation,
                        currentParametrisation
                        ))
                {
                    return(nextParametrisation);
                }

                currentParametrisation = nextParametrisation;
            } while (++iterationNumber < MaximumNewtonIterations);

            return(null);
        }