Description
As part of working on #530, I tried running the test tests/cases/cep/niederer_benchmark_ECGs_quadrature/solver_GMRES_FE_pfib_AP.xml over multiple timesteps. The results seem to be incorrect.
In the initial timesteps, the excited region's potential becomes lower than the resting value (instead of higher):

As the simulation proceeds, the (negative) excitation does not propagate, and at some point it blows up, likely due to the negative values falling in some unfeasible range for the model (next images are the same frame but with different color scales):


The simulation crashes in time step 42, throwing the error std::runtime_error: [cep_integ_l] A NaN has been computed during time integration of electrophysiology variables.
Reproduction
On the main branch, run the test case tests/cases/cep/niederer_benchmark_ECGs_quadrature/solver_GMRES_FE_pfib_AP.xml setting Number_of_time_steps to 1000 (or any value above 40).
Expected behavior
The excited region should have higher potential then the resting value, as in this picture (same timestep as first picture above):

The stimulus should propagate over time to the whole domain, and should not blow up.
The above was achieved by changing the sign of the applied current stimulus from negative to positive. Accordingly, I suggest that that sign be changed in the parameter file for this test and possibly other tests involving the AP model.
Additional context
I don't know if the same issue happens with models other than AP.
I noticed that the sign of the applied current is interpreted differently for different models (at least for TTP and AP, not sure about the others). I think it might be beneficial to make this setting consistent, so that the applied current parameter section can become independent of the ionic model being used. If people agree with this, I can take care of it as part of the refactoring proposed in #530.
Code of Conduct
Description
As part of working on #530, I tried running the test
tests/cases/cep/niederer_benchmark_ECGs_quadrature/solver_GMRES_FE_pfib_AP.xmlover multiple timesteps. The results seem to be incorrect.In the initial timesteps, the excited region's potential becomes lower than the resting value (instead of higher):

As the simulation proceeds, the (negative) excitation does not propagate, and at some point it blows up, likely due to the negative values falling in some unfeasible range for the model (next images are the same frame but with different color scales):


The simulation crashes in time step 42, throwing the error
std::runtime_error: [cep_integ_l] A NaN has been computed during time integration of electrophysiology variables.Reproduction
On the
mainbranch, run the test casetests/cases/cep/niederer_benchmark_ECGs_quadrature/solver_GMRES_FE_pfib_AP.xmlsettingNumber_of_time_stepsto 1000 (or any value above 40).Expected behavior
The excited region should have higher potential then the resting value, as in this picture (same timestep as first picture above):

The stimulus should propagate over time to the whole domain, and should not blow up.
The above was achieved by changing the sign of the applied current stimulus from negative to positive. Accordingly, I suggest that that sign be changed in the parameter file for this test and possibly other tests involving the AP model.
Additional context
I don't know if the same issue happens with models other than AP.
I noticed that the sign of the applied current is interpreted differently for different models (at least for TTP and AP, not sure about the others). I think it might be beneficial to make this setting consistent, so that the applied current parameter section can become independent of the ionic model being used. If people agree with this, I can take care of it as part of the refactoring proposed in #530.
Code of Conduct