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

#216 iteratefdtd_matrix: Updates for the main loop #224

Merged
merged 27 commits into from
Feb 23, 2023

Conversation

willGraham01
Copy link
Collaborator

@willGraham01 willGraham01 commented Jan 31, 2023

Closes #216 | Continues #63 |

Diff is large because .clang-format is running over all touched files. #222 merged so now the diff is manageable.

Source class changes:

  • Now tracks whether the source data is empty through the private variable no_data_stored. This is safer than relying on comparing the data members real and imag to nullptr, since these are public members and so could be accidentally modified in the codebase. Remove MATLAB dependency #70 May change this ethos
  • Has an access method is_empty() that can be used to access no_data_stored.

ObjectFromInfile changes:

  • Has a fetch-method all_sources_are_empty() WDWYTID.

SimulationManager changes:

  • post_processing() method now only runs the normalisation lines if at least one of the Source inputs is non-empty, as required.

source_term_updates.cpp

New file that breaks off the aforementioned Source update equations from the main loop code, and places them into functions. Also involves a logic update and better variable scoping.

  • update_{IJK}source_terms_steadystate() handles the updates to the E_s, H_s, J_c, J_s (as appropriate) in steadystate simulations.
  • update_source_steadystate() serves to unify the update equations, preserving the general structure of the updates whilst using switches to account for differences between the I,J,K cases.

TODO:

  • E_s steadystate update equations
  • E_s pulsed update equations
  • H_s steadystate update equations
  • H_s pulsed update equations
  • Resolve flagged issues below

Issue Resolutions Required

@willGraham01 willGraham01 self-assigned this Feb 2, 2023
@willGraham01 willGraham01 marked this pull request as ready for review February 20, 2023 10:59
@samcunliffe
Copy link
Member

Diff is large because .clang-format is running over all touched files.

Should we, therefore, merge #222 as-is, to simplify(?) this diff? Then clang-tidy and/or cpplint can come in later pull requests?

@willGraham01
Copy link
Collaborator Author

Diff is large because .clang-format is running over all touched files.

Should we, therefore, merge #222 as-is, to simplify(?) this diff? Then clang-tidy and/or cpplint can come in later pull requests?

Yes - I've made #222 ready for review so it can go in. Then I can rebase/merge this on top of that.

Copy link
Member

@samcunliffe samcunliffe left a comment

Choose a reason for hiding this comment

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

Sorry for the slow review!
Weirdly I reviewed almost all of this on Monday and... then just stopped(!?)

All looks very good to me.
SimulationManager is now a large class although that's a big improvement from a gigantonormous function.

tdms/include/source.h Outdated Show resolved Hide resolved
@samcunliffe samcunliffe added enhancement New feature or request housekeeping Code cleanup labels Feb 23, 2023
@willGraham01
Copy link
Collaborator Author

willGraham01 commented Feb 23, 2023

Sorry for the slow review! Weirdly I reviewed almost all of this on Monday and... then just stopped(!?)

All looks very good to me. SimulationManager is now a large class although that's a big improvement from a gigantonormous function.

No worries 😃 However the changes based on your comments mean that GitHub wants a re-review. But all that's changed is me doing this and resolving the conflicts with main.

@samcunliffe
Copy link
Member

GitHub wants a re-review

Hm. Interesting. Was browsing the PR rules when looking into automerge but I didn't think I changed anything.
(This is probably my fault.)

@willGraham01 willGraham01 merged commit 1115ae2 into main Feb 23, 2023
@willGraham01 willGraham01 deleted the wgraham-216-iteratefdtd_matrix_updates branch February 23, 2023 13:38
willGraham01 added a commit that referenced this pull request 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 pull request 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 pull request 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
enhancement New feature or request housekeeping Code cleanup
Projects
None yet
Development

Successfully merging this pull request may close these issues.

array_ind scoping issues Update to iteratefdtd_matrix: Main Loop Alterations
2 participants