Exemplo n.º 1
0
        /// <summary>
        /// Retrieves the solution control parameters for the analysis case.
        /// </summary>
        /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception>
        public void FillSolutionControlParameters()
        {
            if (_apiApp == null)
            {
                return;
            }
            _apiApp.GetSolutionControlParameters(CaseName,
                                                 out var maxTotalSteps,
                                                 out var maxNullSteps,
                                                 out var maxConstantStiffnessIterationsPerStep,
                                                 out var maxNewtonRaphsonIterationsPerStep,
                                                 out var relativeIterationConvergenceTolerance,
                                                 out var useEventStepping,
                                                 out var relativeEventLumpingTolerance,
                                                 out var maxNumberLineSearches,
                                                 out var relativeLineSearchAcceptanceTolerance,
                                                 out var lineSearchStepFactor);

            _solutionControlParameters = new SolutionControlParameters
            {
                MaxTotalSteps = maxTotalSteps,
                MaxNullSteps  = maxNullSteps,
                MaxConstantStiffnessIterationsPerStep = maxConstantStiffnessIterationsPerStep,
                MaxNewtonRaphsonIterationsPerStep     = maxNewtonRaphsonIterationsPerStep,
                RelativeIterationConvergenceTolerance = relativeIterationConvergenceTolerance,
                UseEventStepping = useEventStepping,
                RelativeEventLumpingTolerance         = relativeEventLumpingTolerance,
                MaxNumberLineSearches                 = maxNumberLineSearches,
                RelativeLineSearchAcceptanceTolerance = relativeLineSearchAcceptanceTolerance,
                LineSearchStepFactor = lineSearchStepFactor
            };
        }
Exemplo n.º 2
0
        /// <summary>
        /// Sets the solution control parameters for the analysis case.
        /// </summary>
        /// <param name="solutionControlParameters">The solution control parameters.</param>
        /// <exception cref="CSiException"><see cref="CSiApiBase.API_DEFAULT_ERROR_CODE" /></exception>
        public void SetSolutionControlParameters(SolutionControlParameters solutionControlParameters)
        {
            _apiApp?.SetSolutionControlParameters(CaseName,
                                                  solutionControlParameters.MaxTotalSteps,
                                                  solutionControlParameters.MaxNullSteps,
                                                  solutionControlParameters.MaxConstantStiffnessIterationsPerStep,
                                                  solutionControlParameters.MaxNewtonRaphsonIterationsPerStep,
                                                  solutionControlParameters.RelativeIterationConvergenceTolerance,
                                                  solutionControlParameters.UseEventStepping,
                                                  solutionControlParameters.RelativeEventLumpingTolerance,
                                                  solutionControlParameters.MaxNumberLineSearches,
                                                  solutionControlParameters.RelativeLineSearchAcceptanceTolerance,
                                                  solutionControlParameters.LineSearchStepFactor);

            _solutionControlParameters = solutionControlParameters;
        }