Skip to content

Conversation

speglich
Copy link
Contributor

Closes #54

@navjotk
Copy link
Member

navjotk commented Apr 28, 2022

Can you please clean up the commit history on this a bit? e.g. I see some commits undoing things done by previous commits.

@speglich speglich force-pushed the blocked_timestepping branch from 90c0b7f to 58fd043 Compare April 28, 2022 13:15
@speglich
Copy link
Contributor Author

Can you please clean up the commit history on this a bit? e.g. I see some commits undoing things done by previous commits.

Done.

@navjotk
Copy link
Member

navjotk commented May 10, 2022

This is showing a merge conflict after merging the previous PR. Could you please do a rebase on current master?

@speglich speglich force-pushed the blocked_timestepping branch from 58fd043 to 6844553 Compare May 11, 2022 14:05
@speglich
Copy link
Contributor Author

This is showing a merge conflict after merging the previous PR. Could you please do a rebase on current master?

Done.

@speglich
Copy link
Contributor Author

Help me to remember... there is something missing @navjotk?

assert(t_start <= t_end)
if self.direction == 1:
self.u[:] = self.u[:] + self.direction * abs(t_start - t_end)
for t in range(t_start, t_end):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is happening here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We added a new dimension to the u array. This dimension is responsible to save the block_size time steps. That before are not saved because isn't necessary. This loop is responsible to write each time step in the right position.

Copy link
Member

@navjotk navjotk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a misunderstanding of how the IncOperator works - please fix that.

if self.direction == 1:
self.u[:] = self.u[:] + self.direction * abs(t_start - t_end)
for t in range(t_start, t_end):
idx = t % np.shape(self.u)[0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There must be a better way of getting block_size

self.u[:] = self.u[:] + self.direction * abs(t_start - t_end)
for t in range(t_start, t_end):
idx = t % np.shape(self.u)[0]
past_idx = (t-1) % np.shape(self.u)[0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're assuming that the operator moves one time step at a time, when this has is supposed to go from t_start to t_end.

for t in range(t_start, t_end):
idx = t % np.shape(self.u)[0]
past_idx = (t-1) % np.shape(self.u)[0]
self.u[idx][:] = self.u[past_idx][:] + self.direction * 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, assuming one time step at a time. Not true.

self.u[idx][:] = self.u[past_idx][:] + self.direction * 1
else:
self.v[:] = (self.u[:]*(-1) + 1)
idx = (t_start) % np.shape(self.u)[0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You have to fill in all elements from t_start to t_end.

@navjotk
Copy link
Member

navjotk commented Oct 18, 2022

@speglich any progress here?

@speglich speglich force-pushed the blocked_timestepping branch from 6844553 to 573ae8e Compare November 3, 2022 15:45
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 this pull request may close these issues.

Add Support to Blocked Timestepping

2 participants