huangxingxing 1 жил өмнө
parent
commit
0128910715

+ 4 - 3
src/main/java/com/miniframe/bisiness/system/D00008Service.java

@@ -130,6 +130,7 @@ public class D00008Service extends D00008BaseModel implements ExecProcessFlow {
 				TemplateGenerator.createGasControl(aid,jid,gas.getId(),totaltime,dt,dx,reportstep,interactionstep,cocodes);
 				TemplateGenerator.createGasInit(aid,jid,gas.getId());
 				TemplateGenerator.createGassRunsh(aid,jid,gas.getId());
+				TemplateGenerator2.createGassEsccapeControl(aid,jid,gas.getId());
 				//文件迁移
 				//网格文件
 				SysFileMapper sysFileMapper = UtilTools.getBean(SysFileMapper.class);
@@ -396,21 +397,21 @@ public class D00008Service extends D00008BaseModel implements ExecProcessFlow {
 			try {
 				Runtime runtime = Runtime.getRuntime();
 				Process p =null;
-				LogService.addLog(aid,jid,"Gas","求解——————————————————开始");
+				LogService.addLog(aid,jid,"Gass","求解——————————————————开始");
 				p= runtime.exec("sh "+TemplateGenerator.BPATH + "/" + aid + "/" + jid + "/" + "/gas" + "/" + gid + "/run.sh");
 				InputStream fis = p.getInputStream();
 				InputStreamReader isr = new InputStreamReader(fis);
 				BufferedReader br = new BufferedReader(isr);
 				String line = null;
 				while ((line = br.readLine()) != null) {
-					LogService.addLog(aid,jid,"Gas",line);
+					LogService.addLog(aid,jid,"Gass",line);
 					System.out.println(line);
 				}
 //				//监测点数据保存
 //				saveMonitorValue(aid,jid);
 //				//路径保存
 //				saveWayValue(aid,jid);
-				LogService.addLog(aid,jid,"Gas","求解——————————————————成功");
+				LogService.addLog(aid,jid,"Gass","求解——————————————————成功");
 				JobSucces(jid);
 			} catch (IOException  e) {
 				LogService.addLog(aid,jid,"Fire","求解——————————————————失败");

+ 1 - 0
src/main/java/com/miniframe/template/TemplateGenerator.java

@@ -538,6 +538,7 @@ public class TemplateGenerator {
         Map<String, Object> dataModel = new HashMap<>();
         dataModel.put("casepath", BPATH + "/" + aid + "/" + jid  + "/gas" + "/" + gid + "/case");
         dataModel.put("gascontrol", BPATH + "/" + aid + "/" + jid  + "/gas" + "/" + gid + "/MashGas.control");
+        dataModel.put("gasescapecontrol", BPATH + "/" + aid + "/" + jid + "/" + "/gas" + "/" + gid + "/gasEscape.control");
         // 将数据模型传入模板进行处理
         StringWriter writer = new StringWriter();
         template.process(dataModel, writer);

+ 24 - 0
src/main/java/com/miniframe/template/TemplateGenerator2.java

@@ -183,6 +183,30 @@ public class TemplateGenerator2 {
         fileWriter.write(writer.toString());
         fileWriter.close();
     }
+    public static void createGassEsccapeControl(Integer aid, Integer jid,Integer gid) throws IOException, TemplateException {
+        Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);
+        // 设置模板所在目录
+        cfg.setClassForTemplateLoading(TemplateGenerator2.class, "/templates");
+        // 获取模板对象
+        Template template = cfg.getTemplate("mashGasEscapeControl.ftl");
+        // 定义数据模型(Map)
+        Map<String, Object> dataModel = new HashMap<>();
+        //几何文件路径
+        dataModel.put("geoFilePath", BPATH + "/" + aid + "/" + jid + "/Geometry");
+        //midPath
+        dataModel.put("midPath", BPATH + "/" + aid + "/" + jid + "/gas" + "/" + gid + "/mid");
+        //outPath
+        dataModel.put("outPath", BPATH + "/" + aid + "/" + jid + "/gas" + "/" + gid + "/out");
+        dataModel.put("escape", BPATH + "/" + aid + "/" + jid + "/escape");
+        // 将数据模型传入模板进行处理
+        StringWriter writer = new StringWriter();
+        template.process(dataModel, writer);
+        FileWriter fileWriter =
+                new FileWriter(BPATH + "/" + aid + "/" + jid + "/" + "/gas" + "/" + gid + "/gasEscape.control");
+        fileWriter.write(writer.toString());
+        fileWriter.close();
+    }
+
 
 
 

+ 7 - 0
src/main/resources/templates/mashGasEscapeControl.ftl

@@ -0,0 +1,7 @@
+geoFile : ${geoFilePath}
+midPath : ${midPath}
+outPath : ${outPath}
+escapeFile : ${escape}
+personnumber : 1
+person1,pipes22,0.1,500,1
+#end

+ 2 - 0
src/main/resources/templates/mashGasRunsh.ftl

@@ -10,3 +10,5 @@ mpirun -n 4 ./solver --path=${casepath}
 
 ./couple --proc=3d-1d --path=${casepath} --input-1d=${gascontrol} --delhis
 
+./Gas2 {gascontrol}
+./calDanger {gasescapecontrol}