/// <summary>
 ///Method create model in proj environment
 /// </summary>
 private static void CreateModel(Structure model)
 {
     #region  ---------- Geometry -----------
     #region Create Materials
     Material concmat  = new Material(Guid.NewGuid(), "conc", (int)Material_Type.Concrete, "C30/37");
     Material steelmat = new Material(Guid.NewGuid(), "steel", (int)Material_Type.Steel, "S 355");
     foreach (var x in new List <Material> {
         concmat, steelmat
     })
     {
         model.CreateMaterial(x);
     }
     #endregion
     #region Create Cross Sections
     CrossSectionManufactured hea260      = new CrossSectionManufactured(Guid.NewGuid(), "steel.HEA", steelmat.Id, "HEA260", 1, 0);
     CrossSectionParametric   rect300x300 = new CrossSectionParametric(Guid.NewGuid(), "r300x300", concmat.Id, 1, new double[] { 300.0, 300.0 });
     model.CreateCrossSection(hea260);
     model.CreateCrossSection(rect300x300);
     #endregion
     #region Create Nodes
     double     a  = 5.0;
     double     b  = 6.0;
     double     c  = 4.0;
     StructNode n1 = new StructNode(Guid.NewGuid(), "n1", 0, 0, 0);
     StructNode n2 = new StructNode(Guid.NewGuid(), "n2", a, 0, 0);
     StructNode n3 = new StructNode(Guid.NewGuid(), "n3", a, b, 0);
     StructNode n4 = new StructNode(Guid.NewGuid(), "n4", 0, b, 0);
     StructNode n5 = new StructNode(Guid.NewGuid(), "n5", 0, 0, c);
     StructNode n6 = new StructNode(Guid.NewGuid(), "n6", a, 0, c);
     StructNode n7 = new StructNode(Guid.NewGuid(), "n7", a, b, c);
     StructNode n8 = new StructNode(Guid.NewGuid(), "n8", 0, b, c);
     foreach (var x in new List <StructNode> {
         n1, n2, n3, n4, n5, n6, n7, n8
     })
     {
         model.CreateNode(x);
     }
     #endregion
     #region Create Beams
     Beam b1 = new Beam(Guid.NewGuid(), beamName, hea260.Id, new Guid[2] {
         n1.Id, n5.Id
     });
     Beam b2 = new Beam(Guid.NewGuid(), "b2", hea260.Id, new Guid[2] {
         n2.Id, n6.Id
     });
     Beam b3 = new Beam(Guid.NewGuid(), "b3", hea260.Id, new Guid[2] {
         n3.Id, n7.Id
     });
     Beam b4 = new Beam(Guid.NewGuid(), "b4", hea260.Id, new Guid[2] {
         n4.Id, n8.Id
     });
     foreach (var x in new List <Beam> {
         b1, b2, b3, b4
     })
     {
         model.CreateBeam(x);
     }
     #endregion
     #region Create Slab
     double thickness = 0.30;
     Slab   s1        = new Slab(Guid.NewGuid(), SlabName, (int)Slab_Type.Plate, concmat.Id, thickness, new Guid[4] {
         n5.Id, n6.Id, n7.Id, n8.Id
     });
     model.CreateSlab(s1);
     #endregion
     #region Create Support - in Node
     PointSupport Su1 = new PointSupport(Guid.NewGuid(), "Su1", n1.Id)
     {
         ConstraintRx = eConstraintType.Free, ConstraintRy = eConstraintType.Free, ConstraintRz = eConstraintType.Free
     };
     PointSupport Su2 = new PointSupport(Guid.NewGuid(), "Su2", n2.Id)
     {
         ConstraintZ = eConstraintType.Flexible, StiffnessZ = 10000.0
     };
     PointSupport Su3 = new PointSupport(Guid.NewGuid(), "Su3", n3.Id);
     PointSupport Su4 = new PointSupport(Guid.NewGuid(), "Su4", n4.Id);
     foreach (var x in new List <PointSupport> {
         Su1, Su2, Su3, Su4
     })
     {
         model.CreatePointSupport(x);
     }
     #endregion
     #region Create Support - on Beam & on Slab Edge
     LineSupport lineSupport_onBeam = new LineSupport(Guid.NewGuid(), "linSupBeam", b1.Id)
     {
         ConstraintRx = eConstraintType.Free,
         ConstraintRy = eConstraintType.Free,
         ConstraintRz = eConstraintType.Free,
         ConstraintX  = eConstraintType.Flexible,
         StiffnessX   = 10.0,
         ConstraintY  = eConstraintType.Flexible,
         StiffnessY   = 10.0,
         ConstraintZ  = eConstraintType.Flexible,
         StiffnessZ   = 10.0,
     };
     LineSupport lineSupport_onEdge = new LineSupport(Guid.NewGuid(), "linSupEdge", s1.Id)
     {
         ConstraintRx = eConstraintType.Free,
         ConstraintRy = eConstraintType.Free,
         ConstraintRz = eConstraintType.Free,
         ConstraintX  = eConstraintType.Flexible,
         StiffnessX   = 10.0,
         ConstraintY  = eConstraintType.Flexible,
         StiffnessY   = 10.0,
         ConstraintZ  = eConstraintType.Flexible,
         StiffnessZ   = 10.0,
         EdgeIndex    = 2
     };
     foreach (var x in new List <LineSupport> {
         lineSupport_onBeam, lineSupport_onEdge
     })
     {
         model.CreateLineSupport(x);
     }
     #endregion
     #endregion
     #region  ---------- Loads ---------------
     #region Create Load Group
     LoadGroup lgperm = new LoadGroup(Guid.NewGuid(), "lgperm", (int)eLoadGroup_Load.eLoadGroup_Load_Permanent);
     LoadGroup lgvar1 = new LoadGroup(Guid.NewGuid(), "lgvar1", (int)eLoadGroup_Load.eLoadGroup_Load_Variable);
     LoadGroup lgvar2 = new LoadGroup(Guid.NewGuid(), "lgvar2", (int)eLoadGroup_Load.eLoadGroup_Load_Variable);
     LoadGroup lgvar3 = new LoadGroup(Guid.NewGuid(), "lgvar3", (int)eLoadGroup_Load.eLoadGroup_Load_Variable);
     foreach (var x in new List <LoadGroup> {
         lgperm, lgvar1, lgvar2, lgvar3
     })
     {
         model.CreateLoadGroup(x);
     }
     #endregion
     #region Create Load Case
     LoadCase lc_sw    = new LoadCase(Guid.NewGuid(), "lc_sw", (int)LoadCase_actionType.Permanent, lgperm.Id, (int)LoadCase_loadCaseType.SelfWeight);
     LoadCase lc_perm  = new LoadCase(Lc1Id, "lc_perm", (int)LoadCase_actionType.Permanent, lgperm.Id, (int)LoadCase_loadCaseType.Standard);
     LoadCase lc_var1  = new LoadCase(Guid.NewGuid(), "lc_var1", (int)LoadCase_actionType.Variable, lgvar1.Id, (int)LoadCase_loadCaseType.Static);
     LoadCase lc_var2  = new LoadCase(Guid.NewGuid(), "lc_var2", (int)LoadCase_actionType.Variable, lgvar2.Id, (int)LoadCase_loadCaseType.Static);
     LoadCase lc_var3a = new LoadCase(Guid.NewGuid(), "lc_var3a", (int)LoadCase_actionType.Variable, lgvar3.Id, (int)LoadCase_loadCaseType.Static);
     LoadCase lc_var3b = new LoadCase(Guid.NewGuid(), "lc_var3b", (int)LoadCase_actionType.Variable, lgvar3.Id, (int)LoadCase_loadCaseType.Static);
     LoadCase lc_var3c = new LoadCase(Guid.NewGuid(), "lc_var3c", (int)LoadCase_actionType.Variable, lgvar3.Id, (int)LoadCase_loadCaseType.Static);
     foreach (var x in new List <LoadCase> {
         lc_sw, lc_perm
     })
     {
         model.CreateLoadCase(x);
     }
     #endregion
     #region Create Load Combinations
     CombinationItem[] combinationItems = new CombinationItem[]
     {
         new CombinationItem(lc_sw.Id, 1.0), new CombinationItem(Lc1Id, 1.0),
         // new CombinationItem(lc_var1.Id, 1.0), new CombinationItem(lc_var2.Id, 1.0),
         // new CombinationItem(lc_var3a.Id, 1.0), new CombinationItem(lc_var3b.Id, 1.0), new CombinationItem(lc_var3c.Id, 1.0)
     };
     Combination C_EnUlsB = new Combination(C1Id, "C_EnUlsB", combinationItems)
     {
         Category         = eLoadCaseCombinationCategory.AccordingNationalStandard,
         NationalStandard = eLoadCaseCombinationStandard.EnUlsSetB,
     };
     Combination C_EnUlsC = new Combination(Guid.NewGuid(), "C_EnUlsC", combinationItems)
     {
         Category         = eLoadCaseCombinationCategory.AccordingNationalStandard,
         NationalStandard = eLoadCaseCombinationStandard.EnUlsSetC
     };
     Combination C_EnSlsChar = new Combination(Guid.NewGuid(), "C_EnSlsChar", combinationItems)
     {
         Category         = eLoadCaseCombinationCategory.AccordingNationalStandard,
         NationalStandard = eLoadCaseCombinationStandard.EnSlsCharacteristic
     };
     Combination C_EnSlsFreq = new Combination(Guid.NewGuid(), "C_EnSlsFreq", combinationItems)
     {
         Category         = eLoadCaseCombinationCategory.AccordingNationalStandard,
         NationalStandard = eLoadCaseCombinationStandard.EnSlsFrequent
     };
     Combination C_EnSlsQP = new Combination(Guid.NewGuid(), "C_EnSlsQP", combinationItems)
     {
         Category         = eLoadCaseCombinationCategory.AccordingNationalStandard,
         NationalStandard = eLoadCaseCombinationStandard.EnSlsQuasiPermanent
     };
     Combination C_Acc1 = new Combination(Guid.NewGuid(), "C_Acc1", combinationItems)
     {
         //Category = eLoadCaseCombinationCategory.AccidentalLimitState,
         Category         = eLoadCaseCombinationCategory.AccordingNationalStandard,
         NationalStandard = eLoadCaseCombinationStandard.EnAccidental1
     };
     Combination C_Acc2 = new Combination(Guid.NewGuid(), "C_Acc2", combinationItems)
     {
         //Category = eLoadCaseCombinationCategory.AccidentalLimitState,
         Category         = eLoadCaseCombinationCategory.AccordingNationalStandard,
         NationalStandard = eLoadCaseCombinationStandard.EnAccidental2
     };
     Combination C_ULS = new Combination(Guid.NewGuid(), "C_ULS", combinationItems)
     {
         Category = eLoadCaseCombinationCategory.UltimateLimitState,
     };
     Combination C_SLS = new Combination(Guid.NewGuid(), "C_SLS", combinationItems)
     {
         Category = eLoadCaseCombinationCategory.ServiceabilityLimitState
     };
     foreach (var x in new List <Combination> {
         C_EnUlsB, C_EnUlsC, C_EnSlsChar, C_EnSlsFreq, C_EnSlsQP, C_Acc1, C_Acc2
     })
     {
         model.CreateCombination(x);
     }
     #endregion
     #region Create Load - Point Loads - in Node
     double loadValue;
     loadValue = -12500.0;
     PointLoadInNode pln1 = new PointLoadInNode(Guid.NewGuid(), "pln1", loadValue, lc_perm.Id, n4.Id, (int)eDirection.X);
     model.CreatePointLoadInNode(pln1);
     #endregion
     #region Create Load - Point Loads - Free
     loadValue = -12500.0;
     PointLoadFree plf1 = new PointLoadFree(Guid.NewGuid(), "plf1", lc_perm.Id, loadValue, a / 3.0, b / 3.0, c, (int)eDirection.Z, c - 1.0, c + 1.0);
     model.CreatePointLoadFree(plf1);
     #endregion
     #region Create Load - Surface Loads - on Slab
     loadValue = -12500.0;
     SurfaceLoad sf1 = new SurfaceLoad(Guid.NewGuid(), "sf1", loadValue, lc_perm.Id, s1.Id, (int)eDirection.Z);
     SurfaceLoad sf2 = new SurfaceLoad(Guid.NewGuid(), "sf2", loadValue, lc_var1.Id, s1.Id, (int)eDirection.Y);
     SurfaceLoad sf3 = new SurfaceLoad(Guid.NewGuid(), "sf3", loadValue, lc_var2.Id, s1.Id, (int)eDirection.X);
     SurfaceLoad sf4 = new SurfaceLoad(Guid.NewGuid(), "sf4", loadValue, lc_var3a.Id, s1.Id, (int)eDirection.X);
     SurfaceLoad sf5 = new SurfaceLoad(Guid.NewGuid(), "sf5", loadValue, lc_var3b.Id, s1.Id, (int)eDirection.Y);
     SurfaceLoad sf6 = new SurfaceLoad(Guid.NewGuid(), "sf6", loadValue, lc_var3c.Id, s1.Id, (int)eDirection.Z);
     foreach (var x in new List <SurfaceLoad> {
         sf1
     })
     {
         model.CreateSurfaceLoad(x);
     }
     #endregion
     #region Create Load - Line Load - on Beam & on Slab Edge
     var lin1 = new LineLoadOnBeam(Guid.NewGuid(), "lin1")
     {
         Member               = b1.Id,
         LoadCase             = lc_perm.Id,
         Distribution         = eLineLoadDistribution.Trapez,
         Value1               = -12500,
         Value2               = -12500,
         CoordinateDefinition = eCoordinateDefinition.Relative,
         StartPoint           = 0.01,
         EndPoint             = 0.99,
         CoordinationSystem   = eCoordinationSystem.GCS,
         Direction            = eDirection.X,
         Origin               = eLineOrigin.FromStart,
         Location             = eLineLoadLocation.Length,
         EccentricityEy       = 0.0,
         EccentricityEz       = 0.0
     };
     var lin2 = new LineLoadOnBeam(Guid.NewGuid(), "lin2")
     {
         Member               = b1.Id,
         LoadCase             = lc_var1.Id,
         Distribution         = eLineLoadDistribution.Trapez,
         Value1               = -12500,
         Value2               = 12500,
         CoordinateDefinition = eCoordinateDefinition.Relative,
         StartPoint           = 0.01,
         EndPoint             = 0.99,
         CoordinationSystem   = eCoordinationSystem.GCS,
         Direction            = eDirection.Y,
         Origin               = eLineOrigin.FromStart,
         Location             = eLineLoadLocation.Projection,
         EccentricityEy       = 0.0,
         EccentricityEz       = 0.0
     };
     var lin3a = new LineLoadOnSlabEdge(Guid.NewGuid(), "lin3a")
     {
         Member               = s1.Id,
         LoadCase             = lc_var3a.Id,
         EdgeIndex            = 0,
         Distribution         = eLineLoadDistribution.Trapez,
         Value1               = -12500,
         Value2               = 12500,
         CoordinateDefinition = eCoordinateDefinition.Relative,
         StartPoint           = 0.01,
         EndPoint             = 0.99,
         CoordinationSystem   = eCoordinationSystem.GCS,
         Direction            = eDirection.Z,
         Origin               = eLineOrigin.FromStart,
         Location             = eLineLoadLocation.Length
     };
     var lin3b = new LineLoadOnSlabEdge(Guid.NewGuid(), "lin3b")
     {
         Member               = s1.Id,
         LoadCase             = lc_var3b.Id,
         EdgeIndex            = 1,
         Distribution         = eLineLoadDistribution.Trapez,
         Value1               = -12500,
         Value2               = 12500,
         CoordinateDefinition = eCoordinateDefinition.Relative,
         StartPoint           = 0.01,
         EndPoint             = 0.99,
         CoordinationSystem   = eCoordinationSystem.GCS,
         Direction            = eDirection.Z,
         Origin               = eLineOrigin.FromStart,
         Location             = eLineLoadLocation.Length
     };
     var lin3c = new LineLoadOnSlabEdge(Guid.NewGuid(), "lin3c")
     {
         Member               = s1.Id,
         LoadCase             = lc_var3c.Id,
         EdgeIndex            = 2,
         Distribution         = eLineLoadDistribution.Trapez,
         Value1               = -12500,
         Value2               = 12500,
         CoordinateDefinition = eCoordinateDefinition.Relative,
         StartPoint           = 0.01,
         EndPoint             = 0.99,
         CoordinationSystem   = eCoordinationSystem.GCS,
         Direction            = eDirection.Z,
         Origin               = eLineOrigin.FromStart,
         Location             = eLineLoadLocation.Length
     };
     var lin3d = new LineLoadOnSlabEdge(Guid.NewGuid(), "lin3d")
     {
         Member               = s1.Id,
         LoadCase             = lc_perm.Id,
         EdgeIndex            = 3,
         Distribution         = eLineLoadDistribution.Trapez,
         Value1               = -12500,
         Value2               = 12500,
         CoordinateDefinition = eCoordinateDefinition.Relative,
         StartPoint           = 0.01,
         EndPoint             = 0.99,
         CoordinationSystem   = eCoordinationSystem.GCS,
         Direction            = eDirection.Z,
         Origin               = eLineOrigin.FromStart,
         Location             = eLineLoadLocation.Length
     };
     foreach (var x in new List <LineLoadOnBeam> {
         lin1
     })
     {
         model.CreateLineLoad(x);
     }
     foreach (var x in new List <LineLoadOnSlabEdge> {
         lin3d
     })
     {
         model.CreateLineLoad(x);
     }
     //foreach (var x in new List<LineLoadOnBeam> { lin1, lin2 }) { model.CreateLineLoad(x); }
     //foreach (var x in new List<LineLoadOnSlabEdge> { lin3a, lin3b, lin3c, lin3d }) { model.CreateLineLoad(x); }
     #endregion
     #endregion
 }
