Remove data copying for internal component variables, derivatives, and residuals in PowerElectronics#379
Remove data copying for internal component variables, derivatives, and residuals in PowerElectronics#379alexander-novo wants to merge 8 commits intodevelopfrom
Conversation
|
@pelesh I'm not really sure what to do about the enzyme example, since the DG model's residual has diverged from what's given in that example. Let me know what you think is best. |
Let's merge the other power electronics PRs, first. My understanding is that only variables were reordered and equations remained the same. In that case, it should not be difficult to fix the answer key for the Enzyme test. |
|
I set this to draft for now until we merge other related PRs. |
db31722 to
491b7ca
Compare
8773a38 to
30704e2
Compare
|
@pelesh I'm not sure the |
|
Well I just changed it to be a test of a non-reference generator, and edited the answer key to match. |
d87c9b3 to
77be7b9
Compare
bae5286 to
60c0212
Compare
77be7b9 to
6e597c3
Compare
Previous test was testing a scenario with a refrence DG where delta != 0, which is no longer possible. New test does a non-reference DG, and the answer key has been updated with the expected value of the first residual (0) for a non-reference DG.
60c0212 to
4f84918
Compare
|
This is very nice work for what I could see thus far. I would only avoid calling internal variables How about |
Description
Partially addresses #353.
Removes data copying between the system and components for internal variables, derivatives, and residuals when evaluating residuals and Jacobians.
Proposed changes
CircuitComponentnow has three pointers:int_: a pointer to the component's internal variables in the system vectorintp_: a pointer to the component's internal derivatives in the system vectorint_f_: a pointer to the component's internal residuals in the system vectorPowerElectronicsModel::distributeVectors()andPowerElectronicsModel::evaluateResidual()have been modified to only copy variables betweeny_andf_if they are external. Therefore, components must use the three new pointers above to correctly calculate residuals and Jacobians.Checklist
-Wall -Wpedantic -Wconversion -Wextra.Further comments
This solution won't work quite right for system objects which are components in another system. Maybe we want some sort of flag that checks for this situation and doesn't allocate a
y_orf_vector?