Exemplo n.º 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");
            }
        }
Exemplo n.º 2
0
        /***************************************************/

        private bool CreateCollection(IEnumerable <MeshSettings1D> meshSettings1Ds)
        {
            foreach (MeshSettings1D meshSettings1D in meshSettings1Ds)
            {
                if (meshSettings1D != null)
                {
                    IFMeshLine lusasLineMesh = CreateMeshSettings1D(meshSettings1D);
                }
            }

            return(true);
        }
Exemplo n.º 3
0
        /***************************************************/

        private static void SetEndConditions(IFMeshLine lusasLineMesh, BarRelease barReleases)
        {
            if (barReleases.StartRelease.TranslationX == DOFType.Free)
            {
                lusasLineMesh.setEndRelease("Start", "u", "free");
            }
            if (barReleases.StartRelease.TranslationY == DOFType.Free)
            {
                lusasLineMesh.setEndRelease("Start", "v", "free");
            }
            if (barReleases.StartRelease.TranslationY == DOFType.Free)
            {
                lusasLineMesh.setEndRelease("Start", "w", "free");
            }
            if (barReleases.StartRelease.RotationX == DOFType.Free)
            {
                lusasLineMesh.setEndRelease("Start", "thx", "free");
            }
            if (barReleases.StartRelease.RotationY == DOFType.Free)
            {
                lusasLineMesh.setEndRelease("Start", "thy", "free");
            }
            if (barReleases.StartRelease.RotationZ == DOFType.Free)
            {
                lusasLineMesh.setEndRelease("Start", "thz", "free");
            }

            if (barReleases.EndRelease.TranslationX == DOFType.Free)
            {
                lusasLineMesh.setEndRelease("End", "u", "free");
            }
            if (barReleases.EndRelease.TranslationY == DOFType.Free)
            {
                lusasLineMesh.setEndRelease("End", "v", "free");
            }
            if (barReleases.EndRelease.TranslationY == DOFType.Free)
            {
                lusasLineMesh.setEndRelease("End", "w", "free");
            }
            if (barReleases.EndRelease.RotationX == DOFType.Free)
            {
                lusasLineMesh.setEndRelease("End", "thx", "free");
            }
            if (barReleases.EndRelease.RotationY == DOFType.Free)
            {
                lusasLineMesh.setEndRelease("End", "thy", "free");
            }
            if (barReleases.EndRelease.RotationZ == DOFType.Free)
            {
                lusasLineMesh.setEndRelease("End", "thz", "free");
            }
        }
Exemplo n.º 4
0
        /***************************************************/
        /**** Public Methods                            ****/
        /***************************************************/

        public static MeshSettings1D ToMeshSettings1D(this IFAttribute lusasAttrbute)
        {
            string attributeName = GetName(lusasAttrbute);

            IFMeshLine lusasMeshLine = (IFMeshLine)lusasAttrbute;

            double  value       = 0;
            Split1D splitMethod = Split1D.Automatic;
            int     meshType    = 0;

            lusasMeshLine.getMeshDivisions(ref meshType);

            if (meshType == 0)
            {
                value = 0;
            }
            else if (meshType == 1)
            {
                splitMethod = Split1D.Divisions;
                object[] ratios = lusasMeshLine.getValue("ratio");
                value = ratios.Count();
                if (value == 0)
                {
                    value = 4;
                }
            }
            else if (meshType == 2)
            {
                splitMethod = Split1D.Length;
                value       = lusasMeshLine.getValue("size");
            }

            MeshSettings1D meshSettings1D = new MeshSettings1D
            {
                Name           = attributeName,
                SplitMethod    = splitMethod,
                SplitParameter = value
            };

            int adapterNameId = GetAdapterID(lusasMeshLine, 'e');

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

            return(meshSettings1D);
        }
Exemplo n.º 5
0
        /***************************************************/

        private static BarRelease GetBarRelease(IFMeshLine lusasLineMesh)
        {
            object[]       startReleases    = lusasLineMesh.getValue("start");
            object[]       endReleases      = lusasLineMesh.getValue("end");
            List <DOFType> startReleaseType = GetConstraints(startReleases);
            List <DOFType> endReleaseType   = GetConstraints(endReleases);

            Constraint6DOF startConstraint = SetConstraint(startReleaseType);
            Constraint6DOF endConstraint   = SetConstraint(endReleaseType);

            BarRelease barRelease = new BarRelease
            {
                StartRelease = startConstraint,
                EndRelease   = endConstraint
            };

            return(barRelease);
        }
Exemplo n.º 6
0
        /***************************************************/
        /**** Private Methods                           ****/
        /***************************************************/

        private List <MeshSettings1D> ReadMeshSettings1D(List <string> ids = null)
        {
            List <MeshSettings1D> meshSettings1Ds = new List <MeshSettings1D>();

            object[] lusasMesh1Ds = d_LusasData.getAttributes("Line Mesh");

            for (int i = 0; i < lusasMesh1Ds.Count(); i++)
            {
                IFMeshLine     lusasMesh1D    = (IFMeshLine)lusasMesh1Ds[i];
                MeshSettings1D meshSettings1D = Adapters.Lusas.Convert.ToMeshSettings1D(lusasMesh1D);
                List <string>  analysisName   = new List <string> {
                    lusasMesh1D.getAttributeType()
                };
                meshSettings1D.Tags = new HashSet <string>(analysisName);
                if (meshSettings1D != null)
                {
                    meshSettings1Ds.Add(meshSettings1D);
                }
            }

            return(meshSettings1Ds);
        }
Exemplo n.º 7
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);
        }
Exemplo n.º 8
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);
            }
        }