/// <summary>
        /// Creates an instance of <see cref="LoadCombination">LoadCombination</see> from the load cases in <paramref name="temporaryLoadCases"/>,
        /// the first load case is the leading action.
        /// </summary>
        /// <param name="temporaryLoadCases">List of permanent load cases to be included in the combination</param>
        /// <param name="loadCombNumber">The index of the combination</param>
        /// <param name="loadCombinationNameTag">The name tag used for naming the combination</param>
        /// <param name="permanentLoadGroups">List of permanent load groups</param>
        /// <param name="combinationType">Type of loda combination <see cref="ELoadCombinationType">ELoadCombinationType</see></param>
        /// <returns></returns>
        private LoadCombination CreateLoadCombination(List <ModelLoadCaseInGroup> temporaryLoadCases, int loadCombNumber, string loadCombinationNameTag,
                                                      List <LoadGroupPermanent> permanentLoadGroups, ELoadCombinationType combinationType)
        {
            List <double>   loadCombGammas = new List <double>();
            List <LoadCase> loadCases      = new List <LoadCase>();

            // Add permanent load cases and coefficients
            AddPermanentLoadCases(permanentLoadGroups, loadCases, combinationType, loadCombGammas);

            // Add variable load cases
            string leadingActionName;

            leadingActionName = AddTemporaryLoadCases(temporaryLoadCases, combinationType, loadCases,
                                                      loadCombGammas);

            // Create load combination
            string loadCombName;

            if (combinationType == ELoadCombinationType.SixTenA)
            {
                loadCombName = "LC " + loadCombNumber.ToString() + " " + loadCombinationNameTag;
            }
            else
            {
                loadCombName = "LC " + loadCombNumber.ToString() + " " + loadCombinationNameTag + " - " + leadingActionName + " as leading action";
            }
            LoadCombination loadCombination = new LoadCombination(loadCombName, LoadCombinationType(combinationType), loadCases, loadCombGammas);

            return(loadCombination);
        }
Exemplo n.º 2
0
        public static LoadCombination CreateLoadCombination(string name, [DefaultArgument("\"ultimate_ordinary\"")] string type, List <LoadCase> loadCases, List <double> gammas)
        {
            var             _type           = FemDesign.GenericClasses.EnumParser.Parse <LoadCombType>(type);
            LoadCombination loadCombination = new LoadCombination(name, _type, loadCases, gammas);

            return(loadCombination);
        }
        ///<summary>
        /// Adds load combinations if not already present in LoadCombinations
        ///</summary>
        private void AddLoadCombination(LoadCombination loadCombination)
        {
            bool areLoadCasesSame = false;
            bool areGammasSame    = false;

            foreach (LoadCombination currentLoadCombination in LoadCombinations)
            {
                areLoadCasesSame = currentLoadCombination.ModelLoadCase.SequenceEqual(loadCombination.ModelLoadCase, new GenericClasses.ModelLoadCaseComparer());
                areGammasSame    = Enumerable.SequenceEqual(currentLoadCombination.GetGammas(), loadCombination.GetGammas());
            }

            if (!(areLoadCasesSame && areGammasSame))
            {
                LoadCombinations.Add(loadCombination);
            }
        }