Skip to content

Support fem.Function for CouplingMesh read_fields #62

@Snapex2409

Description

@Snapex2409

Currently, when constructing a CouplingMesh obj the read_fields dict needs contain fem.Functionspace as values.

Would it be possible to also allow fem.Function objects as values, similar to the write_fields dict.
Given the newest support of direct reading into fem.Function buffers, this would make the resulting code more readable.

read_functions = {
    'a': fem.Function(V),
    'b': fem.Function(V)
}
read_fields = {
    'a': V,
    'b': V
}

# ... some other preCICE setup code

for name, func in read_fields.items(): precice.read_data("mesh", name, dt, func)

This could then be simplified by dropping read_fields and using read_function as the new read_fields.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions