forked from petsc/petsc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpetscts.h
1415 lines (1156 loc) · 69 KB
/
petscts.h
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
User interface for the timestepping package. This package
is for use in solving time-dependent PDEs.
*/
#pragma once
#include <petscsnes.h>
#include <petscconvest.h>
/*I <petscts.h> I*/
/* SUBMANSEC = TS */
/*S
TS - Abstract PETSc object that manages all time-steppers (ODE integrators)
Level: beginner
.seealso: [](integrator_table), [](ch_ts), `TSCreate()`, `TSSetType()`, `TSType`, `SNES`, `KSP`, `PC`, `TSDestroy()`
S*/
typedef struct _p_TS *TS;
/*J
TSType - String with the name of a PETSc `TS` method.
Level: beginner
.seealso: [](integrator_table), [](ch_ts), `TSSetType()`, `TS`, `TSRegister()`
J*/
typedef const char *TSType;
#define TSEULER "euler"
#define TSBEULER "beuler"
#define TSBASICSYMPLECTIC "basicsymplectic"
#define TSPSEUDO "pseudo"
#define TSCN "cn"
#define TSSUNDIALS "sundials"
#define TSRK "rk"
#define TSPYTHON "python"
#define TSTHETA "theta"
#define TSALPHA "alpha"
#define TSALPHA2 "alpha2"
#define TSGLLE "glle"
#define TSGLEE "glee"
#define TSSSP "ssp"
#define TSARKIMEX "arkimex"
#define TSROSW "rosw"
#define TSEIMEX "eimex"
#define TSMIMEX "mimex"
#define TSBDF "bdf"
#define TSRADAU5 "radau5"
#define TSMPRK "mprk"
#define TSDISCGRAD "discgrad"
#define TSIRK "irk"
#define TSDIRK "dirk"
/*E
TSProblemType - Determines the type of problem this `TS` object is to be used to solve
Values:
+ `TS_LINEAR` - a linear ODE or DAE
- `TS_NONLINEAR` - a nonlinear ODE or DAE
Level: beginner
.seealso: [](ch_ts), `TS`, `TSCreate()`
E*/
typedef enum {
TS_LINEAR,
TS_NONLINEAR
} TSProblemType;
/*E
TSEquationType - type of `TS` problem that is solved
Values:
+ `TS_EQ_UNSPECIFIED` - (default)
. `TS_EQ_EXPLICIT` - {ODE and DAE index 1, 2, 3, HI} F(t,U,U_t) := M(t) U_t - G(U,t) = 0
- `TS_EQ_IMPLICIT` - {ODE and DAE index 1, 2, 3, HI} F(t,U,U_t) = 0
Level: beginner
.seealso: [](ch_ts), `TS`, `TSGetEquationType()`, `TSSetEquationType()`
E*/
typedef enum {
TS_EQ_UNSPECIFIED = -1,
TS_EQ_EXPLICIT = 0,
TS_EQ_ODE_EXPLICIT = 1,
TS_EQ_DAE_SEMI_EXPLICIT_INDEX1 = 100,
TS_EQ_DAE_SEMI_EXPLICIT_INDEX2 = 200,
TS_EQ_DAE_SEMI_EXPLICIT_INDEX3 = 300,
TS_EQ_DAE_SEMI_EXPLICIT_INDEXHI = 500,
TS_EQ_IMPLICIT = 1000,
TS_EQ_ODE_IMPLICIT = 1001,
TS_EQ_DAE_IMPLICIT_INDEX1 = 1100,
TS_EQ_DAE_IMPLICIT_INDEX2 = 1200,
TS_EQ_DAE_IMPLICIT_INDEX3 = 1300,
TS_EQ_DAE_IMPLICIT_INDEXHI = 1500
} TSEquationType;
PETSC_EXTERN const char *const *TSEquationTypes;
/*E
TSConvergedReason - reason a `TS` method has converged (integrated to the requested time) or not
Values:
+ `TS_CONVERGED_ITERATING` - this only occurs if `TSGetConvergedReason()` is called during the `TSSolve()`
. `TS_CONVERGED_TIME` - the final time was reached
. `TS_CONVERGED_ITS` - the maximum number of iterations (time-steps) was reached prior to the final time
. `TS_CONVERGED_USER` - user requested termination
. `TS_CONVERGED_EVENT` - user requested termination on event detection
. `TS_CONVERGED_PSEUDO_FATOL` - stops when function norm decreased by a set amount, used only for `TSPSEUDO`
. `TS_CONVERGED_PSEUDO_FRTOL` - stops when function norm decreases below a set amount, used only for `TSPSEUDO`
. `TS_DIVERGED_NONLINEAR_SOLVE` - too many nonlinear solve failures have occurred
. `TS_DIVERGED_STEP_REJECTED` - too many steps were rejected
. `TSFORWARD_DIVERGED_LINEAR_SOLVE` - tangent linear solve failed
- `TSADJOINT_DIVERGED_LINEAR_SOLVE` - transposed linear solve failed
Level: beginner
.seealso: [](ch_ts), `TS`, `TSGetConvergedReason()`
E*/
typedef enum {
TS_CONVERGED_ITERATING = 0,
TS_CONVERGED_TIME = 1,
TS_CONVERGED_ITS = 2,
TS_CONVERGED_USER = 3,
TS_CONVERGED_EVENT = 4,
TS_CONVERGED_PSEUDO_FATOL = 5,
TS_CONVERGED_PSEUDO_FRTOL = 6,
TS_DIVERGED_NONLINEAR_SOLVE = -1,
TS_DIVERGED_STEP_REJECTED = -2,
TSFORWARD_DIVERGED_LINEAR_SOLVE = -3,
TSADJOINT_DIVERGED_LINEAR_SOLVE = -4
} TSConvergedReason;
PETSC_EXTERN const char *const *TSConvergedReasons;
/*MC
TS_CONVERGED_ITERATING - this only occurs if `TSGetConvergedReason()` is called during the `TSSolve()`
Level: beginner
.seealso: [](ch_ts), `TS`, `TSSolve()`, `TSGetConvergedReason()`, `TSGetAdapt()`
M*/
/*MC
TS_CONVERGED_TIME - the final time was reached
Level: beginner
.seealso: [](ch_ts), `TS`, `TSSolve()`, `TSGetConvergedReason()`, `TSGetAdapt()`, `TSSetMaxTime()`, `TSGetMaxTime()`, `TSGetSolveTime()`
M*/
/*MC
TS_CONVERGED_ITS - the maximum number of iterations (time-steps) was reached prior to the final time
Level: beginner
.seealso: [](ch_ts), `TS`, `TSSolve()`, `TSGetConvergedReason()`, `TSGetAdapt()`, `TSSetMaxSteps()`, `TSGetMaxSteps()`
M*/
/*MC
TS_CONVERGED_USER - user requested termination
Level: beginner
.seealso: [](ch_ts), `TS`, `TSSolve()`, `TSGetConvergedReason()`, `TSSetConvergedReason()`
M*/
/*MC
TS_CONVERGED_EVENT - user requested termination on event detection
Level: beginner
.seealso: [](ch_ts), `TS`, `TSSolve()`, `TSGetConvergedReason()`, `TSSetConvergedReason()`
M*/
/*MC
TS_CONVERGED_PSEUDO_FRTOL - stops when function norm decreased by a set amount, used only for `TSPSEUDO`
Options Database Key:
. -ts_pseudo_frtol <rtol> - use specified rtol
Level: beginner
.seealso: [](ch_ts), `TS`, `TSSolve()`, `TSGetConvergedReason()`, `TSSetConvergedReason()`, `TS_CONVERGED_PSEUDO_FATOL`
M*/
/*MC
TS_CONVERGED_PSEUDO_FATOL - stops when function norm decreases below a set amount, used only for `TSPSEUDO`
Options Database Key:
. -ts_pseudo_fatol <atol> - use specified atol
Level: beginner
.seealso: [](ch_ts), `TS`, `TSSolve()`, `TSGetConvergedReason()`, `TSSetConvergedReason()`, `TS_CONVERGED_PSEUDO_FRTOL`
M*/
/*MC
TS_DIVERGED_NONLINEAR_SOLVE - too many nonlinear solves failed
Level: beginner
Note:
See `TSSetMaxSNESFailures()` for how to allow more nonlinear solver failures.
.seealso: [](ch_ts), `TS`, `TSSolve()`, `TSGetConvergedReason()`, `TSGetAdapt()`, `TSGetSNES()`, `SNESGetConvergedReason()`, `TSSetMaxSNESFailures()`
M*/
/*MC
TS_DIVERGED_STEP_REJECTED - too many steps were rejected
Level: beginner
Notes:
See `TSSetMaxStepRejections()` for how to allow more step rejections.
.seealso: [](ch_ts), `TS`, `TSSolve()`, `TSGetConvergedReason()`, `TSGetAdapt()`, `TSSetMaxStepRejections()`
M*/
/*E
TSExactFinalTimeOption - option for handling of final time step
Values:
+ `TS_EXACTFINALTIME_STEPOVER` - Don't do anything if requested final time is exceeded
. `TS_EXACTFINALTIME_INTERPOLATE` - Interpolate back to final time
- `TS_EXACTFINALTIME_MATCHSTEP` - Adapt final time step to match the final time requested
Level: beginner
.seealso: [](ch_ts), `TS`, `TSGetConvergedReason()`, `TSSetExactFinalTime()`, `TSGetExactFinalTime()`
E*/
typedef enum {
TS_EXACTFINALTIME_UNSPECIFIED = 0,
TS_EXACTFINALTIME_STEPOVER = 1,
TS_EXACTFINALTIME_INTERPOLATE = 2,
TS_EXACTFINALTIME_MATCHSTEP = 3
} TSExactFinalTimeOption;
PETSC_EXTERN const char *const TSExactFinalTimeOptions[];
/* Logging support */
PETSC_EXTERN PetscClassId TS_CLASSID;
PETSC_EXTERN PetscClassId DMTS_CLASSID;
PETSC_EXTERN PetscClassId TSADAPT_CLASSID;
PETSC_EXTERN PetscErrorCode TSInitializePackage(void);
PETSC_EXTERN PetscErrorCode TSFinalizePackage(void);
PETSC_EXTERN PetscErrorCode TSCreate(MPI_Comm, TS *);
PETSC_EXTERN PetscErrorCode TSClone(TS, TS *);
PETSC_EXTERN PetscErrorCode TSDestroy(TS *);
PETSC_EXTERN PetscErrorCode TSSetProblemType(TS, TSProblemType);
PETSC_EXTERN PetscErrorCode TSGetProblemType(TS, TSProblemType *);
PETSC_EXTERN PetscErrorCode TSMonitor(TS, PetscInt, PetscReal, Vec);
PETSC_EXTERN PetscErrorCode TSMonitorSet(TS, PetscErrorCode (*)(TS, PetscInt, PetscReal, Vec, void *), void *, PetscErrorCode (*)(void **));
PETSC_EXTERN PetscErrorCode TSMonitorSetFromOptions(TS, const char[], const char[], const char[], PetscErrorCode (*)(TS, PetscInt, PetscReal, Vec, PetscViewerAndFormat *), PetscErrorCode (*)(TS, PetscViewerAndFormat *));
PETSC_EXTERN PetscErrorCode TSMonitorCancel(TS);
PETSC_EXTERN PetscErrorCode TSSetOptionsPrefix(TS, const char[]);
PETSC_EXTERN PetscErrorCode TSAppendOptionsPrefix(TS, const char[]);
PETSC_EXTERN PetscErrorCode TSGetOptionsPrefix(TS, const char *[]);
PETSC_EXTERN PetscErrorCode TSSetFromOptions(TS);
PETSC_EXTERN PetscErrorCode TSSetUp(TS);
PETSC_EXTERN PetscErrorCode TSReset(TS);
PETSC_EXTERN PetscErrorCode TSSetSolution(TS, Vec);
PETSC_EXTERN PetscErrorCode TSGetSolution(TS, Vec *);
PETSC_EXTERN PetscErrorCode TS2SetSolution(TS, Vec, Vec);
PETSC_EXTERN PetscErrorCode TS2GetSolution(TS, Vec *, Vec *);
PETSC_EXTERN PetscErrorCode TSGetSolutionComponents(TS, PetscInt *, Vec *);
PETSC_EXTERN PetscErrorCode TSGetAuxSolution(TS, Vec *);
PETSC_EXTERN PetscErrorCode TSGetTimeError(TS, PetscInt, Vec *);
PETSC_EXTERN PetscErrorCode TSSetTimeError(TS, Vec);
PETSC_EXTERN PetscErrorCode TSSetRHSJacobianP(TS, Mat, PetscErrorCode (*)(TS, PetscReal, Vec, Mat, void *), void *);
PETSC_EXTERN PetscErrorCode TSGetRHSJacobianP(TS, Mat *, PetscErrorCode (**)(TS, PetscReal, Vec, Mat, void *), void **);
PETSC_EXTERN PetscErrorCode TSComputeRHSJacobianP(TS, PetscReal, Vec, Mat);
PETSC_EXTERN PetscErrorCode TSSetIJacobianP(TS, Mat, PetscErrorCode (*)(TS, PetscReal, Vec, Vec, PetscReal, Mat, void *), void *);
PETSC_EXTERN PetscErrorCode TSComputeIJacobianP(TS, PetscReal, Vec, Vec, PetscReal, Mat, PetscBool);
PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 5, 0, "TSGetQuadratureTS() then TSComputeRHSJacobianP()", ) PetscErrorCode TSComputeDRDPFunction(TS, PetscReal, Vec, Vec *);
PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 5, 0, "TSGetQuadratureTS() then TSComputeRHSJacobian()", ) PetscErrorCode TSComputeDRDUFunction(TS, PetscReal, Vec, Vec *);
PETSC_EXTERN PetscErrorCode TSSetIHessianProduct(TS, Vec *, PetscErrorCode (*)(TS, PetscReal, Vec, Vec *, Vec, Vec *, void *), Vec *, PetscErrorCode (*)(TS, PetscReal, Vec, Vec *, Vec, Vec *, void *), Vec *, PetscErrorCode (*)(TS, PetscReal, Vec, Vec *, Vec, Vec *, void *), Vec *, PetscErrorCode (*)(TS, PetscReal, Vec, Vec *, Vec, Vec *, void *), void *);
PETSC_EXTERN PetscErrorCode TSComputeIHessianProductFunctionUU(TS, PetscReal, Vec, Vec *, Vec, Vec *);
PETSC_EXTERN PetscErrorCode TSComputeIHessianProductFunctionUP(TS, PetscReal, Vec, Vec *, Vec, Vec *);
PETSC_EXTERN PetscErrorCode TSComputeIHessianProductFunctionPU(TS, PetscReal, Vec, Vec *, Vec, Vec *);
PETSC_EXTERN PetscErrorCode TSComputeIHessianProductFunctionPP(TS, PetscReal, Vec, Vec *, Vec, Vec *);
PETSC_EXTERN PetscErrorCode TSSetRHSHessianProduct(TS, Vec *, PetscErrorCode (*)(TS, PetscReal, Vec, Vec *, Vec, Vec *, void *), Vec *, PetscErrorCode (*)(TS, PetscReal, Vec, Vec *, Vec, Vec *, void *), Vec *, PetscErrorCode (*)(TS, PetscReal, Vec, Vec *, Vec, Vec *, void *), Vec *, PetscErrorCode (*)(TS, PetscReal, Vec, Vec *, Vec, Vec *, void *), void *);
PETSC_EXTERN PetscErrorCode TSComputeRHSHessianProductFunctionUU(TS, PetscReal, Vec, Vec *, Vec, Vec *);
PETSC_EXTERN PetscErrorCode TSComputeRHSHessianProductFunctionUP(TS, PetscReal, Vec, Vec *, Vec, Vec *);
PETSC_EXTERN PetscErrorCode TSComputeRHSHessianProductFunctionPU(TS, PetscReal, Vec, Vec *, Vec, Vec *);
PETSC_EXTERN PetscErrorCode TSComputeRHSHessianProductFunctionPP(TS, PetscReal, Vec, Vec *, Vec, Vec *);
PETSC_EXTERN PetscErrorCode TSSetCostHessianProducts(TS, PetscInt, Vec *, Vec *, Vec);
PETSC_EXTERN PetscErrorCode TSGetCostHessianProducts(TS, PetscInt *, Vec **, Vec **, Vec *);
PETSC_EXTERN PetscErrorCode TSComputeSNESJacobian(TS, Vec, Mat, Mat);
/*S
TSTrajectory - Abstract PETSc object that stores the trajectory (solution of ODE/DAE at each time step)
Level: advanced
.seealso: [](ch_ts), `TS`, `TSSetSaveTrajectory()`, `TSTrajectoryCreate()`, `TSTrajectorySetType()`, `TSTrajectoryDestroy()`, `TSTrajectoryReset()`
S*/
typedef struct _p_TSTrajectory *TSTrajectory;
/*J
TSTrajectoryType - String with the name of a PETSc `TS` trajectory storage method
Level: intermediate
.seealso: [](ch_ts), `TS`, `TSSetSaveTrajectory()`, `TSTrajectoryCreate()`, `TSTrajectoryDestroy()`
J*/
typedef const char *TSTrajectoryType;
#define TSTRAJECTORYBASIC "basic"
#define TSTRAJECTORYSINGLEFILE "singlefile"
#define TSTRAJECTORYMEMORY "memory"
#define TSTRAJECTORYVISUALIZATION "visualization"
PETSC_EXTERN PetscFunctionList TSTrajectoryList;
PETSC_EXTERN PetscClassId TSTRAJECTORY_CLASSID;
PETSC_EXTERN PetscBool TSTrajectoryRegisterAllCalled;
PETSC_EXTERN PetscErrorCode TSSetSaveTrajectory(TS);
PETSC_EXTERN PetscErrorCode TSResetTrajectory(TS);
PETSC_EXTERN PetscErrorCode TSRemoveTrajectory(TS);
PETSC_EXTERN PetscErrorCode TSTrajectoryCreate(MPI_Comm, TSTrajectory *);
PETSC_EXTERN PetscErrorCode TSTrajectoryReset(TSTrajectory);
PETSC_EXTERN PetscErrorCode TSTrajectoryDestroy(TSTrajectory *);
PETSC_EXTERN PetscErrorCode TSTrajectoryView(TSTrajectory, PetscViewer);
PETSC_EXTERN PetscErrorCode TSTrajectorySetType(TSTrajectory, TS, TSTrajectoryType);
PETSC_EXTERN PetscErrorCode TSTrajectoryGetType(TSTrajectory, TS, TSTrajectoryType *);
PETSC_EXTERN PetscErrorCode TSTrajectorySet(TSTrajectory, TS, PetscInt, PetscReal, Vec);
PETSC_EXTERN PetscErrorCode TSTrajectoryGet(TSTrajectory, TS, PetscInt, PetscReal *);
PETSC_EXTERN PetscErrorCode TSTrajectoryGetVecs(TSTrajectory, TS, PetscInt, PetscReal *, Vec, Vec);
PETSC_EXTERN PetscErrorCode TSTrajectoryGetUpdatedHistoryVecs(TSTrajectory, TS, PetscReal, Vec *, Vec *);
PETSC_EXTERN PetscErrorCode TSTrajectoryGetNumSteps(TSTrajectory, PetscInt *);
PETSC_EXTERN PetscErrorCode TSTrajectoryRestoreUpdatedHistoryVecs(TSTrajectory, Vec *, Vec *);
PETSC_EXTERN PetscErrorCode TSTrajectorySetFromOptions(TSTrajectory, TS);
PETSC_EXTERN PetscErrorCode TSTrajectoryRegister(const char[], PetscErrorCode (*)(TSTrajectory, TS));
PETSC_EXTERN PetscErrorCode TSTrajectoryRegisterAll(void);
PETSC_EXTERN PetscErrorCode TSTrajectorySetUp(TSTrajectory, TS);
PETSC_EXTERN PetscErrorCode TSTrajectorySetUseHistory(TSTrajectory, PetscBool);
PETSC_EXTERN PetscErrorCode TSTrajectorySetMonitor(TSTrajectory, PetscBool);
PETSC_EXTERN PetscErrorCode TSTrajectorySetVariableNames(TSTrajectory, const char *const *);
PETSC_EXTERN PetscErrorCode TSTrajectorySetTransform(TSTrajectory, PetscErrorCode (*)(void *, Vec, Vec *), PetscErrorCode (*)(void *), void *);
PETSC_EXTERN PetscErrorCode TSTrajectorySetSolutionOnly(TSTrajectory, PetscBool);
PETSC_EXTERN PetscErrorCode TSTrajectoryGetSolutionOnly(TSTrajectory, PetscBool *);
PETSC_EXTERN PetscErrorCode TSTrajectorySetKeepFiles(TSTrajectory, PetscBool);
PETSC_EXTERN PetscErrorCode TSTrajectorySetDirname(TSTrajectory, const char[]);
PETSC_EXTERN PetscErrorCode TSTrajectorySetFiletemplate(TSTrajectory, const char[]);
PETSC_EXTERN PetscErrorCode TSGetTrajectory(TS, TSTrajectory *);
typedef enum {
TJ_REVOLVE,
TJ_CAMS,
TJ_PETSC
} TSTrajectoryMemoryType;
PETSC_EXTERN const char *const TSTrajectoryMemoryTypes[];
PETSC_EXTERN PetscErrorCode TSTrajectoryMemorySetType(TSTrajectory, TSTrajectoryMemoryType);
PETSC_EXTERN PetscErrorCode TSTrajectorySetMaxCpsRAM(TSTrajectory, PetscInt);
PETSC_EXTERN PetscErrorCode TSTrajectorySetMaxCpsDisk(TSTrajectory, PetscInt);
PETSC_EXTERN PetscErrorCode TSTrajectorySetMaxUnitsRAM(TSTrajectory, PetscInt);
PETSC_EXTERN PetscErrorCode TSTrajectorySetMaxUnitsDisk(TSTrajectory, PetscInt);
PETSC_EXTERN PetscErrorCode TSSetCostGradients(TS, PetscInt, Vec *, Vec *);
PETSC_EXTERN PetscErrorCode TSGetCostGradients(TS, PetscInt *, Vec **, Vec **);
PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 12, 0, "TSCreateQuadratureTS() and TSForwardSetSensitivities()", ) PetscErrorCode TSSetCostIntegrand(TS, PetscInt, Vec, PetscErrorCode (*)(TS, PetscReal, Vec, Vec, void *), PetscErrorCode (*)(TS, PetscReal, Vec, Vec *, void *), PetscErrorCode (*)(TS, PetscReal, Vec, Vec *, void *), PetscBool, void *);
PETSC_EXTERN PetscErrorCode TSGetCostIntegral(TS, Vec *);
PETSC_EXTERN PetscErrorCode TSComputeCostIntegrand(TS, PetscReal, Vec, Vec);
PETSC_EXTERN PetscErrorCode TSCreateQuadratureTS(TS, PetscBool, TS *);
PETSC_EXTERN PetscErrorCode TSGetQuadratureTS(TS, PetscBool *, TS *);
PETSC_EXTERN PetscErrorCode TSAdjointSetFromOptions(TS, PetscOptionItems *);
PETSC_EXTERN PetscErrorCode TSAdjointMonitor(TS, PetscInt, PetscReal, Vec, PetscInt, Vec *, Vec *);
PETSC_EXTERN PetscErrorCode TSAdjointMonitorSet(TS, PetscErrorCode (*)(TS, PetscInt, PetscReal, Vec, PetscInt, Vec *, Vec *, void *), void *, PetscErrorCode (*)(void **));
PETSC_EXTERN PetscErrorCode TSAdjointMonitorCancel(TS);
PETSC_EXTERN PetscErrorCode TSAdjointMonitorSetFromOptions(TS, const char[], const char[], const char[], PetscErrorCode (*)(TS, PetscInt, PetscReal, Vec, PetscInt, Vec *, Vec *, PetscViewerAndFormat *), PetscErrorCode (*)(TS, PetscViewerAndFormat *));
PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 5, 0, "TSSetRHSJacobianP()", ) PetscErrorCode TSAdjointSetRHSJacobian(TS, Mat, PetscErrorCode (*)(TS, PetscReal, Vec, Mat, void *), void *);
PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 5, 0, "TSComputeRHSJacobianP()", ) PetscErrorCode TSAdjointComputeRHSJacobian(TS, PetscReal, Vec, Mat);
PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 5, 0, "TSGetQuadratureTS()", ) PetscErrorCode TSAdjointComputeDRDPFunction(TS, PetscReal, Vec, Vec *);
PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 5, 0, "TSGetQuadratureTS()", ) PetscErrorCode TSAdjointComputeDRDYFunction(TS, PetscReal, Vec, Vec *);
PETSC_EXTERN PetscErrorCode TSAdjointSolve(TS);
PETSC_EXTERN PetscErrorCode TSAdjointSetSteps(TS, PetscInt);
PETSC_EXTERN PetscErrorCode TSAdjointStep(TS);
PETSC_EXTERN PetscErrorCode TSAdjointSetUp(TS);
PETSC_EXTERN PetscErrorCode TSAdjointReset(TS);
PETSC_EXTERN PetscErrorCode TSAdjointCostIntegral(TS);
PETSC_EXTERN PetscErrorCode TSAdjointSetForward(TS, Mat);
PETSC_EXTERN PetscErrorCode TSAdjointResetForward(TS);
PETSC_EXTERN PetscErrorCode TSForwardSetSensitivities(TS, PetscInt, Mat);
PETSC_EXTERN PetscErrorCode TSForwardGetSensitivities(TS, PetscInt *, Mat *);
PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 12, 0, "TSCreateQuadratureTS()", ) PetscErrorCode TSForwardSetIntegralGradients(TS, PetscInt, Vec *);
PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 12, 0, "TSForwardGetSensitivities()", ) PetscErrorCode TSForwardGetIntegralGradients(TS, PetscInt *, Vec **);
PETSC_EXTERN PetscErrorCode TSForwardSetUp(TS);
PETSC_EXTERN PetscErrorCode TSForwardReset(TS);
PETSC_EXTERN PetscErrorCode TSForwardCostIntegral(TS);
PETSC_EXTERN PetscErrorCode TSForwardStep(TS);
PETSC_EXTERN PetscErrorCode TSForwardSetInitialSensitivities(TS, Mat);
PETSC_EXTERN PetscErrorCode TSForwardGetStages(TS, PetscInt *, Mat *[]);
PETSC_EXTERN PetscErrorCode TSSetMaxSteps(TS, PetscInt);
PETSC_EXTERN PetscErrorCode TSGetMaxSteps(TS, PetscInt *);
PETSC_EXTERN PetscErrorCode TSSetMaxTime(TS, PetscReal);
PETSC_EXTERN PetscErrorCode TSGetMaxTime(TS, PetscReal *);
PETSC_EXTERN PetscErrorCode TSSetExactFinalTime(TS, TSExactFinalTimeOption);
PETSC_EXTERN PetscErrorCode TSGetExactFinalTime(TS, TSExactFinalTimeOption *);
PETSC_EXTERN PetscErrorCode TSSetTimeSpan(TS, PetscInt, PetscReal *);
PETSC_EXTERN PetscErrorCode TSGetTimeSpan(TS, PetscInt *, const PetscReal **);
PETSC_EXTERN PetscErrorCode TSGetTimeSpanSolutions(TS, PetscInt *, Vec **);
PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 8, 0, "TSSetTime()", ) PetscErrorCode TSSetInitialTimeStep(TS, PetscReal, PetscReal);
PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 8, 0, "TSSetMax()", ) PetscErrorCode TSSetDuration(TS, PetscInt, PetscReal);
PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 8, 0, "TSGetMax()", ) PetscErrorCode TSGetDuration(TS, PetscInt *, PetscReal *);
PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 8, 0, "TSGetStepNumber()", ) PetscErrorCode TSGetTimeStepNumber(TS, PetscInt *);
PETSC_EXTERN PETSC_DEPRECATED_FUNCTION(3, 8, 0, "TSGetStepNumber()", ) PetscErrorCode TSGetTotalSteps(TS, PetscInt *);
PETSC_EXTERN PetscErrorCode TSMonitorDefault(TS, PetscInt, PetscReal, Vec, PetscViewerAndFormat *);
PETSC_EXTERN PetscErrorCode TSMonitorExtreme(TS, PetscInt, PetscReal, Vec, PetscViewerAndFormat *);
typedef struct _n_TSMonitorDrawCtx *TSMonitorDrawCtx;
PETSC_EXTERN PetscErrorCode TSMonitorDrawCtxCreate(MPI_Comm, const char[], const char[], int, int, int, int, PetscInt, TSMonitorDrawCtx *);
PETSC_EXTERN PetscErrorCode TSMonitorDrawCtxDestroy(TSMonitorDrawCtx *);
PETSC_EXTERN PetscErrorCode TSMonitorDrawSolution(TS, PetscInt, PetscReal, Vec, void *);
PETSC_EXTERN PetscErrorCode TSMonitorDrawSolutionPhase(TS, PetscInt, PetscReal, Vec, void *);
PETSC_EXTERN PetscErrorCode TSMonitorDrawError(TS, PetscInt, PetscReal, Vec, void *);
PETSC_EXTERN PetscErrorCode TSMonitorDrawSolutionFunction(TS, PetscInt, PetscReal, Vec, void *);
PETSC_EXTERN PetscErrorCode TSAdjointMonitorDefault(TS, PetscInt, PetscReal, Vec, PetscInt, Vec *, Vec *, PetscViewerAndFormat *);
PETSC_EXTERN PetscErrorCode TSAdjointMonitorDrawSensi(TS, PetscInt, PetscReal, Vec, PetscInt, Vec *, Vec *, void *);
PETSC_EXTERN PetscErrorCode TSMonitorSolution(TS, PetscInt, PetscReal, Vec, PetscViewerAndFormat *);
PETSC_EXTERN PetscErrorCode TSMonitorSolutionVTK(TS, PetscInt, PetscReal, Vec, void *);
PETSC_EXTERN PetscErrorCode TSMonitorSolutionVTKDestroy(void *);
PETSC_EXTERN PetscErrorCode TSStep(TS);
PETSC_EXTERN PetscErrorCode TSEvaluateWLTE(TS, NormType, PetscInt *, PetscReal *);
PETSC_EXTERN PetscErrorCode TSEvaluateStep(TS, PetscInt, Vec, PetscBool *);
PETSC_EXTERN PetscErrorCode TSSolve(TS, Vec);
PETSC_EXTERN PetscErrorCode TSGetEquationType(TS, TSEquationType *);
PETSC_EXTERN PetscErrorCode TSSetEquationType(TS, TSEquationType);
PETSC_EXTERN PetscErrorCode TSGetConvergedReason(TS, TSConvergedReason *);
PETSC_EXTERN PetscErrorCode TSSetConvergedReason(TS, TSConvergedReason);
PETSC_EXTERN PetscErrorCode TSGetSolveTime(TS, PetscReal *);
PETSC_EXTERN PetscErrorCode TSGetSNESIterations(TS, PetscInt *);
PETSC_EXTERN PetscErrorCode TSGetKSPIterations(TS, PetscInt *);
PETSC_EXTERN PetscErrorCode TSGetStepRejections(TS, PetscInt *);
PETSC_EXTERN PetscErrorCode TSSetMaxStepRejections(TS, PetscInt);
PETSC_EXTERN PetscErrorCode TSGetSNESFailures(TS, PetscInt *);
PETSC_EXTERN PetscErrorCode TSSetMaxSNESFailures(TS, PetscInt);
PETSC_EXTERN PetscErrorCode TSSetErrorIfStepFails(TS, PetscBool);
PETSC_EXTERN PetscErrorCode TSRestartStep(TS);
PETSC_EXTERN PetscErrorCode TSRollBack(TS);
PETSC_EXTERN PetscErrorCode TSGetStages(TS, PetscInt *, Vec *[]);
PETSC_EXTERN PetscErrorCode TSGetTime(TS, PetscReal *);
PETSC_EXTERN PetscErrorCode TSSetTime(TS, PetscReal);
PETSC_EXTERN PetscErrorCode TSGetPrevTime(TS, PetscReal *);
PETSC_EXTERN PetscErrorCode TSGetTimeStep(TS, PetscReal *);
PETSC_EXTERN PetscErrorCode TSSetTimeStep(TS, PetscReal);
PETSC_EXTERN PetscErrorCode TSGetStepNumber(TS, PetscInt *);
PETSC_EXTERN PetscErrorCode TSSetStepNumber(TS, PetscInt);
/*S
TSRHSFunction - A prototype of a `TS` right-hand-side evaluation function that would be passed to `TSSetRHSFunction()`
Calling Sequence:
+ ts - timestep context
. t - current time
. u - input vector
. F - function vector
- ctx - [optional] user-defined function context
Level: beginner
.seealso: [](ch_ts), `TS`, `TSSetRHSFunction()`, `DMTSSetRHSFunction()`, `TSIFunction()`,
`TSIJacobian()`, `TSRHSJacobian()`
S*/
PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSRHSFunction)(TS ts, PetscReal t, Vec u, Vec F, void *ctx);
/*S
TSRHSJacobian - A prototype of a `TS` right-hand-side Jacobian evaluation function that would be passed to `TSSetRHSJacobian()`
Calling Sequence:
+ ts - the `TS` context obtained from `TSCreate()`
. t - current time
. u - input vector
. Amat - (approximate) Jacobian matrix
. Pmat - matrix from which preconditioner is to be constructed (usually the same as `Amat`)
- ctx - [optional] user-defined context for matrix evaluation routine
Level: beginner
.seealso: [](ch_ts), `TS`, `TSSetRHSJacobian()`, `DMTSSetRHSJacobian()`, `TSRHSFunction()`,
`TSIFunction()`, `TSIJacobian()`
S*/
PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSRHSJacobian)(TS ts, PetscReal t, Vec u, Mat Amat, Mat Pmat, void *ctx);
/*S
TSRHSJacobianP - A prototype of a function that computes the Jacobian of G w.r.t. the parameters P where
U_t = G(U,P,t), as well as the location to store the matrix that would be passed to `TSSetRHSJacobianP()`
Calling Sequence:
+ ts - the `TS` context
. t - current timestep
. U - input vector (current ODE solution)
. A - output matrix
- ctx - [optional] user-defined function context
Level: beginner
.seealso: [](ch_ts), `TS`, `TSSetRHSJacobianP()`, `TSGetRHSJacobianP()`
S*/
PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSRHSJacobianP)(TS ts, PetscReal t, Vec U, Mat A, void *ctx);
PETSC_EXTERN PetscErrorCode TSSetRHSFunction(TS, Vec, TSRHSFunction, void *);
PETSC_EXTERN PetscErrorCode TSGetRHSFunction(TS, Vec *, TSRHSFunction *, void **);
PETSC_EXTERN PetscErrorCode TSSetRHSJacobian(TS, Mat, Mat, TSRHSJacobian, void *);
PETSC_EXTERN PetscErrorCode TSGetRHSJacobian(TS, Mat *, Mat *, TSRHSJacobian *, void **);
PETSC_EXTERN PetscErrorCode TSRHSJacobianSetReuse(TS, PetscBool);
/*S
TSSolutionFunction - A prototype of a `TS` solution evaluation function that would be passed to `TSSetSolutionFunction()`
Calling Sequence:
+ ts - timestep context
. t - current time
. u - output vector
- ctx - [optional] user-defined function context
Level: advanced
.seealso: [](ch_ts), `TS`, `TSSetSolutionFunction()`, `DMTSSetSolutionFunction()`
S*/
PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSSolutionFunction)(TS ts, PetscReal t, Vec u, void *ctx);
PETSC_EXTERN PetscErrorCode TSSetSolutionFunction(TS, TSSolutionFunction, void *);
/*S
TSForcingFunction - A prototype of a `TS` forcing function evaluation function that would be passed to `TSSetForcingFunction()`
Calling Sequence:
+ ts - timestep context
. t - current time
. f - output vector
- ctx - [optional] user-defined function context
Level: advanced
.seealso: [](ch_ts), `TS`, `TSSetForcingFunction()`, `DMTSSetForcingFunction()`
S*/
PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSForcingFunction)(TS ts, PetscReal t, Vec f, void *ctx);
PETSC_EXTERN PetscErrorCode TSSetForcingFunction(TS, TSForcingFunction, void *);
/*S
TSIFunction - A prototype of a `TS` implicit function evaluation function that would be passed to `TSSetIFunction()
Calling Sequence:
+ ts - the `TS` context obtained from `TSCreate()`
. t - time at step/stage being solved
. U - state vector
. U_t - time derivative of state vector
. F - function vector
- ctx - [optional] user-defined context for function
Level: beginner
.seealso: [](ch_ts), `TS`, `TSSetIFunction()`, `DMTSSetIFunction()`, `TSIJacobian()`, `TSRHSFunction()`, `TSRHSJacobian()`
S*/
PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSIFunction)(TS ts, PetscReal t, Vec U, Vec U_t, Vec F, void *ctx);
/*S
TSIJacobian - A prototype of a `TS` Jacobian evaluation function that would be passed to `TSSetIJacobian()`
Calling Sequence:
+ ts - the `TS` context obtained from `TSCreate()`
. t - time at step/stage being solved
. U - state vector
. U_t - time derivative of state vector
. a - shift
. Amat - (approximate) Jacobian of F(t,U,W+a*U), equivalent to dF/dU + a*dF/dU_t
. Pmat - matrix used for constructing preconditioner, usually the same as `Amat`
- ctx - [optional] user-defined context for Jacobian evaluation routine
Level: beginner
.seealso: [](ch_ts), `TSSetIJacobian()`, `DMTSSetIJacobian()`, `TSIFunction()`, `TSRHSFunction()`, `TSRHSJacobian()`
S*/
PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSIJacobian)(TS ts, PetscReal t, Vec U, Vec U_t, PetscReal a, Mat Amat, Mat Pmat, void *ctx);
PETSC_EXTERN PetscErrorCode TSSetIFunction(TS, Vec, TSIFunction, void *);
PETSC_EXTERN PetscErrorCode TSGetIFunction(TS, Vec *, TSIFunction *, void **);
PETSC_EXTERN PetscErrorCode TSSetIJacobian(TS, Mat, Mat, TSIJacobian, void *);
PETSC_EXTERN PetscErrorCode TSGetIJacobian(TS, Mat *, Mat *, TSIJacobian *, void **);
/*S
TSI2Function - A prototype of a `TS` implicit function evaluation function for 2nd order systems that would be passed to `TSSetI2Function()`
Calling Sequence:
+ ts - the `TS` context obtained from `TSCreate()`
. t - time at step/stage being solved
. U - state vector
. U_t - time derivative of state vector
. U_tt - second time derivative of state vector
. F - function vector
- ctx - [optional] user-defined context for matrix evaluation routine (may be `NULL`)
Level: advanced
.seealso: [](ch_ts), `TS`, `TSSetI2Function()`, `DMTSSetI2Function()`
S*/
PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSI2Function)(TS ts, PetscReal t, Vec U, Vec U_t, Vec U_tt, Vec F, void *ctx);
/*S
TSI2Jacobian - A prototype of a `TS` implicit Jacobian evaluation function for 2nd order systems that would be passed to `TSSetI2Jacobian()`
Calling Sequence:
+ ts - the `TS` context obtained from `TSCreate()`
. t - time at step/stage being solved
. U - state vector
. U_t - time derivative of state vector
. U_tt - second time derivative of state vector
. v - shift for U_t
. a - shift for U_tt
. J - Jacobian of G(U) = F(t,U,W+v*U,W'+a*U), equivalent to dF/dU + v*dF/dU_t + a*dF/dU_tt
. jac - matrix from which to construct the preconditioner, may be same as `J`
- ctx - [optional] user-defined context for matrix evaluation routine
Level: advanced
.seealso: [](ch_ts), `TS`, `TSSetI2Jacobian()`, `DMTSSetI2Jacobian()`, `TSIFunction()`, `TSIJacobian()`, `TSRHSFunction()`, `TSRHSJacobian()`
S*/
PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSI2Jacobian)(TS ts, PetscReal t, Vec U, Vec U_t, Vec U_tt, PetscReal v, PetscReal a, Mat J, Mat Jac, void *ctx);
PETSC_EXTERN PetscErrorCode TSSetI2Function(TS, Vec, TSI2Function, void *);
PETSC_EXTERN PetscErrorCode TSGetI2Function(TS, Vec *, TSI2Function *, void **);
PETSC_EXTERN PetscErrorCode TSSetI2Jacobian(TS, Mat, Mat, TSI2Jacobian, void *);
PETSC_EXTERN PetscErrorCode TSGetI2Jacobian(TS, Mat *, Mat *, TSI2Jacobian *, void **);
PETSC_EXTERN PetscErrorCode TSRHSSplitSetIS(TS, const char[], IS);
PETSC_EXTERN PetscErrorCode TSRHSSplitGetIS(TS, const char[], IS *);
PETSC_EXTERN PetscErrorCode TSRHSSplitSetRHSFunction(TS, const char[], Vec, TSRHSFunction, void *);
PETSC_EXTERN PetscErrorCode TSRHSSplitGetSubTS(TS, const char[], TS *);
PETSC_EXTERN PetscErrorCode TSRHSSplitGetSubTSs(TS, PetscInt *, TS *[]);
PETSC_EXTERN PetscErrorCode TSSetUseSplitRHSFunction(TS, PetscBool);
PETSC_EXTERN PetscErrorCode TSGetUseSplitRHSFunction(TS, PetscBool *);
PETSC_EXTERN PetscErrorCode TSComputeRHSFunctionLinear(TS, PetscReal, Vec, Vec, void *);
PETSC_EXTERN PetscErrorCode TSComputeRHSJacobianConstant(TS, PetscReal, Vec, Mat, Mat, void *);
PETSC_EXTERN PetscErrorCode TSComputeIFunctionLinear(TS, PetscReal, Vec, Vec, Vec, void *);
PETSC_EXTERN PetscErrorCode TSComputeIJacobianConstant(TS, PetscReal, Vec, Vec, PetscReal, Mat, Mat, void *);
PETSC_EXTERN PetscErrorCode TSComputeSolutionFunction(TS, PetscReal, Vec);
PETSC_EXTERN PetscErrorCode TSComputeForcingFunction(TS, PetscReal, Vec);
PETSC_EXTERN PetscErrorCode TSComputeIJacobianDefaultColor(TS, PetscReal, Vec, Vec, PetscReal, Mat, Mat, void *);
PETSC_EXTERN PetscErrorCode TSPruneIJacobianColor(TS, Mat, Mat);
PETSC_EXTERN PetscErrorCode TSSetPreStep(TS, PetscErrorCode (*)(TS));
PETSC_EXTERN PetscErrorCode TSSetPreStage(TS, PetscErrorCode (*)(TS, PetscReal));
PETSC_EXTERN PetscErrorCode TSSetPostStage(TS, PetscErrorCode (*)(TS, PetscReal, PetscInt, Vec *));
PETSC_EXTERN PetscErrorCode TSSetPostEvaluate(TS, PetscErrorCode (*)(TS));
PETSC_EXTERN PetscErrorCode TSSetPostStep(TS, PetscErrorCode (*)(TS));
PETSC_EXTERN PetscErrorCode TSSetResize(TS, PetscErrorCode (*)(TS, PetscInt, PetscReal, Vec, PetscBool *, void *), PetscErrorCode (*)(TS, PetscInt, Vec[], Vec[], void *), void *);
PETSC_EXTERN PetscErrorCode TSPreStep(TS);
PETSC_EXTERN PetscErrorCode TSPreStage(TS, PetscReal);
PETSC_EXTERN PetscErrorCode TSPostStage(TS, PetscReal, PetscInt, Vec *);
PETSC_EXTERN PetscErrorCode TSPostEvaluate(TS);
PETSC_EXTERN PetscErrorCode TSPostStep(TS);
PETSC_EXTERN PetscErrorCode TSResize(TS);
PETSC_EXTERN PetscErrorCode TSResizeRetrieveVec(TS, const char *, Vec *);
PETSC_EXTERN PetscErrorCode TSResizeRegisterVec(TS, const char *, Vec);
PETSC_EXTERN PetscErrorCode TSInterpolate(TS, PetscReal, Vec);
PETSC_EXTERN PetscErrorCode TSSetTolerances(TS, PetscReal, Vec, PetscReal, Vec);
PETSC_EXTERN PetscErrorCode TSGetTolerances(TS, PetscReal *, Vec *, PetscReal *, Vec *);
PETSC_EXTERN PetscErrorCode TSErrorWeightedNorm(TS, Vec, Vec, NormType, PetscReal *, PetscReal *, PetscReal *);
PETSC_EXTERN PetscErrorCode TSErrorWeightedENorm(TS, Vec, Vec, Vec, NormType, PetscReal *, PetscReal *, PetscReal *);
PETSC_EXTERN PetscErrorCode TSSetCFLTimeLocal(TS, PetscReal);
PETSC_EXTERN PetscErrorCode TSGetCFLTime(TS, PetscReal *);
PETSC_EXTERN PetscErrorCode TSSetFunctionDomainError(TS, PetscErrorCode (*)(TS, PetscReal, Vec, PetscBool *));
PETSC_EXTERN PetscErrorCode TSFunctionDomainError(TS, PetscReal, Vec, PetscBool *);
PETSC_EXTERN PetscErrorCode TSPseudoSetTimeStep(TS, PetscErrorCode (*)(TS, PetscReal *, void *), void *);
PETSC_EXTERN PetscErrorCode TSPseudoTimeStepDefault(TS, PetscReal *, void *);
PETSC_EXTERN PetscErrorCode TSPseudoComputeTimeStep(TS, PetscReal *);
PETSC_EXTERN PetscErrorCode TSPseudoSetMaxTimeStep(TS, PetscReal);
PETSC_EXTERN PetscErrorCode TSPseudoSetVerifyTimeStep(TS, PetscErrorCode (*)(TS, Vec, void *, PetscReal *, PetscBool *), void *);
PETSC_EXTERN PetscErrorCode TSPseudoVerifyTimeStepDefault(TS, Vec, void *, PetscReal *, PetscBool *);
PETSC_EXTERN PetscErrorCode TSPseudoVerifyTimeStep(TS, Vec, PetscReal *, PetscBool *);
PETSC_EXTERN PetscErrorCode TSPseudoSetTimeStepIncrement(TS, PetscReal);
PETSC_EXTERN PetscErrorCode TSPseudoIncrementDtFromInitialDt(TS);
PETSC_EXTERN PetscErrorCode TSPythonSetType(TS, const char[]);
PETSC_EXTERN PetscErrorCode TSPythonGetType(TS, const char *[]);
PETSC_EXTERN PetscErrorCode TSComputeRHSFunction(TS, PetscReal, Vec, Vec);
PETSC_EXTERN PetscErrorCode TSComputeRHSJacobian(TS, PetscReal, Vec, Mat, Mat);
PETSC_EXTERN PetscErrorCode TSComputeIFunction(TS, PetscReal, Vec, Vec, Vec, PetscBool);
PETSC_EXTERN PetscErrorCode TSComputeIJacobian(TS, PetscReal, Vec, Vec, PetscReal, Mat, Mat, PetscBool);
PETSC_EXTERN PetscErrorCode TSComputeI2Function(TS, PetscReal, Vec, Vec, Vec, Vec);
PETSC_EXTERN PetscErrorCode TSComputeI2Jacobian(TS, PetscReal, Vec, Vec, Vec, PetscReal, PetscReal, Mat, Mat);
PETSC_EXTERN PetscErrorCode TSComputeLinearStability(TS, PetscReal, PetscReal, PetscReal *, PetscReal *);
PETSC_EXTERN PetscErrorCode TSVISetVariableBounds(TS, Vec, Vec);
PETSC_EXTERN PetscErrorCode DMTSSetBoundaryLocal(DM, PetscErrorCode (*)(DM, PetscReal, Vec, Vec, void *), void *);
PETSC_EXTERN PetscErrorCode DMTSSetRHSFunction(DM, TSRHSFunction, void *);
PETSC_EXTERN PetscErrorCode DMTSGetRHSFunction(DM, TSRHSFunction *, void **);
PETSC_EXTERN PetscErrorCode DMTSSetRHSFunctionContextDestroy(DM, PetscErrorCode (*)(void *));
PETSC_EXTERN PetscErrorCode DMTSSetRHSJacobian(DM, TSRHSJacobian, void *);
PETSC_EXTERN PetscErrorCode DMTSGetRHSJacobian(DM, TSRHSJacobian *, void **);
PETSC_EXTERN PetscErrorCode DMTSSetRHSJacobianContextDestroy(DM, PetscErrorCode (*)(void *));
PETSC_EXTERN PetscErrorCode DMTSSetIFunction(DM, TSIFunction, void *);
PETSC_EXTERN PetscErrorCode DMTSGetIFunction(DM, TSIFunction *, void **);
PETSC_EXTERN PetscErrorCode DMTSSetIFunctionContextDestroy(DM, PetscErrorCode (*)(void *));
PETSC_EXTERN PetscErrorCode DMTSSetIJacobian(DM, TSIJacobian, void *);
PETSC_EXTERN PetscErrorCode DMTSGetIJacobian(DM, TSIJacobian *, void **);
PETSC_EXTERN PetscErrorCode DMTSSetIJacobianContextDestroy(DM, PetscErrorCode (*)(void *));
PETSC_EXTERN PetscErrorCode DMTSSetI2Function(DM, TSI2Function, void *);
PETSC_EXTERN PetscErrorCode DMTSGetI2Function(DM, TSI2Function *, void **);
PETSC_EXTERN PetscErrorCode DMTSSetI2FunctionContextDestroy(DM, PetscErrorCode (*)(void *));
PETSC_EXTERN PetscErrorCode DMTSSetI2Jacobian(DM, TSI2Jacobian, void *);
PETSC_EXTERN PetscErrorCode DMTSGetI2Jacobian(DM, TSI2Jacobian *, void **);
PETSC_EXTERN PetscErrorCode DMTSSetI2JacobianContextDestroy(DM, PetscErrorCode (*)(void *));
/*S
TSTransientVariable - A prototype of a function to transform from state to transient variables that would be passed to `TSSetTransientVariable()`
Calling Sequence:
+ ts - timestep context
. p - input vector (primitive form)
. c - output vector, transient variables (conservative form)
- ctx - [optional] user-defined function context
Level: advanced
.seealso: [](ch_ts), `TS`, `TSSetTransientVariable()`, `DMTSSetTransientVariable()`
S*/
PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*TSTransientVariable)(TS ts, Vec p, Vec c, void *ctx);
PETSC_EXTERN PetscErrorCode TSSetTransientVariable(TS, TSTransientVariable, void *);
PETSC_EXTERN PetscErrorCode DMTSSetTransientVariable(DM, TSTransientVariable, void *);
PETSC_EXTERN PetscErrorCode DMTSGetTransientVariable(DM, TSTransientVariable *, void *);
PETSC_EXTERN PetscErrorCode TSComputeTransientVariable(TS, Vec, Vec);
PETSC_EXTERN PetscErrorCode TSHasTransientVariable(TS, PetscBool *);
PETSC_EXTERN PetscErrorCode DMTSSetSolutionFunction(DM, TSSolutionFunction, void *);
PETSC_EXTERN PetscErrorCode DMTSGetSolutionFunction(DM, TSSolutionFunction *, void **);
PETSC_EXTERN PetscErrorCode DMTSSetForcingFunction(DM, TSForcingFunction, void *);
PETSC_EXTERN PetscErrorCode DMTSGetForcingFunction(DM, TSForcingFunction *, void **);
PETSC_EXTERN PetscErrorCode DMTSCheckResidual(TS, DM, PetscReal, Vec, Vec, PetscReal, PetscReal *);
PETSC_EXTERN PetscErrorCode DMTSCheckJacobian(TS, DM, PetscReal, Vec, Vec, PetscReal, PetscBool *, PetscReal *);
PETSC_EXTERN PetscErrorCode DMTSCheckFromOptions(TS, Vec);
PETSC_EXTERN PetscErrorCode DMTSGetIFunctionLocal(DM, PetscErrorCode (**)(DM, PetscReal, Vec, Vec, Vec, void *), void **);
PETSC_EXTERN PetscErrorCode DMTSSetIFunctionLocal(DM, PetscErrorCode (*)(DM, PetscReal, Vec, Vec, Vec, void *), void *);
PETSC_EXTERN PetscErrorCode DMTSGetIJacobianLocal(DM, PetscErrorCode (**)(DM, PetscReal, Vec, Vec, PetscReal, Mat, Mat, void *), void **);
PETSC_EXTERN PetscErrorCode DMTSSetIJacobianLocal(DM, PetscErrorCode (*)(DM, PetscReal, Vec, Vec, PetscReal, Mat, Mat, void *), void *);
PETSC_EXTERN PetscErrorCode DMTSGetRHSFunctionLocal(DM, PetscErrorCode (**)(DM, PetscReal, Vec, Vec, void *), void **);
PETSC_EXTERN PetscErrorCode DMTSSetRHSFunctionLocal(DM, PetscErrorCode (*)(DM, PetscReal, Vec, Vec, void *), void *);
PETSC_EXTERN PetscErrorCode DMTSCreateRHSMassMatrix(DM);
PETSC_EXTERN PetscErrorCode DMTSCreateRHSMassMatrixLumped(DM);
PETSC_EXTERN PetscErrorCode DMTSDestroyRHSMassMatrix(DM);
PETSC_EXTERN PetscErrorCode DMTSSetIFunctionSerialize(DM, PetscErrorCode (*)(void *, PetscViewer), PetscErrorCode (*)(void **, PetscViewer));
PETSC_EXTERN PetscErrorCode DMTSSetIJacobianSerialize(DM, PetscErrorCode (*)(void *, PetscViewer), PetscErrorCode (*)(void **, PetscViewer));
/*S
DMDATSRHSFunctionLocal - A prototype of a local `TS` right hand side residual evaluation function for use with `DMDA` that would be passed to `DMDATSSetRHSFunctionLocal()`
Calling Sequence:
+ info - defines the subdomain to evaluate the residual on
. t - time at which to evaluate residual
. x - array of local state information
. f - output array of local residual information
- ctx - optional user context
Level: beginner
.seealso: `DMDA`, `DMDATSSetRHSFunctionLocal()`, `TSRHSFunction()`, `DMDATSRHSJacobianLocal()`, `DMDATSIJacobianLocal()`, `DMDATSIFunctionLocal()`
S*/
PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*DMDATSRHSFunctionLocal)(DMDALocalInfo *info, PetscReal t, void *x, void *f, void *ctx);
/*S
DMDATSRHSJacobianLocal - A prototype of a local residual evaluation function for use with `DMDA` that would be passed to `DMDATSSetRHSJacobianLocal()`
Calling Sequence:
+ info - defines the subdomain to evaluate the residual on
. t - time at which to evaluate residual
. x - array of local state information
. J - Jacobian matrix
. B - matrix from which to construct the preconditioner; often same as `J`
- ctx - optional context
Level: beginner
.seealso: `DMDA`, `DMDATSSetRHSJacobianLocal()`, `TSRHSJacobian()`, `DMDATSRHSFunctionLocal()`, `DMDATSIJacobianLocal()`, `DMDATSIFunctionLocal()`
S*/
PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*DMDATSRHSJacobianLocal)(DMDALocalInfo *info, PetscReal t, void *x, Mat J, Mat B, void *ctx);
/*S
DMDATSIFunctionLocal - A prototype of a local residual evaluation function for use with `DMDA` that would be passed to `DMDATSSetIFunctionLocal()`
Calling Sequence:
+ info - defines the subdomain to evaluate the residual on
. t - time at which to evaluate residual
. x - array of local state information
. xdot - array of local time derivative information
. imode - output array of local function evaluation information
- ctx - optional context
Level: beginner
.seealso: `DMDA`, `DMDATSSetIFunctionLocal()`, `DMDATSIJacobianLocal()`, `TSIFunction()`
S*/
PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*DMDATSIFunctionLocal)(DMDALocalInfo *info, PetscReal t, void *x, void *xdot, void *imode, void *ctx);
/*S
DMDATSIJacobianLocal - A prototype of a local residual evaluation function for use with `DMDA` that would be passed to `DMDATSSetIJacobianLocal()`
Calling Sequence:
+ info - defines the subdomain to evaluate the residual on
. t - time at which to evaluate the jacobian
. x - array of local state information
. xdot - time derivative at this state
. shift - see `TSSetIJacobian()` for the meaning of this parameter
. J - Jacobian matrix
. B - matrix from which to construct the preconditioner; often same as `J`
- ctx - optional context
Level: beginner
.seealso: `DMDA` `DMDATSSetIJacobianLocal()`, `TSIJacobian()`, `DMDATSIFunctionLocal()`, `DMDATSRHSFunctionLocal()`, `DMDATSRHSJacob ianlocal()`
S*/
PETSC_EXTERN_TYPEDEF typedef PetscErrorCode (*DMDATSIJacobianLocal)(DMDALocalInfo *info, PetscReal t, void *x, void *xdot, PetscReal shift, Mat J, Mat B, void *ctx);
PETSC_EXTERN PetscErrorCode DMDATSSetRHSFunctionLocal(DM, InsertMode, DMDATSRHSFunctionLocal, void *);
PETSC_EXTERN PetscErrorCode DMDATSSetRHSJacobianLocal(DM, DMDATSRHSJacobianLocal, void *);
PETSC_EXTERN PetscErrorCode DMDATSSetIFunctionLocal(DM, InsertMode, DMDATSIFunctionLocal, void *);
PETSC_EXTERN PetscErrorCode DMDATSSetIJacobianLocal(DM, DMDATSIJacobianLocal, void *);
typedef struct _n_TSMonitorLGCtx *TSMonitorLGCtx;
typedef struct {
Vec ray;
VecScatter scatter;
PetscViewer viewer;
TSMonitorLGCtx lgctx;
} TSMonitorDMDARayCtx;
PETSC_EXTERN PetscErrorCode TSMonitorDMDARayDestroy(void **);
PETSC_EXTERN PetscErrorCode TSMonitorDMDARay(TS, PetscInt, PetscReal, Vec, void *);
PETSC_EXTERN PetscErrorCode TSMonitorLGDMDARay(TS, PetscInt, PetscReal, Vec, void *);
/* Dynamic creation and loading functions */
PETSC_EXTERN PetscFunctionList TSList;
PETSC_EXTERN PetscErrorCode TSGetType(TS, TSType *);
PETSC_EXTERN PetscErrorCode TSSetType(TS, TSType);
PETSC_EXTERN PetscErrorCode TSRegister(const char[], PetscErrorCode (*)(TS));
PETSC_EXTERN PetscErrorCode TSGetSNES(TS, SNES *);
PETSC_EXTERN PetscErrorCode TSSetSNES(TS, SNES);
PETSC_EXTERN PetscErrorCode TSGetKSP(TS, KSP *);
PETSC_EXTERN PetscErrorCode TSView(TS, PetscViewer);
PETSC_EXTERN PetscErrorCode TSLoad(TS, PetscViewer);
PETSC_EXTERN PetscErrorCode TSViewFromOptions(TS, PetscObject, const char[]);
PETSC_EXTERN PetscErrorCode TSTrajectoryViewFromOptions(TSTrajectory, PetscObject, const char[]);
#define TS_FILE_CLASSID 1211225
PETSC_EXTERN PetscErrorCode TSSetApplicationContext(TS, void *);
PETSC_EXTERN PetscErrorCode TSGetApplicationContext(TS, void *);
PETSC_EXTERN PetscErrorCode TSMonitorLGCtxCreate(MPI_Comm, const char[], const char[], int, int, int, int, PetscInt, TSMonitorLGCtx *);
PETSC_EXTERN PetscErrorCode TSMonitorLGCtxDestroy(TSMonitorLGCtx *);
PETSC_EXTERN PetscErrorCode TSMonitorLGTimeStep(TS, PetscInt, PetscReal, Vec, void *);
PETSC_EXTERN PetscErrorCode TSMonitorLGSolution(TS, PetscInt, PetscReal, Vec, void *);
PETSC_EXTERN PetscErrorCode TSMonitorLGSetVariableNames(TS, const char *const *);
PETSC_EXTERN PetscErrorCode TSMonitorLGGetVariableNames(TS, const char *const **);
PETSC_EXTERN PetscErrorCode TSMonitorLGCtxSetVariableNames(TSMonitorLGCtx, const char *const *);
PETSC_EXTERN PetscErrorCode TSMonitorLGSetDisplayVariables(TS, const char *const *);
PETSC_EXTERN PetscErrorCode TSMonitorLGCtxSetDisplayVariables(TSMonitorLGCtx, const char *const *);
PETSC_EXTERN PetscErrorCode TSMonitorLGSetTransform(TS, PetscErrorCode (*)(void *, Vec, Vec *), PetscErrorCode (*)(void *), void *);
PETSC_EXTERN PetscErrorCode TSMonitorLGCtxSetTransform(TSMonitorLGCtx, PetscErrorCode (*)(void *, Vec, Vec *), PetscErrorCode (*)(void *), void *);
PETSC_EXTERN PetscErrorCode TSMonitorLGError(TS, PetscInt, PetscReal, Vec, void *);
PETSC_EXTERN PetscErrorCode TSMonitorLGSNESIterations(TS, PetscInt, PetscReal, Vec, void *);
PETSC_EXTERN PetscErrorCode TSMonitorLGKSPIterations(TS, PetscInt, PetscReal, Vec, void *);
PETSC_EXTERN PetscErrorCode TSMonitorError(TS, PetscInt, PetscReal, Vec, PetscViewerAndFormat *);
PETSC_EXTERN PetscErrorCode TSDMSwarmMonitorMoments(TS, PetscInt, PetscReal, Vec, PetscViewerAndFormat *);
struct _n_TSMonitorLGCtxNetwork {
PetscInt nlg;
PetscDrawLG *lg;
PetscBool semilogy;
PetscInt howoften; /* when > 0 uses step % howoften, when negative only final solution plotted */
};
typedef struct _n_TSMonitorLGCtxNetwork *TSMonitorLGCtxNetwork;
PETSC_EXTERN PetscErrorCode TSMonitorLGCtxNetworkDestroy(TSMonitorLGCtxNetwork *);
PETSC_EXTERN PetscErrorCode TSMonitorLGCtxNetworkCreate(TS, const char[], const char[], int, int, int, int, PetscInt, TSMonitorLGCtxNetwork *);
PETSC_EXTERN PetscErrorCode TSMonitorLGCtxNetworkSolution(TS, PetscInt, PetscReal, Vec, void *);
typedef struct _n_TSMonitorEnvelopeCtx *TSMonitorEnvelopeCtx;
PETSC_EXTERN PetscErrorCode TSMonitorEnvelopeCtxCreate(TS, TSMonitorEnvelopeCtx *);
PETSC_EXTERN PetscErrorCode TSMonitorEnvelope(TS, PetscInt, PetscReal, Vec, void *);
PETSC_EXTERN PetscErrorCode TSMonitorEnvelopeGetBounds(TS, Vec *, Vec *);
PETSC_EXTERN PetscErrorCode TSMonitorEnvelopeCtxDestroy(TSMonitorEnvelopeCtx *);
typedef struct _n_TSMonitorSPEigCtx *TSMonitorSPEigCtx;
PETSC_EXTERN PetscErrorCode TSMonitorSPEigCtxCreate(MPI_Comm, const char[], const char[], int, int, int, int, PetscInt, TSMonitorSPEigCtx *);
PETSC_EXTERN PetscErrorCode TSMonitorSPEigCtxDestroy(TSMonitorSPEigCtx *);
PETSC_EXTERN PetscErrorCode TSMonitorSPEig(TS, PetscInt, PetscReal, Vec, void *);
typedef struct _n_TSMonitorSPCtx *TSMonitorSPCtx;
PETSC_EXTERN PetscErrorCode TSMonitorSPCtxCreate(MPI_Comm, const char[], const char[], int, int, int, int, PetscInt, PetscInt, PetscBool, PetscBool, TSMonitorSPCtx *);
PETSC_EXTERN PetscErrorCode TSMonitorSPCtxDestroy(TSMonitorSPCtx *);
PETSC_EXTERN PetscErrorCode TSMonitorSPSwarmSolution(TS, PetscInt, PetscReal, Vec, void *);
typedef struct _n_TSMonitorHGCtx *TSMonitorHGCtx;
PETSC_EXTERN PetscErrorCode TSMonitorHGCtxCreate(MPI_Comm, const char[], const char[], int, int, int, int, PetscInt, PetscInt, PetscInt, PetscBool, TSMonitorHGCtx *);
PETSC_EXTERN PetscErrorCode TSMonitorHGSwarmSolution(TS, PetscInt, PetscReal, Vec, void *);
PETSC_EXTERN PetscErrorCode TSMonitorHGCtxDestroy(TSMonitorHGCtx *);
PETSC_EXTERN PetscErrorCode TSMonitorHGSwarmSolution(TS, PetscInt, PetscReal, Vec, void *);
PETSC_EXTERN PetscErrorCode TSSetEventHandler(TS, PetscInt, PetscInt[], PetscBool[], PetscErrorCode (*)(TS, PetscReal, Vec, PetscReal[], void *), PetscErrorCode (*)(TS, PetscInt, PetscInt[], PetscReal, Vec, PetscBool, void *), void *);
PETSC_EXTERN PetscErrorCode TSSetPostEventStep(TS, PetscReal);
PETSC_EXTERN PetscErrorCode TSSetPostEventSecondStep(TS, PetscReal);
PETSC_DEPRECATED_FUNCTION(3, 21, 0, "TSSetPostEventSecondStep()", ) static inline PetscErrorCode TSSetPostEventIntervalStep(TS ts, PetscReal dt)
{
return TSSetPostEventSecondStep(ts, dt);
}
PETSC_EXTERN PetscErrorCode TSSetEventTolerances(TS, PetscReal, PetscReal[]);
PETSC_EXTERN PetscErrorCode TSGetNumEvents(TS, PetscInt *);
/*J
TSSSPType - string with the name of a `TSSSP` scheme.
Level: beginner
.seealso: [](ch_ts), `TSSSPSetType()`, `TS`, `TSSSP`
J*/
typedef const char *TSSSPType;
#define TSSSPRKS2 "rks2"
#define TSSSPRKS3 "rks3"
#define TSSSPRK104 "rk104"
PETSC_EXTERN PetscErrorCode TSSSPSetType(TS, TSSSPType);
PETSC_EXTERN PetscErrorCode TSSSPGetType(TS, TSSSPType *);
PETSC_EXTERN PetscErrorCode TSSSPSetNumStages(TS, PetscInt);
PETSC_EXTERN PetscErrorCode TSSSPGetNumStages(TS, PetscInt *);
PETSC_EXTERN PetscErrorCode TSSSPInitializePackage(void);
PETSC_EXTERN PetscErrorCode TSSSPFinalizePackage(void);
PETSC_EXTERN PetscFunctionList TSSSPList;
/*S
TSAdapt - Abstract object that manages time-step adaptivity
Level: beginner
.seealso: [](ch_ts), `TS`, `TSGetAdapt()`, `TSAdaptCreate()`, `TSAdaptType`
S*/
typedef struct _p_TSAdapt *TSAdapt;
/*J
TSAdaptType - String with the name of `TSAdapt` scheme.
Level: beginner
.seealso: [](ch_ts), `TSGetAdapt()`, `TSAdaptSetType()`, `TS`, `TSAdapt`
J*/
typedef const char *TSAdaptType;
#define TSADAPTNONE "none"
#define TSADAPTBASIC "basic"
#define TSADAPTDSP "dsp"
#define TSADAPTCFL "cfl"
#define TSADAPTGLEE "glee"
#define TSADAPTHISTORY "history"
PETSC_EXTERN PetscErrorCode TSGetAdapt(TS, TSAdapt *);
PETSC_EXTERN PetscErrorCode TSAdaptRegister(const char[], PetscErrorCode (*)(TSAdapt));
PETSC_EXTERN PetscErrorCode TSAdaptInitializePackage(void);
PETSC_EXTERN PetscErrorCode TSAdaptFinalizePackage(void);
PETSC_EXTERN PetscErrorCode TSAdaptCreate(MPI_Comm, TSAdapt *);
PETSC_EXTERN PetscErrorCode TSAdaptSetType(TSAdapt, TSAdaptType);
PETSC_EXTERN PetscErrorCode TSAdaptGetType(TSAdapt, TSAdaptType *);
PETSC_EXTERN PetscErrorCode TSAdaptSetOptionsPrefix(TSAdapt, const char[]);
PETSC_EXTERN PetscErrorCode TSAdaptCandidatesClear(TSAdapt);
PETSC_EXTERN PetscErrorCode TSAdaptCandidateAdd(TSAdapt, const char[], PetscInt, PetscInt, PetscReal, PetscReal, PetscBool);
PETSC_EXTERN PetscErrorCode TSAdaptCandidatesGet(TSAdapt, PetscInt *, const PetscInt **, const PetscInt **, const PetscReal **, const PetscReal **);
PETSC_EXTERN PetscErrorCode TSAdaptChoose(TSAdapt, TS, PetscReal, PetscInt *, PetscReal *, PetscBool *);
PETSC_EXTERN PetscErrorCode TSAdaptCheckStage(TSAdapt, TS, PetscReal, Vec, PetscBool *);
PETSC_EXTERN PetscErrorCode TSAdaptView(TSAdapt, PetscViewer);
PETSC_EXTERN PetscErrorCode TSAdaptLoad(TSAdapt, PetscViewer);
PETSC_EXTERN PetscErrorCode TSAdaptSetFromOptions(TSAdapt, PetscOptionItems *);
PETSC_EXTERN PetscErrorCode TSAdaptReset(TSAdapt);
PETSC_EXTERN PetscErrorCode TSAdaptDestroy(TSAdapt *);