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

Address type piracy related SummationByPartsOperators.jl and StartUpDG.jl #1639

Closed
jlchan opened this issue Sep 14, 2023 · 5 comments
Closed
Labels

Comments

@jlchan
Copy link
Contributor

jlchan commented Sep 14, 2023

          I am not 100% sure if we want or need this, but adding Aqua tests seemed like not such a big issue to add. Also, testing time is hardly affected (<1 min). There are a lot of imho false-positive method ambiguities. There's also a legit piracy warning, thanks to buccaneer-in-chief @jlchan. I added an exception such that tests pass, but we could also think about moving [the relevant function](https://github.com/trixi-framework/Trixi.jl/blob/main/src/solvers/dgmulti/sbp.jl#L457-L475) to StartUpDG.

Originally posted by @sloede in #1628 (comment)

The SummationByPartsOperators.jl solvers specialize RefElemData, MeshData, and estimate_h from StartUpDG.jl, but do so in a way which is technically type piracy. See for example

function StartUpDG.RefElemData(element_type::Line,
D::AbstractDerivativeOperator;
tol = 100 * eps())

This type piracy can be addressed by moving these specializations into to StartUpDG.jl

@ranocha
Copy link
Member

ranocha commented Sep 15, 2023

They could basically be defined in a package extension for StartUpDg.jl, I think?

@sloede
Copy link
Member

sloede commented Sep 15, 2023

They could basically be defined in a package extension for StartUpDg.jl, I think?

Yes, that should work, but OTOH why the additional hassle? They do not depend on Trixi.jl types afaict, so they could just as well live in StartUpDG proper.

@ranocha
Copy link
Member

ranocha commented Sep 15, 2023

But then StartUpDg.jl would need to depend on SummationByPartsOperators.jl without any real reason. Thus, we should either keep it like it is right now with type piracy where it is needed (in Trixi.jl) or make it a package extension.

@sloede
Copy link
Member

sloede commented Sep 15, 2023

Ah, my bad, I thought it already was a dependency there. You're right, a Pkg extension seems the cleanest solution here.

@jlchan
Copy link
Contributor Author

jlchan commented Oct 9, 2023

Closed by #1665

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

No branches or pull requests

3 participants