Lines Matching refs:hist

5   PetscReal *hist;    /* time history */  member
26 PetscCall(PetscRealloc(tsh->c * sizeof(*tsh->hist), &tsh->hist)); in TSHistoryUpdate()
29 …tsh->sorted = (PetscBool)(tsh->sorted && (tsh->n ? (PetscBool)(time >= tsh->hist[tsh->n - 1]) : PE… in TSHistoryUpdate()
42 tsh->hist[tsh->n] = time; in TSHistoryUpdate()
54 PetscCall(PetscSortRealWithArrayInt(tsh->n, tsh->hist, tsh->hist_id)); in TSHistoryGetTime()
58 if (!backward) *t = tsh->hist[step]; in TSHistoryGetTime()
59 else *t = tsh->hist[tsh->n - step - 1]; in TSHistoryGetTime()
69 PetscCall(PetscSortRealWithArrayInt(tsh->n, tsh->hist, tsh->hist_id)); in TSHistoryGetTimeStep()
73 …if (!backward) *dt = tsh->hist[PetscMin(step + 1, tsh->n - 1)] - tsh->hist[PetscMin(step, tsh->n -… in TSHistoryGetTimeStep()
74 else *dt = tsh->hist[PetscMax(tsh->n - step - 1, 0)] - tsh->hist[PetscMax(tsh->n - step - 2, 0)]; in TSHistoryGetTimeStep()
83 PetscCall(PetscSortRealWithArrayInt(tsh->n, tsh->hist, tsh->hist_id)); in TSHistoryGetLocFromTime()
86 PetscCall(PetscFindReal(time, tsh->n, tsh->hist, PETSC_SMALL, loc)); in TSHistoryGetLocFromTime()
90 PetscErrorCode TSHistorySetHistory(TSHistory tsh, PetscInt n, PetscReal hist[], PetscInt hist_id[],… in TSHistorySetHistory() argument
95 if (n) PetscAssertPointer(hist, 3); in TSHistorySetHistory()
96 PetscCall(PetscFree(tsh->hist)); in TSHistorySetHistory()
100 PetscCall(PetscMalloc1(tsh->n, &tsh->hist)); in TSHistorySetHistory()
103 tsh->hist[i] = hist[i]; in TSHistorySetHistory()
106 if (!sorted) PetscCall(PetscSortRealWithArrayInt(tsh->n, tsh->hist, tsh->hist_id)); in TSHistorySetHistory()
111 PetscErrorCode TSHistoryGetHistory(TSHistory tsh, PetscInt *n, const PetscReal *hist[], const Petsc… in TSHistoryGetHistory() argument
115 if (hist) *hist = tsh->hist; in TSHistoryGetHistory()
125 PetscCall(PetscFree((*tsh)->hist)); in TSHistoryDestroy()
146 PetscCall(PetscMalloc1(tsh->c, &tsh->hist)); in TSHistoryCreate()