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

Return internal information for future use #10

Open
jwscook opened this issue Aug 21, 2018 · 5 comments
Open

Return internal information for future use #10

jwscook opened this issue Aug 21, 2018 · 5 comments

Comments

@jwscook
Copy link
Contributor

jwscook commented Aug 21, 2018

I'm currently doing a lot of cubature integrals, and it's quite slow due to the shear number of integrals. However, I suspect that the number of intervals and/or quadrature points at convergence are quite similar from one integral to another. Is there is an opportunity for speed up if this information can be passed from one cubature evaluation to another, so that the algorithm can start off from a better position?

Top work on this package btw!

@stevengj
Copy link
Member

The best way to share points between similar integrals is probably to integrate a vector-valued integrand. (Use StaticArrays.jl for the integrand so that you don't need to allocate lots of temporary vectors on the heap.)

Also, I'm skeptical that the savings from saving/re-using cubature regions would be that great — because it's a geometric series of points, you waste at most a factor of two in the number of integrand evaluations during adaptivity.

@jwscook
Copy link
Contributor Author

jwscook commented Aug 21, 2018

It's going to be quite a challenge to create a vector valued integrand because the integral bounds are different for each quantity that would be in the vector, or so it's been written. It's for a least squares finite element method where I'm integrating over the intersection of at least two multi-dimensional basis functions of compact supports. Also the problem isn't in general translationally invariant because of spatially dependent factors in the integrand.

I wasn't very clear before. When I said saving intervals, I meant it in a relative sense:

Let's say that in the course of the first integral over the interval [a,b), normalised to [-1, 1), there are N subdivisions e.g. [-1, -0.75), [-0.75, 0.25) [0.25, 0.5) and [0.25, 1). It is then possible to start with the same subdivision, relatively speaking, but over the interval of the next integral [a', b')?

I assume not because it sounds difficult.

@jwscook
Copy link
Contributor Author

jwscook commented Aug 21, 2018

Also, a factor of 2 sounds good! I'll take what I can get.

@stevengj
Copy link
Member

It is then possible to start with the same subdivision, relatively speaking, …

If that is what you want, you could use a vector-valued integrand with a coordinate transformation to map all of your integrands to the same domain.

@jwscook
Copy link
Contributor Author

jwscook commented Aug 25, 2018

A coordinate transformation will be rather challenging because I'm working with non-orthogonal coordinate systems.

Having vectorised it, and storing the vector result with vector of inputs as a dictionary has made re-evaluations redundant.

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