Skip to content

Update preciceDict to comply with upcoming schema changes #354

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

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

vidulejs
Copy link
Collaborator

The new preCICE schema will have additional options for fields, to specify solver_name and operation. This means that readData and writeData in preciceDict would be dictionaries instead of lists, so that these additional options can be parsed. For example:

  Interface1
  {
    mesh              Fluid-Mesh;
    patches           (interface);
    
    readData
    {
      Heat-Flux
      {
      	solver_name	T;
      	operation	gradient;
      };
    };
    
    writeData
    {
      Temperature
      {
      	solver_name	T;
      	operation	value;
      };	
    };
  };

I tried to look into ways to keep backwards compatibility with the lists, but this may not be desirable. The new schema warrants breaking changes. In order to read old config files, we'd have to check if it's a list or a dict. OpenFOAM does not make this easy... I tried to use the ITstream (Input Token Stream) to check whether the token is ( for list or { for dict. However the ITstream & dictionary.lookup(word &keyword) works only if i'm looking up a list and not a dict. I would need to write a custom parser. Similar issue on cfd-online forums.

TODO list:

  • I updated the documentation in docs/
  • I added a changelog entry in changelog-entries/ (create directory if missing)

…ionary AND list (for backwards compatibility).
@MakisH
Copy link
Member

MakisH commented Mar 20, 2025

For the review, I think we would need also a corresponding draft PR in the tutorials, porting at least one case (e.g., the flow-over-heated-plate).

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

Successfully merging this pull request may close these issues.

2 participants