public override object Read(string path)
        {
            var    obj  = new TurbulencePropertiesData();
            string text = Load(path);

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

            _fileHandler = null;

            foreach (ParseTreeNode rootEntryNode in tree.Root.FindDictEntries(null))
            {
                if (rootEntryNode.GetEntryIdentifier() == "simulationType")
                {
                    obj.SimulationType = rootEntryNode.GetBasicValEnum <TurbulenceModel>();
                    if (obj.SimulationType == TurbulenceModel.RASModel)
                    {
                        _fileHandler      = new RASPropertiesHandler();
                        obj.RasProperties = (RASPropertiesData)_fileHandler.Read(path);
                    }
                    else if (obj.SimulationType == TurbulenceModel.LESModel)
                    {
                        _fileHandler      = new LESPropertiesHandler();
                        obj.LesProperties = (LESPropertiesData)_fileHandler.Read(path);
                    }
                    break;
                }
            }
            return(obj);
        }
 public void SetFileHandler(FoamFileHandler handler)
 {
     _fileHandler = handler;
 }
Beispiel #3
0
 public void SetFileHandler(FoamFileHandler handler)
 {
     throw new NotImplementedException();
 }
 public void SetFileHandler(FoamFileHandler handler)
 {
     _fileHandler = handler;
 }
Beispiel #5
0
 public void SetFileHandler(FoamFileHandler handler)
 {
 }
Beispiel #6
0
 public void SetFileHandler(FoamFileHandler handler)
 {
     _fileHandler = (FieldDataHandler) handler;
 }
Beispiel #7
0
 public void SetFileHandler(FoamFileHandler handler)
 {
     throw new NotImplementedException();
 }
Beispiel #8
0
 public void SetFileHandler(FoamFileHandler handler)
 {
     _fileHandler = (AblGeometryHandler)handler;
 }
Beispiel #9
0
 public void SetFileHandler(FoamFileHandler handler)
 {
     _fileHandler = (AblGeometryHandler)handler;
 }
Beispiel #10
0
 public void SetFileHandler(FoamFileHandler handler)
 {
     _fileHandler = (FieldDataHandler)handler;
 }