Skip to content

Permit user to select source terms by passed string #27

@nicholasmalaya

Description

@nicholasmalaya

Presently, MASA requires calling a specific method for each source term, e.g.

exact_u   = masa_eval_exact_u     (tempx,tempy);
exact_p   = masa_eval_exact_p     (tempx,tempy);

etc.

We won't break old functionality, but adding a generic source and exact term that parses a string to select which term to evaluate would be nifty. This would then look like,

exact_u   = masa_eval_exact     ("u",tempx,tempy);
exact_p   = masa_eval_exact     ("p",tempx,tempy);

No rubber to road yet, so we can plan this out, happy for any feedback/suggestions. Under the hood I'm inclined to build a map between string and a pointer to source/exact functions, e.g. "u":"masa_eval_exact_u()", after which this method calls the appropriate function evaluated at the points it was given. The trick is that we have man different methods due to the numerous overloaded functions for the various dimensionality we might have. We could circumvent this by pointing the map to a container of all the available functions for that variable and then selecting only the one that has the appropriate dimensionality, but I suspect there is a more elegant solution available.

This was an old MASA svn ticket that is being resurrected for @pbauman and @vikramgarg.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions