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

array_ind scoping issues #226

Closed
willGraham01 opened this issue Feb 6, 2023 · 1 comment · Fixed by #224
Closed

array_ind scoping issues #226

willGraham01 opened this issue Feb 6, 2023 · 1 comment · Fixed by #224
Labels
bug Something isn't working context required More context/information is required technical Technical and meta issues, not related to physics but infrastructure.
Milestone

Comments

@willGraham01
Copy link
Collaborator

In the Jsource loop, the !inputs.params.is_multilayer-logical statement occurs within the first k < inputs.K1.index conditional statement.

This is inconsistent with the other loops, where the former is conducted prior to entering the latter conditional block. Additionally, the array_ind variable that is assigned in this conditional block is used again on line 181 - despite the fact that it might not actually have been set!

The logical inconsistency can be seen in Jsource loop compared to the Isource loop, for example.

@willGraham01 willGraham01 added bug Something isn't working technical Technical and meta issues, not related to physics but infrastructure. context required More context/information is required labels Feb 6, 2023
@prmunro
Copy link
Collaborator

prmunro commented Feb 7, 2023

I suggest to move the assignment of array_ind to outside the

if (k < (inputs.K1.index) ||
inputs.params.dimension == Dimension::TRANSVERSE_MAGNETIC)

statement.

willGraham01 added a commit that referenced this issue Feb 8, 2023
willGraham01 added a commit that referenced this issue Feb 23, 2023
* Cherry-pick Sam's linting

* Add flag to Source class to indicate empty array

* Add flag to Source class to indicate empty array

* Indentation

* Initialise values rather than assign

* Refactored source updates - flagged mystery indexing

* Pre-commit consistency with #223

* Update clang-format to #222 settings

* Fix out-of-order initilisation warning

* Revert pre-commit to suppress GitHub failures until #223 is ready

* Remove unused variables in updating Ksource terms

* Start refactoring the refactored functions. Flag more inconsistencies

* Missing std::

* Merge E_s steady-state updates into one function (revert files to previous commit if undesired)

* Fix bugs in unification (IE Will can't type)

* Pull out E_s source updates, and wrap to avoid empty-source updates

* Pull out H-source updates, don't add empty array checks yet

* Fully refactor H-field, now to find the bug...

* Add that newline to make pre-commit happy

* Missed a -1 in ONE place... does this fix the bug?

* Remove useless comment

* Apply Peter's suggestion on #226

* Add Peter's resolution to #225

* Apply Sam's suggestions for SourceIndex struct

* Small doc changes that didn't get caught
willGraham01 added a commit that referenced this issue Mar 6, 2023
* Cherry-pick Sam's linting

* Add flag to Source class to indicate empty array

* Add flag to Source class to indicate empty array

* Indentation

* Initialise values rather than assign

* Refactored source updates - flagged mystery indexing

* Pre-commit consistency with #223

* Update clang-format to #222 settings

* Fix out-of-order initilisation warning

* Revert pre-commit to suppress GitHub failures until #223 is ready

* Remove unused variables in updating Ksource terms

* Start refactoring the refactored functions. Flag more inconsistencies

* Missing std::

* Merge E_s steady-state updates into one function (revert files to previous commit if undesired)

* Fix bugs in unification (IE Will can't type)

* Pull out E_s source updates, and wrap to avoid empty-source updates

* Pull out H-source updates, don't add empty array checks yet

* Fully refactor H-field, now to find the bug...

* Add that newline to make pre-commit happy

* Missed a -1 in ONE place... does this fix the bug?

* Remove useless comment

* Apply Peter's suggestion on #226

* Add Peter's resolution to #225

* Apply Sam's suggestions for SourceIndex struct

* Small doc changes that didn't get caught
willGraham01 added a commit that referenced this issue Mar 7, 2023
* Cherry-pick Sam's linting

* Add flag to Source class to indicate empty array

* Add flag to Source class to indicate empty array

* Indentation

* Initialise values rather than assign

* Refactored source updates - flagged mystery indexing

* Pre-commit consistency with #223

* Update clang-format to #222 settings

* Fix out-of-order initilisation warning

* Revert pre-commit to suppress GitHub failures until #223 is ready

* Remove unused variables in updating Ksource terms

* Start refactoring the refactored functions. Flag more inconsistencies

* Missing std::

* Merge E_s steady-state updates into one function (revert files to previous commit if undesired)

* Fix bugs in unification (IE Will can't type)

* Pull out E_s source updates, and wrap to avoid empty-source updates

* Pull out H-source updates, don't add empty array checks yet

* Fully refactor H-field, now to find the bug...

* Add that newline to make pre-commit happy

* Missed a -1 in ONE place... does this fix the bug?

* Remove useless comment

* Apply Peter's suggestion on #226

* Add Peter's resolution to #225

* Apply Sam's suggestions for SourceIndex struct

* Small doc changes that didn't get caught
willGraham01 added a commit that referenced this issue Mar 29, 2023
* Cherry-pick Sam's linting

* Add flag to Source class to indicate empty array

* Add flag to Source class to indicate empty array

* Indentation

* Initialise values rather than assign

* Refactored source updates - flagged mystery indexing

* Pre-commit consistency with #223

* Update clang-format to #222 settings

* Fix out-of-order initilisation warning

* Revert pre-commit to suppress GitHub failures until #223 is ready

* Remove unused variables in updating Ksource terms

* Start refactoring the refactored functions. Flag more inconsistencies

* Missing std::

* Merge E_s steady-state updates into one function (revert files to previous commit if undesired)

* Fix bugs in unification (IE Will can't type)

* Pull out E_s source updates, and wrap to avoid empty-source updates

* Pull out H-source updates, don't add empty array checks yet

* Fully refactor H-field, now to find the bug...

* Add that newline to make pre-commit happy

* Missed a -1 in ONE place... does this fix the bug?

* Remove useless comment

* Apply Peter's suggestion on #226

* Add Peter's resolution to #225

* Apply Sam's suggestions for SourceIndex struct

* Small doc changes that didn't get caught
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working context required More context/information is required technical Technical and meta issues, not related to physics but infrastructure.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants