コード例 #1
0
        static void Main()
        {
            // PRACTICAL EXAMPLE: SETTING UP LOAD GROUPS
            // This example shows the core steps of creating load groups for a model.

            // This example was last updated 2022-04-06, using the ver. 21.1.0 FEM-Design API.


            // CREATING LOAD CASES
            LoadCase deadLoad1 = new LoadCase("Deadload1", LoadCaseType.DeadLoad, LoadCaseDuration.Permanent);
            LoadCase deadLoad2 = new LoadCase("Deadload2", LoadCaseType.DeadLoad, LoadCaseDuration.Permanent);
            LoadCase liveLoad1 = new LoadCase("Liveload1", LoadCaseType.Static, LoadCaseDuration.Permanent);
            LoadCase liveLoad2 = new LoadCase("Liveload2", LoadCaseType.Static, LoadCaseDuration.Permanent);

            List <LoadCase> loadCasesDeadLoads = new List <LoadCase>()
            {
                deadLoad1, deadLoad2
            };
            List <LoadCase> loadCaseLiveLoads = new List <LoadCase>()
            {
                liveLoad1, liveLoad2
            };


            // FETCHING LOAD CATEGORY DATABASE
            var          loadCategoryDatabase = LoadCategoryDatabase.GetDefault();
            LoadCategory loadCategory         = loadCategoryDatabase.LoadCategoryByName("A");


            // CREATING LOAD GROUPS
            var LG1 = new ModelGeneralLoadGroup(new LoadGroupPermanent(1, 1.35, 1, 1, loadCasesDeadLoads, ELoadGroupRelationship.Simultaneous, 0.89, "LG1"));
            var LG2 = new ModelGeneralLoadGroup(new LoadGroupTemporary(1.5, loadCategory.Psi0, loadCategory.Psi1, loadCategory.Psi2, true, loadCaseLiveLoads, ELoadGroupRelationship.Alternative, "LG2"));

            var loadGroups = new List <ModelGeneralLoadGroup>()
            {
                LG1, LG2
            };


            // CREATING AND OPENING NEW MODEL
            var model2 = new Model(Country.S, null, null, loadCasesDeadLoads.Concat(loadCaseLiveLoads).ToList(), null, loadGroups);

            string path = Path.GetFullPath("output/LoadGroups.struxml");

            if (!Directory.Exists("output"))
            {
                Directory.CreateDirectory("output");
            }

            model2.SerializeModel(path);
            var app = new Calculate.Application();

            app.OpenStruxml(path, true);
        }
コード例 #2
0
        private List <LoadCombination> CreateLoadCombinations()
        {
            // Create load cases
            LoadCase        deadLoad1          = new LoadCase("Deadload1", LoadCaseType.DeadLoad, LoadCaseDuration.Permanent);
            LoadCase        deadLoad2          = new LoadCase("Deadload2", LoadCaseType.DeadLoad, LoadCaseDuration.Permanent);
            LoadCase        liveLoad1          = new LoadCase("Liveload1", LoadCaseType.Static, LoadCaseDuration.Permanent);
            LoadCase        liveLoad2          = new LoadCase("Liveload2", LoadCaseType.Static, LoadCaseDuration.Permanent);
            LoadCase        windLoad1          = new LoadCase("Windload1", LoadCaseType.Static, LoadCaseDuration.Permanent);
            LoadCase        windLoad2          = new LoadCase("Windload2", LoadCaseType.Static, LoadCaseDuration.Permanent);
            List <LoadCase> loadCasesDeadLoads = new List <LoadCase>()
            {
                deadLoad1, deadLoad2
            };
            List <LoadCase> loadCaseCategoryA = new List <LoadCase>()
            {
                liveLoad1, liveLoad2
            };
            List <LoadCase> loadCaseCategoryWind = new List <LoadCase>()
            {
                windLoad1, windLoad2
            };
            List <LoadCase> loadCases = loadCasesDeadLoads.Concat(loadCaseCategoryA).Concat(loadCaseCategoryWind).ToList();

            // Get the load categories that hold the coefficients
            var          loadCategoryDatabase = LoadCategoryDatabase.GetDefault();
            LoadCategory loadCategoryA        = loadCategoryDatabase.LoadCategoryByName("A");
            LoadCategory loadCategoryWind     = loadCategoryDatabase.LoadCategoryByName("Wind");

            // Create load groups
            var LGPermanent = new LoadGroupPermanent(1, 1.35, 1, 1, loadCasesDeadLoads, ELoadGroupRelationship.Entire, 0.89, "LGPermanent");
            var LGA         = new LoadGroupTemporary(1.5, loadCategoryA.Psi0, loadCategoryA.Psi1, loadCategoryA.Psi2, true, loadCaseCategoryA, ELoadGroupRelationship.Alternative, "LGCategoryA");
            var LGWind      = new LoadGroupTemporary(1.5, loadCategoryWind.Psi0, loadCategoryWind.Psi1, loadCategoryWind.Psi2, true, loadCaseCategoryWind, ELoadGroupRelationship.Alternative, "LGCategoryWind");

            var loadGroups = new List <LoadGroupBase>()
            {
                LGPermanent, LGA, LGWind
            };

            // Generate ULS and SLS Combinations
            LoadCombinationTable loadCombinationTable = new LoadCombinationTable();

            Program.CombineULS(loadGroups, loadCombinationTable);
            Program.CombineSLS(loadGroups, loadCombinationTable);
            return(loadCombinationTable.LoadCombinations);
        }
