KratosMultiphysics / Kratos

Kratos Multiphysics (A.K.A Kratos) is a framework for building parallel multi-disciplinary simulation software. Modularity, extensibility and HPC are the main objectives. Kratos has BSD license and is written in C++ with extensive Python interface.
https://kratosmultiphysics.github.io/Kratos/
Other
1.01k stars 244 forks source link

[FSI] MeshMovingApplication module not found #3278

Closed 94zz94 closed 5 years ago

94zz94 commented 5 years ago

Hi, I'm Enrico, a master student from the university of Padova. I'm working with the developer version of Kratos Multi-Physics 6.0.0-60b6b3a672 When I try to run from GID 14.1.0d the FSI 2D example of "MOK -Channel with flexible wall" I receive a message of error. That's the message of error from Gid:

Traceback (most recent call last): File "MainKratos.py", line 6, in from fsi_analysis import FSIAnalysis File "/home/bod-cwe/Kratos/applications/FSIapplication/python_scripts/fsi_analysis.py", line 4, in import KratosMultiphysics.MeshMovingApplication as MeshMovingApplication ModuleNotFoundError: No module named 'KratosMultiphysics.MeshMovingApplication'

Could you help me with that? @rubenzorrilla

rubenzorrilla commented 5 years ago

Hi Enrico! I've just finished PR #2053. Once this is fully merged to the master branch, everything will work fine.

What I'm afraid of is that you are trying to run the cases using the version downloaded directly from GiD. Isn't it? If this is the case, maybe we need to update it. In any case, you can find the same case in https://github.com/KratosMultiphysics/Examples/tree/master/fluid_structure_interaction/validation . Provided that you have compiled Kratos in your machine, the source files in there must do the job.

94zz94 commented 5 years ago

Thank you for answering me so quickly... The version I'm using is the one downloaded from the terminal, just like written in the wiki-linux build with the comand :

git clone https://github.com/KratosMultiphysics/Kratos Kratos

rubenzorrilla commented 5 years ago

@94zz94 , I've just merged #2053 . If you do a git pull inside your Kratos directory the Mok benchmark should run (remember that you will require to recompile the changes).

94zz94 commented 5 years ago

Now I'm using KratosMulti-Physics 6.0.0-84ff446edb, but I still have the same error. Is it possible that in fsi_analysis.py there's a missmatch calling MeshMovingApplication.py?

import KratosMultiphysics.MeshMovingApplication as MeshMovingApplication instead of import KratosMeshMovingApplication as MeshMovingApplication?

rubenzorrilla commented 5 years ago

Have you compiled the MeshMovingApplication?

94zz94 commented 5 years ago

After the pull comand I launched sh configure.sh for recompiling all.

If you mean compile only the MeshMovingApplication.py I get:

File "MeshMovingApplication.py", line 2, in from KratosMeshMovingApplication import * ModuleNotFoundError: No module named 'KratosMeshMovingApplication'

rubenzorrilla commented 5 years ago

You need to be sure that you have -DMESHING_APPLICATION=ON in your configure file.

philbucher commented 5 years ago

it should be -DMESH_MOVING_APPLICATION=ON

rubenzorrilla commented 5 years ago

Thanks @philbucher :sweat_smile: (too fast copy & paste)

94zz94 commented 5 years ago

that's it...it's missing...thank you so much

philbucher commented 5 years ago

Great! Please close this issue if your problem is solved @94zz94

94zz94 commented 5 years ago

