Skip to content

Allow mesh file to be read from data_dir #3300

Open

Description

@oparry-ukaea

I'd like to be able to specify a mesh file name in BOUT.inp and have it read from the directory passed with -d.

Activity

  1. mikekryjak commented on Mar 4, 2026

    @mikekryjak
    Contributor

    I've always wondered why we don't do this already... is there a reason for it?
    I'd also like to be able to read it from a directory defined in the input file.

  2. bendudson commented on Mar 4, 2026

    @bendudson
    Contributor

    I agree this would make more sense. The reason for the current system is that it's much more common to change the BOUT.inp than the mesh file: A set of simulations will all share the same mesh file, which can be in the root directory, with separate runs or restarted runs in subdirectories. I would however be happy to switch to the mesh file path being relative to the BOUT.inp file, so BOUT.inp could contain

    [mesh]
    file = "../some_mesh.nc"
    

    to use subdirectories for separate runs.

    It would be a breaking change, but probably not very difficult for people to adapt to.

  3. ZedThree commented on Mar 4, 2026

    @ZedThree
    Member

    One way to not make it a breaking change would be to first search (relative to?) the same directory as the input file, and then if not found, try the current working directory (or the other way round). That should probably not break things? Might be confusing?

    See also #3208

  4. oparry-ukaea commented on Mar 4, 2026

    @oparry-ukaea
    ContributorAuthor

    That makes sense to me. Searching cwd first would be guaranteed not to break anybody's current setup, presumably?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions