Skip to content
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

Configure the adapter with a YAML or JSON configuration file #40

Open
IshaanDesai opened this issue Feb 19, 2025 · 2 comments
Open

Configure the adapter with a YAML or JSON configuration file #40

IshaanDesai opened this issue Feb 19, 2025 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@IshaanDesai
Copy link
Member

IshaanDesai commented Feb 19, 2025

The adapter would benefit from a configuration file as right now quantities like the coupling mesh name, coupling data names, participant name, etc. For example, a configuration file like

{
  "participant_name": "Neumann",
  "config_file_name": "../precice-config.xml",
  "interface": {
      "coupling_mesh_name": "Neumann-Mesh",
      "write_data_name": "Temperature",
      "read_data_name": "Heat-Flux"
    }
}

can be added. The format can either be JSON or YAML (more about format choices in precice/preeco-orga#32). Currently the data and mesh names are hard-coded in the DuMuX simulation code, and passed to the adapter functions in each call. This is inefficient and error prone. With a configuration file the names will be defined at one single place. If data is read or written from the adapter, it would need an identifier to associate it to a particular name inside the adapter.

@IshaanDesai IshaanDesai added the question Further information is requested label Feb 19, 2025
@uekerman
Copy link
Member

If you start from scratch, please directly try to follow the current state of the adapter configuration schema. Will likely still change, but the closer you are, the less inertia later.

Current state of the schema: https://github.com/precice/preeco-orga/blob/main/adapter-config-schema/preatcs.json

For the example above this would mean:

{
  "participant_name": "Neumann",
  "precice_config_file_name": "../precice-config.xml",
  "interfaces": [
    {
      "mesh_name": "Neumann-Mesh",
      "write_data_names": [
        "Temperature"
      ],
      "read_data_names": [
        "Heat-Flux"
      ]
    }
  ]
}

@mathiskelm
Copy link
Collaborator

Yes, I think the adapter should adopt the configuration schema of the preCICE ecosystem. Seems like you've made good progress with the schema.

Something I'm not clear on is how it would look to use this on the participant/user side and how you mean "it would need an identifier to associate it to a particular name inside the adapter." Currently one uses the data name defined in the precice config to write/read data, this would instead need to be read from the adapter config? Does one use (agreed upon) identifiers? Does this config specify names to use when communicating to preCICE or the names of data communicated by the DuMux simulation participant? Where do I have to set/change names and how do I interact with the data fields?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

4 participants