| /petsc/src/ts/tutorials/optimal_control/ |
| H A D | ex1.c | 26 Aircraft actx = (Aircraft)ctx; in RHSFunction() local 34 PetscCall(VecGetArrayRead(actx->V, &v)); in RHSFunction() 35 PetscCall(VecGetArrayRead(actx->W, &w)); in RHSFunction() 40 PetscCall(VecRestoreArrayRead(actx->V, &v)); in RHSFunction() 41 PetscCall(VecRestoreArrayRead(actx->W, &w)); in RHSFunction() 48 Aircraft actx = (Aircraft)ctx; in RHSJacobianP() local 57 PetscCall(VecGetArrayRead(actx->V, &v)); in RHSJacobianP() 58 PetscCall(VecGetArrayRead(actx->W, &w)); in RHSJacobianP() 66 PetscCall(VecRestoreArrayRead(actx->V, &v)); in RHSJacobianP() 67 PetscCall(VecRestoreArrayRead(actx->W, &w)); in RHSJacobianP() [all …]
|
| /petsc/src/ts/tutorials/hybrid/ |
| H A D | ex1fwd.c | 31 AppCtx *actx = (AppCtx *)ctx; in MyMonitor() local 38 if (time >= actx->print_time) { in MyMonitor() 39 actx->print_time += 1. / 256.; in MyMonitor() 52 AppCtx *actx = (AppCtx *)ctx; in EventFunction() local 57 if (actx->mode == 1) { in EventFunction() 58 fvalue[0] = PetscRealPart(u[1] - actx->lambda1 * u[0]); in EventFunction() 59 } else if (actx->mode == 2) { in EventFunction() 60 fvalue[0] = PetscRealPart(u[1] - actx->lambda2 * u[0]); in EventFunction() 66 PetscErrorCode ShiftGradients(TS ts, Vec U, AppCtx *actx) in ShiftGradients() argument 78 if (actx->mode == 1) { in ShiftGradients() [all …]
|
| H A D | ex1fd.c | 30 AppCtx *actx = (AppCtx *)ctx; in EventFunction() local 35 if (actx->mode == 1) { in EventFunction() 36 fvalue[0] = PetscRealPart(u[1] - actx->lambda1 * u[0]); in EventFunction() 37 } else if (actx->mode == 2) { in EventFunction() 38 fvalue[0] = PetscRealPart(u[1] - actx->lambda2 * u[0]); in EventFunction() 44 PetscErrorCode ShiftGradients(TS ts, Vec U, AppCtx *actx) in ShiftGradients() argument 56 if (actx->mode == 2) { in ShiftGradients() 57 denorm1 = -actx->lambda1 * (u[0] - 100. * u[1]) + 1. * (10. * u[0] + u[1]); in ShiftGradients() 58 denorm2 = -actx->lambda1 * (u[0] + 10. * u[1]) + 1. * (-100. * u[0] + u[1]); in ShiftGradients() 59 A1[0][0] = 110. * u[1] * (-actx->lambda1) / denorm1 + 1.; in ShiftGradients() [all …]
|
| H A D | ex1adj.c | 30 AppCtx *actx = (AppCtx *)ctx; in EventFunction() local 35 if (actx->mode == 1) { in EventFunction() 36 fvalue[0] = PetscRealPart(u[1] - actx->lambda1 * u[0]); in EventFunction() 37 } else if (actx->mode == 2) { in EventFunction() 38 fvalue[0] = PetscRealPart(u[1] - actx->lambda2 * u[0]); in EventFunction() 44 PetscErrorCode ShiftGradients(TS ts, Vec U, AppCtx *actx) in ShiftGradients() argument 56 if (actx->mode == 2) { in ShiftGradients() 57 denorm = -actx->lambda1 * (u[0] - 100. * u[1]) + 1. * (10. * u[0] + u[1]); in ShiftGradients() 58 A1[0][0] = 110. * u[1] * (-actx->lambda1) / denorm + 1.; in ShiftGradients() 59 A1[0][1] = -110. * u[0] * (-actx->lambda1) / denorm; in ShiftGradients() [all …]
|
| H A D | ex1.c | 28 AppCtx *actx = (AppCtx *)ctx; in EventFunction() local 33 if (actx->mode == 1) { in EventFunction() 34 fvalue[0] = PetscRealPart(u[1] - actx->lambda1 * u[0]); in EventFunction() 35 } else if (actx->mode == 2) { in EventFunction() 36 fvalue[0] = PetscRealPart(u[1] - actx->lambda2 * u[0]); in EventFunction() 44 AppCtx *actx = (AppCtx *)ctx; in PostEventFunction() local 47 if (actx->mode == 1) { in PostEventFunction() 48 actx->mode = 2; in PostEventFunction() 50 } else if (actx->mode == 2) { in PostEventFunction() 51 actx->mode = 1; in PostEventFunction() [all …]
|
| /petsc/src/ts/trajectory/impls/memory/ |
| H A D | trajmemory.c | 114 CAMSCTX *actx; member 1579 if (tjsch->actx->nextcheckpointstep == -1) PetscFunctionReturn(PETSC_SUCCESS); in TSTrajectoryMemorySet_AOF() 1582 …allExternal(offline_ca, tjsch->actx->lastcheckpointstep, tjsch->actx->num_units_avail, tjsch->actx… in TSTrajectoryMemorySet_AOF() 1585 …actx->lastcheckpointstep, tjsch->actx->lastcheckpointtype, tjsch->actx->num_units_avail, tjsch->ac… in TSTrajectoryMemorySet_AOF() 1591 if (tjsch->actx->nextcheckpointstep == stepnum) { in TSTrajectoryMemorySet_AOF() 1594 if (tjsch->actx->nextcheckpointtype == 2) { /* solution + stage values */ in TSTrajectoryMemorySet_AOF() 1599 if (tjsch->actx->nextcheckpointtype == 1) { in TSTrajectoryMemorySet_AOF() 1604 if (tjsch->actx->nextcheckpointtype == 0) { /* solution only */ in TSTrajectoryMemorySet_AOF() 1611 tjsch->actx->lastcheckpointstep = stepnum; in TSTrajectoryMemorySet_AOF() 1613 …allExternal(offline_ca, tjsch->actx->lastcheckpointstep, tjsch->actx->num_units_avail, tjsch->actx… in TSTrajectoryMemorySet_AOF() [all …]
|
| /petsc/src/ts/tests/ |
| H A D | ex6.c | 83 PetscErrorCode TSFunction(TS ts, PetscReal t, Vec U, Vec F, void *actx) in TSFunction() argument 85 AppCtx *ctx = (AppCtx *)actx; in TSFunction() 98 PetscErrorCode SNESFunction(SNES snes, Vec V, Vec F, void *actx) in SNESFunction() argument 100 AppCtx *ctx = (AppCtx *)actx; in SNESFunction()
|
| H A D | ex8.c | 98 PetscErrorCode TSFunctionRHS(TS ts, PetscReal t, Vec UV, Vec F, void *actx) in TSFunctionRHS() argument 100 AppCtx *ctx = (AppCtx *)actx; in TSFunctionRHS() 111 PetscErrorCode TSFunctionI(TS ts, PetscReal t, Vec UV, Vec UVdot, Vec F, void *actx) in TSFunctionI() argument 113 AppCtx *ctx = (AppCtx *)actx; in TSFunctionI()
|
| H A D | ex10.c | 93 PetscErrorCode TSDAESimple_Reduced_TSFunction(TS ts, PetscReal t, Vec U, Vec F, void *actx) in TSDAESimple_Reduced_TSFunction() argument 95 TSDAESimple tsdae = (TSDAESimple)actx; in TSDAESimple_Reduced_TSFunction() 110 PetscErrorCode TSDAESimple_Reduced_SNESFunction(SNES snes, Vec V, Vec F, void *actx) in TSDAESimple_Reduced_SNESFunction() argument 112 TSDAESimple tsdae = (TSDAESimple)actx; in TSDAESimple_Reduced_SNESFunction() 197 PetscErrorCode TSDAESimple_Full_TSRHSFunction(TS ts, PetscReal t, Vec UV, Vec F, void *actx) in TSDAESimple_Full_TSRHSFunction() argument 199 TSDAESimple tsdae = (TSDAESimple)actx; in TSDAESimple_Full_TSRHSFunction() 221 …tscErrorCode TSDAESimple_Full_TSIFunction(TS ts, PetscReal t, Vec UV, Vec UVdot, Vec F, void *actx) in TSDAESimple_Full_TSIFunction() argument 223 TSDAESimple tsdae = (TSDAESimple)actx; in TSDAESimple_Full_TSIFunction()
|
| H A D | ex9.c | 100 PetscErrorCode TSFunctionRHS(TS ts, PetscReal t, Vec UV, Vec F, void *actx) in TSFunctionRHS() argument 102 AppCtx *ctx = (AppCtx *)actx; in TSFunctionRHS() 120 PetscErrorCode TSFunctionI(TS ts, PetscReal t, Vec UV, Vec UVdot, Vec F, void *actx) in TSFunctionI() argument 122 AppCtx *ctx = (AppCtx *)actx; in TSFunctionI()
|
| H A D | ex7.c | 127 PetscErrorCode TSFunction(TS ts, PetscReal t, Vec U, Vec F, void *actx) in TSFunction() argument 129 AppCtx *ctx = (AppCtx *)actx; in TSFunction() 146 PetscErrorCode SNESFunction(SNES snes, Vec V, Vec F, void *actx) in SNESFunction() argument 148 AppCtx *ctx = (AppCtx *)actx; in SNESFunction()
|
| /petsc/src/mat/impls/cdiagonal/ |
| H A D | cdiagonal.c | 101 Mat_ConstantDiagonal *actx = (Mat_ConstantDiagonal *)A->data; in MatDuplicate_ConstantDiagonal() local 112 bctx->diag = actx->diag; in MatDuplicate_ConstantDiagonal() 414 …Mat_ConstantDiagonal *actx = (Mat_ConstantDiagonal *)A->data, *fctx = (Mat_ConstantDiagonal *)fact… in MatFactorNumeric_ConstantDiagonal() local 417 if (actx->diag == 0.0) fact->factorerrortype = MAT_FACTOR_NUMERIC_ZEROPIVOT; in MatFactorNumeric_ConstantDiagonal() 419 fctx->diag = 1.0 / actx->diag; in MatFactorNumeric_ConstantDiagonal()
|
| /petsc/src/ts/utils/dmplexlandau/tutorials/ |
| H A D | ex1.c | 81 …n(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nf_dummy, PetscScalar *u, void *actx) in maxwellian() argument 83 MaxwellianCtx *mctx = (MaxwellianCtx *)actx; in maxwellian() 206 PetscErrorCode Monitor_nrl(TS ts, PetscInt stepi, PetscReal time, Vec X, void *actx) in Monitor_nrl() argument 209 LandauCtx *ctx = (LandauCtx *)actx; /* user-defined application context */ in Monitor_nrl() 222 PetscErrorCode Monitor(TS ts, PetscInt stepi, PetscReal time, Vec X, void *actx) in Monitor() argument 224 LandauCtx *ctx = (LandauCtx *)actx; /* user-defined application context */ in Monitor()
|
| H A D | ex2.c | 410 static PetscErrorCode Monitor(TS ts, PetscInt stepi, PetscReal time, Vec X, void *actx) in Monitor() argument 412 LandauCtx *ctx = (LandauCtx *)actx; /* user-defined application context */ in Monitor()
|
| /petsc/src/dm/dt/dualspace/impls/lagrange/tutorials/ |
| H A D | ex2.c | 5 …(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nf_unused, PetscScalar *u, void *actx) in x() argument
|
| /petsc/src/mat/impls/diagonal/ |
| H A D | diagonal.c | 121 Mat_Diagonal *actx = (Mat_Diagonal *)A->data; in MatDuplicate_Diagonal() local 135 PetscCall(VecCopy(actx->diag, bctx->diag)); in MatDuplicate_Diagonal() 136 PetscCall(VecCopy(actx->inv_diag, bctx->inv_diag)); in MatDuplicate_Diagonal() 137 bctx->diag_valid = actx->diag_valid; in MatDuplicate_Diagonal() 138 bctx->inv_diag_valid = actx->inv_diag_valid; in MatDuplicate_Diagonal()
|
| /petsc/src/ts/utils/dmplexlandau/ |
| H A D | plexland.c | 44 …f(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nf_dummy, PetscScalar *u, void *actx) in energy_f() argument 57 …f(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nf_dummy, PetscScalar *u, void *actx) in gamma_m1_f() argument 59 PetscReal *c2_0_arr = ((PetscReal *)actx); in gamma_m1_f() 802 …n(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nf_dummy, PetscScalar *u, void *actx) in maxwellian() argument 804 MaxwellianCtx *mctx = (MaxwellianCtx *)actx; in maxwellian() 849 …ime, PetscReal temps[], PetscReal ns[], PetscInt grid, PetscInt b_id, PetscInt n_batch, void *actx) in DMPlexLandauAddMaxwellians() argument 851 LandauCtx *ctx = (LandauCtx *)actx; in DMPlexLandauAddMaxwellians() 892 …LandauSetInitialCondition(DM dm, Vec X, PetscInt grid, PetscInt b_id, PetscInt n_batch, void *actx) in LandauSetInitialCondition() argument 894 LandauCtx *ctx = (LandauCtx *)actx; in LandauSetInitialCondition() 2338 …mma_n_f(PetscInt dim, PetscReal time, const PetscReal x[], PetscInt Nf, PetscScalar *u, void *actx) in gamma_n_f() argument [all …]
|
| /petsc/src/ts/tutorials/ |
| H A D | ex30.c | 1920 AdaptCtx *actx = (AdaptCtx *)vctx; in ResizeTransfer() local 1929 …PetscCheck(actx->adaptLabel, PetscObjectComm((PetscObject)ts), PETSC_ERR_ARG_WRONGSTATE, "Missing … in ResizeTransfer() 1930 PetscCall(DMAdaptLabel(dm, actx->adaptLabel, &adm)); in ResizeTransfer() 1933 PetscCall(DMLabelDestroy(&actx->adaptLabel)); in ResizeTransfer() 2246 AdaptCtx *actx; in Run() local 2315 PetscCall(PetscNew(&actx)); in Run() 2316 if (ctx->amr) PetscCall(TSSetResize(ts, PETSC_TRUE, ResizeSetUp, ResizeTransfer, actx)); in Run() 2357 PetscCall(VecTaggerDestroy(&actx->refineTag)); in Run() 2358 PetscCall(PetscFree(actx)); in Run()
|
| H A D | ex48.c | 296 static PetscErrorCode Monitor(TS ts, PetscInt stepi, PetscReal time, Vec X, void *actx) in Monitor() argument 298 AppCtx *ctx = (AppCtx *)actx; /* user-defined application context */ in Monitor()
|