Skip to content

Commit aef86d5

Browse files
committed
A new structural solver box
1 parent d04da09 commit aef86d5

File tree

1 file changed

+54
-0
lines changed

1 file changed

+54
-0
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
class StructuralMechanicSolver {
2+
constructor() {
3+
this.addInput("model_import_settings", "map"); // 0
4+
this.addInput("material_import_settings", "map"); // 1
5+
this.addOutput("solver_settings", "map");
6+
this.properties = {
7+
"solver_type" : "Static",
8+
"model_part_name" : "Structure",
9+
"domain_size" : 2,
10+
"echo_level" : 0,
11+
"analysis_type" : "non_linear",
12+
"model_import_settings" : {
13+
"input_type" : "mdpa",
14+
"input_filename" : "Ring"
15+
},
16+
"material_import_settings" : {
17+
"materials_filename" : "StructuralMaterials.json"
18+
},
19+
"time_stepping" : {
20+
"time_step" : 1
21+
},
22+
"line_search" : false,
23+
"convergence_criterion" : "residual_criterion",
24+
"displacement_relative_tolerance" : 0.0001,
25+
"displacement_absolute_tolerance" : 1e-9,
26+
"residual_relative_tolerance" : 0.0001,
27+
"residual_absolute_tolerance" : 1e-9,
28+
"max_iteration" : 10,
29+
"rotation_dofs" : false,
30+
"volumetric_strain_dofs" : false
31+
},
32+
this.domain_size = this.addWidget("combo","Domain Size", 2, function(v){}, { values:[2,3]} );
33+
34+
this.size = this.computeSize();
35+
}
36+
37+
onExecute() {
38+
this._value = Object.assign({}, this.properties);
39+
this._value["domain_size"] = this.domain_size.value;
40+
this._value["model_import_settings"] = this.getInputData(0);
41+
this._value["material_import_settings"] = this.getInputData(1);
42+
43+
// Get the
44+
45+
this.setOutputData(0, this._value);
46+
}
47+
}
48+
49+
StructuralMechanicSolver.title = "Structural mechanic solver";
50+
StructuralMechanicSolver.desc = "Properties for the structural mechanic solver";
51+
52+
LiteGraph.registerNodeType("solver_settings/StructuralMechanicSolver", StructuralMechanicSolver);
53+
54+
console.log("StructuralMechanicSolver node created"); //helps to debug

0 commit comments

Comments
 (0)