| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | /* | ||
| 2 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| 3 | SLEPc - Scalable Library for Eigenvalue Problem Computations | ||
| 4 | Copyright (c) 2002-, Universitat Politecnica de Valencia, Spain | ||
| 5 | |||
| 6 | This file is part of SLEPc. | ||
| 7 | SLEPc is distributed under a 2-clause BSD license (see LICENSE). | ||
| 8 | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | ||
| 9 | */ | ||
| 10 | /* | ||
| 11 | LME routines related to monitors | ||
| 12 | */ | ||
| 13 | |||
| 14 | #include <slepc/private/lmeimpl.h> /*I "slepclme.h" I*/ | ||
| 15 | #include <petscdraw.h> | ||
| 16 | |||
| 17 | /* | ||
| 18 | Runs the user provided monitor routines, if any. | ||
| 19 | */ | ||
| 20 | 789 | PetscErrorCode LMEMonitor(LME lme,PetscInt it,PetscReal errest) | |
| 21 | { | ||
| 22 | 789 | PetscInt i,n = lme->numbermonitors; | |
| 23 | |||
| 24 |
1/2✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
|
789 | PetscFunctionBegin; |
| 25 |
7/8✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 10 times.
✓ Branch 3 taken 8 times.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
✓ Branch 6 taken 2 times.
✓ Branch 7 taken 2 times.
|
861 | for (i=0;i<n;i++) PetscCall((*lme->monitor[i])(lme,it,errest,lme->monitorcontext[i])); |
| 26 |
6/12✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 2 times.
|
126 | PetscFunctionReturn(PETSC_SUCCESS); |
| 27 | } | ||
| 28 | |||
| 29 | /*@C | ||
| 30 | LMEMonitorSet - Sets an ADDITIONAL function to be called at every | ||
| 31 | iteration to monitor convergence. | ||
| 32 | |||
| 33 | Logically Collective | ||
| 34 | |||
| 35 | Input Parameters: | ||
| 36 | + lme - the linear matrix equation solver context | ||
| 37 | . monitor - pointer to function (if this is `NULL`, it turns off monitoring), | ||
| 38 | see `LMEMonitorFn` | ||
| 39 | . mctx - [optional] context for private data for the monitor routine | ||
| 40 | (use `NULL` if no context is desired) | ||
| 41 | - monitordestroy - [optional] routine that frees monitor context (may be `NULL`), | ||
| 42 | see `PetscCtxDestroyFn` for the calling sequence | ||
| 43 | |||
| 44 | Options Database Keys: | ||
| 45 | + -lme_monitor - print the error estimate | ||
| 46 | . -lme_monitor draw::draw_lg - sets line graph monitor for the error estimate | ||
| 47 | - -lme_monitor_cancel - cancels all monitors that have been hardwired into | ||
| 48 | a code by calls to `LMEMonitorSet()`, but does not cancel | ||
| 49 | those set via the options database | ||
| 50 | |||
| 51 | Notes: | ||
| 52 | The options database option `-lme_monitor` and related options are the easiest way | ||
| 53 | to turn on `LME` iteration monitoring. | ||
| 54 | |||
| 55 | `LMEMonitorRegister()` provides a way to associate an options database key with `LME` | ||
| 56 | monitor function. | ||
| 57 | |||
| 58 | Several different monitoring routines may be set by calling `LMEMonitorSet()` multiple | ||
| 59 | times; all will be called in the order in which they were set. | ||
| 60 | |||
| 61 | Fortran Note: | ||
| 62 | Only a single monitor function can be set for each `LME` object. | ||
| 63 | |||
| 64 | Level: intermediate | ||
| 65 | |||
| 66 | .seealso: [](ch:lme), `LMEMonitorDefault()`, `LMEMonitorDefaultDrawLG()`, `LMEMonitorCancel()` | ||
| 67 | @*/ | ||
| 68 | 46 | PetscErrorCode LMEMonitorSet(LME lme,LMEMonitorFn *monitor,void *mctx,PetscCtxDestroyFn *monitordestroy) | |
| 69 | { | ||
| 70 | 46 | PetscInt i; | |
| 71 | 46 | PetscBool identical; | |
| 72 | |||
| 73 |
1/2✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
|
46 | PetscFunctionBegin; |
| 74 |
3/16✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✓ Branch 9 taken 2 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
|
46 | PetscValidHeaderSpecific(lme,LME_CLASSID,1); |
| 75 |
2/2✓ Branch 0 taken 10 times.
✓ Branch 1 taken 10 times.
|
46 | for (i=0;i<lme->numbermonitors;i++) { |
| 76 |
4/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
|
10 | PetscCall(PetscMonitorCompare((PetscErrorCode(*)(void))(PetscVoidFn*)monitor,mctx,monitordestroy,(PetscErrorCode (*)(void))(PetscVoidFn*)lme->monitor[i],lme->monitorcontext[i],lme->monitordestroy[i],&identical)); |
| 77 |
8/14✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✓ Branch 10 taken 2 times.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✓ Branch 13 taken 2 times.
|
10 | if (identical) PetscFunctionReturn(PETSC_SUCCESS); |
| 78 | } | ||
| 79 |
1/4✗ Branch 0 not taken.
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
|
36 | PetscCheck(lme->numbermonitors<MAXLMEMONITORS,PetscObjectComm((PetscObject)lme),PETSC_ERR_ARG_OUTOFRANGE,"Too many LME monitors set"); |
| 80 | 36 | lme->monitor[lme->numbermonitors] = monitor; | |
| 81 | 36 | lme->monitorcontext[lme->numbermonitors] = mctx; | |
| 82 | 36 | lme->monitordestroy[lme->numbermonitors++] = monitordestroy; | |
| 83 |
6/12✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 2 times.
|
36 | PetscFunctionReturn(PETSC_SUCCESS); |
| 84 | } | ||
| 85 | |||
| 86 | /*@ | ||
| 87 | LMEMonitorCancel - Clears all monitors for an `LME` object. | ||
| 88 | |||
| 89 | Logically Collective | ||
| 90 | |||
| 91 | Input Parameter: | ||
| 92 | . lme - the linear matrix equation solver context | ||
| 93 | |||
| 94 | Options Database Key: | ||
| 95 | . -lme_monitor_cancel - cancels all monitors that have been hardwired into a code by calls to | ||
| 96 | `LMEMonitorSet()`, but does not cancel those set via the options database. | ||
| 97 | |||
| 98 | Level: intermediate | ||
| 99 | |||
| 100 | .seealso: [](ch:lme), `LMEMonitorSet()` | ||
| 101 | @*/ | ||
| 102 | 218 | PetscErrorCode LMEMonitorCancel(LME lme) | |
| 103 | { | ||
| 104 | 218 | PetscInt i; | |
| 105 | |||
| 106 |
1/2✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
|
218 | PetscFunctionBegin; |
| 107 |
3/16✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✓ Branch 9 taken 2 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
|
218 | PetscValidHeaderSpecific(lme,LME_CLASSID,1); |
| 108 |
2/2✓ Branch 0 taken 10 times.
✓ Branch 1 taken 10 times.
|
254 | for (i=0; i<lme->numbermonitors; i++) { |
| 109 |
5/8✓ Branch 0 taken 10 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 2 times.
✓ Branch 3 taken 8 times.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✗ Branch 6 not taken.
✓ Branch 7 taken 2 times.
|
36 | if (lme->monitordestroy[i]) PetscCall((*lme->monitordestroy[i])(&lme->monitorcontext[i])); |
| 110 | } | ||
| 111 | 218 | lme->numbermonitors = 0; | |
| 112 |
6/12✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 2 times.
|
218 | PetscFunctionReturn(PETSC_SUCCESS); |
| 113 | } | ||
| 114 | |||
| 115 | /*@C | ||
| 116 | LMEGetMonitorContext - Gets the monitor context, as set by | ||
| 117 | `LMEMonitorSet()` for the FIRST monitor only. | ||
| 118 | |||
| 119 | Not Collective | ||
| 120 | |||
| 121 | Input Parameter: | ||
| 122 | . lme - the linear matrix equation solver context | ||
| 123 | |||
| 124 | Output Parameter: | ||
| 125 | . ctx - monitor context | ||
| 126 | |||
| 127 | Level: intermediate | ||
| 128 | |||
| 129 | .seealso: [](ch:lme), `LMEMonitorSet()` | ||
| 130 | @*/ | ||
| 131 | ✗ | PetscErrorCode LMEGetMonitorContext(LME lme,void *ctx) | |
| 132 | { | ||
| 133 | ✗ | PetscFunctionBegin; | |
| 134 | ✗ | PetscValidHeaderSpecific(lme,LME_CLASSID,1); | |
| 135 | ✗ | *(void**)ctx = lme->monitorcontext[0]; | |
| 136 | ✗ | PetscFunctionReturn(PETSC_SUCCESS); | |
| 137 | } | ||
| 138 | |||
| 139 | /*@C | ||
| 140 | LMEMonitorDefault - Print the error estimate of the current approximation at each | ||
| 141 | iteration of the linear matrix equation solver. | ||
| 142 | |||
| 143 | Collective | ||
| 144 | |||
| 145 | Input Parameters: | ||
| 146 | + lme - the linear matrix equation solver context | ||
| 147 | . its - iteration number | ||
| 148 | . errest - error estimate | ||
| 149 | - vf - viewer and format for monitoring | ||
| 150 | |||
| 151 | Options Database Key: | ||
| 152 | . -lme_monitor - activates `LMEMonitorDefault()` | ||
| 153 | |||
| 154 | Note: | ||
| 155 | This is not called directly by users, rather one calls `LMEMonitorSet()`, with this | ||
| 156 | function as an argument, to cause the monitor to be used during the `LME` solve. | ||
| 157 | |||
| 158 | Level: intermediate | ||
| 159 | |||
| 160 | .seealso: [](ch:lme), `LMEMonitorSet()` | ||
| 161 | @*/ | ||
| 162 | 40 | PetscErrorCode LMEMonitorDefault(LME lme,PetscInt its,PetscReal errest,PetscViewerAndFormat *vf) | |
| 163 | { | ||
| 164 | 40 | PetscViewer viewer = vf->viewer; | |
| 165 | |||
| 166 |
1/2✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
|
40 | PetscFunctionBegin; |
| 167 |
3/16✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✓ Branch 9 taken 2 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
|
40 | PetscValidHeaderSpecific(lme,LME_CLASSID,1); |
| 168 |
3/16✗ Branch 0 not taken.
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✓ Branch 9 taken 2 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
|
40 | PetscValidHeaderSpecific(viewer,PETSC_VIEWER_CLASSID,4); |
| 169 |
4/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
|
40 | PetscCall(PetscViewerPushFormat(viewer,vf->format)); |
| 170 |
4/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
|
40 | PetscCall(PetscViewerASCIIAddTab(viewer,((PetscObject)lme)->tablevel)); |
| 171 |
7/10✓ Branch 0 taken 10 times.
✓ Branch 1 taken 10 times.
✓ Branch 2 taken 10 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2 times.
✓ Branch 5 taken 8 times.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✓ Branch 9 taken 2 times.
|
40 | if (its == 1 && ((PetscObject)lme)->prefix) PetscCall(PetscViewerASCIIPrintf(viewer," Error estimates for %s solve.\n",((PetscObject)lme)->prefix)); |
| 172 |
4/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
|
40 | PetscCall(PetscViewerASCIIPrintf(viewer,"%3" PetscInt_FMT " LME Error estimate %14.12e\n",its,(double)errest)); |
| 173 |
4/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
|
40 | PetscCall(PetscViewerASCIISubtractTab(viewer,((PetscObject)lme)->tablevel)); |
| 174 |
4/6✓ Branch 0 taken 2 times.
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 2 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 2 times.
|
40 | PetscCall(PetscViewerPopFormat(viewer)); |
| 175 |
6/12✓ Branch 0 taken 2 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 2 times.
✓ Branch 4 taken 2 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 2 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 2 times.
|
8 | PetscFunctionReturn(PETSC_SUCCESS); |
| 176 | } | ||
| 177 | |||
| 178 | /*@C | ||
| 179 | LMEMonitorDefaultDrawLG - Plots the error estimate of the current approximation at each | ||
| 180 | iteration of the linear matrix equation solver. | ||
| 181 | |||
| 182 | Collective | ||
| 183 | |||
| 184 | Input Parameters: | ||
| 185 | + lme - the linear matrix equation solver context | ||
| 186 | . its - iteration number | ||
| 187 | . errest - error estimate | ||
| 188 | - vf - viewer and format for monitoring | ||
| 189 | |||
| 190 | Options Database Key: | ||
| 191 | . -lme_monitor draw::draw_lg - activates `LMEMonitorDefaultDrawLG()` | ||
| 192 | |||
| 193 | Notes: | ||
| 194 | This is not called directly by users, rather one calls `LMEMonitorSet()`, with this | ||
| 195 | function as an argument, to cause the monitor to be used during the `LME` solve. | ||
| 196 | |||
| 197 | Call `LMEMonitorDefaultDrawLGCreate()` to create the context used with this monitor. | ||
| 198 | |||
| 199 | Level: intermediate | ||
| 200 | |||
| 201 | .seealso: [](ch:lme), `LMEMonitorSet()`, `LMEMonitorDefaultDrawLGCreate()` | ||
| 202 | @*/ | ||
| 203 | 32 | PetscErrorCode LMEMonitorDefaultDrawLG(LME lme,PetscInt its,PetscReal errest,PetscViewerAndFormat *vf) | |
| 204 | { | ||
| 205 | 32 | PetscViewer viewer = vf->viewer; | |
| 206 | 32 | PetscDrawLG lg; | |
| 207 | 32 | PetscReal x,y; | |
| 208 | |||
| 209 |
1/2✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
|
32 | PetscFunctionBegin; |
| 210 |
3/16✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
|
32 | PetscValidHeaderSpecific(lme,LME_CLASSID,1); |
| 211 |
3/16✗ Branch 0 not taken.
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
✗ Branch 11 not taken.
✗ Branch 12 not taken.
✗ Branch 13 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
|
32 | PetscValidHeaderSpecific(viewer,PETSC_VIEWER_CLASSID,4); |
| 212 |
4/6✓ Branch 0 taken 1 times.
✓ Branch 1 taken 7 times.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
|
32 | PetscCall(PetscViewerPushFormat(viewer,vf->format)); |
| 213 |
4/6✓ Branch 0 taken 1 times.
✓ Branch 1 taken 7 times.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
|
32 | PetscCall(PetscViewerDrawGetDrawLG(viewer,0,&lg)); |
| 214 |
2/2✓ Branch 0 taken 8 times.
✓ Branch 1 taken 8 times.
|
32 | if (its==1) { |
| 215 |
4/6✓ Branch 0 taken 1 times.
✓ Branch 1 taken 7 times.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
|
8 | PetscCall(PetscDrawLGReset(lg)); |
| 216 |
4/6✓ Branch 0 taken 1 times.
✓ Branch 1 taken 7 times.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
|
8 | PetscCall(PetscDrawLGSetDimension(lg,1)); |
| 217 |
4/6✓ Branch 0 taken 1 times.
✓ Branch 1 taken 7 times.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
|
8 | PetscCall(PetscDrawLGSetLimits(lg,1,1.0,PetscLog10Real(lme->tol)-2,0.0)); |
| 218 | } | ||
| 219 | 32 | x = (PetscReal)its; | |
| 220 |
1/2✓ Branch 0 taken 8 times.
✗ Branch 1 not taken.
|
32 | if (errest > 0.0) y = PetscLog10Real(errest); |
| 221 | ✗ | else y = 0.0; | |
| 222 |
4/6✓ Branch 0 taken 1 times.
✓ Branch 1 taken 7 times.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
|
32 | PetscCall(PetscDrawLGAddPoint(lg,&x,&y)); |
| 223 |
1/6✗ Branch 0 not taken.
✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
|
32 | if (its <= 20 || !(its % 5) || lme->reason) { |
| 224 |
4/6✓ Branch 0 taken 1 times.
✓ Branch 1 taken 7 times.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
|
32 | PetscCall(PetscDrawLGDraw(lg)); |
| 225 |
4/6✓ Branch 0 taken 1 times.
✓ Branch 1 taken 7 times.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
|
32 | PetscCall(PetscDrawLGSave(lg)); |
| 226 | } | ||
| 227 |
4/6✓ Branch 0 taken 1 times.
✓ Branch 1 taken 7 times.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
|
32 | PetscCall(PetscViewerPopFormat(viewer)); |
| 228 |
6/12✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 1 times.
|
4 | PetscFunctionReturn(PETSC_SUCCESS); |
| 229 | } | ||
| 230 | |||
| 231 | /*@C | ||
| 232 | LMEMonitorDefaultDrawLGCreate - Creates the plotter for the error estimate. | ||
| 233 | |||
| 234 | Collective | ||
| 235 | |||
| 236 | Input Parameters: | ||
| 237 | + viewer - the viewer | ||
| 238 | . format - the viewer format | ||
| 239 | - ctx - an optional user context | ||
| 240 | |||
| 241 | Output Parameter: | ||
| 242 | . vf - the viewer and format context | ||
| 243 | |||
| 244 | Level: intermediate | ||
| 245 | |||
| 246 | .seealso: [](ch:lme), `LMEMonitorSet()` | ||
| 247 | @*/ | ||
| 248 | 8 | PetscErrorCode LMEMonitorDefaultDrawLGCreate(PetscViewer viewer,PetscViewerFormat format,void *ctx,PetscViewerAndFormat **vf) | |
| 249 | { | ||
| 250 |
1/2✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
|
8 | PetscFunctionBegin; |
| 251 |
4/6✓ Branch 0 taken 1 times.
✓ Branch 1 taken 7 times.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
|
8 | PetscCall(PetscViewerAndFormatCreate(viewer,format,vf)); |
| 252 | 8 | (*vf)->data = ctx; | |
| 253 |
4/6✓ Branch 0 taken 1 times.
✓ Branch 1 taken 7 times.
✓ Branch 2 taken 1 times.
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✓ Branch 5 taken 1 times.
|
8 | PetscCall(PetscViewerMonitorLGSetUp(viewer,NULL,"Error Estimate","Log Error Estimate",1,NULL,PETSC_DECIDE,PETSC_DECIDE,400,300)); |
| 254 |
6/12✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✗ Branch 2 not taken.
✓ Branch 3 taken 1 times.
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 6 taken 1 times.
✗ Branch 7 not taken.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
✓ Branch 11 taken 1 times.
|
1 | PetscFunctionReturn(PETSC_SUCCESS); |
| 255 | } | ||
| 256 |