Skip to content

Commit

Permalink
PetscTryMethod for dynamic call, remove method on destroy
Browse files Browse the repository at this point in the history
  • Loading branch information
jedbrown committed Mar 18, 2011
1 parent 4a2033e commit b1fe411
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/jacobi/impls/modal/modal.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ static dErr dJacobiDestroy_Modal(dJacobi jac)
}
err = dFree3(modal->efsOpsLine,modal->efsOpsQuad,modal->efsOpsHex);dCHK(err);
err = dFree(modal);dCHK(err);
err = PetscObjectComposeFunctionDynamic((PetscObject)jac,"dJacobiModalSetFamily_C",NULL,NULL);dCHK(err);
dFunctionReturn(0);
}

Expand Down Expand Up @@ -409,12 +410,9 @@ dErr dJacobiCreate_Modal(dJacobi jac)

dErr dJacobiModalSetFamily(dJacobi jac,dJacobiModalFamily fam)
{
dErr err,(*f)(dJacobi,dJacobiModalFamily);
dErr err;

dFunctionBegin;
err = PetscObjectQueryFunction((PetscObject)jac,"dJacobiModalSetFamily_C",(void (**)(void))&f);dCHK(err);
if (f) {
err = (*f)(jac,fam);dCHK(err);
}
err = PetscTryMethod(jac,"dJacobiModalFamily_C",(dJacobi,dJacobiModalFamily),(jac,fam));dCHK(err);
PetscFunctionReturn(0);
}

0 comments on commit b1fe411

Please sign in to comment.