precice / precice/python-bindings
Easily switch off preCICE
Nessuno ha ancora preso questa issue.
- Lingua principale
- Cython
- Stelle
- 30
- Fork
- 19
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
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
import precice
precice.turn_off()
...
interface = precice.Interface("Solid", "../precice-config.xml", 0, 1)
...
vertex_ids = interface.set_mesh_vertices(mesh_id, vertices)
Then all preCICE calls should be NOPs.
This prevents us from polluting compact codes with a lot of
if(precice_used):
interface = precice.Interface("Solid", "../precice-config.xml", 0, 1)
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?
Guida per i contributori
Nessuna guida per i contributori indicizzata per questo repository
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Iniziate ispezionando il modulo pubblico precice e il punto di ingresso Interface mostrato nell'esempio. Determinate in che modo uno stato turn_off influirebbe sulla costruzione di Interface e sulle chiamate successive, quindi verificate che tutte le chiamate a preCICE diventino no-op mentre il codice Python a singola fisica continua a funzionare normalmente.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- python
- Ambito
- api
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 30/100