Skip to content

Commit

Permalink
Shapeopt/update for kratos 9 (#97)
Browse files Browse the repository at this point in the history
* update examples for Kratos version 9.0

* clean python scripts
  • Loading branch information
armingeiser authored Jan 4, 2022
1 parent 8134429 commit be9aa3b
Show file tree
Hide file tree
Showing 19 changed files with 9 additions and 123 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Making KratosMultiphysics backward compatible with python 2.6 and 2.7
from __future__ import print_function, absolute_import, division

# Import Kratos core and apps
import KratosMultiphysics as KM

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,6 @@
"material_import_settings": {
"materials_filename": "materials_2D.json"
},
"line_search": false,
"convergence_criterion": "residual_criterion",
"displacement_relative_tolerance": 0.0001,
"displacement_absolute_tolerance": 1e-9,
"residual_relative_tolerance": 0.0001,
"residual_absolute_tolerance": 1e-9,
"max_iteration": 10,
"linear_solver_settings": {
"solver_type": "EigenSolversApplication.sparse_lu",
"scaling": false,
"verbosity": 0
},
"rotation_dofs": true
},
"processes": {
Expand Down Expand Up @@ -140,13 +128,7 @@
"help": "This process writes postprocessing files for VTK",
"Parameters": {
"model_part_name": "3D_Shell",
"file_format": "binary",
"output_precision": 7,
"output_control_type": "step",
"output_interval": 1.0,
"output_sub_model_parts": false,
"folder_name": "Primal_Results",
"save_output_files_in_folder": true,
"nodal_solution_step_data_variables": [
"DISPLACEMENT",
"REACTION",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Making KratosMultiphysics backward compatible with python 2.6 and 2.7
from __future__ import print_function, absolute_import, division

# Import Kratos core and apps
import KratosMultiphysics as KM

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,6 @@
"material_import_settings" :{
"materials_filename": "materials_2D.json"
},
"line_search" : false,
"convergence_criterion" : "residual_criterion",
"displacement_relative_tolerance" : 0.0001,
"displacement_absolute_tolerance" : 1e-9,
"residual_relative_tolerance" : 0.0001,
"residual_absolute_tolerance" : 1e-9,
"max_iteration" : 10,
"linear_solver_settings" : {
"solver_type" : "ExternalSolversApplication.super_lu",
"scaling" : false,
"verbosity" : 0
},
"rotation_dofs" : true
},
"processes": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Making KratosMultiphysics backward compatible with python 2.6 and 2.7
from __future__ import print_function, absolute_import, division

# Import Kratos core and apps
import KratosMultiphysics as KM

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,6 @@
"time_step" : 1.0
},
"domain_size" : 3,
"mesh_motion_linear_solver_settings" : {
"solver_type" : "ExternalSolversApplication.super_lu",
"scaling" : false,
"verbosity" : 0
},
"compute_reactions" : true
}
}
Expand Down Expand Up @@ -111,7 +106,7 @@
"SHAPE_UPDATE",
"SHAPE_CHANGE" ],
"output_format" : {
"name": "gid"
"name": "vtk"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@
"materials_filename": "materials.json"
},
"eigensolver_settings":{
"solver_type": "eigen_eigensystem",
"solver_type": "spectra_sym_g_eigs_shift",
"number_of_eigenvalues": 2,
"max_iteration": 1000,
"tolerance": 1e-6,
"echo_level": 1
},
"rotation_dofs" : false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Making KratosMultiphysics backward compatible with python 2.6 and 2.7
from __future__ import print_function, absolute_import, division

