Home
last modified time | relevance | path

Searched refs:grad (Results 1 – 25 of 31) sorted by relevance

12

/petsc/src/dm/dt/tests/
H A Dex11.c9 PetscScalar *dx, *grad; in main() local
21 PetscCall(PetscMalloc2(dim * numFaces, &dx, dim * numFaces, &grad)); in main()
27 PetscCall(PetscFVComputeGradient(fvm, numFaces, dx, grad)); in main()
30 PetscCall(PetscFree2(dx, grad)); in main()
/petsc/src/dm/impls/plex/
H A Dplexfvm.c56 …etscFV fvm, PetscInt fStart, PetscInt fEnd, Vec faceGeometry, Vec cellGeometry, Vec locX, Vec grad) in DMPlexReconstructGradients_Internal() argument
81 PetscCall(VecGetDM(grad, &dmGrad)); in DMPlexReconstructGradients_Internal()
82 PetscCall(VecZeroEntries(grad)); in DMPlexReconstructGradients_Internal()
83 PetscCall(VecGetArray(grad, &gr)); in DMPlexReconstructGradients_Internal()
113 if (cgrad[0]) cgrad[0][pd * dim + d] += fg->grad[0][d] * delta; in DMPlexReconstructGradients_Internal()
114 if (cgrad[1]) cgrad[1][pd * dim + d] -= fg->grad[1][d] * delta; in DMPlexReconstructGradients_Internal()
154 PetscCall(VecRestoreArray(grad, &gr)); in DMPlexReconstructGradients_Internal()
172 PetscErrorCode DMPlexReconstructGradientsFVM(DM dm, Vec locX, Vec grad) in DMPlexReconstructGradientsFVM() argument
203 …econstructGradients_Internal(dm, fvm, fStart, fEnd, faceGeometryFVM, cellGeometryFVM, locX, grad)); in DMPlexReconstructGradientsFVM()
/petsc/src/tao/unconstrained/tutorials/
H A Dburgers_spectral.c58 Vec grad; member
69 Mat grad; member
191 PetscCall(DMCreateMatrix(appctx.da, &appctx.SEMop.grad)); in main()
198 …PetscCall(RHSMatrixAdvectiongllDM(appctx.ts, 0.0, u, appctx.SEMop.grad, appctx.SEMop.grad, &appctx… in main()
215 PetscCall(MatSetNullSpace(appctx.SEMop.grad, nsp)); in main()
216 PetscCall(MatNullSpaceTest(nsp, appctx.SEMop.grad, NULL)); in main()
259 PetscCall(MatDestroy(&appctx.SEMop.grad)); in main()
370 PetscCall(MatMult(appctx->SEMop.grad, globalin, globalout)); /* grad u */ in RHSFunction()
393 PetscCall(MatCopy(appctx->SEMop.grad, A, SAME_NONZERO_PATTERN)); in RHSJacobian()
398 PetscCall(MatMult(appctx->SEMop.grad, globalin, Gglobalin)); in RHSJacobian()
H A Dspectraladjointassimilation.c65 Vec grad; member
616 Vec temp, grad; in MonitorError() local
627 PetscCall(TaoGetGradient(tao, &grad, NULL, NULL)); in MonitorError()
/petsc/src/ts/tutorials/
H A Dex50.c61 Mat grad; member
173 PetscCall(DMCreateMatrix(appctx.da, &appctx.SEMop.grad)); in main()
180 …AdvectiongllDM(appctx.ts, 0.0, appctx.dat.curr_sol, appctx.SEMop.grad, appctx.SEMop.grad, &appctx)… in main()
197 PetscCall(MatSetNullSpace(appctx.SEMop.grad, nsp)); in main()
198 PetscCall(MatNullSpaceTest(nsp, appctx.SEMop.grad, NULL)); in main()
228 PetscCall(MatDestroy(&appctx.SEMop.grad)); in main()
279 PetscCall(MatMult(appctx->SEMop.grad, globalin, globalout)); /* grad u */ in RHSFunction()
302 PetscCall(MatCopy(appctx->SEMop.grad, A, SAME_NONZERO_PATTERN)); in RHSJacobian()
307 PetscCall(MatMult(appctx->SEMop.grad, globalin, Gglobalin)); in RHSJacobian()
H A Dex11.c704 …cReal volume, PetscInt numComps, const PetscScalar u[], const PetscScalar grad[], PetscReal *error… in ErrorIndicator_Simple() argument
711 for (j = 0; j < dim; j++) err += PetscSqr(PetscRealPart(grad[i * dim + j])); in ErrorIndicator_Simple()
1113 Vec grad, locGrad, locX, errVec; in adaptToleranceFVMSetUp() local
1136 PetscCall(DMCreateGlobalVector(gradDM, &grad)); in adaptToleranceFVMSetUp()
1137 PetscCall(DMPlexReconstructGradientsFVM(plex, locX, grad)); in adaptToleranceFVMSetUp()
1139 PetscCall(DMGlobalToLocalBegin(gradDM, grad, INSERT_VALUES, locGrad)); in adaptToleranceFVMSetUp()
1140 PetscCall(DMGlobalToLocalEnd(gradDM, grad, INSERT_VALUES, locGrad)); in adaptToleranceFVMSetUp()
1141 PetscCall(VecDestroy(&grad)); in adaptToleranceFVMSetUp()
/petsc/include/
H A Dpetscfvtypes.h42 PetscScalar grad[2][3]; /* Face contribution to gradient in left and right cell */ member
/petsc/src/tao/bound/impls/blmvm/
H A Dblmvm.h23 PetscInt grad; member
H A Dblmvm.c33 blmP->grad = 0; in TaoSolve_BLMVM()
63 ++blmP->grad; in TaoSolve_BLMVM()
177 PetscCall(PetscViewerASCIIPrintf(viewer, "Gradient steps: %" PetscInt_FMT "\n", lmP->grad)); in TaoView_BLMVM()
/petsc/src/snes/tutorials/
H A Dex16.c62 PetscScalar grad[3 * NVALS]; variable
296 TensorVector(invJ, &grad[3 * bidx], lgrad); in DeformationGradient()
319 TensorVector(invJ, &grad[3 * bidx], lgrad); in DeformationGradientJacobian()
404 grad[3 * idx + 0] = dbx * by * bz; in FormElements()
405 grad[3 * idx + 1] = dby * bx * bz; in FormElements()
406 grad[3 * idx + 2] = dbz * bx * by; in FormElements()
447 J[0] += grad[3 * bidx + 0] * ec[idx][0]; in QuadraturePointGeometricJacobian()
448 J[1] += grad[3 * bidx + 1] * ec[idx][0]; in QuadraturePointGeometricJacobian()
449 J[2] += grad[3 * bidx + 2] * ec[idx][0]; in QuadraturePointGeometricJacobian()
450 J[3] += grad[3 * bidx + 0] * ec[idx][1]; in QuadraturePointGeometricJacobian()
[all …]
/petsc/src/tao/unconstrained/impls/lmvm/
H A Dlmvm.h21 PetscInt grad; member
H A Dlmvm.c33 lmP->grad = 0; in TaoSolve_LMVM()
123 ++lmP->grad; in TaoSolve_LMVM()
207 PetscCall(PetscViewerASCIIPrintf(viewer, "Gradient steps: %" PetscInt_FMT "\n", lm->grad)); in TaoView_LMVM()
210 recycled_its = lm->bfgs + lm->grad; in TaoView_LMVM()
/petsc/src/tao/unconstrained/impls/owlqn/
H A Dowlqn.h23 PetscInt grad; member
H A Dowlqn.c84 lmP->grad = 0; in TaoSolve_OWLQN()
108 ++lmP->grad; in TaoSolve_OWLQN()
181 ++lmP->grad; in TaoSolve_OWLQN()
281 PetscCall(PetscViewerASCIIPrintf(viewer, "Gradient steps: %" PetscInt_FMT "\n", lm->grad)); in TaoView_OWLQN()
/petsc/src/dm/impls/swarm/tests/
H A Dex2.c493 PetscScalar *grad = &gradsum[coordDim * numComponents]; in InterpolateGradient() local
504 PetscCall(PetscArrayzero(grad, coordDim * numComponents)); in InterpolateGradient()
521 …for (d = 0; d < coordDim; ++d) grad[fc * coordDim + d] += interpolant[fc * dim + d] * wt * fegeom.… in InterpolateGradient()
528 for (d = 0; d < coordDim; ++d) gradsum[fc * coordDim + d] += grad[fc * coordDim + d]; in InterpolateGradient()
535 … PetscCall(PetscPrintf(PETSC_COMM_SELF, "%g", (double)PetscRealPart(grad[fc * coordDim + d]))); in InterpolateGradient()
554 Vec f, rhs, fhat, grad; /* Particle field f, \int phi_i f, FEM field */ in TestFieldGradientProjection() local
565 PetscCall(DMGetGlobalVector(dm, &grad)); in TestFieldGradientProjection()
582 PetscCall(InterpolateGradient(dm, fhat, grad)); in TestFieldGradientProjection()
587 PetscCall(KSPSolve(ksp, rhs, grad)); in TestFieldGradientProjection()
593 PetscCall(computeFEMMoments(dm, grad, fmoments, user)); in TestFieldGradientProjection()
[all …]
H A Dex11.c9 PetscBool grad; // Test gradient projection member
62 options->grad = PETSC_FALSE; in ProcessOptions()
71 …scOptionsBool("-grad", "Test gradient projection", __FILE__, options->grad, &options->grad, NULL)); in ProcessOptions()
398 if (user.grad) { in main()
/petsc/src/tao/unconstrained/impls/ntl/
H A Dntl.c222 tl->grad = 0; in TaoSolve_NTL()
427 ++tl->grad; in TaoSolve_NTL()
449 ++tl->grad; in TaoSolve_NTL()
455 ++tl->grad; in TaoSolve_NTL()
492 ++tl->grad; in TaoSolve_NTL()
509 ++tl->grad; in TaoSolve_NTL()
515 ++tl->grad; in TaoSolve_NTL()
534 ++tl->grad; in TaoSolve_NTL()
695 … PetscCall(PetscViewerASCIIPrintf(viewer, "Gradient search steps: %" PetscInt_FMT "\n", tl->grad)); in TaoView_NTL()
H A Dntlimpl.h117 PetscInt grad; /* Gradient directions attempted */ member
/petsc/src/dm/dt/fv/interface/
H A Dfv.c1700 …orCode PetscFVComputeGradient(PetscFV fvm, PetscInt numFaces, PetscScalar dx[], PetscScalar grad[]) in PetscFVComputeGradient() argument
1704 PetscTryTypeMethod(fvm, computegradient, numFaces, dx, grad); in PetscFVComputeGradient()
1891 …FVComputeGradient_Upwind(PetscFV fv, PetscInt numFaces, const PetscScalar dx[], PetscScalar grad[]) in PetscFVComputeGradient_Upwind() argument
1898 for (PetscInt d = 0; d < dim; ++d) grad[f * dim + d] = 0.; in PetscFVComputeGradient_Upwind()
2110 PetscReal grad[2] = {0, 0};
2130 grad[0] += fg->grad[!i][0] * du;
2131 grad[1] += fg->grad[!i][1] * du;
2134 PetscCall(PetscPrintf(PETSC_COMM_SELF, "cell[%d] grad (%g, %g)\n", cell, grad[0], grad[1]));
2151 …teGradient_LeastSquares(PetscFV fvm, PetscInt numFaces, const PetscScalar dx[], PetscScalar grad[]) in PetscFVComputeGradient_LeastSquares() argument
2173 for (d = 0; d < dim; ++d) grad[f * dim + d] = ls->Binv[d + maxmn * f]; in PetscFVComputeGradient_LeastSquares()
[all …]
/petsc/src/tao/unconstrained/impls/nls/
H A Dnls.c248 nlsP->grad = 0; in TaoSolve_NLS()
365 ++nlsP->grad; in TaoSolve_NLS()
387 ++nlsP->grad; in TaoSolve_NLS()
393 ++nlsP->grad; in TaoSolve_NLS()
467 ++nlsP->grad; in TaoSolve_NLS()
483 ++nlsP->grad; in TaoSolve_NLS()
488 ++nlsP->grad; in TaoSolve_NLS()
507 ++nlsP->grad; in TaoSolve_NLS()
799 PetscCall(PetscViewerASCIIPrintf(viewer, "Gradient steps: %" PetscInt_FMT "\n", nlsP->grad)); in TaoView_NLS()
H A Dnlsimpl.h160 PetscInt grad; /* Gradient directions attempted */ member
/petsc/src/tao/interface/ftn-custom/
H A Dztaosolverf.c48 PetscFortranCallbackId grad; member
79 …PetscObjectUseFortranCallback(tao, _cb.grad, (Tao *, Vec *, Vec *, void *, PetscErrorCode *), (&ta… in ourtaogradientroutine()
176 …*ierr = PetscObjectSetFortranCallback((PetscObject)*tao, PETSC_FORTRAN_CALLBACK_CLASS, &_cb.grad, … in taosetgradient_()
/petsc/src/tao/bound/impls/bnk/
H A Dbnk.h189 PetscInt grad; /* Gradient directions attempted */ member
/petsc/src/dm/impls/plex/tests/
H A Dex3.c602 Vec cellgeom, grad, locGrad; in TestFVGrad() local
650 PetscCall(DMGetGlobalVector(dmgrad, &grad)); in TestFVGrad()
679 PetscCall(DMPlexReconstructGradientsFVM(dmfv, locX, grad)); in TestFVGrad()
680 PetscCall(DMGlobalToLocalBegin(dmgrad, grad, INSERT_VALUES, locGrad)); in TestFVGrad()
681 PetscCall(DMGlobalToLocalEnd(dmgrad, grad, INSERT_VALUES, locGrad)); in TestFVGrad()
718 PetscCall(DMRestoreGlobalVector(dmgrad, &grad)); in TestFVGrad()
/petsc/src/snes/utils/dm/
H A Ddmadapt.c738 Vec grad; in DMAdaptorPreAdapt() local
755 PetscCall(DMCreateGlobalVector(adaptor->gradDM, &grad)); in DMAdaptorPreAdapt()
756 PetscCall(DMPlexReconstructGradientsFVM(plex, locX, grad)); in DMAdaptorPreAdapt()
758 PetscCall(DMGlobalToLocalBegin(adaptor->gradDM, grad, INSERT_VALUES, adaptor->cellGrad)); in DMAdaptorPreAdapt()
759 PetscCall(DMGlobalToLocalEnd(adaptor->gradDM, grad, INSERT_VALUES, adaptor->cellGrad)); in DMAdaptorPreAdapt()
760 PetscCall(VecDestroy(&grad)); in DMAdaptorPreAdapt()

12