I'm sorry but now another message of error is printed: That's about the dynamic tau not present in the default values Multi-Physics 6.0.0-4c0b7bbec9 Traceback (most recent call last): File "MainKratos.py", line 33, in simulation = FSIAnalysisWithFlush(model, parameters) File "MainKratos.py", line 14, in init super(FSIAnalysisWithFlush,self).init(model, project_parameters) File "/home/bod-cwe/Kratos/applications/FSIapplication/python_scripts/fsi_analysis.py", line 58, in init self._GetSolver().AddVariables() File "/home/bod-cwe/Kratos/kratos/python_scripts/analysis_stage.py", line 190, in _GetSolver self._solver = self._CreateSolver() File "/home/bod-cwe/Kratos/applications/FSIapplication/python_scripts/fsi_analysis.py", line 120, in _CreateSolver return python_solvers_wrapper_fsi.CreateSolver(self.model, self.project_parameters) File "/home/bod-cwe/Kratos/applications/FSIapplication/python_scripts/python_solvers_wrapper_fsi.py", line 58, in CreateSolver return CreateSolverByParameters(model, solver_settings, parallelism) File "/home/bod-cwe/Kratos/applications/FSIapplication/python_scripts/python_solvers_wrapper_fsi.py", line 43, in CreateSolverByParameters solver = solver_module.CreateSolver(model, solver_settings) File "/home/bod-cwe/Kratos/applications/FSIapplication/python_scripts/partitioned_fsi_dirichlet_neumann_solver.py", line 29, in CreateSolver return PartitionedFSIDirichletNeumannSolver(model, project_parameters) File "/home/bod-cwe/Kratos/applications/FSIapplication/python_scripts/partitioned_fsi_dirichlet_neumann_solver.py", line 33, in init super(PartitionedFSIDirichletNeumannSolver, self).init(model, project_parameters) File "/home/bod-cwe/Kratos/applications/FSIapplication/python_scripts/partitioned_fsi_base_solver.py", line 76, in init self.structure_solver = python_solvers_wrapper_structural.CreateSolverByParameters(self.model, self.settings["structure_solver_settings"], self.parallel_type) File "/home/bod-cwe/Kratos/applications/StructuralMechanicsApplication/python_scripts/python_solvers_wrapper_structural.py", line 70, in CreateSolverByParameters solver = solver_module.CreateSolver(model, solver_settings) File "/home/bod-cwe/Kratos/applications/StructuralMechanicsApplication/python_scripts/structural_mechanics_implicit_dynamic_solver.py", line 17, in CreateSolver return ImplicitMechanicalSolver(model, custom_settings) File "/home/bod-cwe/Kratos/applications/StructuralMechanicsApplication/python_scripts/structural_mechanics_implicit_dynamic_solver.py", line 45, in init super(ImplicitMechanicalSolver, self).init(model, custom_settings) File "/home/bod-cwe/Kratos/applications/StructuralMechanicsApplication/python_scripts/structural_mechanics_solver.py", line 114, in init self.settings.ValidateAndAssignDefaults(default_settings) RuntimeError: Error: ** the item with name "dynamic_tau" is present in this Parameters but NOT in the default values


hence Validation fails parameters being validated are : { "multi_point_constraints_used": false, "model_part_name": "Structure", "domain_size": 2, "echo_level": 0, "analysis_type": "non_linear", "rotation_dofs": false, "processes_sub_model_part_list": [ "DISPLACEMENT_FixedDisplacement", "StructureInterface2D_StructureInterface" ], "model_import_settings": { "input_type": "mdpa", "input_filename": "FSI2Dmok" }, "material_import_settings": { "materials_filename": "StructuralMaterials.json" }, "time_stepping": { "time_step": 0.1 }, "compute_reactions": true, "dynamic_tau": 1.0, "oss_switch": 0, "maximum_iterations": 20, "relative_velocity_tolerance": 1e-8, "absolute_velocity_tolerance": 1e-10, "relative_pressure_tolerance": 1e-8, "absolute_pressure_tolerance": 1e-10, "problem_domain_sub_model_part_list": [ "Parts_Structure" ] } defaults against which the current parameters are validated are : { "model_part_name": "", "domain_size": -1, "echo_level": 0, "buffer_size": 2, "analysis_type": "non_linear", "model_import_settings": { "input_type": "mdpa", "input_filename": "unknown_name" }, "computing_model_part_name": "computing_domain", "material_import_settings": { "materials_filename": "" }, "time_stepping": {}, "rotation_dofs": false, "reform_dofs_at_each_step": false, "line_search": false, "compute_reactions": true, "block_builder": true, "clear_storage": false, "move_mesh_flag": true, "multi_point_constraints_used": true, "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": "SuperLUSolver", "max_iteration": 500, "tolerance": 1e-9, "scaling": false, "verbosity": 1 }, "problem_domain_sub_model_part_list": [ "solid" ], "processes_sub_model_part_list": [ "" ], "auxiliary_variables_list": [], "auxiliary_dofs_list": [], "auxiliary_reaction_list": [] }

in kratos/includes/kratos_parameters.h:638:void Parameters::ValidateAndAssignDefaults(Parameters&) kratos/includes/kratos_parameters.h:697:void Parameters::ValidateAndAssignDefaults(Parameters&)

KRATOS TERMINATED WITH ERROR

rubenzorrilla commented 5 years ago

@94zz94 we did realize that the changes in the GUI introduced an error in the JSON settings writing. @jginternational is already aware.

jginternational commented 5 years ago

Yes, will be fixed soon.

a quickfix is to open the ProjectParameters.json and :

a hotfix will be published soon

AndreasWinterstein commented 5 years ago

Can we close this issue?

rubenzorrilla commented 5 years ago

@AndreasWinterstein I think we can. @94zz94 feel free to reopen if you still require this.