-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
All necessary boxes and changes to create a simple structure.
- Loading branch information
Showing
13 changed files
with
432 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// TODO: Create a material base class | ||
class StructuralMaterial { | ||
constructor() | ||
{ | ||
this.addInput("model_part_name","string"); | ||
this.properties = { | ||
"model_part_name" : "Structure.Parts_Solid_Solid_Auto1", | ||
"properties_id" : 1, | ||
"Material" : { | ||
"constitutive_law" : { | ||
"name" : "LinearElasticPlaneStress2DLaw" | ||
}, | ||
"Variables" : { | ||
"DENSITY" : 7850.0, | ||
"YOUNG_MODULUS" : 206900000000.0, | ||
"POISSON_RATIO" : 0.29, | ||
"THICKNESS" : 0.1 | ||
}, | ||
"Tables" : {} | ||
} | ||
}; | ||
|
||
this.properties_id = this.addWidget("combo","Properties_ID", 1, function(v){}, { values:[1, 2, 3, 4, 5]} ); | ||
this.name = this.addWidget("text","Name", "LinearElasticPlaneStress2DLaw", function(v){}, function(v){}, {} ); | ||
this.DENSITY= this.addWidget("number","Density", 7850.0, function(v){}, {}); | ||
this.YOUNG_MODULUS = this.addWidget("number","Young_Modulus", 206900000000.0, function(v){}, {}); | ||
this.POISSON_RATIO = this.addWidget("number","Poisson_Ratio", 0.29, function(v){}, {}); | ||
this.THICKNESS = this.addWidget("number","Thinckness", 0.1, function(v){}, {}); | ||
this.addInput("tables","process_array"); | ||
this.addOutput("Material","material"); | ||
|
||
this.size = this.computeSize(); | ||
} | ||
|
||
onExecute() | ||
{ | ||
this._value = Object.assign({}, this.properties); | ||
|
||
// Current material model part | ||
this._value["model_part_name"] = this.getInputData(0) | ||
|
||
// Table | ||
if (this.getInputData(7) != undefined) { | ||
this._value["Material"]["Table"] = this.getInputData(7) | ||
} else { | ||
this._value["Material"]["Table"]= this.properties["Table"] | ||
} | ||
this._value["properties_id"] = this.properties_id.value | ||
this._value["Material"]["constitutive_law"]["name"] = this.name.value | ||
this._value["Material"]["Variables"]["DENSITY"] = this.DENSITY.value | ||
this._value["Material"]["Variables"]["YOUNG_MODULUS"] = this.YOUNG_MODULUS.value | ||
this._value["Material"]["Variables"]["POISSON_RATIO"] = this.POISSON_RATIO.value | ||
this._value["Material"]["Variables"]["THICKNESS"] = this.THICKNESS.value | ||
|
||
this.setOutputData(0, this._value); | ||
} | ||
} | ||
|
||
StructuralMaterial.title = "Structural material"; | ||
StructuralMaterial.desc = "Node to specify a Structurall material."; | ||
|
||
LiteGraph.registerNodeType("materials/StructuralMaterial", StructuralMaterial); | ||
|
||
console.log("StructuralMaterialNew node created"); //helps to debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
|
||
//********************************************************************/ | ||
//********************************************************************/ | ||
//********************************************************************/ | ||
//********************************************************************/ | ||
function GiDStructural() { | ||
|
||
this.addOutput("Process", "process"); | ||
this.properties = { | ||
"python_module" : "gid_output_process", | ||
"kratos_module" : "KratosMultiphysics", | ||
"process_name" : "GiDOutputProcess", | ||
"help" : "This process writes postprocessing files for GiD", | ||
"Parameters" : { | ||
"model_part_name" : "Structure", | ||
"output_name" : "SWQ", | ||
"postprocess_parameters" : { | ||
"result_file_configuration" : { | ||
"gidpost_flags" : { | ||
"GiDPostMode" : "GiD_PostBinary", | ||
"WriteDeformedMeshFlag" : "WriteDeformed", | ||
"WriteConditionsFlag" : "WriteConditions", | ||
"MultiFileFlag" : "SingleFile" | ||
}, | ||
"file_label" : "step", | ||
"output_control_type" : "step", | ||
"output_interval" : 1, | ||
"body_output" : true, | ||
"node_output" : false, | ||
"skin_output" : false, | ||
"plane_output" : [], | ||
"nodal_results" : ["DISPLACEMENT","REACTION"], | ||
"gauss_point_results" : ["VON_MISES_STRESS"], | ||
"nodal_nonhistorical_results" : [] | ||
}, | ||
"point_data_configuration" : [] | ||
} | ||
} | ||
} | ||
this.model_part_name = this.addWidget("text","ModelPartName", "Structure", function(v){}, {} ); | ||
this.output_name = this.addWidget("text","OutputName", "SWQ", function(v){}, {} ); | ||
|
||
this.size = this.computeSize(); | ||
} | ||
|
||
GiDStructural.title = "GiD structural"; | ||
GiDStructural.desc = "Creates GiD structural"; | ||
|
||
GiDStructural.prototype.onExecute = function () { | ||
output = this.properties | ||
|
||
output["Parameters"]["model_part_name"] = this.model_part_name.value; | ||
output["Parameters"]["output_name"] = this.output_name.value; | ||
|
||
|
||
this.setOutputData(0, output); | ||
}; | ||
|
||
LiteGraph.registerNodeType("output_processes/GiDStructural", GiDStructural); | ||
|
||
console.log("GiD node created"); //helps to debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
|
||
//********************************************************************/ | ||
//********************************************************************/ | ||
//********************************************************************/ | ||
//********************************************************************/ | ||
function VTKStructural() { | ||
|
||
this.properties = { | ||
"python_module" : "vtk_output_process", | ||
"kratos_module" : "KratosMultiphysics", | ||
"process_name" : "VtkOutputProcess", | ||
"help" : "This process writes postprocessing files for Paraview", | ||
"Parameters" : { | ||
"model_part_name" : "Structure", | ||
"output_control_type" : "step", | ||
"output_interval" : 1, | ||
"file_format" : "ascii", | ||
"output_precision" : 7, | ||
"output_sub_model_parts" : false, | ||
"folder_name" : "vtk_output", | ||
"save_output_files_in_folder" : true, | ||
"nodal_solution_step_data_variables" : ["DISPLACEMENT","REACTION"], | ||
"nodal_data_value_variables" : [], | ||
"element_data_value_variables" : [], | ||
"condition_data_value_variables" : [], | ||
"gauss_point_variables_extrapolated_to_nodes" : ["VON_MISES_STRESS"] | ||
} | ||
} | ||
this.addOutput("Process", "process"); | ||
this.model_part_name = this.addWidget("text","ModelPartName", "Structure", function(v){}, {} ); | ||
this.size = this.computeSize(); | ||
} | ||
|
||
VTKStructural.title = "VTK structural"; | ||
VTKStructural.desc = "Creates VTK"; | ||
|
||
VTKStructural.prototype.onExecute = function () { | ||
output = this.properties | ||
|
||
output["Parameters"]["model_part_name"] = this.model_part_name.value; | ||
|
||
this.setOutputData(0, output); | ||
}; | ||
|
||
LiteGraph.registerNodeType("output_processes/VTK_structural", VTKStructural); | ||
|
||
console.log("VTK node created"); //helps to debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
function BooleanList (){ | ||
this.addOutput("", "process_array"); | ||
this.xposi = this.addWidget("toggle","x",true,); | ||
this.yposi = this.addWidget("toggle","y",true,); | ||
this.zposi = this.addWidget("toggle","z",true,); | ||
} | ||
BooleanList.title = "Boolean list"; | ||
BooleanList.desc = "Merges several boolean into an array"; | ||
|
||
BooleanList.prototype.onExecute = function() { | ||
this.setOutputData(0, [this.xposi.value, this.yposi.value, this.zposi.value]); | ||
}; | ||
|
||
|
||
LiteGraph.registerNodeType("processes/BooleanList", BooleanList); | ||
|
||
console.log("BooleanList node created"); //helps to debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
function ConstraintsProcessList () { | ||
this.addInput("model_part_name","string"); | ||
this.addInput("interval","process_array"); | ||
this.addInput("constrained","process_array"); | ||
this.addInput("value","process_array") | ||
|
||
this.properties = { | ||
|
||
"python_module" : "assign_vector_variable_process", | ||
"kratos_module" : "KratosMultiphysics", | ||
"process_name" : "AssignVectorVariableProcess", | ||
"Parameters" : { | ||
"model_part_name" : "Structure.DISPLACEMENT_Displacement_Auto1", | ||
"variable_name" : "DISPLACEMENT", | ||
"interval" : [0.0,"End"], | ||
"constrained" : [true,true,true], | ||
"value" : [0.0,0.0,0.0] | ||
} | ||
}; | ||
var that = this; | ||
this.variable_name = this.addWidget("text","VariableName", "DISPLACEMENT", function(v){}, {} ); | ||
|
||
|
||
this.addOutput("Process","process"); | ||
|
||
this.size = this.computeSize(); | ||
this.serialize_widgets = true; | ||
|
||
} | ||
|
||
|
||
ConstraintsProcessList.title = "Constraints process list"; | ||
ConstraintsProcessList.desc = "Node to specify a boundary process."; | ||
|
||
ConstraintsProcessList.prototype.onExecute = function() { | ||
myoutput = this.properties | ||
// model_part_name | ||
if (this.getInputData(0) != undefined) { | ||
myoutput["Parameters"]["model_part_name"] = this.getInputData(0) | ||
} else { | ||
myoutput["Parameters"]["model_part_name"] = this.properties["Parameters"]["model_part_name"] | ||
} | ||
// interval | ||
if (this.getInputData(1) != undefined) { | ||
myoutput["Parameters"]["interval"] = this.getInputData(1) | ||
} else { | ||
myoutput["Parameters"]["interval"] = this.properties["Parameters"]["interval"] | ||
} | ||
|
||
// constrained | ||
if (this.getInputData(2) != undefined) { | ||
myoutput["Parameters"]["constrained"] = this.getInputData(2) | ||
} else { | ||
myoutput["Parameters"]["constrained"] = this.properties["Parameters"]["constrained"] | ||
} | ||
|
||
// value | ||
if (this.getInputData(3) != undefined) { | ||
myoutput["Parameters"]["value"] = this.getInputData(3) | ||
} else { | ||
myoutput["Parameters"]["value"] = this.properties["Parameters"]["value"] | ||
} | ||
|
||
|
||
myoutput["Parameters"]["variable_name"] = this.variable_name.value | ||
|
||
this.setOutputData(0, myoutput); | ||
}; | ||
|
||
LiteGraph.registerNodeType("processes/ConstraintsProcessList", ConstraintsProcessList ); | ||
|
||
console.log("ConstraintsProcessList node created"); //helps to debug |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
|
||
function Interval(){ | ||
this.addOutput("", "process_array"); | ||
this.widget_1 = this.addWidget("number","Initial", 0, function(v){}, {}); | ||
this.widget_2 = this.addWidget("text","Final", "End", function(v){}, {}); | ||
|
||
|
||
}; | ||
|
||
Interval.title = "Interval"; | ||
Interval.desc = "Time interval"; | ||
|
||
Interval.prototype.onExecute = function() { | ||
this.setOutputData(0, [this.widget_1.value, this.widget_2.value]) | ||
}; | ||
|
||
LiteGraph.registerNodeType("processes/interval", Interval); | ||
|
||
console.log("Interval node created"); //helps to debug | ||
|
||
|
Oops, something went wrong.