Browse Source

FEM 求解参数配置

hxx 3 years ago
parent
commit
f4beb854c8

+ 10 - 6
src/main/java/com/miniframe/bisiness/system/C00003Service.java

@@ -1,9 +1,5 @@
 package com.miniframe.bisiness.system;
 
-import java.util.Date;
-import java.util.List;
-import java.util.Map;
-
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.miniframe.core.ExecProcessFlow;
 import com.miniframe.core.exception.BusinessException;
@@ -13,13 +9,16 @@ import com.miniframe.model.system.AdiSolver;
 import com.miniframe.model.system.AdiSolverConfig;
 import com.miniframe.model.system.AdiSolverConfigSQLBuilder;
 import com.miniframe.model.system.AdiSolverSQLBuilder;
-import com.miniframe.model.system.dao.AdiProjectMapper;
 import com.miniframe.model.system.dao.AdiSolverConfigMapper;
 import com.miniframe.model.system.dao.AdiSolverMapper;
 import com.miniframe.solveconfig.SolverParam;
+import com.miniframe.solveconfig.fem.FEMParam;
 import com.miniframe.solveconfig.hcfd.HcfdParam;
 import com.miniframe.tools.XIDateTimeUtils;
-import com.miniframe.tools.XiJsonUtil;
+
+import java.util.Date;
+import java.util.List;
+import java.util.Map;
 
 /**
  * 基础系统,“项目求解查询”逻辑处理(重新生成不覆盖)。
@@ -87,6 +86,11 @@ public class C00003Service extends C00003BaseModel implements ExecProcessFlow {
 				SolverParam param =new HcfdParam();
 				solverConfig.setParameterObj(param.paramJson());
 			}
+			if(company.equals("ADI.SimWork")&& solverModel.equals("FEMLab(结构力学)")){
+				SolverParam param = new FEMParam();
+				solverConfig.setParameterObj(param.paramJson());
+			}
+
 		}catch (JsonProcessingException e){
 
 			throw new BusinessException("EB4000006");

+ 9 - 0
src/main/java/com/miniframe/bisiness/system/C00004Service.java

@@ -14,6 +14,7 @@ import com.miniframe.model.system.AdiSolverConfigSQLBuilder;
 import com.miniframe.model.system.dao.AdiSolverConfigMapper;
 import com.miniframe.model.system.dao.AdiSolverMapper;
 import com.miniframe.solveconfig.SolverParam;
+import com.miniframe.solveconfig.fem.FEMParam;
 import com.miniframe.solveconfig.hcfd.HcfdParam;
 import com.miniframe.tools.XIDateTimeUtils;
 import com.miniframe.tools.XiJsonUtil;
@@ -46,6 +47,14 @@ public class C00004Service extends C00004BaseModel implements ExecProcessFlow {
 				throw new BusinessException("EB4000006");
 			}
 		}
+		if(solver.getCompany().equals("Adi.SimWork")&& solver.getSolverModel().equals("FEMLab(结构力学)")){
+			try {
+				FEMParam param =XiJsonUtil.jsonToPojo(parameterObj,FEMParam.class);
+			}catch (JsonProcessingException e){
+				e.printStackTrace();
+				throw new BusinessException("EB4000006");
+			}
+		}
 		solverConfig.setParameterObj(parameterObj);
 		solverConfig.setUpdateTime(now);
 		configMapper.updateByPrimaryKey(solverConfig);

+ 53 - 0
src/main/java/com/miniframe/solveconfig/fem/FEMElement.java

@@ -0,0 +1,53 @@
+package com.miniframe.solveconfig.fem;
+
+import io.netty.util.internal.StringUtil;
+
+/**
+ * FEM 元素
+ */
+public class FEMElement {
+    private String key;
+    private String order;
+    private String value;
+
+    public FEMElement() {
+        super();
+    }
+
+    public FEMElement(String key, String order, String value) {
+        this.key = key;
+        this.order = order;
+        this.value = value;
+    }
+
+    public String getKey() {
+        return key;
+    }
+
+    public void setKey(String key) {
+        this.key = key;
+    }
+
+    public String getOrder() {
+        return order;
+    }
+
+    public void setOrder(String order) {
+        this.order = order;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public void setValue(String value) {
+        this.value = value;
+    }
+
+    public String showAnalysisStr() {
+        if(!StringUtil.isNullOrEmpty(this.value)){
+            return "\""+key+"\" "+"\""+order+"\" "+"\""+value+"\"";
+        }
+        return null;
+    }
+}

+ 385 - 0
src/main/java/com/miniframe/solveconfig/fem/FEMParam.java

@@ -0,0 +1,385 @@
+package com.miniframe.solveconfig.fem;
+
+import com.fasterxml.jackson.core.JsonProcessingException;
+import com.miniframe.solveconfig.SolverParam;
+import com.miniframe.tools.XiJsonUtil;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class FEMParam  implements SolverParam {
+
+    /**
+     * 上传文件名称
+     * "mesh_inp "3" "2.2_flat_dynamicResponse-transient.bdf"
+     */
+    private FEMElement mesh_inp =new FEMElement("mesh_inp","3",null);
+
+    /**
+     * Static(静态)
+     * "static "3" "false"/"static "3" "true"
+     */
+    private FEMElement f_static =new FEMElement("static","3","false");
+
+    /**
+     * Stiffness Matrix Output(刚度矩阵输出)
+     * "dump_stiff "1" "true"/“dump_stiff "1" "false"
+     */
+    private FEMElement dump_stiff =new FEMElement("dump_stiff","1","false");
+
+    /**
+     * Mass Matrix Output(质量矩阵输出)
+     * "dump_mass" "1" "true"/"dump_mass“ "1" "false"
+     */
+    private FEMElement dump_mass =new FEMElement("dump_mass","1","true");
+
+    /**
+     * Node Strains Output(节点压力输出)
+     * "strain_o "1" "true"/"strain_o "1" "false"
+     */
+    private FEMElement strain_o =new FEMElement("strain_o","1","false");
+
+    /**
+     * Modes(模式)
+     * "eigenv" "3" "true"
+     */
+    private FEMElement eigenv =new FEMElement("eigenv","3","false");
+
+    /**
+     * Num of Eigenvalue(特征值)5
+     * "num_eigv" "1" "5"
+     */
+    private FEMElement num_eigv =new FEMElement("num_eigv","1",null);
+
+    /**
+     * Method(方法)
+     * Inverse iteration(逆迭代)		"eigv_method "1" "1"
+     * Lanczos(兰索斯)		"eigv_method "1" "2"
+     */
+    private FEMElement eigv_method =new FEMElement("eigv_method","1",null);
+
+    /**
+     * Mass Coupled(质量耦合)
+     * "coupled "1" "1"/"coupled" "1" "0"
+     */
+    private FEMElement coupled =new FEMElement("coupled","1","0");
+
+    /**
+     * C=αM+βK
+     * 	α		alphad "2" "12"
+     * 	β		betad "2" "0.00001"
+     */
+    private FEMElement alphad =new FEMElement("alphad","2","0.0");
+    /**
+     * C=αM+βK
+     * 	α		alphad "2" "12"
+     * 	β		betad "2" "0.00001"
+     */
+    private FEMElement betad =new FEMElement("betad","2","0.00001");
+
+    /**
+     * Method(方法)
+     * 	HHT		transient "1" "3"
+     * 	Newmark(纽马克)		transient "1" "2"
+     * 	    δn	gam_newmark "2" "0.5"
+     * 	    αn	bet_newmark "2" "0.25"
+     *  Direct(直接)	    transient "1" "1"
+     */
+    private FEMElement f_transient =new FEMElement("transient","1","1");
+    /**
+     * Method(方法)
+     * 	HHT		transient "1" "3"
+     * 	Newmark(纽马克)		transient "1" "2"
+     * 	    δn	gam_newmark "2" "0.5"
+     * 	    αn	bet_newmark "2" "0.25"
+     *  Direct(直接)	    transient "1" "1"
+     */
+    private FEMElement gam_newmark =new FEMElement("gam_newmark","2",null);
+    /**
+     * Method(方法)
+     * 	HHT		transient "1" "3"
+     * 	Newmark(纽马克)		transient "1" "2"
+     * 	    δn	gam_newmark "2" "0.5"
+     * 	    αn	bet_newmark "2" "0.25"
+     *  Direct(直接)	    transient "1" "1"
+     */
+    private FEMElement bet_newmark =new FEMElement("bet_newmark","2",null);
+
+    /**
+     * Step Control(步控制)
+     * 	Case Num(案例数)		"SID" "1" "1"
+     */
+    private FEMElement sid =new FEMElement("SID","1","1");
+
+    /**
+     * 	Total Time Steps(总时间的步骤)	num_steps "1" "2"
+     */
+    private FEMElement num_steps =new FEMElement("num_steps","1","1");
+
+    /**
+     * 	Time Step(sencond)(时间步)		dt_str "2" "0.25"
+     */
+    private FEMElement dt_str =new FEMElement("dt_str","2","0.0");
+
+    /**
+     * 	Output Interval(输出时间间隔)		freq "1" "3"
+     */
+    private FEMElement freq =new FEMElement("freq","1","1");
+    /**
+     * 	Output Format (输出格式)
+     * 		1	sort "1" "1"
+     * 	    2	sort "1" "2"
+     */
+    private FEMElement sort =new FEMElement("sort","1","1");
+
+    /**
+     * 	Nonlinear(非线性)
+     * 		"nlgeom" "1" "0"/"nlgeom" "1" "1"
+     */
+    private FEMElement nlgeom =new FEMElement("nlgeom","1","0");
+
+    /**
+     * Solver(解算器)
+     * 	MUMPS Direct Solver(MUMPS 直接解算器)				solver "1" "0"
+     * 	PCG Iterative Solver(PCG迭代解算器)				solver "1" "1"
+     * 	LDL Direct Solver(LDL 直接解算器)				    solver "1" "2"
+     */
+    private FEMElement solver =new FEMElement("solver","1","2");
+
+    /**
+     * Result FileName(结果文件名)
+     * 	result_file "3" "2.2_flat_dynamicResponse-transient"
+     */
+    private FEMElement result_file =new FEMElement("result_file","3",null);
+
+    public FEMElement getMesh_inp() {
+        return mesh_inp;
+    }
+
+    public void setMesh_inp(FEMElement mesh_inp) {
+        this.mesh_inp = mesh_inp;
+    }
+
+    public FEMElement getF_static() {
+        return f_static;
+    }
+
+    public void setF_static(FEMElement f_static) {
+        this.f_static = f_static;
+    }
+
+    public FEMElement getDump_stiff() {
+        return dump_stiff;
+    }
+
+    public void setDump_stiff(FEMElement dump_stiff) {
+        this.dump_stiff = dump_stiff;
+    }
+
+    public FEMElement getDump_mass() {
+        return dump_mass;
+    }
+
+    public void setDump_mass(FEMElement dump_mass) {
+        this.dump_mass = dump_mass;
+    }
+
+    public FEMElement getStrain_o() {
+        return strain_o;
+    }
+
+    public void setStrain_o(FEMElement strain_o) {
+        this.strain_o = strain_o;
+    }
+
+    public FEMElement getEigenv() {
+        return eigenv;
+    }
+
+    public void setEigenv(FEMElement eigenv) {
+        this.eigenv = eigenv;
+    }
+
+    public FEMElement getNum_eigv() {
+        return num_eigv;
+    }
+
+    public void setNum_eigv(FEMElement num_eigv) {
+        this.num_eigv = num_eigv;
+    }
+
+    public FEMElement getEigv_method() {
+        return eigv_method;
+    }
+
+    public void setEigv_method(FEMElement eigv_method) {
+        this.eigv_method = eigv_method;
+    }
+
+    public FEMElement getCoupled() {
+        return coupled;
+    }
+
+    public void setCoupled(FEMElement coupled) {
+        this.coupled = coupled;
+    }
+
+    public FEMElement getAlphad() {
+        return alphad;
+    }
+
+    public void setAlphad(FEMElement alphad) {
+        this.alphad = alphad;
+    }
+
+    public FEMElement getBetad() {
+        return betad;
+    }
+
+    public void setBetad(FEMElement betad) {
+        this.betad = betad;
+    }
+
+    public FEMElement getF_transient() {
+        return f_transient;
+    }
+
+    public void setF_transient(FEMElement f_transient) {
+        this.f_transient = f_transient;
+    }
+
+    public FEMElement getGam_newmark() {
+        return gam_newmark;
+    }
+
+    public void setGam_newmark(FEMElement gam_newmark) {
+        this.gam_newmark = gam_newmark;
+    }
+
+    public FEMElement getBet_newmark() {
+        return bet_newmark;
+    }
+
+    public void setBet_newmark(FEMElement bet_newmark) {
+        this.bet_newmark = bet_newmark;
+    }
+
+    public FEMElement getSid() {
+        return sid;
+    }
+
+    public void setSID(FEMElement sid) {
+        this.sid = sid;
+    }
+
+    public FEMElement getNum_steps() {
+        return num_steps;
+    }
+
+    public void setNum_steps(FEMElement num_steps) {
+        this.num_steps = num_steps;
+    }
+
+    public FEMElement getDt_str() {
+        return dt_str;
+    }
+
+    public void setDt_str(FEMElement dt_str) {
+        this.dt_str = dt_str;
+    }
+
+    public FEMElement getFreq() {
+        return freq;
+    }
+
+    public void setFreq(FEMElement freq) {
+        this.freq = freq;
+    }
+
+    public FEMElement getSort() {
+        return sort;
+    }
+
+    public void setSort(FEMElement sort) {
+        this.sort = sort;
+    }
+
+    public FEMElement getNlgeom() {
+        return nlgeom;
+    }
+
+    public void setNlgeom(FEMElement nlgeom) {
+        this.nlgeom = nlgeom;
+    }
+
+    public FEMElement getSolver() {
+        return solver;
+    }
+
+    public void setSolver(FEMElement solver) {
+        this.solver = solver;
+    }
+
+    public FEMElement getResult_file() {
+        return result_file;
+    }
+
+    public void setResult_file(FEMElement result_file) {
+        this.result_file = result_file;
+    }
+
+    public List<String> showAnalysisWindow() {
+        List<String> analysisList=new ArrayList<>();
+        if(this.alphad.showAnalysisStr()!=null)
+            analysisList.add(this.alphad.showAnalysisStr());
+        if(this.bet_newmark.showAnalysisStr()!=null)
+            analysisList.add(this.bet_newmark.showAnalysisStr());
+        if(this.betad.showAnalysisStr()!=null)
+            analysisList.add(this.betad.showAnalysisStr());
+        if(this.coupled.showAnalysisStr()!=null)
+            analysisList.add(this.coupled.showAnalysisStr());
+        if(this.dt_str.showAnalysisStr()!=null)
+            analysisList.add(this.dt_str.showAnalysisStr());
+        if(this.dump_mass.showAnalysisStr()!=null)
+            analysisList.add(this.dump_mass.showAnalysisStr());
+        if(this.dump_stiff.showAnalysisStr()!=null)
+            analysisList.add(this.dump_stiff.showAnalysisStr());
+        if(this.eigenv.showAnalysisStr()!=null)
+            analysisList.add(this.eigenv.showAnalysisStr());
+        if(this.eigv_method.showAnalysisStr()!=null)
+            analysisList.add(this.eigv_method.showAnalysisStr());
+        if(this.f_static.showAnalysisStr()!=null)
+            analysisList.add(this.f_static.showAnalysisStr());
+        if(this.f_transient.showAnalysisStr()!=null)
+            analysisList.add(this.f_transient.showAnalysisStr());
+        if(this.freq.showAnalysisStr()!=null)
+            analysisList.add(this.freq.showAnalysisStr());
+        if(this.gam_newmark.showAnalysisStr()!=null)
+            analysisList.add(this.gam_newmark.showAnalysisStr());
+        if(this.mesh_inp.showAnalysisStr()!=null)
+            analysisList.add(this.mesh_inp.showAnalysisStr());
+        if(this.nlgeom.showAnalysisStr()!=null)
+            analysisList.add(this.nlgeom.showAnalysisStr());
+        if(this.num_eigv.showAnalysisStr()!=null)
+            analysisList.add(this.num_eigv.showAnalysisStr());
+        if(this.num_steps.showAnalysisStr()!=null)
+            analysisList.add(this.num_steps.showAnalysisStr());
+        if(this.result_file.showAnalysisStr()!=null)
+            analysisList.add(this.result_file.showAnalysisStr());
+        if(this.sid.showAnalysisStr()!=null)
+            analysisList.add(this.sid.showAnalysisStr());
+        if(this.solver.showAnalysisStr()!=null)
+            analysisList.add(this.solver.showAnalysisStr());
+        if(this.sort.showAnalysisStr()!=null)
+            analysisList.add(this.sort.showAnalysisStr());
+        if(this.strain_o.showAnalysisStr()!=null)
+            analysisList.add(this.strain_o.showAnalysisStr());
+       return analysisList;
+    }
+
+    @Override
+    public String paramJson() throws JsonProcessingException {
+        String t = XiJsonUtil.objectToJson(this);
+        return t;
+    }
+}