Example #2
0
        public static void CreateModel(Structure model, OpenApiSimpleExampleContext context)
        {
            Guid comatid = Guid.NewGuid();

            model.CreateMaterial(new Material(comatid, "conc", 0, context.ConcreteGrade));
            Guid stmatid = Guid.NewGuid();

            model.CreateMaterial(new Material(stmatid, "steel", 1, context.SteelGrade));
            Guid css_steel = Guid.NewGuid();

            model.CreateCrossSection(new CrossSectionManufactured(css_steel, "steel.HEA", stmatid, context.SteelProfile, 1, 0));

            Guid n1 = Guid.NewGuid();
            Guid n2 = Guid.NewGuid();
            Guid n3 = Guid.NewGuid();
            Guid n4 = Guid.NewGuid();
            Guid n5 = Guid.NewGuid();
            Guid n6 = Guid.NewGuid();
            Guid n7 = Guid.NewGuid();
            Guid n8 = Guid.NewGuid();

            //Create structural nodes in local ADM
            model.CreateNode(new StructNode(n1, "n1", 0, 0, 0));
            model.CreateNode(new StructNode(n2, "n2", context.A, 0, 0));
            model.CreateNode(new StructNode(n3, "n3", context.A, context.B, 0));
            model.CreateNode(new StructNode(n4, "n4", 0, context.B, 0));
            model.CreateNode(new StructNode(n5, "n5", 0, 0, context.C));
            model.CreateNode(new StructNode(n6, "n6", context.A, 0, context.C));
            model.CreateNode(new StructNode(n7, "n7", context.A, context.B, context.C));
            model.CreateNode(new StructNode(n8, "n8", 0, context.B, context.C));

            Guid b1 = Guid.NewGuid();
            Guid b2 = Guid.NewGuid();
            Guid b3 = Guid.NewGuid();
            Guid b4 = Guid.NewGuid();

            //Create beams in local ADM
            model.CreateBeam(new Beam(b1, context.BeamName, css_steel, new Guid[2] {
                n1, n5
            }));
            model.CreateBeam(new Beam(b2, "b2", css_steel, new Guid[2] {
                n2, n6
            }));
            model.CreateBeam(new Beam(b3, "b3", css_steel, new Guid[2] {
                n3, n7
            }));
            model.CreateBeam(new Beam(b4, "b4", css_steel, new Guid[2] {
                n4, n8
            }));
            //Create fix nodal support in local ADM
            var Su1 = new PointSupport(Guid.NewGuid(), "Su1", n1)
            {
                ConstraintRx = eConstraintType.Free,
                ConstraintRy = eConstraintType.Free,
                ConstraintRz = eConstraintType.Free
            };

            model.CreatePointSupport(Su1);
            model.CreatePointSupport(new PointSupport(Guid.NewGuid(), "Su2", n2));
            model.CreatePointSupport(new PointSupport(Guid.NewGuid(), "Su3", n3));
            model.CreatePointSupport(new PointSupport(Guid.NewGuid(), "Su4", n4));

            Guid s1 = Guid.NewGuid();

            Guid[] nodes = new Guid[4] {
                n5, n6, n7, n8
            };
            //Create flat slab in local ADM
            model.CreateSlab(new Slab(s1, context.SlabName, 0, comatid, context.SlabThickness, nodes));



            Guid lg1 = Guid.NewGuid();

            //Create load group in local ADM
            model.CreateLoadGroup(new LoadGroup(lg1, "lg1", 0));


            //Create load case in local ADM
            model.CreateLoadCase(new LoadCase(context.Lc1_Id, "lc1", 0, lg1, 1));

            //Combination
            CombinationItem[] combinationItems = new CombinationItem[1] {
                new CombinationItem(context.Lc1_Id, 1.5)
            };
            Combination C1 = new Combination(context.Combi1, "C1", combinationItems)
            {
                Category         = eLoadCaseCombinationCategory.AccordingNationalStandard,
                NationalStandard = eLoadCaseCombinationStandard.EnUlsSetC
            };

            model.CreateCombination(C1);

            Guid sf1 = Guid.NewGuid();

            Console.WriteLine($"Set value of surface load on the slab: ");

            //Create surface load on slab in local ADM
            model.CreateSurfaceLoad(new SurfaceLoad(sf1, "sf1", context.LoadValue, context.Lc1_Id, s1, 2));
            // line support on B1
            var lineSupport = new LineSupport(Guid.NewGuid(), "lineSupport", b1)
            {
                Member       = b1,
                ConstraintRx = eConstraintType.Free,
                ConstraintRy = eConstraintType.Free,
                ConstraintRz = eConstraintType.Free
            };

            model.CreateLineSupport(lineSupport);
            //line load on B1
            var lineLoad = new LineLoadOnBeam(Guid.NewGuid(), "lineLoad")
            {
                Member    = b1,
                LoadCase  = context.Lc1_Id,
                Value1    = -12500,
                Value2    = -12500,
                Direction = eDirection.X
            };

            model.CreateLineLoad(lineLoad);
        }