コード例 #3
0
        static void Main()
        {
            // PRACTICAL EXAMPLE: COMBINING LOAD GROUPS
            // This example shows the steps for creating a complete set of load combination,
            // combining existing load groups. In addition to the main program, there are two
            // public functions at the bottom - CombineULS and CombineSLS.

            // This example was last updated 2022-04-06, using the ver. 21.1.0 FEM-Design API.


            // Create load cases
            LoadCase        deadLoad1          = new LoadCase("Deadload1", LoadCaseType.DeadLoad, LoadCaseDuration.Permanent);
            LoadCase        deadLoad2          = new LoadCase("Deadload2", LoadCaseType.DeadLoad, LoadCaseDuration.Permanent);
            LoadCase        liveLoad1          = new LoadCase("Liveload1", LoadCaseType.Static, LoadCaseDuration.Permanent);
            LoadCase        liveLoad2          = new LoadCase("Liveload2", LoadCaseType.Static, LoadCaseDuration.Permanent);
            LoadCase        windLoad1          = new LoadCase("Windload1", LoadCaseType.Static, LoadCaseDuration.Permanent);
            LoadCase        windLoad2          = new LoadCase("Windload2", LoadCaseType.Static, LoadCaseDuration.Permanent);
            List <LoadCase> loadCasesDeadLoads = new List <LoadCase>()
            {
                deadLoad1, deadLoad2
            };
            List <LoadCase> loadCaseCategoryA = new List <LoadCase>()
            {
                liveLoad1, liveLoad2
            };
            List <LoadCase> loadCaseCategoryWind = new List <LoadCase>()
            {
                windLoad1, windLoad2
            };
            List <LoadCase> loadCases = loadCasesDeadLoads.Concat(loadCaseCategoryA).Concat(loadCaseCategoryWind).ToList();


            // Get the load categories that hold the coefficients
            var          loadCategoryDatabase = LoadCategoryDatabase.GetDefault();
            LoadCategory loadCategoryA        = loadCategoryDatabase.LoadCategoryByName("A");
            LoadCategory loadCategoryWind     = loadCategoryDatabase.LoadCategoryByName("Wind");


            // Create load groups
            var LGPermanent = new LoadGroupPermanent(1, 1.35, 1, 1, loadCasesDeadLoads, ELoadGroupRelationship.Entire, 0.89, "LGPermanent");
            var LGA         = new LoadGroupTemporary(1.5, loadCategoryA.Psi0, loadCategoryA.Psi1, loadCategoryA.Psi2, true, loadCaseCategoryA, ELoadGroupRelationship.Alternative, "LGCategoryA");
            var LGWind      = new LoadGroupTemporary(1.5, loadCategoryWind.Psi0, loadCategoryWind.Psi1, loadCategoryWind.Psi2, true, loadCaseCategoryWind, ELoadGroupRelationship.Alternative, "LGCategoryWind");

            var loadGroups = new List <LoadGroupBase>()
            {
                LGPermanent, LGA, LGWind
            };


            // Wrap the load groups so that they can be added to the load group table
            var generalLoadGroups = new List <ModelGeneralLoadGroup>()
            {
                new ModelGeneralLoadGroup(LGPermanent), new ModelGeneralLoadGroup(LGA),
                new ModelGeneralLoadGroup(LGWind)
            };

            // Generate ULS and SLS Combinations
            List <LoadCombination> loadCombinations;
            LoadCombinationTable   loadCombinationTable = new LoadCombinationTable();

            CombineULS(loadGroups, loadCombinationTable);
            CombineSLS(loadGroups, loadCombinationTable);
            loadCombinations = loadCombinationTable.LoadCombinations;


            // Create model and open file in FEM design
            var model2 = new Model(Country.S, null, null, loadCases, loadCombinations, generalLoadGroups);

            string path = Path.GetFullPath("output/LoadGroupsAndCombinations.struxml");

            if (!Directory.Exists("output"))
            {
                Directory.CreateDirectory("output");
            }

            model2.SerializeModel(path);
            var app = new Calculate.Application();

            app.OpenStruxml(path, true);
        }