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

[ODEs] Caching matrix and vector when operator cannot be evaluated at t = 0.0 #887

Closed
ericneiva opened this issue Mar 15, 2023 · 1 comment · Fixed by #891
Closed

[ODEs] Caching matrix and vector when operator cannot be evaluated at t = 0.0 #887

ericneiva opened this issue Mar 15, 2023 · 1 comment · Fixed by #891

Comments

@ericneiva
Copy link
Member

Dear @oriolcg,

I'd say an ODE solver caches (allocates) the matrix and vector, by evaluating the FE operator at t = 0.0.

For instance, the Affine Theta Method:

if cache === nothing
ode_cache = allocate_cache(op)
= similar(u0)
vθ .= 0.0
l_cache = nothing
A, b = _allocate_matrix_and_vector(op,u0,ode_cache)
else
ode_cache, vθ, A, b, l_cache = cache
end

Eventually visits these two through _allocate_matrix_and_vector:

vecdata = collect_cell_vector(V,op.res(0.0,xh,v))

_matdata = (_matdata...,_matdata_jacobian(op,0.0,xh,i,0.0))

I am trying to solve a transient problem whose operator cannot be evaluated at t = 0.0, so you can imagine I am getting an error when caching the ODE system...

Shall we pass the initial time to all _allocate_matrix_and_vector methods?

@oriolcg
Copy link
Member

oriolcg commented Mar 15, 2023

Good point @ericneiva . Until now we assumed that the operator allocation was independent of the time and "hard coded" its evaluation at t=0 for allocation purposes. Passing t0 would solve the issue and make it more general, without overhead (other than having an argument more in the function).

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

Successfully merging a pull request may close this issue.

2 participants