diff --git a/Compiler/Template/CodegenAdevs.tpl b/Compiler/Template/CodegenAdevs.tpl index d51e525b07d..249e68f1de2 100644 --- a/Compiler/Template/CodegenAdevs.tpl +++ b/Compiler/Template/CodegenAdevs.tpl @@ -369,7 +369,7 @@ template makeExtraResiduals(list allEquations, String name) N_Vector y = N_VNew_Serial(NEQ); N_Vector scale = N_VNew_Serial(NEQ); void* kmem = KINCreate(); - active_model = this; + active_model = this; assert(kmem != NULL); flag = KINInit(kmem, residualFunc<%index%>, y); assert(flag == KIN_SUCCESS); @@ -382,8 +382,8 @@ template makeExtraResiduals(list allEquations, String name) >> ;separator="\n"%> flag = KINSol(kmem,y,KIN_LINESEARCH,scale,scale); - // Save the outcome and calculate any dependent variables - residualFunc<%index%>(y,scale,NULL); + // Save the outcome and calculate any dependent variables + residualFunc<%index%>(y,scale,NULL); N_VDestroy_Serial(y); N_VDestroy_Serial(scale); KINFree(&kmem);