예제 #1
0
        /***************************************************/
        /**** Public Methods                            ****/
        /***************************************************/
        public static BarUniformlyDistributedLoad ToBarUniformlyDistributed(IFLoading lusasDistributed,
            IEnumerable<IFAssignment> lusasAssignments, Dictionary<string, Bar> bars)
        {
            IFLoadcase assignedLoadcase = (IFLoadcase)lusasAssignments.First().getAssignmentLoadset();
            Loadcase loadcase = ToLoadcase(assignedLoadcase);

            IEnumerable<Bar> assignedBars = GetLineAssignments(lusasAssignments, bars);

            Vector forceVector = new Vector
            {
                X = lusasDistributed.getValue("WX"),
                Y = lusasDistributed.getValue("WY"),
                Z = lusasDistributed.getValue("WZ")
            };

            BarUniformlyDistributedLoad barUniformlyDistributed = null;

            if (lusasDistributed.getAttributeType() == "Global Distributed Load")
            {
                Vector momentVector = new Vector
                {
                    X = lusasDistributed.getValue("MX"),
                    Y = lusasDistributed.getValue("MY"),
                    Z = lusasDistributed.getValue("MZ")
                };

                barUniformlyDistributed = Engine.Structure.Create.BarUniformlyDistributedLoad(
                    loadcase,
                    assignedBars,
                    forceVector,
                    momentVector,
                    LoadAxis.Global,
                    true,
                    GetName(lusasDistributed));
            }
            else if (lusasDistributed.getAttributeType() == "Distributed Load")
            {
                barUniformlyDistributed = Engine.Structure.Create.BarUniformlyDistributedLoad(
                    loadcase,
                    assignedBars,
                    forceVector,
                    null,
                    LoadAxis.Local,
                    true,
                    GetName(lusasDistributed));
            }

            int adapterNameId = lusasDistributed.getID();
            barUniformlyDistributed.SetAdapterId(typeof(LusasId), adapterNameId);

            return barUniformlyDistributed;
        }
        /***************************************************/
        /**** Public Methods                            ****/
        /***************************************************/

        public static AreaUniformlyDistributedLoad ToAreaUniformlyDistributed(
            IFLoading lusasDistributed, IEnumerable <IFAssignment> lusasAssignments,
            Dictionary <string, Panel> panels)
        {
            IFLoadcase assignedLoadcase = (IFLoadcase)lusasAssignments.First().getAssignmentLoadset();
            Loadcase   loadcase         = ToLoadcase(assignedLoadcase);

            IEnumerable <IAreaElement> assignedPanels = GetSurfaceAssignments(
                lusasAssignments, panels);

            Vector pressureVector = new Vector
            {
                X = lusasDistributed.getValue("WX"),
                Y = lusasDistributed.getValue("WY"),
                Z = lusasDistributed.getValue("WZ")
            };

            AreaUniformlyDistributedLoad areaUniformlyDistributedLoad = null;

            if (lusasDistributed.getAttributeType() == "Global Distributed Load")
            {
                areaUniformlyDistributedLoad = Engine.Structure.Create.AreaUniformlyDistributedLoad(
                    loadcase,
                    pressureVector,
                    assignedPanels,
                    LoadAxis.Global,
                    true,
                    GetName(lusasDistributed));
            }
            else if (lusasDistributed.getAttributeType() == "Distributed Load")
            {
                areaUniformlyDistributedLoad = Engine.Structure.Create.AreaUniformlyDistributedLoad(
                    loadcase,
                    pressureVector,
                    assignedPanels,
                    LoadAxis.Local,
                    true,
                    GetName(lusasDistributed));
            }

            int adapterNameId = lusasDistributed.getID();

            areaUniformlyDistributedLoad.SetAdapterId(typeof(LusasId), adapterNameId);

            return(areaUniformlyDistributedLoad);
        }
