/// <summary>
        /// Create a new ComputationalDomain object and set default values
        /// </summary>
        public GEMSComputationalDomain(GEMSProject parent)
        {
            this.parent = parent;

            minVector3 = new Vector3WithUnit(0.0f, parent.Environment.DefaultLengthUnit);
            maxVector3 = new Vector3WithUnit(0.0f, parent.Environment.DefaultLengthUnit);
        }
示例#2
0
        public CreateCone(System.Xml.XPath.XPathNavigator navigator, GEMSSingle parent)
            : base(navigator, parent)
        {
            alineAxis = (Axis)Enum.Parse(typeof(Axis), navigator.GetAttribute("axis", string.Empty));

            //Bottom radius of cylinder
            navigator.MoveToChild("BottomRadius", string.Empty);
            bottomRadius = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent( );

            //Top radius of cylinder
            navigator.MoveToChild("TopRadius", string.Empty);
            topRadius = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent( );

            //Height of cylinder
            navigator.MoveToChild("Height", string.Empty);
            height = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent( );

            //Center of cylinder
            navigator.MoveToChild("Center", string.Empty);
            center   = new Vector3WithUnit( );
            center.X = new Length(navigator.GetAttribute("x", string.Empty), navigator.GetAttribute("ux", string.Empty));
            center.Y = new Length(navigator.GetAttribute("y", string.Empty), navigator.GetAttribute("uy", string.Empty));
            center.Z = new Length(navigator.GetAttribute("z", string.Empty), navigator.GetAttribute("uz", string.Empty));
            navigator.MoveToParent( );
        }
示例#3
0
        public CreateCuboid(System.Xml.XPath.XPathNavigator navigator, GEMSSingle parent)
            : base(navigator, parent)
        {
            //Width of box
            navigator.MoveToChild("Width", string.Empty);
            width = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent();

            //Depth of box
            navigator.MoveToChild("Depth", string.Empty);
            depth = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent();

            //Height of box
            navigator.MoveToChild("Height", string.Empty);
            height = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent();

            //Reference point of box
            navigator.MoveToChild("RefPoint", string.Empty);
            refPoint   = new Vector3WithUnit();
            refPoint.X = new Length(navigator.GetAttribute("x", string.Empty), navigator.GetAttribute("ux", string.Empty));
            refPoint.Y = new Length(navigator.GetAttribute("y", string.Empty), navigator.GetAttribute("uy", string.Empty));
            refPoint.Z = new Length(navigator.GetAttribute("z", string.Empty), navigator.GetAttribute("uz", string.Empty));
            navigator.MoveToParent();
        }
示例#4
0
 public GEMSHuygensBox(GEMSProject parent)
 {
     this.parent    = parent;
     referencePoint = new Vector3WithUnit(0.0f, parent.Environment.DefaultLengthUnit);
     phis.Add(0);
     phis.Add(90);
     thetas.Add(90);
 }
示例#5
0
 public CreatePoint(System.Xml.XPath.XPathNavigator navigator, GEMSSingle parent)
     : base(navigator, parent)
 {
     //Position of Point
     navigator.MoveToChild("Position", string.Empty);
     position   = new Vector3WithUnit();
     position.X = new Length(navigator.GetAttribute("x", string.Empty), navigator.GetAttribute("ux", string.Empty));
     position.Y = new Length(navigator.GetAttribute("y", string.Empty), navigator.GetAttribute("uy", string.Empty));
     position.Z = new Length(navigator.GetAttribute("z", string.Empty), navigator.GetAttribute("uz", string.Empty));
     navigator.MoveToParent();
 }
示例#6
0
        public CreateSphere(System.Xml.XPath.XPathNavigator navigator, GEMSSingle parent)
            : base(navigator, parent)
        {
            //Radius of sphere
            navigator.MoveToChild("Radius", string.Empty);
            radius = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent();

            //Center of sphere
            navigator.MoveToChild("Center", string.Empty);
            center   = new Vector3WithUnit();
            center.X = new Length(navigator.GetAttribute("x", string.Empty), navigator.GetAttribute("ux", string.Empty));
            center.Y = new Length(navigator.GetAttribute("y", string.Empty), navigator.GetAttribute("uy", string.Empty));
            center.Z = new Length(navigator.GetAttribute("z", string.Empty), navigator.GetAttribute("uz", string.Empty));
            navigator.MoveToParent();
        }
