Пример #1
0
        /***************************************************/
        /****           Public Constructors             ****/
        /***************************************************/

        public static MeshSettings2D MeshSettings2D(Split2D splitMethod,
                                                    int xDivisions = 0, int yDivisions = 0, double size = 1, string name = null)
        {
            return(new MeshSettings2D
            {
                SplitMethod = splitMethod,
                xDivisions = xDivisions,
                yDivisions = yDivisions,
                ElementSize = size,
                Name = name
            });
        }
Пример #2
0
        public static MeshSettings2D ToMeshSettings2D(this IFAttribute lusasAttribute)
        {
            /***************************************************/
            /**** Public Methods                            ****/
            /***************************************************/

            string attributeName = GetName(lusasAttribute);

            int    xDivisions = 0;
            int    yDivisions = 0;
            double size       = 0;

            Split2D splitMethod = Split2D.Automatic;


            if ((lusasAttribute.getValue("size") == 0) &&
                (lusasAttribute.getValue("xDivisions") == 0 &&
                 lusasAttribute.getValue("yDivisions") == 0))
            {
            }
            else if (lusasAttribute.getValue("size") == 0)
            {
                splitMethod = Split2D.Divisions;
                xDivisions  = lusasAttribute.getValue("xDivisions");
                yDivisions  = lusasAttribute.getValue("yDivisions");
            }
            else
            {
                splitMethod = Split2D.Size;
                size        = lusasAttribute.getValue("size");
            }

            MeshSettings2D meshSettings2D = new MeshSettings2D
            {
                Name        = attributeName,
                SplitMethod = splitMethod,
                xDivisions  = xDivisions,
                yDivisions  = yDivisions,
                ElementSize = size
            };

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

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

            return(meshSettings2D);
        }