예제 #3
0
        private List <ILoad> ReadAreaUniformTemperatureLoads(List <string> ids = null)
        {
            /***************************************************/
            /**** Private Methods                           ****/
            /***************************************************/

            List <ILoad> areaUniformTemperatureLoads = new List <ILoad>();

            object[] lusasTemperatureLoads = d_LusasData.getAttributes("Temperature");

            if (!(lusasTemperatureLoads.Count() == 0))
            {
                List <Panel> panelsList           = ReadPanels();
                Dictionary <string, Panel> panels = panelsList.ToDictionary(
                    x => x.AdapterId <string>(typeof(LusasId)));

                List <IFLoadcase> allLoadcases = new List <IFLoadcase>();

                for (int i = 0; i < lusasTemperatureLoads.Count(); i++)
                {
                    IFLoading lusasTemperatureLoad = (IFLoading)lusasTemperatureLoads[i];

                    IEnumerable <IGrouping <string, IFAssignment> > groupedByLoadcases =
                        GetLoadAssignments(lusasTemperatureLoad);

                    foreach (IEnumerable <IFAssignment> groupedAssignment in groupedByLoadcases)
                    {
                        List <IFAssignment> surfaceAssignments = new List <IFAssignment>();

                        foreach (IFAssignment assignment in groupedAssignment)
                        {
                            IFSurface trySurf = assignment.getDatabaseObject() as IFSurface;

                            if (trySurf != null)
                            {
                                surfaceAssignments.Add(assignment);
                            }
                        }

                        List <string> analysisName = new List <string> {
                            lusasTemperatureLoad.getAttributeType()
                        };

                        if (surfaceAssignments.Count != 0)
                        {
                            AreaUniformTemperatureLoad areaUniformTemperatureLoad =
                                Adapters.Lusas.Convert.ToAreaTempratureLoad(
                                    lusasTemperatureLoad, groupedAssignment, panels);

                            areaUniformTemperatureLoad.Tags = new HashSet <string>(analysisName);
                            areaUniformTemperatureLoads.Add(areaUniformTemperatureLoad);
                        }
                    }
                }
            }

            return(areaUniformTemperatureLoads);
        }
예제 #4
0
        /***************************************************/
        /**** Private Methods                           ****/
        /***************************************************/

        private List <ILoad> ReadBarUniformTemperatureLoads(List <string> ids = null)
        {
            List <ILoad> barUniformTemperatureLoads = new List <ILoad>();

            object[] lusasTemperatureLoads = d_LusasData.getAttributes("Temperature");

            if (!(lusasTemperatureLoads.Count() == 0))
            {
                List <Bar> barsList           = ReadBars();
                Dictionary <string, Bar> bars = barsList.ToDictionary(
                    x => x.AdapterId <string>(typeof(LusasId)));

                List <IFLoadcase> allLoadcases = new List <IFLoadcase>();

                for (int i = 0; i < lusasTemperatureLoads.Count(); i++)
                {
                    IFLoading lusasTemperatureLoad = (IFLoading)lusasTemperatureLoads[i];

                    IEnumerable <IGrouping <string, IFAssignment> > groupedByLoadcases =
                        GetLoadAssignments(lusasTemperatureLoad);

                    foreach (IEnumerable <IFAssignment> groupedAssignment in groupedByLoadcases)
                    {
                        List <IFAssignment> assignments = new List <IFAssignment>();

                        foreach (IFAssignment assignment in groupedAssignment)
                        {
                            IFLine tryLine = assignment.getDatabaseObject() as IFLine;

                            if (tryLine != null)
                            {
                                assignments.Add(assignment);
                            }
                        }

                        List <string> analysisName = new List <string> {
                            lusasTemperatureLoad.getAttributeType()
                        };

                        if (assignments.Count != 0)
                        {
                            BarUniformTemperatureLoad barUniformTemperatureLoad =
                                Adapter.Adapters.Lusas.Convert.ToBarUniformTemperatureLoad(
                                    lusasTemperatureLoad, groupedAssignment, bars);

                            barUniformTemperatureLoad.Tags = new HashSet <string>(analysisName);
                            barUniformTemperatureLoads.Add(barUniformTemperatureLoad);
                        }
                    }
                }
            }

            return(barUniformTemperatureLoads);
        }
