/// <summary> 清理父节点 </summary> public void InitParentKey() { RUNSPEC runspec = this.Key.CreateSingle <RUNSPEC>("RUNSPEC"); GRID grid = this.Key.CreateSingle <GRID>("GRID"); if (grid != null) { INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_grid.inc"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; grid.Add(include); INCLUDE include1 = new INCLUDE("INCLUDE"); include1.FileName = this.FileName.GetFileNameWithoutExtension() + "_faults.inc"; include1.FilePath = this.FilePath.GetDirectoryName() + "\\" + include1.FileName; grid.Add(include1); INCLUDE include2 = new INCLUDE("INCLUDE"); include2.FileName = this.FileName.GetFileNameWithoutExtension() + "_aquifer.inc"; include2.FilePath = this.FilePath.GetDirectoryName() + "\\" + include1.FileName; grid.Add(include2); } EDIT edit = this.Key.Find <EDIT>(); if (edit != null) { INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_edit.inc"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; edit.Add(include); } PROPS props = this.Key.CreateSingle <PROPS>("PROPS"); if (props != null) { INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_pvt.inc"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; props.Add(include); include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_rp.inc"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; props.Add(include); } SOLUTION solution = this.Key.CreateSingle <SOLUTION>("SOLUTION"); if (solution != null) { INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_init.inc"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; solution.Add(include); } REGIONS region = this.Key.CreateSingle <REGIONS>("REGIONS"); if (region != null) { INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_regs.inc"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; region.Add(include); } SUMMARY summary = this.Key.CreateSingle <SUMMARY>("SUMMARY"); if (summary != null) { INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_sum.inc"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; summary.Add(include); //if (include.Keys.Count == 0) //{ // ALL all = new ALL("ALL"); // include.Add(all); //} } SCHEDULE schedule = this.Key.CreateSingle <SCHEDULE>("SCHEDULE"); if (schedule != null) { INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_sch.inc"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; schedule.Add(include); } END end = this.Key.CreateSingle <END>("END"); }
/// <summary> 清理父节点 </summary> public void InitParentKey(bool isCoal = false) { this.Key.Clear(); this.Key.CreateSingle <SIMSET>("SIMSET"); GRID grid = this.Key.CreateSingle <GRID>("GRID"); if (grid != null) { // 增加屏显 ECHO_OFF echo_off = new ECHO_OFF("ECHO_OFF"); grid.Add(echo_off); INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_REG.DAT"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; grid.Add(include); include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_GPRO.DAT"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; grid.Add(include); include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_GGO.DAT"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; grid.Add(include); include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_GOTH.DAT"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; grid.Add(include); // 关闭屏显 ECHO_ON echo_on = new ECHO_ON("ECHO_ON"); grid.Add(echo_on); } this.Key.CreateSingle <MODIFY>("MODIFY"); WELL well = this.Key.CreateSingle <WELL>("WELL"); USE_TF use_tf = new USE_TF("USE_TF"); if (well != null) { well.Add(use_tf); INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_WELL.DAT"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; well.Add(include); } PROPS props = this.Key.CreateSingle <PROPS>("PROPS"); if (props != null) { INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_SAT.DAT"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; props.Add(include); include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_PVT.DAT"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; props.Add(include); } if (isCoal) { ADSORB adsorb = this.Key.CreateSingle <ADSORB>("ADSORB"); INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_ADS.DAT"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; adsorb.Add(include); } SOLUTION solution = this.Key.CreateSingle <SOLUTION>("SOLUTION"); if (solution != null) { INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_INI.DAT"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; solution.Add(include); include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_AQU.DAT"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; solution.Add(include); } TUNESET tuneset = this.Key.CreateSingle <TUNESET>("TUNESET"); SOLVECTRL solvectrl = new SOLVECTRL("SOLVECTRL"); tuneset.Add(solvectrl); //if (solvectrl != null) //{ // INCLUDE include = new INCLUDE("INCLUDE"); // include.FileName = this.FileName.GetFileNameWithoutExtension() + "_TUN.DAT"; // include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; // solvectrl.Add(include); //} //SUMMARY summary = this.Key.CreateSingle<SUMMARY>("SUMMARY"); //if (summary != null) //{ // INCLUDE include = new INCLUDE("INCLUDE"); // include.FileName = this.FileName.GetFileNameWithoutExtension() + "_sum.inc"; // include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; // summary.Add(include); // //if (include.Keys.Count == 0) // //{ // // ALL all = new ALL("ALL"); // // include.Add(all); // //} //} SCHEDULE schedule = this.Key.CreateSingle <SCHEDULE>("SCHEDULE"); if (schedule != null) { INCLUDE include = new INCLUDE("INCLUDE"); include.FileName = this.FileName.GetFileNameWithoutExtension() + "_SCH.DAT"; include.FilePath = this.FilePath.GetDirectoryName() + "\\" + include.FileName; schedule.Add(include); } //END end = this.Key.CreateSingle<END>("END"); // 输出关键字 OUTSCHED rptsched = new OUTSCHED("RPTSCHED"); this.Key.Add(rptsched); }