Beispiel #1
0
        /***************************************************/
        /**** Private Methods                           ****/
        /***************************************************/

        private IFLoadingBody CreateGravityLoad(GravityLoad gravityLoad, IFGeometry[] lusasGeometry)
        {
            IFLoadingBody lusasGravityLoad;
            IFLoadcase    assignedLoadcase = (IFLoadcase)d_LusasData.getLoadset(gravityLoad.Loadcase.AdapterId <int>(typeof(LusasId)));

            if (d_LusasData.existsAttribute("Loading", gravityLoad.Name))
            {
                lusasGravityLoad = (IFLoadingBody)d_LusasData.getAttributes("Loading", gravityLoad.Name);
            }
            else
            {
                lusasGravityLoad = d_LusasData.createLoadingBody(gravityLoad.Name);
                lusasGravityLoad.setBody(gravityLoad.GravityDirection.X, gravityLoad.GravityDirection.Y, gravityLoad.GravityDirection.Z);
            }

            IFAssignment lusasAssignment = m_LusasApplication.assignment();

            lusasAssignment.setLoadset(assignedLoadcase);
            lusasGravityLoad.assignTo(lusasGeometry, lusasAssignment);

            int adapterIdName = lusasGravityLoad.getID();

            gravityLoad.SetAdapterId(typeof(LusasId), adapterIdName);

            return(lusasGravityLoad);
        }
Beispiel #2
0
        /***************************************************/

        private IFLoadingGlobalDistributed CreateGlobalDistributed(string lusasName,
                                                                   string type, IFLoadcase assignedLoadcase, Vector force, Vector moment, object[] lusasGeometry)
        {
            IFLoadingGlobalDistributed lusasGlobalDistributed;

            if (d_LusasData.existsAttribute("Loading", lusasName))
            {
                lusasGlobalDistributed = (IFLoadingGlobalDistributed)d_LusasData.getAttribute("Loading", lusasName);
            }
            else
            {
                lusasGlobalDistributed = d_LusasData.createLoadingGlobalDistributed(lusasName);
                if (type == "Length")
                {
                    lusasGlobalDistributed.setGlobalDistributed(type,
                                                                force.X, force.Y, force.Z, moment.X, moment.Y, moment.Z);
                }
                else if (type == "Area")
                {
                    lusasGlobalDistributed.setGlobalDistributed(type,
                                                                force.X, force.Y, force.Z);
                }
            }

            IFAssignment lusasAssignment = m_LusasApplication.assignment();

            lusasAssignment.setLoadset(assignedLoadcase);
            lusasGlobalDistributed.assignTo(lusasGeometry, lusasAssignment);

            return(lusasGlobalDistributed);
        }