예제 #5
0
        private List <ILoad> ReadAreaUniformlyDistributedLoads(List <string> ids = null)
        {
            /***************************************************/
            /**** Private Methods                           ****/
            /***************************************************/

            List <ILoad> areaUniformlyDistributedLoads = new List <ILoad>();

            object[] lusasGlobalDistributedLoads = d_LusasData.getAttributes("Global Distributed Load");
            object[] lusasLocalDistributedLoads  = d_LusasData.getAttributes("Distributed Load");


            object[] lusasDistributedLoads = lusasGlobalDistributedLoads.Concat(
                lusasLocalDistributedLoads).ToArray();

            if (!(lusasDistributedLoads.Count() == 0))
            {
                List <Panel> panelsList           = ReadPanels();
                Dictionary <string, Panel> panels = panelsList.ToDictionary(
                    x => x.AdapterId <string>(typeof(LusasId)));

                List <IFLoadcase> allLoadcases = new List <IFLoadcase>();

                for (int i = 0; i < lusasDistributedLoads.Count(); i++)
                {
                    IFLoading lusasDistributedLoad = (IFLoading)lusasDistributedLoads[i];

                    if (lusasDistributedLoad.getValue("type") == "Area" || lusasDistributedLoad.getValue("type") == "all")
                    {
                        IEnumerable <IGrouping <string, IFAssignment> > groupedByLoadcases =
                            GetLoadAssignments(lusasDistributedLoad);

                        foreach (IEnumerable <IFAssignment> groupedAssignment in groupedByLoadcases)
                        {
                            AreaUniformlyDistributedLoad areaUniformlyDistributedLoad =
                                Adapters.Lusas.Convert.ToAreaUniformlyDistributed(
                                    lusasDistributedLoad, groupedAssignment, panels);

                            List <string> analysisName = new List <string> {
                                lusasDistributedLoad.getAttributeType()
                            };
                            areaUniformlyDistributedLoad.Tags = new HashSet <string>(analysisName);
                            areaUniformlyDistributedLoads.Add(areaUniformlyDistributedLoad);
                        }
                    }
                }
            }

            return(areaUniformlyDistributedLoads);
        }
예제 #6
0
        /***************************************************/
        /**** Private Methods                           ****/
        /***************************************************/

        private List <ILoad> ReadBarUniformlyDistributedLoads(List <string> ids = null)
        {
            List <ILoad> barUniformlyDistributedLoads = new List <ILoad>();

            object[] lusasGlobalDistributedLoads = d_LusasData.getAttributes("Global Distributed Load");
            object[] lusasLocalDistributedLoads  = d_LusasData.getAttributes("Distributed Load");

            object[] lusasDistributedLoads = lusasGlobalDistributedLoads.Concat(
                lusasLocalDistributedLoads).ToArray();

            if (!(lusasDistributedLoads.Count() == 0))
            {
                List <Bar> barsList           = ReadBars();
                Dictionary <string, Bar> bars = barsList.ToDictionary(
                    x => x.AdapterId <string>(typeof(LusasId)));

                List <IFLoadcase> allLoadcases = new List <IFLoadcase>();

                for (int i = 0; i < lusasDistributedLoads.Count(); i++)
                {
                    IFLoading lusasDistributedLoad = (IFLoading)lusasDistributedLoads[i];

                    IEnumerable <IGrouping <string, IFAssignment> > groupedByLoadcases = GetLoadAssignments(
                        lusasDistributedLoad);

                    if (lusasDistributedLoad.getValue("type") == "Length" || lusasDistributedLoad.getValue("type") == "line")
                    {
                        foreach (IEnumerable <IFAssignment> groupedAssignment in groupedByLoadcases)
                        {
                            BarUniformlyDistributedLoad barUniformlyDistributedLoad =
                                Adapters.Lusas.Convert.ToBarUniformlyDistributed(
                                    lusasDistributedLoad, groupedAssignment, bars);

                            List <string> analysisName = new List <string> {
                                lusasDistributedLoad.getAttributeType()
                            };
                            barUniformlyDistributedLoad.Tags = new HashSet <string>(analysisName);
                            barUniformlyDistributedLoads.Add(barUniformlyDistributedLoad);
                        }
                    }
                }
            }

            return(barUniformlyDistributedLoads);
        }
