-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Easily switch off preCICE #99
Comments
Let me first state the obvious downsides of such a feature:
Wouldn't it be easier to refactor the code by breaking it up into general, precice-on and precice-off chunks? |
I see the points. I really meant it for very short codes, such as https://github.com/precice/tutorials/blob/master/flow-over-heated-plate/solid-nutils/solid.py |
I can provide another example of such polluting code here. In this code I have a single python script to do the single-physics as well as coupled simulation. This is a relatively small code and adding |
We could have a
this would keep the python bindings clean and it still handles your use case. Not sure whether I would provide this under |
I just found this issue now. I would mostly agree with with @fsimonis and if necessary, I would prefer the approach of @BenjaminRodenberg with At the moment I would have the following, additional critical remarks:
|
Another code example why this feature is needed |
Can you elaborate or point to a more specific place? Looking at the code I don't directly see the reason (I only looked very quickly and carelessly, though). |
Sure, if you search |
Oftentimes, you want to run a coupled code in single-physics mode, so without preCICE. For codes like OpenFOAM or FEniCS, we would handle this in the adapter. As the Python bindings are also used in codes without adapters (e.g. Nutils) and the codes don't need compiling (Python), it would be really great if there was a simple "switch off" mechanism.
Say
Then all preCICE calls should be NOPs.
This prevents us from polluting compact codes with a lot of
Is there a standard Python way how to do this? If not, could we handle it in the Python bindings?
I don't think we need this feature for other bindings as there we have longer codes and/or adapters and we compile. Do you agree?
The text was updated successfully, but these errors were encountered: