-
Notifications
You must be signed in to change notification settings - Fork 249
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
[CoSimulationApplication] Adding VTK debugging option for Kratos Mapping #12511
[CoSimulationApplication] Adding VTK debugging option for Kratos Mapping #12511
Conversation
For some reason FSI tests are failing in the FSIApp but this does not affect that application. |
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.
Will do a review on the weekend
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.
I think this is a good addition, but the implementation should be moved to a CouplingOperation
instead, this is the intended place for such things
Check for example the CouplingOutput which has a similar purpose
=> then the user can add it to the coupling_operations
and call it before_data_transfer_operations
or after_data_transfer_operations
pre_origin_settings["Parameters"]["output_path"].SetString(origin_output_path + "_pre_map") | ||
|
||
# Create a VTK output process object with the provided settings and the current model | ||
pre_process_origin = vtk_output_process.Factory(pre_origin_settings, model_origin) |
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.
I would use the vtk_output directly, then you only need to call PrintOutput
, and not have all the overhead of the process
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.
I understand your point, but the problem with that impliementation is that I will need to manually add the settings for the IO instead of automatically deduce the variables and settings from the mapping like I do in the current proposal.
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.
Ping @philbucher
We should discuss this @philbucher. Currently I need to transfer the files to the interested people for debug and it is a bit inconvinient |
The commit refactors the `KratosMappingDataTransferOperator` class in the `CoSimulationApplication` to improve VTK debugging. It adds an auxiliary counter for wrappers without `TIME` or `STEP` defined, and updates the output paths for VTK output processing. The changes ensure that the VTK output files are saved in the correct directory and have appropriate names.
…pers and improve VTK debugging
oh sorry I completely forgot, will take a look over the weekend |
A priori it is done, I am just adding some minor fixes from internal feedback |
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.
I had a look and TBH its very complicated and not very nicely done
How about you derive a class from it, e.g. kratos_mapping_with_debug_output
to not mess up the baseclass?
.../CoSimulationApplication/python_scripts/base_classes/co_simulation_data_transfer_operator.py
Outdated
Show resolved
Hide resolved
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.
please move the additions in this file, they should not be in the baseclass
applications/CoSimulationApplication/python_scripts/data_transfer_operators/kratos_mapping.py
Outdated
Show resolved
Hide resolved
applications/CoSimulationApplication/python_scripts/data_transfer_operators/kratos_mapping.py
Outdated
Show resolved
Hide resolved
applications/CoSimulationApplication/python_scripts/data_transfer_operators/kratos_mapping.py
Outdated
Show resolved
Hide resolved
applications/CoSimulationApplication/python_scripts/data_transfer_operators/kratos_mapping.py
Outdated
Show resolved
Hide resolved
Theare are better ways to express that :P
I could do that |
Co-authored-by: Philipp Bucher <[email protected]>
I tried my best, sry 😓 |
…ithub.com/KratosMultiphysics/Kratos into CoSim/adding-vtk-debugging-kratos-mapping
… variables/methods protected
Should be Okay now |
applications/CoSimulationApplication/python_scripts/data_transfer_operators/kratos_mapping.py
Outdated
Show resolved
Hide resolved
.../CoSimulationApplication/python_scripts/data_transfer_operators/kratos_mapping_with_debug.py
Show resolved
Hide resolved
.../CoSimulationApplication/python_scripts/data_transfer_operators/kratos_mapping_with_debug.py
Outdated
Show resolved
Hide resolved
.../CoSimulationApplication/python_scripts/data_transfer_operators/kratos_mapping_with_debug.py
Show resolved
Hide resolved
.../CoSimulationApplication/python_scripts/data_transfer_operators/kratos_mapping_with_debug.py
Outdated
Show resolved
Hide resolved
Suggestions applied @philbucher |
Are you Okay now @philbucher ¿? |
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.
👍
from KratosMultiphysics.CoSimulationApplication.utilities import data_communicator_utilities | ||
from time import time | ||
from dataclasses import dataclass | ||
from typing import Union, Tuple |
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.
ah my archnemesis, typing in python ...
/rant over
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.
It was your suggestion...
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.
I know, its the direction the language goes, smarter ppl than me design this
still, I can complain about it :D
@roigcarlo do you think it is possible to cherry-pick this into a minor release? |
I Will include it in 10.0 |
📝 Description
Adding new mapping class with VTK debuggin, derived from Kratos Mapping.
For example can be sued as follows:
It will generate VTK folder for the pre and post mapping.
🆕 Changelog