Esempio n. 1
0
        public override object Read(string path)
        {
            var    obj  = new RASPropertiesData();
            string text = Load(path);

            var grammar = new OpenFoamGrammar();
            var parser  = new Parser(grammar);
            var tree    = parser.Parse(text);

            foreach (ParseTreeNode rootEntryNode in tree.Root.FindDictEntries(null))
            {
                switch (rootEntryNode.GetEntryIdentifier())
                {
                case "RASModel":
                    obj.RasModelName = rootEntryNode.GetBasicValString();
                    break;

                case "turbulence":
                    obj.Turbulence = rootEntryNode.GetBasicValEnum <OnOffValue>();
                    break;

                case "printCoeffs":
                    obj.PrintCoeffs = rootEntryNode.GetBasicValEnum <OnOffValue>();
                    break;
                }
            }
            return(obj);
        }
        public override object Read(string path)
        {
            var obj = new RASPropertiesData();
            string text = Load(path);

            var grammar = new OpenFoamGrammar();
            var parser = new Parser(grammar);
            var tree = parser.Parse(text);

            foreach (ParseTreeNode rootEntryNode in tree.Root.FindDictEntries(null))
            {
                switch (rootEntryNode.GetEntryIdentifier())
                {
                    case "RASModel":
                        obj.RasModelName = rootEntryNode.GetBasicValString();
                        break;
                    case "turbulence":
                        obj.Turbulence = rootEntryNode.GetBasicValEnum<OnOffValue>();
                        break;
                    case "printCoeffs":
                        obj.PrintCoeffs = rootEntryNode.GetBasicValEnum<OnOffValue>();
                        break;
                }
            }
            return obj;
        }