Skip to content
Merged
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea of this list is, that we can slowly format the old files by removing a few lines of this exception file, while new jsons will be formatted automatically

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest to use Unix-style path separators rather than Windows-style ones, to avoid misinterpretation of characters (for instance, \n may be understood as a newline character, whereas /n will not).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point, done!

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,31 +1,33 @@
{
"properties": [{
"model_part_name": "PorousDomain.Soil",
"properties_id": 1,
"Material": {
"constitutive_law": {
"name" : "GeoIncrementalLinearElastic3DLaw"
},
"Variables": {
"IGNORE_UNDRAINED" : true,
"YOUNG_MODULUS" : 10000,
"POISSON_RATIO" : 0.0,
"DENSITY_SOLID" : 2.65,
"DENSITY_WATER" : 1.0,
"POROSITY" : 0.36,
"BULK_MODULUS_SOLID" : 1.0e9,
"BULK_MODULUS_FLUID" : 175500,
"PERMEABILITY_XX" : 0.1521,
"PERMEABILITY_YY" : 0.1521,
"PERMEABILITY_XY" : 0.0,
"PERMEABILITY_ZZ" : 0.1521,
"PERMEABILITY_YZ" : 0.0,
"PERMEABILITY_ZX" : 0.0,
"DYNAMIC_VISCOSITY" : 9.81,
"BIOT_COEFFICIENT" : 1.0,
"RETENTION_LAW" : "SaturatedLaw",
"SATURATED_SATURATION" : 1.0
}
}
}]
}
"properties": [
{
"model_part_name": "PorousDomain.Soil",
"properties_id": 1,
"Material": {
"constitutive_law": {
"name": "GeoIncrementalLinearElastic3DLaw"
},
"Variables": {
"IGNORE_UNDRAINED": true,
"YOUNG_MODULUS": 1e+04,
"POISSON_RATIO": 0.0,
"DENSITY_SOLID": 2.65,
"DENSITY_WATER": 1.0,
"POROSITY": 0.36,
"BULK_MODULUS_SOLID": 1e+09,
"BULK_MODULUS_FLUID": 1.755e+05,
"PERMEABILITY_XX": 0.1521,
"PERMEABILITY_YY": 0.1521,
"PERMEABILITY_XY": 0.0,
"PERMEABILITY_ZZ": 0.1521,
"PERMEABILITY_YZ": 0.0,
"PERMEABILITY_ZX": 0.0,
"DYNAMIC_VISCOSITY": 9.81,
"BIOT_COEFFICIENT": 1.0,
"RETENTION_LAW": "SaturatedLaw",
"SATURATED_SATURATION": 1.0
Comment on lines +11 to +28
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it possible that to have a rule that aligns the things after the : ? ( for that it would be nice if the font has equal width characters. such that it really aligns )

Suggested change
"IGNORE_UNDRAINED": true,
"YOUNG_MODULUS": 1e+04,
"POISSON_RATIO": 0.0,
"DENSITY_SOLID": 2.65,
"DENSITY_WATER": 1.0,
"POROSITY": 0.36,
"BULK_MODULUS_SOLID": 1e+09,
"BULK_MODULUS_FLUID": 1.755e+05,
"PERMEABILITY_XX": 0.1521,
"PERMEABILITY_YY": 0.1521,
"PERMEABILITY_XY": 0.0,
"PERMEABILITY_ZZ": 0.1521,
"PERMEABILITY_YZ": 0.0,
"PERMEABILITY_ZX": 0.0,
"DYNAMIC_VISCOSITY": 9.81,
"BIOT_COEFFICIENT": 1.0,
"RETENTION_LAW": "SaturatedLaw",
"SATURATED_SATURATION": 1.0
"IGNORE_UNDRAINED": true,
"YOUNG_MODULUS": 1e+04,
"POISSON_RATIO": 0.0,
"DENSITY_SOLID": 2.65,
"DENSITY_WATER": 1.0,
"POROSITY": 0.36,
"BULK_MODULUS_SOLID": 1e+09,
"BULK_MODULUS_FLUID": 1.755e+05,
"PERMEABILITY_XX": 0.1521,
"PERMEABILITY_YY": 0.1521,
"PERMEABILITY_XY": 0.0,
"PERMEABILITY_ZZ": 0.1521,
"PERMEABILITY_YZ": 0.0,
"PERMEABILITY_ZX": 0.0,
"DYNAMIC_VISCOSITY": 9.81,
"BIOT_COEFFICIENT": 1.0,
"RETENTION_LAW": "SaturatedLaw",
"SATURATED_SATURATION": 1.0

Further for doubles in scientific notation, I would like if at least the . is present 1e+04 --> 1.e+04 or even nicer 1.0e+04

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think json writing does the alignment in general. We could have a look how difficult it would be to implement it.

For the double in scientific notation, I'll have a look, that shouldn't be difficult

Comment on lines +11 to +28
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question from my side: Why did the previous format need changing in this case?
I liked that we have all the values in a straight line/column. Made it easy for me to read the values... But I'm just curious...

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It didn't have to, I just don't know at this point how to make sure the formatting does alignment correctly. The default python json writer doesn't seem to have that option, but we could have a look into how difficult it would be to do so.

}
}
}
]
}
Original file line number Diff line number Diff line change
@@ -1,119 +1,126 @@
{
"problem_data": {
"problem_name": "apply_initial_uniform_stress_field",
"start_time": 0.0,
"end_time": 1.0,
"echo_level": 1,
"parallel_type": "OpenMP",
"number_of_threads": 1
"problem_name": "apply_initial_uniform_stress_field",
"start_time": 0.0,
"end_time": 1.0,
"echo_level": 1,
"parallel_type": "OpenMP",
"number_of_threads": 1
},
Comment on lines +3 to 9
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also in the ProjectParameters.json files, some alignment after the : would be nice.

"solver_settings": {
"solver_type": "U_Pw",
"model_part_name": "PorousDomain",
"domain_size": 3,
"model_import_settings": {
"input_type": "mdpa",
"input_filename": "single_element"
"solver_type": "U_Pw",
"model_part_name": "PorousDomain",
"domain_size": 3,
"model_import_settings": {
"input_type": "mdpa",
"input_filename": "single_element"
},
"material_import_settings": {
"materials_filename": "MaterialParameters.json"
"material_import_settings": {
"materials_filename": "MaterialParameters.json"
},
"time_stepping": {
"time_step": 1.0
"time_stepping": {
"time_step": 1.0
},
"buffer_size": 2,
"echo_level": 1,
"clear_storage": false,
"compute_reactions": true,
"move_mesh_flag": false,
"reform_dofs_at_each_step": false,
Comment on lines -24 to -29
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also here the alignment seemed more neat in my opinion...

"block_builder": true,
"solution_type": "Quasi-Static",
"scheme_type": "Newmark",
"reset_displacements": false,
"newmark_beta": 0.25,
"newmark_gamma": 0.5,
"newmark_theta": 0.5,
"strategy_type": "newton_raphson",
"convergence_criterion": "residual_criterion",
"residual_relative_tolerance": 1.0E-4,
"residual_absolute_tolerance": 1.0E-9,
"min_iterations": 6,
"max_iterations": 15,
"number_cycles": 1,
"reduction_factor": 0.5,
"increase_factor": 2.0,
"calculate_reactions": true,
"rotation_dofs": false,
"linear_solver_settings": {
"solver_type": "LinearSolversApplication.sparse_lu",
"scaling": true
"buffer_size": 2,
"echo_level": 1,
"clear_storage": false,
"compute_reactions": true,
"move_mesh_flag": false,
"reform_dofs_at_each_step": false,
"block_builder": true,
"solution_type": "Quasi-Static",
"scheme_type": "Newmark",
"reset_displacements": false,
"newmark_beta": 0.25,
"newmark_gamma": 0.5,
"newmark_theta": 0.5,
"strategy_type": "newton_raphson",
"convergence_criterion": "residual_criterion",
"residual_relative_tolerance": 1e-04,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Below is how I always do it. But it's really personal preference...

Suggested change
"residual_relative_tolerance": 1e-04,
"residual_relative_tolerance": 1.0e-04,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, I'll have a look, shouldn't be too difficult to fix

"residual_absolute_tolerance": 1e-09,
"min_iterations": 6,
"max_iterations": 15,
"number_cycles": 1,
"reduction_factor": 0.5,
"increase_factor": 2.0,
"calculate_reactions": true,
"rotation_dofs": false,
"linear_solver_settings": {
"solver_type": "LinearSolversApplication.sparse_lu",
"scaling": true
},
"problem_domain_sub_model_part_list": ["Soil"],
"body_domain_sub_model_part_list": ["Soil"]
"body_domain_sub_model_part_list": ["Soil"]
},
"output_processes": {
"gid_output": [{
"python_module": "gid_output_process",
"kratos_module": "KratosMultiphysics",
"process_name": "GiDOutputProcess",
"Parameters": {
"model_part_name": "PorousDomain.porous_computational_model_part",
"output_name": "output",
"postprocess_parameters": {
"result_file_configuration": {
"gidpost_flags": {
"WriteDeformedMeshFlag": "WriteUndeformed",
"WriteConditionsFlag": "WriteElementsOnly",
"GiDPostMode": "GiD_PostAscii",
"MultiFileFlag": "SingleFile"
},
"file_label": "step",
"output_control_type": "step",
"output_interval": 1,
"body_output": true,
"node_output": false,
"skin_output": false,
"gauss_point_results": ["CAUCHY_STRESS_VECTOR"]
"gid_output": [
{
"python_module": "gid_output_process",
"kratos_module": "KratosMultiphysics",
"process_name": "GiDOutputProcess",
"Parameters": {
"model_part_name": "PorousDomain.porous_computational_model_part",
"output_name": "output",
"postprocess_parameters": {
"result_file_configuration": {
"gidpost_flags": {
"WriteDeformedMeshFlag": "WriteUndeformed",
"WriteConditionsFlag": "WriteElementsOnly",
"GiDPostMode": "GiD_PostAscii",
"MultiFileFlag": "SingleFile"
},
"file_label": "step",
"output_control_type": "step",
"output_interval": 1,
"body_output": true,
"node_output": false,
"skin_output": false,
"gauss_point_results": ["CAUCHY_STRESS_VECTOR"]
}
}
}
}
}]
]
},
"processes": {
"constraints_process_list": [{
"python_module": "apply_vector_constraint_table_process",
"kratos_module": "KratosMultiphysics.GeoMechanicsApplication",
"process_name": "ApplyVectorConstraintTableProcess",
"Parameters": {
"model_part_name": "PorousDomain.Soil",
"variable_name": "DISPLACEMENT",
"active": [true,true,true],
"is_fixed": [true,true,true],
"value": [0.0,0.0,0.0],
"table": [0,0,0]
}
},{
"python_module": "apply_scalar_constraint_table_process",
"kratos_module": "KratosMultiphysics.GeoMechanicsApplication",
"process_name": "ApplyScalarConstraintTableProcess",
"Parameters": {
"model_part_name": "PorousDomain.Soil",
"variable_name": "WATER_PRESSURE",
"active": true,
"is_fixed": true,
"value": 0.0,
"table": 0
}
}],
"loads_process_list": [{
"python_module": "apply_initial_uniform_stress_field",
"kratos_module": "KratosMultiphysics.GeoMechanicsApplication",
"process_name": "ApplyInitialUniformStressField",
"Parameters": {
"model_part_name": "PorousDomain.Soil",
"value": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]
"constraints_process_list": [
{
"python_module": "apply_vector_constraint_table_process",
"kratos_module": "KratosMultiphysics.GeoMechanicsApplication",
"process_name": "ApplyVectorConstraintTableProcess",
"Parameters": {
"model_part_name": "PorousDomain.Soil",
"variable_name": "DISPLACEMENT",
"active": [true, true, true],
"is_fixed": [true, true, true],
"value": [0.0, 0.0, 0.0],
"table": [0, 0, 0]
}
},
{
"python_module": "apply_scalar_constraint_table_process",
"kratos_module": "KratosMultiphysics.GeoMechanicsApplication",
"process_name": "ApplyScalarConstraintTableProcess",
"Parameters": {
"model_part_name": "PorousDomain.Soil",
"variable_name": "WATER_PRESSURE",
"active": true,
"is_fixed": true,
"value": 0.0,
"table": 0
}
}
],
"loads_process_list": [
{
"python_module": "apply_initial_uniform_stress_field",
"kratos_module": "KratosMultiphysics.GeoMechanicsApplication",
"process_name": "ApplyInitialUniformStressField",
"Parameters": {
"model_part_name": "PorousDomain.Soil",
"value": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]
}
}
}]
]
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,26 +10,32 @@
"Variables": {
"IGNORE_UNDRAINED": false,
"BIOT_COEFFICIENT": 1.0,
"DENSITY_SOLID": 2242.609582059123,
"DENSITY_WATER": 1019.367991845056,
"DENSITY_SOLID": 2.242609582059123e+03,
"DENSITY_WATER": 1.019367991845056e+03,
Comment on lines +13 to +14
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nice.

"POROSITY": 0.5,
"BULK_MODULUS_SOLID": 2.0e10,
"BULK_MODULUS_FLUID": 2.2e9,
"BULK_MODULUS_SOLID": 2e+10,
"BULK_MODULUS_FLUID": 2.2e+09,
"PERMEABILITY_XX": 1.5041e-12,
"PERMEABILITY_YY": 1.5041e-12,
"PERMEABILITY_XY": 0.0,
"DYNAMIC_VISCOSITY": 0.0013,
"DYNAMIC_VISCOSITY": 1.3e-03,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is nice too.

"RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw",
"RESIDUAL_SATURATION": 0.0,
"SATURATED_SATURATION": 1.0,
"MINIMUM_RELATIVE_PERMEABILITY": 0.0001,
"MINIMUM_RELATIVE_PERMEABILITY": 1e-04,
"UDSM_NAME": "../UDSM.dll",
"UDSM_NUMBER": 1,
"IS_FORTRAN_UDSM": true,
"UMAT_PARAMETERS": [0.049987294867064276, 0.19999260891644746, 0.019999260891644745, 86400, 1.5],
"UMAT_PARAMETERS": [
4.998729486706428e-02,
0.19999260891644746,
1.999926089164475e-02,
8.64e+04,
1.5
],
Comment on lines +29 to +35
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could be shorter if the opening and closing [ ] are on the lines of the first and last item of the list.

Comment on lines +29 to +35
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nice change!

"USE_HENCKY_STRAIN": false
}
}
}
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,22 @@
"Variables": {
"IGNORE_UNDRAINED": true,
"BIOT_COEFFICIENT": 1.0,
"DENSITY_SOLID": 2242.609582059123,
"DENSITY_WATER": 1019.367991845056,
"DENSITY_SOLID": 2.242609582059123e+03,
"DENSITY_WATER": 1.019367991845056e+03,
"POROSITY": 0.5,
"BULK_MODULUS_SOLID": 2.0e10,
"BULK_MODULUS_FLUID": 2.2e9,
"BULK_MODULUS_SOLID": 2e+10,
"BULK_MODULUS_FLUID": 2.2e+09,
"PERMEABILITY_XX": 1.5041e-12,
"PERMEABILITY_YY": 1.5041e-12,
"PERMEABILITY_XY": 0.0,
"DYNAMIC_VISCOSITY": 0.0013,
"DYNAMIC_VISCOSITY": 1.3e-03,
"RETENTION_LAW": "SaturatedBelowPhreaticLevelLaw",
"RESIDUAL_SATURATION": 0.0,
"SATURATED_SATURATION": 1.0,
"MINIMUM_RELATIVE_PERMEABILITY": 0.0001,
"MINIMUM_RELATIVE_PERMEABILITY": 1e-04,
"K0_MAIN_DIRECTION": 1,
"K0_NC": 0.6,
"YOUNG_MODULUS": 1.0e9,
"YOUNG_MODULUS": 1e+09,
"POISSON_RATIO": 0.2
}
}
Expand Down
Loading
Loading