예제 #7
0
        /***************************************************/
        /**** Private Methods                           ****/
        /***************************************************/

        private List <ILoad> ReadGravityLoads(List <string> ids = null)
        {
            List <ILoad> gravityLoads = new List <ILoad>();

            object[] lusasBodyForces = d_LusasData.getAttributes("Body Force Load");

            if (!(lusasBodyForces.Count() == 0))
            {
                List <Node>  nodesList          = ReadNodes();
                List <Bar>   barsList           = ReadBars();
                List <Panel> panelsList         = ReadPanels();
                Dictionary <string, Node> nodes = nodesList.ToDictionary(
                    x => x.AdapterId <string>(typeof(LusasId)));
                Dictionary <string, Bar> bars = barsList.ToDictionary(
                    x => x.AdapterId <string>(typeof(LusasId)));
                Dictionary <string, Panel> panels = panelsList.ToDictionary(
                    x => x.AdapterId <string>(typeof(LusasId)));

                List <IFLoadcase> allLoadcases = new List <IFLoadcase>();

                for (int i = 0; i < lusasBodyForces.Count(); i++)
                {
                    IFLoading lusasBodyForce = (IFLoading)lusasBodyForces[i];

                    IEnumerable <IGrouping <string, IFAssignment> > groupedByLoadcases =
                        GetLoadAssignments(lusasBodyForce);

                    foreach (IEnumerable <IFAssignment> groupedAssignment in groupedByLoadcases)
                    {
                        List <string> analysisName = new List <string> {
                            lusasBodyForce.getAttributeType()
                        };

                        GravityLoad gravityLoad = Adapters.Lusas.Convert.ToGravityLoad(
                            lusasBodyForce, groupedAssignment, nodes, bars, panels);
                        gravityLoad.Tags = new HashSet <string>(analysisName);
                        gravityLoads.Add(gravityLoad);
                    }
                }
            }

            return(gravityLoads);
        }
        /***************************************************/
        /**** Private Methods                           ****/
        /***************************************************/

        private List <ILoad> ReadBarVaryingDistributedLoads(List <string> ids = null)
        {
            List <ILoad> barDistributedLoads = new List <ILoad>();

            object[] lusasInternalBeamDistributedLoads = d_LusasData.getAttributes("Beam Distributed Load");

            if (lusasInternalBeamDistributedLoads.Count() != 0)
            {
                List <Bar> barsList           = ReadBars();
                Dictionary <string, Bar> bars = barsList.ToDictionary(
                    x => x.AdapterId <string>(typeof(LusasId)));

                List <IFLoadcase> allLoadcases = new List <IFLoadcase>();

                for (int i = 0; i < lusasInternalBeamDistributedLoads.Count(); i++)
                {
                    IFLoading lusasInternalBeamDistributedLoad = (IFLoading)lusasInternalBeamDistributedLoads[i];
                    IEnumerable <IGrouping <string, IFAssignment> > groupedByLoadcases =
                        GetLoadAssignments(lusasInternalBeamDistributedLoad);

                    foreach (IEnumerable <IFAssignment> groupedAssignment in groupedByLoadcases)
                    {
                        BarVaryingDistributedLoad barDistributedLoad =
                            Adapters.Lusas.Convert.ToBarDistributedLoad(
                                lusasInternalBeamDistributedLoad, groupedAssignment, bars);

                        if (barDistributedLoad != null)
                        {
                            List <string> analysisName = new List <string> {
                                lusasInternalBeamDistributedLoad.getAttributeType()
                            };

                            barDistributedLoad.Tags = new HashSet <string>(analysisName);
                            barDistributedLoads.Add(barDistributedLoad);
                        }
                    }
                }
            }

            return(barDistributedLoads);
        }
예제 #9
0
        /***************************************************/
        /**** Private Methods                           ****/
        /***************************************************/

        private List <ILoad> ReadPointDisplacements(List <string> ids = null)
        {
            List <ILoad> pointDisplacements = new List <ILoad>();

            object[] lusasPrescribedDisplacements = d_LusasData.getAttributes("Prescribed Load");

            if (!(lusasPrescribedDisplacements.Count() == 0))
            {
                List <Node> nodesList           = ReadNodes();
                Dictionary <string, Node> nodes = nodesList.ToDictionary(
                    x => x.AdapterId <string>(typeof(LusasId)));

                List <IFLoadcase> allLoadcases = new List <IFLoadcase>();

                for (int i = 0; i < lusasPrescribedDisplacements.Count(); i++)
                {
                    IFLoading lusasPrescribedDisplacement = (IFLoading)lusasPrescribedDisplacements[i];

                    IEnumerable <IGrouping <string, IFAssignment> > groupedByLoadcases =
                        GetLoadAssignments(lusasPrescribedDisplacement);

                    foreach (IEnumerable <IFAssignment> groupedAssignment in groupedByLoadcases)
                    {
                        PointDisplacement pointDisplacement =
                            Adapters.Lusas.Convert.ToPointDisplacement(
                                lusasPrescribedDisplacement, groupedAssignment, nodes);

                        List <string> analysisName = new List <string> {
                            lusasPrescribedDisplacement.getAttributeType()
                        };
                        pointDisplacement.Tags = new HashSet <string>(analysisName);
                        pointDisplacements.Add(pointDisplacement);
                    }
                }
            }

            return(pointDisplacements);
        }