-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Structural Mechanics Cases #7
base: master
Are you sure you want to change the base?
Changes from 16 commits
aef86d5
9abec2a
50654a7
068c2f4
7fbce47
9b8335d
c24496c
a752602
d3c1c57
d821956
b0352c5
eba8a6b
263722d
6bc5f6e
a77ca0a
03bc2c1
50ee40f
d998d8a
d95a9d7
9d4ddb1
5823155
06cd5aa
3f7970b
d2aebf8
2ec3e33
fed6253
be2a39d
a34de81
1b84156
37c9f18
bff6599
ad20de9
d85fdd9
2724d7f
c5e59d2
993a938
8f71882
51f1d15
efdd6ef
dd021fd
2f0b06a
d0086ef
71a142b
47c6d85
2eb96f4
d9b9f9d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This must be an input. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rubenzorrilla these are the defaults, assignments are done in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK, I missed the part in which the claw is chosen. I thought it was hardcoded in the defaults. |
||
}, | ||
"Variables" : { | ||
"DENSITY" : 7850.0, | ||
"YOUNG_MODULUS" : 206900000000.0, | ||
"POISSON_RATIO" : 0.29, | ||
"THICKNESS" : 0.1 | ||
Comment on lines
+14
to
+17
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and these would depend on the input above. Just pointing it out as this most probably affects the design. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Mm that's interesting, if we want to to this probably we should refactor the whole constitutive law as you say. There is no pretty way to make the variables change dynamically in a node, but we could create an additional node per CL with let the user adjust the variables and their values. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd go for the second one, create a node per each constitutive law. In my opinion, this would have the next advantages:
|
||
}, | ||
"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 |
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 |
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 |
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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
function ConstraintsProcessList () { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd rename the class to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
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 |
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); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Move this to a separate category like ´input/interval´, process is reserved for Kratos processes There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
|
||
console.log("Interval node created"); //helps to debug | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need specific nodes for the structural output?