# Import Kratos core and apps
import KratosMultiphysics as KM

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
"SHAPE_UPDATE",
"SHAPE_CHANGE" ],
"output_format" : {
"name": "gid"
"name": "vtk"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@
"material_import_settings" :{
"materials_filename": "materials_2D.json"
},
"line_search" : false,
"convergence_criterion" : "residual_criterion",
"displacement_relative_tolerance" : 0.0001,
"displacement_absolute_tolerance" : 1e-9,
"residual_relative_tolerance" : 0.0001,
"residual_absolute_tolerance" : 1e-9,
"max_iteration" : 10,
"linear_solver_settings" : {
"solver_type" : "ExternalSolversApplication.super_lu"
},
"rotation_dofs" : true
},
"processes": {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# Making KratosMultiphysics backward compatible with python 2.6 and 2.7
from __future__ import print_function, absolute_import, division

# Import Kratos core and apps
import KratosMultiphysics as KM

# Additional imports
from KratosMultiphysics.ShapeOptimizationApplication import optimizer_factory
from KratosMultiphysics.ShapeOptimizationApplication.analyzer_base import AnalyzerBaseClass
from KratosMultiphysics.ShapeOptimizationApplication.analyzers.analyzer_base import AnalyzerBaseClass

# Read parameters
with open("optimization_parameters.json",'r') as parameter_file:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,6 @@
"material_import_settings": {
"materials_filename": "2D_material.json"
},
"line_search": false,
"convergence_criterion": "residual_criterion",
"displacement_relative_tolerance": 0.0001,
"displacement_absolute_tolerance": 1e-9,
"residual_relative_tolerance": 0.0001,
"residual_absolute_tolerance": 1e-9,
"max_iteration": 10,
"linear_solver_settings": {
"solver_type": "EigenSolversApplication.sparse_lu",
"scaling": false,
"verbosity": 0
},
"rotation_dofs": true
},
"processes": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@
"type": "vertex_morphing",
"filter": {
"filter_function_type": "linear",
"filter_radius": 0.075,
"max_nodes_in_filter_radius": 1000
"filter_radius": 0.075
}
},
"optimization_algorithm": {
Expand All @@ -71,6 +70,7 @@
"DF1DALPHA",
"DF1DALPHA_MAPPED",
"DPDALPHA",
"DLDALPHA",
"ALPHA",
"ALPHA_MAPPED",
"CONTROL_POINT_CHANGE",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,6 @@
"material_import_settings" :{
"materials_filename": "2D_material.json"
},
"line_search" : false,
"convergence_criterion" : "residual_criterion",
"displacement_relative_tolerance" : 0.0001,
"displacement_absolute_tolerance" : 1e-9,
"residual_relative_tolerance" : 0.0001,
"residual_absolute_tolerance" : 1e-9,
"max_iteration" : 10,
"linear_solver_settings" : {
"solver_type" : "ExternalSolversApplication.super_lu",
"scaling" : false,
"verbosity" : 0
},
"rotation_dofs" : true
},
"processes" : {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# Making KratosMultiphysics backward compatible with python 2.6 and 2.7
from __future__ import print_function, absolute_import, division

# Import Kratos core and apps
import KratosMultiphysics as KM

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
# Making KratosMultiphysics backward compatible with python 2.6 and 2.7
from __future__ import print_function, absolute_import, division

# Import Kratos core and apps
import KratosMultiphysics as KM

# Additional imports
from KratosMultiphysics.ShapeOptimizationApplication import optimizer_factory
from KratosMultiphysics.ShapeOptimizationApplication.analyzer_base import AnalyzerBaseClass
from KratosMultiphysics.ShapeOptimizationApplication.analyzers.analyzer_base import AnalyzerBaseClass

# Read parameters
with open("optimization_parameters.json",'r') as parameter_file:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@
"material_import_settings" :{
"materials_filename": "materials_3D.json"
},
"line_search" : false,
"convergence_criterion" : "Residual_criterion",
"displacement_relative_tolerance" : 0.0001,
"displacement_absolute_tolerance" : 1e-9,
"residual_relative_tolerance" : 0.0001,
"residual_absolute_tolerance" : 1e-9,
"max_iteration" : 10,
"linear_solver_settings" : {
"solver_type" : "LinearSolversApplication.pardiso_llt"
},
"rotation_dofs" : false
},
"processes": {
Expand Down Expand Up @@ -78,13 +68,7 @@
"process_name" : "VTKOutputProcess",
"Parameters" : {
"model_part_name": "3D_Hook",
"file_format": "binary",
"output_precision": 7,
"output_control_type": "step",
"output_interval": 1.0,
"output_sub_model_parts": false,
"folder_name": "Primal_Results_main",
"save_output_files_in_folder": true,
"nodal_solution_step_data_variables": ["DISPLACEMENT","REACTION"],
"nodal_data_value_variables": [],
"element_data_value_variables": [],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# Making KratosMultiphysics backward compatible with python 2.6 and 2.7
from __future__ import print_function, absolute_import, division

# Import Kratos core and apps
import KratosMultiphysics as KM

# Additional imports
import KratosMultiphysics.ShapeOptimizationApplication as KSO
from KratosMultiphysics.ShapeOptimizationApplication import optimizer_factory, analyzer_base
from KratosMultiphysics.ShapeOptimizationApplication import optimizer_factory
from KratosMultiphysics.StructuralMechanicsApplication import structural_response_function_factory as csm_response_factory
from KratosMultiphysics.ShapeOptimizationApplication.analyzer_base import AnalyzerBaseClass
from KratosMultiphysics.ShapeOptimizationApplication.analyzers.analyzer_base import AnalyzerBaseClass

# Read parameters
with open("optimization_parameters.json", 'r') as parameter_file:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
# Making KratosMultiphysics backward compatible with python 2.6 and 2.7
from __future__ import print_function, absolute_import, division

# Import Kratos core and apps
import KratosMultiphysics as KM

# Additional imports
import KratosMultiphysics.ShapeOptimizationApplication as KSO
from KratosMultiphysics.ShapeOptimizationApplication import optimizer_factory

# Read parameters
Expand Down

0 comments on commit be9aa3b

Please sign in to comment.