Skip to content

Commit a4ddaa1

Browse files
niklworsOpenModelica-Hudson
authored andcommitted
fix in kinsol of cpp runtime for linear tearing system
1 parent 66ba9e3 commit a4ddaa1

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Compiler/Template/CodegenCpp.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5573,7 +5573,7 @@ case SIMCODE(modelInfo = MODELINFO(__)) then
55735573
{
55745574
<% match eq
55755575
case SES_LINEAR(__) then
5576-
"*A_matrix=*__Asparse;"
5576+
"A_matrix=*(__Asparse.get());"
55775577
%>
55785578
}
55795579

SimulationRuntime/cpp/Solver/Kinsol/Kinsol.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ void Kinsol::solve()
223223
for(int j=0;j<dimSys;j++)
224224
jac[i+j*_dimSys] = amatrix(j,i);
225225

226-
_algLoop->getReal(_y);
226+
227227
// calcJacobian(_f,_y);
228228
dgesv_(&dimSys, &dimRHS, jac, &dimSys, _ihelpArray, _f,&dimSys,&irtrn);
229229

@@ -232,8 +232,8 @@ void Kinsol::solve()
232232

233233
memcpy(_y, _f, _dimSys*sizeof(double));
234234
delete [] jac ;
235-
_algLoop->setReal(_y);
236-
//_algLoop->evaluate();
235+
_algLoop->setReal(_y);
236+
_algLoop->evaluate();
237237
if(irtrn != 0)
238238
throw ModelicaSimulationError(ALGLOOP_SOLVER,"error solving linear tearing system");
239239
else

SimulationRuntime/cpp/Solver/UmfPack/UmfPack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ void UmfPack::solve()
6262
{
6363
_algLoop->evaluate();
6464
_algLoop->getRHS(_rhs);
65-
_algLoop->getSystemMatrix(_jacs);
65+
_algLoop->getSystemMatrix(*(_jacs.get()));
6666

6767
int status, sys=0;
6868
double Control [UMFPACK_CONTROL], Info [UMFPACK_INFO] ;

0 commit comments

Comments
 (0)