|
@@ -204,18 +204,18 @@ public class TemplateGenerator {
|
|
|
XIFileUtils.mkdir(BPATH + "/" + aid + "/" + jid + s + "/out");
|
|
|
}
|
|
|
|
|
|
- private static void mkGassDirs(Integer aid, Integer jid, Integer gid) {
|
|
|
+ private static void mkGassDirs(Integer aid, Integer jid) {
|
|
|
String s = "/gas";
|
|
|
XIFileUtils.mkdir(BPATH);
|
|
|
XIFileUtils.mkdir(BPATH + "/" + aid);
|
|
|
XIFileUtils.mkdir(BPATH + "/" + aid + "/" + jid);
|
|
|
XIFileUtils.mkdir(BPATH + "/" + aid + "/" + jid + s);
|
|
|
- XIFileUtils.mkdir(BPATH + "/" + aid + "/" + jid + s + "/" + gid);
|
|
|
- XIFileUtils.mkdir(BPATH + "/" + aid + "/" + jid + s + "/" + gid + "/mid");
|
|
|
- XIFileUtils.mkdir(BPATH + "/" + aid + "/" + jid + s + "/" + gid + "/out");
|
|
|
- XIFileUtils.mkdir(BPATH + "/" + aid + "/" + jid + s + "/" + gid + "/case");
|
|
|
- XIFileUtils.mkdir(BPATH + "/" + aid + "/" + jid + s + "/" + gid + "/data_mnt");
|
|
|
- XIFileUtils.mkdir(BPATH + "/" + aid + "/" + jid + s + "/" + gid + "/data_rst");
|
|
|
+ XIFileUtils.mkdir(BPATH + "/" + aid + "/" + jid + s + "/" );
|
|
|
+ XIFileUtils.mkdir(BPATH + "/" + aid + "/" + jid + s + "/" + "/mid");
|
|
|
+ XIFileUtils.mkdir(BPATH + "/" + aid + "/" + jid + s + "/" + "/out");
|
|
|
+ XIFileUtils.mkdir(BPATH + "/" + aid + "/" + jid + s + "/" + "/case");
|
|
|
+ XIFileUtils.mkdir(BPATH + "/" + aid + "/" + jid + s + "/" + "/data_mnt");
|
|
|
+ XIFileUtils.mkdir(BPATH + "/" + aid + "/" + jid + s + "/" + "/data_rst");
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -411,7 +411,7 @@ public class TemplateGenerator {
|
|
|
System.out.println(formattedString); // 输出: 123.46
|
|
|
}
|
|
|
|
|
|
- public static void createGasControl(Integer aid, Integer jid, Integer gid, String totaltime,
|
|
|
+ public static void createGasControl(Integer aid, Integer jid, String totaltime,
|
|
|
String dt, String dx, String reportstep, String interactionstep,
|
|
|
String cocodes) throws IOException, TemplateException {
|
|
|
|
|
@@ -425,13 +425,13 @@ public class TemplateGenerator {
|
|
|
//几何文件路径
|
|
|
dataModel.put("geoFilePath", BPATH + "/" + aid + "/" + jid + "/Geometry");
|
|
|
//fireinit 文件路径
|
|
|
- dataModel.put("initFilePath", BPATH + "/" + aid + "/" + jid + "/gas" + "/" + gid + "/" + "MashGas.init");
|
|
|
+ dataModel.put("initFilePath", BPATH + "/" + aid + "/" + jid + "/gas" + "/" + "MashGas.init");
|
|
|
//midPath
|
|
|
dataModel.put("monitorPath", BPATH + "/" + aid + "/" + jid + "/monitor.in");
|
|
|
//midPath
|
|
|
- dataModel.put("midPath", BPATH + "/" + aid + "/" + jid + "/gas" + "/" + gid + "/mid");
|
|
|
+ dataModel.put("midPath", BPATH + "/" + aid + "/" + jid + "/gas" + "/" + "/mid");
|
|
|
//outPath
|
|
|
- dataModel.put("outPath", BPATH + "/" + aid + "/" + jid + "/gas" + "/" + gid + "/out");
|
|
|
+ dataModel.put("outPath", BPATH + "/" + aid + "/" + jid + "/gas" + "/" + "/out");
|
|
|
//CPUS
|
|
|
dataModel.put("cups", 4);
|
|
|
dataModel.put("totaltime", totaltime);
|
|
@@ -470,9 +470,9 @@ public class TemplateGenerator {
|
|
|
// 将数据模型传入模板进行处理
|
|
|
StringWriter writer = new StringWriter();
|
|
|
template.process(dataModel, writer);
|
|
|
- mkGassDirs(aid, jid, gid);
|
|
|
+ mkGassDirs(aid, jid);
|
|
|
|
|
|
- FileWriter fileWriter = new FileWriter(BPATH + "/" + aid + "/" + jid + "/" + "/gas" + "/" + gid + "/MashGas.control");
|
|
|
+ FileWriter fileWriter = new FileWriter(BPATH + "/" + aid + "/" + jid + "/" + "/gas" + "/MashGas.control");
|
|
|
fileWriter.write(writer.toString());
|
|
|
fileWriter.close();
|
|
|
|
|
@@ -520,15 +520,15 @@ public class TemplateGenerator {
|
|
|
// 将数据模型传入模板进行处理
|
|
|
StringWriter writer = new StringWriter();
|
|
|
template.process(dataModel, writer);
|
|
|
- mkGassDirs(aid, jid, gid);
|
|
|
+ mkGassDirs(aid, jid);
|
|
|
|
|
|
- FileWriter fileWriter = new FileWriter(BPATH + "/" + aid + "/" + jid + "/" + "/gas" + "/" + gid + "/MashGas.init");
|
|
|
+ FileWriter fileWriter = new FileWriter(BPATH + "/" + aid + "/" + jid + "/" + "/gas" + "/MashGas.init");
|
|
|
fileWriter.write(writer.toString());
|
|
|
fileWriter.close();
|
|
|
|
|
|
}
|
|
|
|
|
|
- public static void createGassRunsh(Integer aid, Integer jid, Integer gid) throws IOException, TemplateException {
|
|
|
+ public static void createGassRunsh(Integer aid, Integer jid) throws IOException, TemplateException {
|
|
|
Configuration cfg = new Configuration(Configuration.VERSION_2_3_0);
|
|
|
// 设置模板所在目录
|
|
|
cfg.setClassForTemplateLoading(TemplateGenerator.class, "/templates");
|
|
@@ -536,14 +536,14 @@ public class TemplateGenerator {
|
|
|
Template template = cfg.getTemplate("mashGasRunsh.ftl");
|
|
|
// 定义数据模型(Map)
|
|
|
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");
|
|
|
+ dataModel.put("casepath", BPATH + "/" + aid + "/" + jid + "/gas" + "/case");
|
|
|
+ dataModel.put("gascontrol", BPATH + "/" + aid + "/" + jid + "/gas" + "/MashGas.control");
|
|
|
+ dataModel.put("gasescapecontrol", BPATH + "/" + aid + "/" + jid + "/" + "/gas" + "/gasEscape.control");
|
|
|
// 将数据模型传入模板进行处理
|
|
|
StringWriter writer = new StringWriter();
|
|
|
template.process(dataModel, writer);
|
|
|
- mkGassDirs(aid, jid, gid);
|
|
|
- FileWriter fileWriter = new FileWriter(BPATH + "/" + aid + "/" + jid + "/" + "/gas" + "/" + gid + "/run.sh");
|
|
|
+ mkGassDirs(aid, jid);
|
|
|
+ FileWriter fileWriter = new FileWriter(BPATH + "/" + aid + "/" + jid + "/" + "/gas" + "/run.sh");
|
|
|
fileWriter.write(writer.toString());
|
|
|
|
|
|
fileWriter.close();
|