Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ namespace GridKit
template <typename scalar_type, typename index_type>
int BusToSignalAdapter<scalar_type, index_type>::evaluateJacobian()
{
return 0;
return this->constructCoo();
}

} // namespace PhasorDynamics
Expand Down
17 changes: 17 additions & 0 deletions tests/UnitTests/PhasorDynamics/BusToSignalAdapterTests.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,23 @@ namespace GridKit

return success.report(__func__);
}

TestOutcome jacobian()
{
TestStatus success = true;

auto bus = BusT(1.0, 0.0);
auto adapter = AdapterT(&bus);
bus.allocate();
adapter.allocate();

success *= (adapter.evaluateJacobian() == 0);

const auto* jacobian = adapter.getCooJacobian();
success *= (jacobian != nullptr && jacobian->getNnz() == 0);

return success.report(__func__);
}
};

} // namespace Testing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ int main()

result += test.constructor();
result += test.residual();
result += test.jacobian();

return result.summary();
}
Loading