示例#7
0
        public CreateRound(System.Xml.XPath.XPathNavigator navigator, GEMSSingle parent)
            : base(navigator, parent)
        {
            alineAxis = (Axis)Enum.Parse(typeof(Axis), navigator.GetAttribute("axis", string.Empty));

            //Radius of circle
            navigator.MoveToChild("Radius", string.Empty);
            radius = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent();

            //Center of circle
            navigator.MoveToChild("Center", string.Empty);
            center   = new Vector3WithUnit();
            center.X = new Length(navigator.GetAttribute("x", string.Empty), navigator.GetAttribute("ux", string.Empty));
            center.Y = new Length(navigator.GetAttribute("y", string.Empty), navigator.GetAttribute("uy", string.Empty));
            center.Z = new Length(navigator.GetAttribute("z", string.Empty), navigator.GetAttribute("uz", string.Empty));
            navigator.MoveToParent();
        }
示例#8
0
        public CreateLine(System.Xml.XPath.XPathNavigator navigator, GEMSSingle parent)
            : base(navigator, parent)
        {
            navigator.MoveToChild("Positions", string.Empty);
            navigator.MoveToFirstChild();

            //Start Point of line
            startPoint   = new Vector3WithUnit();
            startPoint.X = new Length(navigator.GetAttribute("x", string.Empty), navigator.GetAttribute("ux", string.Empty));
            startPoint.Y = new Length(navigator.GetAttribute("y", string.Empty), navigator.GetAttribute("uy", string.Empty));
            startPoint.Z = new Length(navigator.GetAttribute("z", string.Empty), navigator.GetAttribute("uz", string.Empty));


            //End Point of line
            navigator.MoveToNext();
            endPoint   = new Vector3WithUnit();
            endPoint.X = new Length(navigator.GetAttribute("x", string.Empty), navigator.GetAttribute("ux", string.Empty));
            endPoint.Y = new Length(navigator.GetAttribute("y", string.Empty), navigator.GetAttribute("uy", string.Empty));
            endPoint.Z = new Length(navigator.GetAttribute("z", string.Empty), navigator.GetAttribute("uz", string.Empty));

            navigator.MoveToParent();
            navigator.MoveToParent();
        }
示例#9
0
        public CreateRectangle(System.Xml.XPath.XPathNavigator navigator, GEMSSingle parent)
            : base(navigator, parent)
        {
            alineAxis = (Axis)Enum.Parse(typeof(Axis), navigator.GetAttribute("axis", string.Empty));

            //Width of rectangle
            navigator.MoveToChild("Width", string.Empty);
            width = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent();

            //Height of rectangle
            navigator.MoveToChild("Height", string.Empty);
            height = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            navigator.MoveToParent();

            //Reference point of rectangle
            navigator.MoveToChild("RefPoint", string.Empty);
            refPoint   = new Vector3WithUnit();
            refPoint.X = new Length(navigator.GetAttribute("x", string.Empty), navigator.GetAttribute("ux", string.Empty));
            refPoint.Y = new Length(navigator.GetAttribute("y", string.Empty), navigator.GetAttribute("uy", string.Empty));
            refPoint.Z = new Length(navigator.GetAttribute("z", string.Empty), navigator.GetAttribute("uz", string.Empty));
            navigator.MoveToParent();
        }
        /// <summary>
        /// Create a new ComputationalDomain object and load the information from the specified file
        /// </summary>
        /// <param name="navigator"></param>
        /// <returns></returns>
        public GEMSComputationalDomain(XPathNavigator navigator, GEMSProject parent)
        {
            this.parent = parent;

            minVector3 = new Vector3WithUnit();
            maxVector3 = new Vector3WithUnit();

            navigator.MoveToChild("X0", string.Empty);
            minVector3.X  = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            conditionXmin = (BoundaryCondition)Enum.Parse(typeof(BoundaryCondition), navigator.GetAttribute("condition", string.Empty));
            navigator.MoveToParent();

            navigator.MoveToChild("X1", string.Empty);
            maxVector3.X  = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            conditionXmax = (BoundaryCondition)Enum.Parse(typeof(BoundaryCondition), navigator.GetAttribute("condition", string.Empty));
            navigator.MoveToParent();

            navigator.MoveToChild("Y0", string.Empty);
            minVector3.Y  = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            conditionYmin = (BoundaryCondition)Enum.Parse(typeof(BoundaryCondition), navigator.GetAttribute("condition", string.Empty));
            navigator.MoveToParent();

            navigator.MoveToChild("Y1", string.Empty);
            maxVector3.Y  = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            conditionYmax = (BoundaryCondition)Enum.Parse(typeof(BoundaryCondition), navigator.GetAttribute("condition", string.Empty));
            navigator.MoveToParent();

            navigator.MoveToChild("Z0", string.Empty);
            minVector3.Z  = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            conditionZmin = (BoundaryCondition)Enum.Parse(typeof(BoundaryCondition), navigator.GetAttribute("condition", string.Empty));
            navigator.MoveToParent();

            navigator.MoveToChild("Z1", string.Empty);
            maxVector3.Z  = new Length(navigator.GetAttribute("value", string.Empty), navigator.GetAttribute("unit", string.Empty));
            conditionZmax = (BoundaryCondition)Enum.Parse(typeof(BoundaryCondition), navigator.GetAttribute("condition", string.Empty));
            navigator.MoveToParent();
        }
