Example #1
0
        /***************************************************/

        private static void SetElementType(IFMeshLine lusasLineMesh, BarFEAType barFEAType)
        {
            if (barFEAType == BarFEAType.Axial)
            {
                lusasLineMesh.addElementName("BRS2");
            }
            else if (barFEAType == BarFEAType.Flexural)
            {
                lusasLineMesh.addElementName("BMI21");
            }
        }
Example #2
0
        /***************************************************/
        /**** Private Methods                           ****/
        /***************************************************/

        private IFMeshLine CreateMeshSettings1D(MeshSettings1D meshSettings1D, BarFEAType barFEAType = BarFEAType.Flexural, BarRelease barRelease = null)
        {
            if (!Engine.Adapters.Lusas.Query.CheckIllegalCharacters(meshSettings1D.Name))
            {
                return(null);
            }

            if (barRelease != null && barFEAType == BarFEAType.Axial)
            {
                Engine.Base.Compute.RecordWarning(
                    barFEAType + " used with barReleases, this information will be lost when pushed to Lusas");
            }
            else if (barRelease == null)
            {
                barRelease = Engine.Structure.Create.BarReleaseFixFix();
            }

            string releaseString = CreateReleaseString(barRelease);

            IFMeshLine lusasLineMesh;
            string     lusasName = meshSettings1D.Name + "\\" + barFEAType.ToString() + "|" + releaseString;

            if (d_LusasData.existsAttribute("Mesh", lusasName))
            {
                lusasLineMesh = (IFMeshLine)d_LusasData.getAttribute("Mesh", lusasName);
            }
            else
            {
                lusasLineMesh = d_LusasData.createMeshLine(lusasName);
                SetSplitMethod(lusasLineMesh, meshSettings1D, barFEAType);
                if (barRelease != null)
                {
                    SetEndConditions(lusasLineMesh, barRelease);
                }
            }

            if (lusasLineMesh != null)
            {
                int adapterNameId = d_LusasData.getLargestAttributeID("Mesh");
                meshSettings1D.SetAdapterId(typeof(LusasId), adapterNameId);

                return(lusasLineMesh);
            }

            return(null);
        }
Example #3
0
        /***************************************************/

        private static BarFEAType GetFEAType(object type)
        {
            BarFEAType barFEAType = BarFEAType.Flexural;

            if (
                type.ToString() == "BMI21" ||
                type.ToString() == "BMI31" ||
                type.ToString() == "BMX21" ||
                type.ToString() == "BMX31" ||
                type.ToString() == "BMI21W" ||
                type.ToString() == "BMI31W" ||
                type.ToString() == "BMX21W" ||
                type.ToString() == "BMX31W")
            {
                barFEAType = BarFEAType.Flexural;
            }
            else if (
                type.ToString() == "BRS2" ||
                type.ToString() == "BRS3")
            {
                barFEAType = BarFEAType.Axial;
            }
            else if (
                type.ToString() == "BS4" ||
                type.ToString() == "BSL4" ||
                type.ToString() == "BXL4" ||
                type.ToString() == "JSH4" ||
                type.ToString() == "JL43" ||
                type.ToString() == "JNT4" ||
                type.ToString() == "IPN4" ||
                type.ToString() == "IPN6" ||
                type.ToString() == "LMS3" ||
                type.ToString() == "LMS4")
            {
                Engine.Base.Compute.RecordWarning(
                    type.ToString() + " not supported, FEAType defaulted to Flexural");
            }

            return(barFEAType);
        }
Example #4
0
        /***************************************************/
        /**** Private Methods                           ****/
        /***************************************************/

        public static Tuple <bool, double, BarRelease, BarFEAType> GetMeshProperties(IFLine lusasLine)
        {
            bool       meshAssigned = true;
            double     betaAngle    = 0;
            BarRelease barRelease   = null;
            BarFEAType barType      = BarFEAType.Flexural;

            object[] meshAssignments = lusasLine.getAssignments("Mesh");

            if (meshAssignments.Length > 0)
            {
                foreach (object assignment in meshAssignments)
                {
                    IFAssignment lusasAssignment = (IFAssignment)assignment;
                    IFAttribute  lusasMesh       = lusasAssignment.getAttribute();
                    IFMeshLine   lusasLineMesh   = (IFMeshLine)lusasMesh;
                    betaAngle = lusasAssignment.getBetaAngle();

                    barRelease = GetBarRelease(lusasLineMesh);

                    object[] barMeshName = lusasLineMesh.getElementNames();

                    foreach (object type in barMeshName)
                    {
                        barType = GetFEAType(type);
                    }
                }
            }
            else
            {
                meshAssigned = false;
            }

            Tuple <bool, double, BarRelease, BarFEAType> lineMeshProperties =
                new Tuple <bool, double, BarRelease, BarFEAType>(meshAssigned, betaAngle, barRelease, barType);

            return(lineMeshProperties);
        }
