ts.c (87828ca270d8140797fd4271705413c4ecfcb535) ts.c (ef66eb6987ddfdf4e414d6b820cbc8d8d7d17bc2)
1/* $Id: ts.c,v 1.41 2001/06/21 21:18:58 bsmith Exp bsmith $ */
1/* $Id: ts.c,v 1.42 2001/08/06 21:18:08 bsmith Exp bsmith $ */
2#include "src/ts/tsimpl.h" /*I "petscts.h" I*/
3
4#undef __FUNCT__
5#define __FUNCT__ "TSComputeRHSJacobian"
6/*@
7 TSComputeRHSJacobian - Computes the Jacobian matrix that has been
8 set with TSSetRHSJacobian().
9

--- 30 unchanged lines hidden (view full) ---

40
41 PetscFunctionBegin;
42 PetscValidHeaderSpecific(ts,TS_COOKIE);
43 PetscValidHeaderSpecific(X,VEC_COOKIE);
44 PetscCheckSameComm(ts,X);
45 if (ts->problem_type != TS_NONLINEAR) {
46 SETERRQ(PETSC_ERR_ARG_WRONG,"For TS_NONLINEAR only");
47 }
2#include "src/ts/tsimpl.h" /*I "petscts.h" I*/
3
4#undef __FUNCT__
5#define __FUNCT__ "TSComputeRHSJacobian"
6/*@
7 TSComputeRHSJacobian - Computes the Jacobian matrix that has been
8 set with TSSetRHSJacobian().
9

--- 30 unchanged lines hidden (view full) ---

40
41 PetscFunctionBegin;
42 PetscValidHeaderSpecific(ts,TS_COOKIE);
43 PetscValidHeaderSpecific(X,VEC_COOKIE);
44 PetscCheckSameComm(ts,X);
45 if (ts->problem_type != TS_NONLINEAR) {
46 SETERRQ(PETSC_ERR_ARG_WRONG,"For TS_NONLINEAR only");
47 }
48 if (!ts->rhsjacobian) PetscFunctionReturn(0);
49 ierr = PetscLogEventBegin(TS_JacobianEval,ts,X,*A,*B);CHKERRQ(ierr);
50 *flg = DIFFERENT_NONZERO_PATTERN;
51 PetscStackPush("TS user Jacobian function");
52 ierr = (*ts->rhsjacobian)(ts,t,X,A,B,flg,ts->jacP);CHKERRQ(ierr);
53 PetscStackPop;
54 ierr = PetscLogEventEnd(TS_JacobianEval,ts,X,*A,*B);CHKERRQ(ierr);
55 /* make sure user returned a correct Jacobian and preconditioner */
56 PetscValidHeaderSpecific(*A,MAT_COOKIE);
57 PetscValidHeaderSpecific(*B,MAT_COOKIE);
48 if (ts->rhsjacobian) {
49 ierr = PetscLogEventBegin(TS_JacobianEval,ts,X,*A,*B);CHKERRQ(ierr);
50 *flg = DIFFERENT_NONZERO_PATTERN;
51 PetscStackPush("TS user Jacobian function");
52 ierr = (*ts->rhsjacobian)(ts,t,X,A,B,flg,ts->jacP);CHKERRQ(ierr);
53 PetscStackPop;
54 ierr = PetscLogEventEnd(TS_JacobianEval,ts,X,*A,*B);CHKERRQ(ierr);
55 /* make sure user returned a correct Jacobian and preconditioner */
56 PetscValidHeaderSpecific(*A,MAT_COOKIE);
57 PetscValidHeaderSpecific(*B,MAT_COOKIE);
58 } else {
59 ierr = MatAssemblyBegin(*A,MAT_FINAL_ASSEMBLY);CHKERRQ(ierr);
60 ierr = MatAssemblyEnd(*A,MAT_FINAL_ASSEMBLY);CHKERRQ(ierr);
61 if (*A != *B) {
62 ierr = MatAssemblyBegin(*B,MAT_FINAL_ASSEMBLY);CHKERRQ(ierr);
63 ierr = MatAssemblyEnd(*B,MAT_FINAL_ASSEMBLY);CHKERRQ(ierr);
64 }
65 }
58 PetscFunctionReturn(0);
59}
60
61#undef __FUNCT__
62#define __FUNCT__ "TSComputeRHSFunction"
63/*
64 TSComputeRHSFunction - Evaluates the right-hand-side function.
65

--- 1419 unchanged lines hidden ---
66 PetscFunctionReturn(0);
67}
68
69#undef __FUNCT__
70#define __FUNCT__ "TSComputeRHSFunction"
71/*
72 TSComputeRHSFunction - Evaluates the right-hand-side function.
73

--- 1419 unchanged lines hidden ---