Skip to content

Commit

Permalink
Commands/CalcLaplacian: handle missing incidence matrix.
Browse files Browse the repository at this point in the history
  • Loading branch information
PMeira committed Feb 21, 2024
1 parent 4d366c1 commit ef35b76
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

- Alt/CE: Fix `RegisterValues` in the C header.
- Alt/PDE: Check for missing solution in a few functions.
- Commands/`CalcLaplacian`: Give proper error message instead of crashing or giving "access violation" messages.

## Version 0.14.1 (2024-02-16)

Expand Down
5 changes: 5 additions & 0 deletions src/Executive/ExecCommands.pas
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,11 @@ procedure ProcessCommand({$IFDEF DSS_CAPI_PM}MainDSS{$ELSE}DSS{$ENDIF}: TDSSCont
{$ENDIF}
ord(Cmd.CalcLaplacian):
begin
if DSS.ActiveCircuit.Solution.IncMat = NIL then
begin
DoSimpleMsg(DSS, _('Indidence matrix is not present. Please run either "CalcIncMatrix" or "CalcIncMatrix_O" first.'), 8877);
Exit;
end;
with DSS.ActiveCircuit.Solution do
begin
Laplacian := IncMat.Transpose(); // Transposes the Incidence Matrix
Expand Down

0 comments on commit ef35b76

Please sign in to comment.