Example #5
0
        public static Bar Bar(Line line, ISectionProperty sectionProperty = null, Vector normal = null, BarRelease release = null, BarFEAType feaType = BarFEAType.Flexural, string name = "")
        {
            double orientationAngle;

            if (normal == null)
            {
                orientationAngle = 0;
            }
            else
            {
                normal = normal.Normalise();
                Vector tan = (line.End - line.Start).Normalise();

                double dot = normal.DotProduct(tan);

                if (Math.Abs(1 - dot) < oM.Geometry.Tolerance.Angle)
                {
                    Reflection.Compute.RecordError("The normal is parallell to the centreline of the Bar.");
                    return(null);
                }
                else if (Math.Abs(dot) > oM.Geometry.Tolerance.Angle)
                {
                    Reflection.Compute.RecordWarning("Normal not othogonal to the centreline and will get projected.");
                }

                Vector reference;

                if (!line.IsVertical())
                {
                    reference = Vector.ZAxis;
                }
                else
                {
                    reference = tan.CrossProduct(Vector.YAxis);
                }

                orientationAngle = reference.Angle(normal, new Plane {
                    Normal = tan
                });
            }

            return(Bar(line, sectionProperty, orientationAngle, release, feaType, name));
        }
Example #6
0
 public static Bar Bar(Line line, ISectionProperty sectionProperty = null, double orientationAngle = 0, BarRelease release = null, BarFEAType feaType = BarFEAType.Flexural, string name = "")
 {
     return(new Bar
     {
         Name = name,
         StartNode = (Node)line.Start,
         EndNode = (Node)line.End,
         SectionProperty = sectionProperty,
         Release = release == null?BarReleaseFixFix() : release,
                       FEAType = feaType,
                       OrientationAngle = orientationAngle
     });
 }
Example #7
0
 public static Bar Bar(Node startNode, Node endNode, ISectionProperty property = null, double orientationAngle = 0, BarRelease release = null, BarFEAType feaType = BarFEAType.Flexural, string name = "")
 {
     return(new Bar
     {
         Name = name,
         StartNode = startNode,
         EndNode = endNode,
         SectionProperty = property,
         Release = release == null?BarReleaseFixFix() : release,
                       FEAType = feaType,
                       OrientationAngle = orientationAngle
     });
 }
Example #8
0
        /***************************************************/
        /**** Public Methods                            ****/
        /***************************************************/

        public static Bar Bar(Line line, ISectionProperty property = null, double orientationAngle = 0, BarRelease release = null, BarFEAType feaType = BarFEAType.Flexural, string name = "")
        {
            return(Bar(Node(line.Start), Node(line.End), property, orientationAngle, release, feaType, name));
        }
Example #9
0
        public static Bar Bar(Line line, ISectionProperty sectionProperty = null, Vector normal = null, BarRelease release = null, BarFEAType feaType = BarFEAType.Flexural, string name = "")
        {
            double orientationAngle = normal.OrientationAngleLinear(line);

            if (double.IsNaN(orientationAngle))
            {
                return(null);
            }

            return(Bar(line, sectionProperty, orientationAngle, release, feaType, name));
        }
Example #10
0
        /***************************************************/

        private static void SetSplitMethod(IFMeshLine lusasLineMesh, MeshSettings1D meshSettings1D, BarFEAType barFEAType)
        {
            if (meshSettings1D.SplitMethod == Split1D.Length)
            {
                if (barFEAType == BarFEAType.Axial)
                {
                    lusasLineMesh.setSize("BRS2", meshSettings1D.SplitParameter);
                }
                else if (barFEAType == BarFEAType.Flexural)
                {
                    lusasLineMesh.setSize("BMI21", meshSettings1D.SplitParameter);
                }
            }
            else if (meshSettings1D.SplitMethod == Split1D.Automatic)
            {
                lusasLineMesh.setValue("uiSpacing", "uniform");
                SetElementType(lusasLineMesh, barFEAType);
            }
            else if (meshSettings1D.SplitMethod == Split1D.Divisions)
            {
                lusasLineMesh.addSpacing(System.Convert.ToInt32(meshSettings1D.SplitParameter), 1);
                SetElementType(lusasLineMesh, barFEAType);
            }
        }