1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98
|
<center><a href="tsimpl.h">Actual source code: tsimpl.h</a></center><br>
<html>
<head>
<title></title>
<meta name="generator" content="c2html 0.9.5">
<meta name="date" content="2010-04-08T19:46:25+00:00">
</head>
<body bgcolor="#FFFFFF">
<pre width="80">
<a name="line2"> 2: </a><font color="#A020F0">#ifndef __TSIMPL_H</font>
<a name="line5"> 5: </a> #include <A href="../../include/petscts.h.html">petscts.h</A>
<a name="line7"> 7: </a><font color="#B22222">/*</font>
<a name="line8"> 8: </a><font color="#B22222"> Timesteping context.</font>
<a name="line9"> 9: </a><font color="#B22222"> General DAE: F(t,U,U_t) = 0, required Jacobian is G'(U) where G(U) = F(t,U,U0+a*U)</font>
<a name="line10"> 10: </a><font color="#B22222"> General ODE: U_t = F(t,U) <-- the right-hand-side function</font>
<a name="line11"> 11: </a><font color="#B22222"> Linear ODE: U_t = A(t) U <-- the right-hand-side matrix</font>
<a name="line12"> 12: </a><font color="#B22222"> Linear (no time) ODE: U_t = A U <-- the right-hand-side matrix</font>
<a name="line13"> 13: </a><font color="#B22222">*/</font>
<a name="line15"> 15: </a><font color="#B22222">/*</font>
<a name="line16"> 16: </a><font color="#B22222"> Maximum number of monitors you can run with a single <A href="../docs/manualpages/TS/TS.html#TS">TS</A></font>
<a name="line17"> 17: </a><font color="#B22222">*/</font>
<a name="line18"> 18: </a><strong><font color="#228B22">#define MAXTSMONITORS 5 </font></strong>
<a name="line20"> 20: </a><font color="#4169E1"><a name="_TSOps"></a>struct _TSOps </font>{
<a name="line21"> 21: </a> <A href="../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*rhsmatrix)(<A href="../docs/manualpages/TS/TS.html#TS">TS</A>,<A href="../docs/manualpages/Sys/PetscReal.html#PetscReal">PetscReal</A>,<A href="../docs/manualpages/Mat/Mat.html#Mat">Mat</A>*,<A href="../docs/manualpages/Mat/Mat.html#Mat">Mat</A>*,<A href="../docs/manualpages/Mat/MatStructure.html#MatStructure">MatStructure</A>*,void*);
<a name="line22"> 22: </a> <A href="../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*lhsmatrix)(<A href="../docs/manualpages/TS/TS.html#TS">TS</A>,<A href="../docs/manualpages/Sys/PetscReal.html#PetscReal">PetscReal</A>,<A href="../docs/manualpages/Mat/Mat.html#Mat">Mat</A>*,<A href="../docs/manualpages/Mat/Mat.html#Mat">Mat</A>*,<A href="../docs/manualpages/Mat/MatStructure.html#MatStructure">MatStructure</A>*,void*);
<a name="line23"> 23: </a> <A href="../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*rhsfunction)(<A href="../docs/manualpages/TS/TS.html#TS">TS</A>,<A href="../docs/manualpages/Sys/PetscReal.html#PetscReal">PetscReal</A>,<A href="../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,<A href="../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,void*);
<a name="line24"> 24: </a> <A href="../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*rhsjacobian)(<A href="../docs/manualpages/TS/TS.html#TS">TS</A>,<A href="../docs/manualpages/Sys/PetscReal.html#PetscReal">PetscReal</A>,<A href="../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,<A href="../docs/manualpages/Mat/Mat.html#Mat">Mat</A>*,<A href="../docs/manualpages/Mat/Mat.html#Mat">Mat</A>*,<A href="../docs/manualpages/Mat/MatStructure.html#MatStructure">MatStructure</A>*,void*);
<a name="line25"> 25: </a> <A href="../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*ifunction)(<A href="../docs/manualpages/TS/TS.html#TS">TS</A>,<A href="../docs/manualpages/Sys/PetscReal.html#PetscReal">PetscReal</A>,<A href="../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,<A href="../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,<A href="../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,void*);
<a name="line26"> 26: </a> <A href="../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*ijacobian)(<A href="../docs/manualpages/TS/TS.html#TS">TS</A>,<A href="../docs/manualpages/Sys/PetscReal.html#PetscReal">PetscReal</A>,<A href="../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,<A href="../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,<A href="../docs/manualpages/Sys/PetscReal.html#PetscReal">PetscReal</A>,<A href="../docs/manualpages/Mat/Mat.html#Mat">Mat</A>*,<A href="../docs/manualpages/Mat/Mat.html#Mat">Mat</A>*,<A href="../docs/manualpages/Mat/MatStructure.html#MatStructure">MatStructure</A>*,void*);
<a name="line27"> 27: </a> <A href="../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*prestep)(<A href="../docs/manualpages/TS/TS.html#TS">TS</A>);
<a name="line28"> 28: </a> <A href="../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*poststep)(<A href="../docs/manualpages/TS/TS.html#TS">TS</A>);
<a name="line29"> 29: </a> <A href="../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*setup)(<A href="../docs/manualpages/TS/TS.html#TS">TS</A>);
<a name="line30"> 30: </a> <A href="../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*step)(<A href="../docs/manualpages/TS/TS.html#TS">TS</A>,<A href="../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>*,<A href="../docs/manualpages/Sys/PetscReal.html#PetscReal">PetscReal</A>*);
<a name="line31"> 31: </a> <A href="../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*setfromoptions)(<A href="../docs/manualpages/TS/TS.html#TS">TS</A>);
<a name="line32"> 32: </a> <A href="../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*destroy)(<A href="../docs/manualpages/TS/TS.html#TS">TS</A>);
<a name="line33"> 33: </a> <A href="../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*view)(<A href="../docs/manualpages/TS/TS.html#TS">TS</A>,<A href="../docs/manualpages/Viewer/PetscViewer.html#PetscViewer">PetscViewer</A>);
<a name="line34"> 34: </a>};
<a name="line36"> 36: </a><font color="#4169E1"><a name="_p_TS"></a>struct _p_TS </font>{
<a name="line37"> 37: </a> PETSCHEADER(<font color="#4169E1">struct _TSOps</font>);
<a name="line38"> 38: </a> <A href="../docs/manualpages/TS/TSProblemType.html#TSProblemType">TSProblemType</A> problem_type;
<a name="line39"> 39: </a> <A href="../docs/manualpages/Vec/Vec.html#Vec">Vec</A> vec_sol,vec_sol_always;
<a name="line41"> 41: </a> <font color="#B22222">/* ---------------- User (or PETSc) Provided stuff ---------------------*/</font>
<a name="line42"> 42: </a> <A href="../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*monitor[MAXTSMONITORS])(<A href="../docs/manualpages/TS/TS.html#TS">TS</A>,<A href="../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>,<A href="../docs/manualpages/Sys/PetscReal.html#PetscReal">PetscReal</A>,<A href="../docs/manualpages/Vec/Vec.html#Vec">Vec</A>,void*); <font color="#B22222">/* returns control to user after */</font>
<a name="line43"> 43: </a> <A href="../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> (*mdestroy[MAXTSMONITORS])(void*);
<a name="line44"> 44: </a> void *monitorcontext[MAXTSMONITORS]; <font color="#B22222">/* residual calculation, allows user */</font>
<a name="line45"> 45: </a> <A href="../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A> numbermonitors; <font color="#B22222">/* to, for instance, print residual norm, etc. */</font>
<a name="line47"> 47: </a> <font color="#B22222">/* ---------------------Linear Iteration---------------------------------*/</font>
<a name="line48"> 48: </a> <A href="../docs/manualpages/KSP/KSP.html#KSP">KSP</A> ksp;
<a name="line49"> 49: </a> <A href="../docs/manualpages/Mat/Mat.html#Mat">Mat</A> A,B; <font color="#B22222">/* internel matrix and preconditioner used for <A href="../docs/manualpages/KSP/KSPSolve.html#KSPSolve">KSPSolve</A>() */</font>
<a name="line50"> 50: </a> <A href="../docs/manualpages/Mat/Mat.html#Mat">Mat</A> Arhs,Alhs; <font color="#B22222">/* user provided right/left hand side matrix and preconditioner */</font>
<a name="line51"> 51: </a> <A href="../docs/manualpages/Mat/MatStructure.html#MatStructure">MatStructure</A> matflg; <font color="#B22222">/* flag indicating the matrix structure of Arhs and Alhs */</font>
<a name="line53"> 53: </a> <font color="#B22222">/* ---------------------Nonlinear Iteration------------------------------*/</font>
<a name="line54"> 54: </a> <A href="../docs/manualpages/SNES/SNES.html#SNES">SNES</A> snes;
<a name="line55"> 55: </a> void *funP;
<a name="line56"> 56: </a> void *jacP,*jacPlhs;
<a name="line57"> 57: </a> void *bcP;
<a name="line60"> 60: </a> <font color="#B22222">/* --- Data that is unique to each particular solver --- */</font>
<a name="line61"> 61: </a> <A href="../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A> setupcalled; <font color="#B22222">/* true if setup has been called */</font>
<a name="line62"> 62: </a> void *data; <font color="#B22222">/* implementationspecific data */</font>
<a name="line63"> 63: </a> void *user; <font color="#B22222">/* user context */</font>
<a name="line65"> 65: </a> <font color="#B22222">/* ------------------ Parameters -------------------------------------- */</font>
<a name="line66"> 66: </a> <A href="../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A> max_steps; <font color="#B22222">/* max number of steps */</font>
<a name="line67"> 67: </a> <A href="../docs/manualpages/Sys/PetscReal.html#PetscReal">PetscReal</A> max_time; <font color="#B22222">/* max time allowed */</font>
<a name="line68"> 68: </a> <A href="../docs/manualpages/Sys/PetscReal.html#PetscReal">PetscReal</A> time_step; <font color="#B22222">/* current time increment */</font>
<a name="line69"> 69: </a> <A href="../docs/manualpages/Sys/PetscReal.html#PetscReal">PetscReal</A> time_step_old; <font color="#B22222">/* previous time increment */</font>
<a name="line70"> 70: </a> <A href="../docs/manualpages/Sys/PetscReal.html#PetscReal">PetscReal</A> initial_time_step; <font color="#B22222">/* initial time increment */</font>
<a name="line71"> 71: </a> <A href="../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A> steps; <font color="#B22222">/* steps taken so far */</font>
<a name="line72"> 72: </a> <A href="../docs/manualpages/Sys/PetscReal.html#PetscReal">PetscReal</A> ptime; <font color="#B22222">/* time taken so far */</font>
<a name="line73"> 73: </a> <A href="../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A> linear_its; <font color="#B22222">/* total number of linear solver iterations */</font>
<a name="line74"> 74: </a> <A href="../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A> nonlinear_its; <font color="#B22222">/* total number of nonlinear solver iterations */</font>
<a name="line76"> 76: </a> <font color="#B22222">/* ------------------- Default work-area management ------------------ */</font>
<a name="line77"> 77: </a> <A href="../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A> nwork;
<a name="line78"> 78: </a> <A href="../docs/manualpages/Vec/Vec.html#Vec">Vec</A> *work;
<a name="line79"> 79: </a>};
<a name="line81"> 81: </a><strong><font color="#4169E1">EXTERN <A href="../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> TSMonitor(<A href="../docs/manualpages/TS/TS.html#TS">TS</A>,<A href="../docs/manualpages/Sys/PetscInt.html#PetscInt">PetscInt</A>,<A href="../docs/manualpages/Sys/PetscReal.html#PetscReal">PetscReal</A>,<A href="../docs/manualpages/Vec/Vec.html#Vec">Vec</A>)</font></strong>;
<a name="line82"> 82: </a><strong><font color="#4169E1">EXTERN <A href="../docs/manualpages/Sys/PetscErrorCode.html#PetscErrorCode">PetscErrorCode</A> TSScaleShiftMatrices(<A href="../docs/manualpages/TS/TS.html#TS">TS</A>,<A href="../docs/manualpages/Mat/Mat.html#Mat">Mat</A>,<A href="../docs/manualpages/Mat/Mat.html#Mat">Mat</A>,<A href="../docs/manualpages/Mat/MatStructure.html#MatStructure">MatStructure</A>)</font></strong>;
<a name="line86"> 86: </a><font color="#A020F0">#endif</font>
</pre>
</body>
</html>
|