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

software architecture around shenfun? #12

Open
apatlpo opened this issue Mar 20, 2018 · 2 comments
Open

software architecture around shenfun? #12

apatlpo opened this issue Mar 20, 2018 · 2 comments

Comments

@apatlpo
Copy link
Contributor

apatlpo commented Mar 20, 2018

I will be in the next incoming months start writing a code library solving fluid flows with different sets of physics, in different types of domains (periodic vs closed).
The library will rely on shenfun and I was wondering whether anybody had advice regarding software architecture in order to do that.
One item I am worrying about for example is how to "gracefully" allow for switches between different spectral bases.

My strategy was to inspire myself from spectralDNS.
A minimal code library leveraging shenfun and providing an adequate architecture would actually be something useful to have around in order for people to start coding their solvers.

Does anybody has an opinion about this?

@mikaem
Copy link
Member

mikaem commented Mar 20, 2018

I think your question is a little too broad to spark any new ideas. A solver library can be created in a lot of different ways. SpectralDNS is one library that initially only contained Navier-Stokes, and then grew from that. I'm sure it's not the ideal library, but it seems to be working:-) One thing is that I have considered rewriting it with a nicer interface to integrators, as I don't really like the way it is now. The integrators that are in Shenfun I find nicer. Did you look at those yet? I also want to add some adaptive integrators here eventually. The good thing with these is that they separate the right hand side of the equations into linear and nonlinear parts completely generically.

When it comes to gracefully switching between bases I'm not so sure this should be possible. If you have a solution in a Chebyshev basis and want it in Legendre, then you need to make a projection. There's really no other switch allowed. One thing that actually is allowed is to switch directly from a Dirichlet basis to a regular Chebyshev basis, because these bases can use the same quadrature points in physical space. There is no simple mechanism implemented to do this switch yet though. You need to create both bases and then copy the data from one physical array in one basis, to an array in the other one.

One option is to implement solvers in spectralDNS in the current framework. Have you thought about that possibility?

@apatlpo
Copy link
Contributor Author

apatlpo commented Mar 23, 2018

yeah, I agree, this issue is a bit vague. It did steered some useful replies from your part though ;)
I'll look at integrators more closely, this looks interesting.

Regarding the bases switching issue, I am afraid I was not accurate enough in my initial post.
In a most simple situation, imagine we want to write a solver for an elliptic problem and we would like to let the basis choice as an option to the user. My intuition is that this may have an important impact on the architecture of the library but it's tough for me to estimate what this would be precisely.

I like your last suggestion about trying spectralDNS architecture.
Would it be difficult to build a minimalist version of spectralDNS?

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

No branches or pull requests

2 participants