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

Conflict in time_M when using saved buffer and conditional dimension #2273

Open
ccuetom opened this issue Nov 24, 2023 · 0 comments
Open

Conflict in time_M when using saved buffer and conditional dimension #2273

ccuetom opened this issue Nov 24, 2023 · 0 comments
Assignees
Labels

Comments

@ccuetom
Copy link
Contributor

ccuetom commented Nov 24, 2023

When using a conditional dimension that contains Ge / Le types of conditions and a saved buffer defined over that conditional dimension, there is a conflict in the calculation of time_M for different objects:

from devito import *
from devito.symbolics import CondEq


grid = Grid(shape=(10, 10))
time = grid.time_dim

nt = 200
bounds = (10, 100)
factor = 5

condition = sympy.And(CondEq(time % 7, 0),
                      Ge(time, bounds[0]),
                      Le(time, bounds[1]), )

time_under = ConditionalDimension(name='timeu',
                                  parent=time,
                                  factor=7,
                                  condition=condition)

buffer_size = (bounds[1] - bounds[0] + factor) // factor + 1

rec = SparseTimeFunction(name='rec', grid=grid, npoint=1, nt=nt)

u = TimeFunction(name='u', grid=grid, space_order=2)
usaved = TimeFunction(name='usaved', grid=grid, space_order=2, time_dim=time_under, save=buffer_size)

eq = [Eq(usaved, u)] + rec.interpolate(u)

op = Operator(eq)
op(time_m=1, time_M=nt-1, usaved=usaved, rec=rec)

produces the error ValueError: Unable to find unique value for key time_M, candidates: [199, range(1, 139)].

@georgebisbas georgebisbas self-assigned this May 10, 2024
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