Skip to content

reshape state array for a multiple-state element after solving the roots #11

Open
gdarkwah wants to merge 1 commit intodalmo1991:masterfrom
gdarkwah:patch-1
Open

reshape state array for a multiple-state element after solving the roots #11
gdarkwah wants to merge 1 commit intodalmo1991:masterfrom
gdarkwah:patch-1

Conversation

@gdarkwah
Copy link
Contributor

@gdarkwah gdarkwah commented Jan 5, 2024

I am just reopening a previous pull request that I mistakenly closed

For example, an element with 2 states will have two flux functions: [f1, f2] and two s_zeros: [S0_1, S0_2].
Let's say S0_1 = [0, 1, 2, 3, 4] and S0_2 = [5, 6, 7, 8, 9], the current implementation of line 170 will return a state_array of:

array([[1, 2],
       [3, 4],
       [5, 6],
       [7, 8]])

instead of:

array([[1, 5],
       [2, 6],
       [3, 7],
       [4, 8]])

This means that when you call get_states()[0] on the element, it will return the first two values in S0_1 instead of the first S0_1 and S0_2.

The new modification solves the issue. I encountered this while developing a multi-state element for my class project.

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.

1 participant