Beispiel #3
0
        /***************************************************/
        /**** Private Methods                           ****/
        /***************************************************/

        private IFLoadingConcentrated CreateConcentratedLoad(PointLoad pointLoad, object[] lusasPoints)
        {
            IFLoadingConcentrated lusasPointLoad;
            IFLoadcase            assignedLoadcase = (IFLoadcase)d_LusasData.getLoadset(pointLoad.Loadcase.AdapterId <int>(typeof(LusasId)));

            if (d_LusasData.existsAttribute("Loading", pointLoad.Name))
            {
                lusasPointLoad = (IFLoadingConcentrated)d_LusasData.getAttribute("Loading", pointLoad.Name);
            }
            else
            {
                lusasPointLoad = d_LusasData.createLoadingConcentrated(pointLoad.Name);
                lusasPointLoad.setConcentrated(
                    pointLoad.Force.X, pointLoad.Force.Y, pointLoad.Force.Z,
                    pointLoad.Moment.X, pointLoad.Moment.Y, pointLoad.Moment.Z);
            }

            IFAssignment lusasAssignment = m_LusasApplication.assignment();

            lusasAssignment.setLoadset(assignedLoadcase);
            lusasPointLoad.assignTo(lusasPoints, lusasAssignment);

            int adapterIdName = lusasPointLoad.getID();

            pointLoad.SetAdapterId(typeof(LusasId), adapterIdName);

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

        private IFPrescribedDisplacementLoad CreatePrescribedDisplacement(PointDisplacement pointDisplacement, object[] lusasPoints)
        {
            IFPrescribedDisplacementLoad lusasPrescribedDisplacement;
            IFLoadcase assignedLoadcase = (IFLoadcase)d_LusasData.getLoadset(pointDisplacement.Loadcase.AdapterId <int>(typeof(LusasId)));

            if (d_LusasData.existsAttribute("Loading", pointDisplacement.Name))
            {
                lusasPrescribedDisplacement = (IFPrescribedDisplacementLoad)d_LusasData.getAttribute("Loading", pointDisplacement.Name);
            }
            else
            {
                List <string> valueNames = new List <string> {
                    "u", "v", "w", "thx", "thy", "thz"
                };
                List <string> boolCheck = new List <string> {
                    "haveDispX", "haveDispY", "haveDispZ",
                    "haveRotX", "haveRotY", "haveRotZ"
                };
                List <double> displacements = new List <double>
                {
                    pointDisplacement.Translation.X, pointDisplacement.Translation.Y,
                    pointDisplacement.Translation.Z,
                    pointDisplacement.Rotation.X, pointDisplacement.Rotation.Y,
                    pointDisplacement.Rotation.Z
                };

                lusasPrescribedDisplacement = d_LusasData.createPrescribedDisplacementLoad(
                    pointDisplacement.Name, "Total");

                for (int i = 0; i < valueNames.Count(); i++)
                {
                    if (!(displacements[i] == 0))
                    {
                        lusasPrescribedDisplacement.setValue(boolCheck[i], true);
                        lusasPrescribedDisplacement.setValue(valueNames[i], displacements[i]);
                    }
                    else
                    {
                        lusasPrescribedDisplacement.setValue(boolCheck[i], false);
                    }
                }
            }

            IFAssignment lusasAssignment = m_LusasApplication.assignment();

            lusasAssignment.setLoadset(assignedLoadcase);
            lusasPrescribedDisplacement.assignTo(lusasPoints, lusasAssignment);

            int adapterIdName = lusasPrescribedDisplacement.getID();

            pointDisplacement.SetAdapterId(typeof(LusasId), adapterIdName);

            return(lusasPrescribedDisplacement);
        }
Beispiel #5
0
        /***************************************************/

        private IFLoadingLocalDistributed CreateLocalDistributed(string lusasName,
                                                                 string type, IFLoadcase assignedLoadcase, Vector force, object[] lusasGeometry)
        {
            IFLoadingLocalDistributed lusasLocalDistributed;

            if (d_LusasData.existsAttribute("Loading", lusasName))
            {
                lusasLocalDistributed = (IFLoadingLocalDistributed)d_LusasData.getAttribute("Loading", lusasName);
            }
            else
            {
                lusasLocalDistributed = d_LusasData.createLoadingLocalDistributed(lusasName);
                lusasLocalDistributed.setLocalDistributed(force.X, force.Y, force.Z, type);
            }

            IFAssignment lusasAssignment = m_LusasApplication.assignment();

            lusasAssignment.setLoadset(assignedLoadcase);
            lusasLocalDistributed.assignTo(lusasGeometry, lusasAssignment);

            return(lusasLocalDistributed);
        }
Beispiel #6
0
        private IFLoadingTemperature CreateTemperatureLoad(string name,
                                                           double temperatureChange, object[] lusasGeometry, IFLoadcase assignedLoadcase)
        {
            IFLoadingTemperature lusasTemperatureLoad;

            if (d_LusasData.existsAttribute("Loading", name))
            {
                lusasTemperatureLoad = (IFLoadingTemperature)d_LusasData.getAttributes("Loading", name);
            }
            else
            {
                lusasTemperatureLoad = d_LusasData.createLoadingTemperature(name);
                lusasTemperatureLoad.setValue("T0", 0);
                lusasTemperatureLoad.setValue("T", temperatureChange);
            }

            IFAssignment lusasAssignment = m_LusasApplication.assignment();

            lusasAssignment.setLoadset(assignedLoadcase);
            lusasTemperatureLoad.assignTo(lusasGeometry, lusasAssignment);

            return(lusasTemperatureLoad);
        }
Beispiel #7
0
        /***************************************************/
        /**** Private Methods                           ****/
        /***************************************************/

        private IFLoadingBeamPoint CreateBarPointLoad(BarPointLoad barPointLoad, object[] lusasLines)
        {
            IFLoadingBeamPoint lusasBarPointLoad;
            IFLoadcase         assignedLoadcase = (IFLoadcase)d_LusasData.getLoadset(barPointLoad.Loadcase.AdapterId <int>(typeof(LusasId)));

            if (d_LusasData.existsAttribute("Loading", barPointLoad.Name))
            {
                lusasBarPointLoad = (IFLoadingBeamPoint)d_LusasData.getAttribute("Loading", barPointLoad.Name);
            }
            else
            {
                lusasBarPointLoad = d_LusasData.createLoadingBeamPoint(barPointLoad.Name);
                if (barPointLoad.Axis.ToString() == "Global")
                {
                    lusasBarPointLoad.setBeamPoint("parametric", "global", "beam");
                }
                else
                {
                    lusasBarPointLoad.setBeamPoint("parametric", "local", "beam");
                }
                lusasBarPointLoad.addRow(
                    barPointLoad.DistanceFromA,
                    barPointLoad.Force.X, barPointLoad.Force.Y, barPointLoad.Force.Z,
                    barPointLoad.Moment.X, barPointLoad.Moment.Y, barPointLoad.Moment.Z);
            }

            IFAssignment lusasAssignment = m_LusasApplication.assignment();

            lusasAssignment.setLoadset(assignedLoadcase);
            lusasBarPointLoad.assignTo(lusasLines, lusasAssignment);

            int adapterIdName = lusasBarPointLoad.getID();

            barPointLoad.SetAdapterId(typeof(LusasId), adapterIdName);

            return(lusasBarPointLoad);
        }
Beispiel #8
0
        /***************************************************/
        /**** Private Methods                           ****/
        /***************************************************/

        private List <IFLoadingBeamDistributed> CreateBarDistributedLoad(
            BarVaryingDistributedLoad barDistributedLoad, object[] lusasLines)
        {
            List <IFLoadingBeamDistributed> lusasBarDistributedLoads = new List <IFLoadingBeamDistributed>();
            IFAssignment lusasAssignment  = m_LusasApplication.assignment();
            IFLoadcase   assignedLoadcase = (IFLoadcase)d_LusasData.getLoadset(barDistributedLoad.Loadcase.AdapterId <int>(typeof(LusasId)));

            Engine.Base.Compute.RecordWarning(
                barDistributedLoad.GetType().ToString() + " uses parametric distances in the Lusas_Toolkit"
                );

            List <double> valuesAtA = new List <double> {
                barDistributedLoad.ForceAtStart.X, barDistributedLoad.ForceAtStart.Y, barDistributedLoad.ForceAtStart.Z,
                barDistributedLoad.MomentAtStart.X, barDistributedLoad.MomentAtStart.Y, barDistributedLoad.MomentAtStart.Z
            };

            List <double> valuesAtB = new List <double> {
                barDistributedLoad.ForceAtEnd.X, barDistributedLoad.ForceAtEnd.Y, barDistributedLoad.ForceAtEnd.Z,
                barDistributedLoad.MomentAtEnd.X, barDistributedLoad.MomentAtEnd.Y, barDistributedLoad.MomentAtEnd.Z
            };

            List <string> keys = new List <string>()
            {
                "FX", "FY", "FZ", "MX", "MY", "MZ"
            };

            List <int> ids = new List <int>();

            string positioning = barDistributedLoad.RelativePositions ? "parametric" : "actual";
            string axis;

            if (barDistributedLoad.Projected)
            {
                axis = "projected";
                if (barDistributedLoad.RelativePositions)
                {
                    Engine.Base.Compute.RecordError("Projected loads with parametric distances are not supported in Lusas.");
                    return(null);
                }
            }
            else
            {
                axis = barDistributedLoad.Axis == LoadAxis.Global ? "global" : "local";
            }

            for (int i = 0; i < valuesAtA.Count(); i++)
            {
                double valueAtA = valuesAtA[i];
                double valueAtB = valuesAtB[i];

                if ((valueAtA != 0) || (valueAtB != 0))
                {
                    IFLoadingBeamDistributed lusasBarDistributedLoad;
                    if (d_LusasData.existsAttribute("Loading", barDistributedLoad.Name + keys[i]))
                    {
                        lusasBarDistributedLoad = (IFLoadingBeamDistributed)d_LusasData.getAttribute("Loading", barDistributedLoad.Name + keys[i]);
                        lusasBarDistributedLoads.Add(lusasBarDistributedLoad);
                    }
                    else
                    {
                        lusasBarDistributedLoad = d_LusasData.createLoadingBeamDistributed(barDistributedLoad.Name + keys[i]);

                        lusasBarDistributedLoad.setBeamDistributed(positioning, axis, "beam");

                        switch (keys[i])
                        {
                        case "FX":
                            lusasBarDistributedLoad.addRow(
                                barDistributedLoad.StartPosition, valueAtA, 0, 0, 0, 0, 0,
                                barDistributedLoad.EndPosition, valueAtB, 0, 0, 0, 0, 0);

                            lusasBarDistributedLoads.Add(lusasBarDistributedLoad);
                            lusasAssignment.setLoadset(assignedLoadcase);
                            lusasBarDistributedLoad.assignTo(lusasLines, lusasAssignment);
                            break;

                        case "FY":
                            lusasBarDistributedLoad.addRow(
                                barDistributedLoad.StartPosition, 0, valueAtA, 0, 0, 0, 0,
                                barDistributedLoad.EndPosition, 0, valueAtB, 0, 0, 0, 0);

                            lusasBarDistributedLoads.Add(lusasBarDistributedLoad);
                            lusasAssignment.setLoadset(assignedLoadcase);
                            lusasBarDistributedLoad.assignTo(lusasLines, lusasAssignment);
                            break;

                        case "FZ":
                            lusasBarDistributedLoad.addRow(
                                barDistributedLoad.StartPosition, 0, 0, valueAtA, 0, 0, 0,
                                barDistributedLoad.EndPosition, 0, 0, valueAtB, 0, 0, 0);

                            lusasBarDistributedLoads.Add(lusasBarDistributedLoad);
                            lusasAssignment.setLoadset(assignedLoadcase);
                            lusasBarDistributedLoad.assignTo(lusasLines, lusasAssignment);
                            break;

                        case "MX":
                            lusasBarDistributedLoad.addRow(
                                barDistributedLoad.StartPosition, 0, 0, 0, valueAtA, 0, 0,
                                barDistributedLoad.EndPosition, 0, 0, 0, valueAtB, 0, 0);

                            lusasBarDistributedLoads.Add(lusasBarDistributedLoad);
                            lusasAssignment.setLoadset(assignedLoadcase);
                            if (barDistributedLoad.Projected || barDistributedLoad.Axis == LoadAxis.Global)
                            {
                                Engine.Base.Compute.RecordWarning("Lusas does not support internal distributed                                                                                 moments in the global axis or as projected loads.");
                            }
                            lusasBarDistributedLoad.assignTo(lusasLines, lusasAssignment);
                            break;

                        case "MY":
                            lusasBarDistributedLoad.addRow(
                                barDistributedLoad.StartPosition, 0, 0, 0, 0, valueAtA, 0,
                                barDistributedLoad.EndPosition, 0, 0, 0, 0, valueAtB, 0);

                            lusasBarDistributedLoads.Add(lusasBarDistributedLoad);
                            lusasAssignment.setLoadset(assignedLoadcase);
                            lusasBarDistributedLoad.assignTo(lusasLines, lusasAssignment);
                            break;

                        case "MZ":
                            lusasBarDistributedLoad.addRow(
                                barDistributedLoad.StartPosition, 0, 0, 0, 0, 0, valueAtA,
                                barDistributedLoad.EndPosition, 0, 0, 0, 0, 0, valueAtB);

                            lusasBarDistributedLoads.Add(lusasBarDistributedLoad);
                            lusasAssignment.setLoadset(assignedLoadcase);
                            lusasBarDistributedLoad.assignTo(lusasLines, lusasAssignment);
                            break;
                        }
                        lusasBarDistributedLoads.Add(lusasBarDistributedLoad);
                        ids.Add(lusasBarDistributedLoad.getID());
                    }
                }
            }

            barDistributedLoad.SetAdapterId(typeof(LusasId), ids);

            return(lusasBarDistributedLoads);
        }