Skip to content

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

Closed
gdarkwah wants to merge 1 commit intodalmo1991:masterfrom
gdarkwah:master
Closed

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

Conversation

@gdarkwah
Copy link
Contributor

@gdarkwah gdarkwah commented May 30, 2023

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.

@gdarkwah gdarkwah changed the title reshape for a multiple-state element reshape state array for a multiple-state element after solving the roots May 30, 2023
@gdarkwah gdarkwah closed this by deleting the head repository Nov 9, 2023
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