示例#11
0
        public GEMSHuygensBox(XPathNavigator navigator, GEMSProject parent)
        {
            this.parent = parent;

            isEnable = (int.Parse(navigator.GetAttribute("enabled", string.Empty)) == 1);
            isMcOnly = (int.Parse(navigator.GetAttribute("mconly", string.Empty)) == 1);

            navigator.MoveToChild("Geometry", string.Empty);
            minX = int.Parse(navigator.GetAttribute("minx", string.Empty));
            minY = int.Parse(navigator.GetAttribute("miny", string.Empty));
            minZ = int.Parse(navigator.GetAttribute("minz", string.Empty));
            maxX = int.Parse(navigator.GetAttribute("maxx", string.Empty));
            maxY = int.Parse(navigator.GetAttribute("maxy", string.Empty));
            maxZ = int.Parse(navigator.GetAttribute("maxz", string.Empty));
            navigator.MoveToParent();

            navigator.MoveToChild("RefPoint", string.Empty);
            referencePoint   = new Vector3WithUnit();
            referencePoint.X = new Length(navigator.GetAttribute("x", string.Empty), navigator.GetAttribute("ux", string.Empty));
            referencePoint.Y = new Length(navigator.GetAttribute("y", string.Empty), navigator.GetAttribute("uy", string.Empty));
            referencePoint.Z = new Length(navigator.GetAttribute("z", string.Empty), navigator.GetAttribute("uz", string.Empty));
            navigator.MoveToParent();

            //Frequency list
            navigator.MoveToChild("FrequencyList", string.Empty);
            frequencyUnit = (Frequency.FrequencyUnit)Enum.Parse(typeof(Frequency.FrequencyUnit), navigator.GetAttribute("unit", string.Empty));
            XPathNodeIterator nodes = navigator.SelectChildren("Frequency", string.Empty);

            while (nodes.MoveNext())
            {
                frequencys.Add(float.Parse(nodes.Current.GetAttribute("value", string.Empty)));
            }
            navigator.MoveToParent();

            navigator.MoveToChild("TwoD", string.Empty);
            //Phi plane
            navigator.MoveToChild("PhiPlane", string.Empty);
            isPhiEnable = (int.Parse(navigator.GetAttribute("enabled", string.Empty)) == 1);
            nodes       = navigator.SelectChildren("Phi", string.Empty);
            phis.Clear();
            while (nodes.MoveNext())
            {
                phis.Add(float.Parse(nodes.Current.GetAttribute("value", string.Empty)));
            }
            navigator.MoveToChild("Theta", string.Empty);
            thetaStart = float.Parse(navigator.GetAttribute("from", string.Empty));
            thetaStep  = float.Parse(navigator.GetAttribute("step", string.Empty));
            thetaEnd   = float.Parse(navigator.GetAttribute("to", string.Empty));
            navigator.MoveToParent();
            navigator.MoveToParent();

            //Theta plane
            navigator.MoveToChild("ThetaPlane", string.Empty);
            isThetaEnable = (int.Parse(navigator.GetAttribute("enabled", string.Empty)) == 1);
            nodes         = navigator.SelectChildren("Theta", string.Empty);
            thetas.Clear();
            while (nodes.MoveNext())
            {
                thetas.Add(float.Parse(nodes.Current.GetAttribute("value", string.Empty)));
            }
            navigator.MoveToChild("Phi", string.Empty);
            phiStart = float.Parse(navigator.GetAttribute("from", string.Empty));
            phiStep  = float.Parse(navigator.GetAttribute("step", string.Empty));
            phiEnd   = float.Parse(navigator.GetAttribute("to", string.Empty));
            navigator.MoveToParent();
            navigator.MoveToParent();

            navigator.MoveToParent();

            navigator.MoveToChild("ApertureField", string.Empty);
            apertureField = byte.Parse(navigator.GetAttribute("value", string.Empty));
            navigator.MoveToParent();
        }