| /petsc/src/tao/unconstrained/tutorials/ |
| H A D | minsurf1.c | 205 f1 = PetscSqrtScalar(1.0 + d1 * d1 + d7 * d7); in FormFunctionGradient() 206 f2 = PetscSqrtScalar(1.0 + d1 * d1 + d4 * d4); in FormFunctionGradient() 207 f3 = PetscSqrtScalar(1.0 + d3 * d3 + d8 * d8); in FormFunctionGradient() 208 f4 = PetscSqrtScalar(1.0 + d3 * d3 + d2 * d2); in FormFunctionGradient() 209 f5 = PetscSqrtScalar(1.0 + d2 * d2 + d5 * d5); in FormFunctionGradient() 210 f6 = PetscSqrtScalar(1.0 + d4 * d4 + d6 * d6); in FormFunctionGradient() 228 ft = ft + PetscSqrtScalar(1.0 + d3 * d3 + d2 * d2); in FormFunctionGradient() 234 ft = ft + PetscSqrtScalar(1.0 + d3 * d3 + d2 * d2); in FormFunctionGradient() 240 ft = ft + PetscSqrtScalar(1.0 + d1 * d1 + d4 * d4); in FormFunctionGradient() 246 ft = ft + PetscSqrtScalar(1.0 + d1 * d1 + d4 * d4); in FormFunctionGradient() [all …]
|
| /petsc/src/tao/complementarity/tutorials/ |
| H A D | minsurf1.c | 219 f1 = PetscSqrtScalar(1.0 + d1 * d1 + d7 * d7); in FormConstraints() 220 f2 = PetscSqrtScalar(1.0 + d1 * d1 + d4 * d4); in FormConstraints() 221 f3 = PetscSqrtScalar(1.0 + d3 * d3 + d8 * d8); in FormConstraints() 222 f4 = PetscSqrtScalar(1.0 + d3 * d3 + d2 * d2); in FormConstraints() 223 f5 = PetscSqrtScalar(1.0 + d2 * d2 + d5 * d5); in FormConstraints() 224 f6 = PetscSqrtScalar(1.0 + d4 * d4 + d6 * d6); in FormConstraints() 328 f1 = PetscSqrtScalar(1.0 + d1 * d1 + d7 * d7); in FormJacobian() 329 f2 = PetscSqrtScalar(1.0 + d1 * d1 + d4 * d4); in FormJacobian() 330 f3 = PetscSqrtScalar(1.0 + d3 * d3 + d8 * d8); in FormJacobian() 331 f4 = PetscSqrtScalar(1.0 + d3 * d3 + d2 * d2); in FormJacobian() [all …]
|
| /petsc/src/snes/tutorials/ |
| H A D | ex25.c | 88 coeffup = 1.0 / PetscSqrtScalar(1.0 + gradup * gradup + gradx * gradx); in FormFunctionLocal() 89 coeffdown = 1.0 / PetscSqrtScalar(1.0 + graddown * graddown + gradx * gradx); in FormFunctionLocal() 91 coeffleft = 1.0 / PetscSqrtScalar(1.0 + gradleft * gradleft + grady * grady); in FormFunctionLocal() 92 coeffright = 1.0 / PetscSqrtScalar(1.0 + gradright * gradright + grady * grady); in FormFunctionLocal()
|
| H A D | ex58.c | 231 f1 = PetscSqrtScalar(1.0 + d1 * d1 + d7 * d7); in FormGradient() 232 f2 = PetscSqrtScalar(1.0 + d1 * d1 + d4 * d4); in FormGradient() 233 f3 = PetscSqrtScalar(1.0 + d3 * d3 + d8 * d8); in FormGradient() 234 f4 = PetscSqrtScalar(1.0 + d3 * d3 + d2 * d2); in FormGradient() 235 f5 = PetscSqrtScalar(1.0 + d2 * d2 + d5 * d5); in FormGradient() 236 f6 = PetscSqrtScalar(1.0 + d4 * d4 + d6 * d6); in FormGradient() 353 f1 = PetscSqrtScalar(1.0 + d1 * d1 + d7 * d7); in FormJacobian() 354 f2 = PetscSqrtScalar(1.0 + d1 * d1 + d4 * d4); in FormJacobian() 355 f3 = PetscSqrtScalar(1.0 + d3 * d3 + d8 * d8); in FormJacobian() 356 f4 = PetscSqrtScalar(1.0 + d3 * d3 + d2 * d2); in FormJacobian() [all …]
|
| H A D | ex4.c | 158 f2 = PetscSqrtScalar(1.0 + d1 * d1 + d4 * d4); in FormObjectiveLocal() 159 f4 = PetscSqrtScalar(1.0 + d3 * d3 + d2 * d2); in FormObjectiveLocal() 280 f1 = PetscSqrtScalar(1.0 + d1 * d1 + d7 * d7); in FormFunctionLocal() 281 f2 = PetscSqrtScalar(1.0 + d1 * d1 + d4 * d4); in FormFunctionLocal() 282 f3 = PetscSqrtScalar(1.0 + d3 * d3 + d8 * d8); in FormFunctionLocal() 283 f4 = PetscSqrtScalar(1.0 + d3 * d3 + d2 * d2); in FormFunctionLocal() 284 f5 = PetscSqrtScalar(1.0 + d2 * d2 + d5 * d5); in FormFunctionLocal() 285 f6 = PetscSqrtScalar(1.0 + d4 * d4 + d6 * d6); in FormFunctionLocal() 364 f1 = PetscSqrtScalar(1.0 + d1 * d1 + d7 * d7); in FormJacobianLocal() 365 f2 = PetscSqrtScalar(1.0 + d1 * d1 + d4 * d4); in FormJacobianLocal() [all …]
|
| H A D | ex46.c | 150 …f[j][i] = D * (uxx + uyy) - (K * funcA(x[j][i], user) * PetscSqrtScalar(ux * ux + uy * uy) + funcU… in FormFunctionLocal() 201 normGradZ = PetscRealPart(PetscSqrtScalar(ux * ux + uy * uy)); in FormJacobianLocal()
|
| /petsc/src/ts/tutorials/ |
| H A D | ex11.h | 25 #undef PetscSqrtScalar 26 #define PetscSqrtScalar(x) sqrt(x) macro 434 cl = PetscSqrtScalar(*gaml * *pl / *rl); in riem1mdt() 435 cr = PetscSqrtScalar(*gamr * *pr / *rr); in riem1mdt() 443 skpr1 = cr * (pst - 1.) * PetscSqrtScalar(2. / (*gamr * (*gamr - 1. + (*gamr + 1.) * pst))); in riem1mdt() 447 skpr2 = cl * (pst - 1.) * PetscSqrtScalar(2. / (*gaml * (*gaml - 1. + (*gaml + 1.) * pst))); in riem1mdt() 476 cstarl = PetscSqrtScalar(*gaml * *pstar / *rstarl); in riem1mdt() 482 cstarr = PetscSqrtScalar(*gamr * *pstar / *rstarr); in riem1mdt() 500 …ustarl = *uxl - (pst - 1.) * cl * PetscSqrtScalar(2. / (*gaml * (*gaml - 1. + (*gaml + 1.) * pst)… in riem1mdt() 501 …zl = *pl / cl * PetscSqrtScalar(*gaml * 2. * (*gaml - 1. + (*gaml + 1.) * pst)) * (*gaml - 1.… in riem1mdt() [all …]
|
| H A D | ex9.c | 829 …ubar = (uL[1] / PetscSqrtScalar(uL[0]) + uR[1] / PetscSqrtScalar(uR[0])) / (PetscSqrtScalar(uL[0])… in PhysicsRiemann_IsoGas_Roe() 884 fl = (L.rho < rho) ? (rho - L.rho) / PetscSqrtScalar(L.rho * rho) /* shock */ in PhysicsRiemann_IsoGas_Exact() 886 fr = (R.rho < rho) ? (rho - R.rho) / PetscSqrtScalar(R.rho * rho) /* shock */ in PhysicsRiemann_IsoGas_Exact() 895 …dfl = (L.rho < rho) ? 1 / PetscSqrtScalar(L.rho * rho) * (1 - 0.5 * (rho - L.rho) / rho) : 1 / rho; in PhysicsRiemann_IsoGas_Exact() 896 …dfr = (R.rho < rho) ? 1 / PetscSqrtScalar(R.rho * rho) * (1 - 0.5 * (rho - R.rho) / rho) : 1 / rho; in PhysicsRiemann_IsoGas_Exact() 1023 cL = PetscSqrtScalar(g * L.h); in PhysicsRiemann_Shallow_Exact() 1024 cR = PetscSqrtScalar(g * R.h); in PhysicsRiemann_Shallow_Exact() 1033 … fl = (L.h < h) ? PetscSqrtScalar(0.5 * g * (h * h - L.h * L.h) * (1 / L.h - 1 / h)) /* shock */ in PhysicsRiemann_Shallow_Exact() 1034 … : 2 * PetscSqrtScalar(g * h) - 2 * PetscSqrtScalar(g * L.h); /* rarefaction */ in PhysicsRiemann_Shallow_Exact() 1035 … fr = (R.h < h) ? PetscSqrtScalar(0.5 * g * (h * h - R.h * R.h) * (1 / R.h - 1 / h)) /* shock */ in PhysicsRiemann_Shallow_Exact() [all …]
|
| /petsc/src/tao/bound/tutorials/ |
| H A D | plate2.c | 296 f1 = PetscSqrtScalar(1.0 + d1 * d1 + d7 * d7); in FormFunctionGradient() 297 f2 = PetscSqrtScalar(1.0 + d1 * d1 + d4 * d4); in FormFunctionGradient() 298 f3 = PetscSqrtScalar(1.0 + d3 * d3 + d8 * d8); in FormFunctionGradient() 299 f4 = PetscSqrtScalar(1.0 + d3 * d3 + d2 * d2); in FormFunctionGradient() 300 f5 = PetscSqrtScalar(1.0 + d2 * d2 + d5 * d5); in FormFunctionGradient() 301 f6 = PetscSqrtScalar(1.0 + d4 * d4 + d6 * d6); in FormFunctionGradient() 321 ft = ft + PetscSqrtScalar(1.0 + d3 * d3 + d2 * d2); in FormFunctionGradient() 328 ft = ft + PetscSqrtScalar(1.0 + d3 * d3 + d2 * d2); in FormFunctionGradient() 336 ft = ft + PetscSqrtScalar(1.0 + d1 * d1 + d4 * d4); in FormFunctionGradient() 343 ft = ft + PetscSqrtScalar(1.0 + d1 * d1 + d4 * d4); in FormFunctionGradient() [all …]
|
| /petsc/src/ts/tutorials/multirate/ |
| H A D | ex3.c | 67 u[0] = PetscSqrtScalar(1.0 + PetscCosScalar(t)); in sol_true() 68 u[1] = PetscSqrtScalar(2.0 + PetscCosScalar(5.0 * t)); in sol_true() 119 u[0] = PetscSqrtScalar(2.0); in main() 120 u[1] = PetscSqrtScalar(3.0); in main()
|
| H A D | ex3fastslowsplit.c | 97 u[0] = PetscSqrtScalar(1.0 + PetscCosScalar(t)); in sol_true() 98 u[1] = PetscSqrtScalar(2.0 + PetscCosScalar(5.0 * t)); in sol_true() 160 u[0] = PetscSqrtScalar(2.0); in main() 161 u[1] = PetscSqrtScalar(3.0); in main()
|
| H A D | ex4.c | 170 cL = PetscSqrtScalar(g * L.h); in PhysicsRiemann_Shallow_Exact() 171 cR = PetscSqrtScalar(g * R.h); in PhysicsRiemann_Shallow_Exact() 180 … fl = (L.h < h) ? PetscSqrtScalar(0.5 * g * (h * h - L.h * L.h) * (1 / L.h - 1 / h)) /* shock */ in PhysicsRiemann_Shallow_Exact() 181 … : 2 * PetscSqrtScalar(g * h) - 2 * PetscSqrtScalar(g * L.h); /* rarefaction */ in PhysicsRiemann_Shallow_Exact() 182 … fr = (R.h < h) ? PetscSqrtScalar(0.5 * g * (h * h - R.h * R.h) * (1 / R.h - 1 / h)) /* shock */ in PhysicsRiemann_Shallow_Exact() 183 … : 2 * PetscSqrtScalar(g * h) - 2 * PetscSqrtScalar(g * R.h); /* rarefaction */ in PhysicsRiemann_Shallow_Exact() 197 …(L.h < h) ? 0.5 / fl * 0.5 * g * (-L.h * L.h / (h * h) - 1 + 2 * h / L.h) : PetscSqrtScalar(g / h); in PhysicsRiemann_Shallow_Exact() 198 …(R.h < h) ? 0.5 / fr * 0.5 * g * (-R.h * R.h / (h * h) - 1 + 2 * h / R.h) : PetscSqrtScalar(g / h); in PhysicsRiemann_Shallow_Exact() 207 cstar = PetscSqrtScalar(g * star.h); in PhysicsRiemann_Shallow_Exact() 211 ufan[1] = PetscSqrtScalar(g * ufan[0]) * ufan[0]; in PhysicsRiemann_Shallow_Exact() [all …]
|
| /petsc/src/snes/interface/noise/ |
| H A D | snesdnest.c | 181 stdv = scale * PetscSqrtScalar(stdv / (*nf - j)); in SNESNoise_dnest_() 222 *hopt = PetscSqrtScalar(*fnoise / PetscAbsScalar(*fder2)) * 1.68; in SNESNoise_dnest_() 242 *hopt = PetscSqrtScalar(*fnoise / PetscAbsScalar(*fder2)) * 1.68; in SNESNoise_dnest_()
|
| /petsc/src/snes/impls/vi/ss/ |
| H A D | vissimpl.h | 10 #define PetscScalarNorm(a, b) (PetscSqrtScalar((a) * (a) + (b) * (b)))
|
| /petsc/src/dm/tests/ |
| H A D | ex50.c | 18 mxyz[0] = x * PetscSqrtScalar(1.0 - y2 / 2.0 - z2 / 2.0 + y2 * z2 / 3.0); in MapPoint() 19 mxyz[1] = y * PetscSqrtScalar(1.0 - z2 / 2.0 - x2 / 2.0 + z2 * x2 / 3.0); in MapPoint() 20 mxyz[2] = z * PetscSqrtScalar(1.0 - x2 / 2.0 - y2 / 2.0 + x2 * y2 / 3.0); in MapPoint()
|
| /petsc/src/ksp/ksp/impls/symmlq/ |
| H A D | symmlq.c | 72 dp = PetscSqrtScalar(dp); in KSPSolve_SYMMLQ() 142 beta = PetscSqrtScalar(dp); /* beta = sqrt(dp); */ in KSPSolve_SYMMLQ() 150 rho1 = PetscSqrtScalar(rho0 * rho0 + beta * beta); /* gamma */ in KSPSolve_SYMMLQ()
|
| /petsc/src/tao/linesearch/impls/morethuente/ |
| H A D | morethuente.c | 390 gamma1 = s * PetscSqrtScalar(PetscPowScalar(theta / s, 2.0) - (*dx / s) * (*dp / s)); in Tao_mcstep() 413 gamma1 = s * PetscSqrtScalar(PetscPowScalar(theta / s, 2.0) - (*dx / s) * (*dp / s)); in Tao_mcstep() 442 …gamma1 = s * PetscSqrtScalar(PetscMax(0.0, PetscPowScalar(theta / s, 2.0) - (*dx / s) * (*dp / s))… in Tao_mcstep() 471 gamma1 = s * PetscSqrtScalar(PetscPowScalar(theta / s, 2.0) - (*dy / s) * (*dp / s)); in Tao_mcstep()
|
| /petsc/src/ksp/ksp/impls/tcqmr/ |
| H A D | tcqmr.c | 112 s = 1.0 / PetscSqrtScalar(1.0 + ta * ta); in KSPSolve_TCQMR() 116 c = 1.0 / PetscSqrtScalar(1.0 + ta * ta); in KSPSolve_TCQMR()
|
| /petsc/src/ts/tutorials/power_grid/stability_9bus/ |
| H A D | ex9bus.c | 163 Vm = PetscSqrtScalar(Vr * Vr + Vi * Vi); in EventFunction() 247 Vm = PetscSqrtScalar(Vr * Vr + Vi * Vi); in PostEventFunction() 371 Vm = PetscSqrtScalar(Vr * Vr + Vi * Vi); in SetInitialGuess() 507 Vm = PetscSqrtScalar(Vd * Vd + Vq * Vq); in ResidualFunction() 525 Vm = PetscSqrtScalar(Vr * Vr + Vi * Vi); in ResidualFunction() 527 …Vm0 = PetscSqrtScalar(v0[2 * lbus[i]] * v0[2 * lbus[i]] + v0[2 * lbus[i] + 1] * v0[2 * lbus[i] + 1… in ResidualFunction() 849 Vm = PetscSqrtScalar(Vd * Vd + Vq * Vq); in ResidualJacobian() 933 Vm = PetscSqrtScalar(Vr * Vr + Vi * Vi); in ResidualJacobian() 936 …Vm0 = PetscSqrtScalar(v0[2 * lbus[i]] * v0[2 * lbus[i]] + v0[2 * lbus[i] + 1] * v0[2 * lbus[i] + 1… in ResidualJacobian()
|
| H A D | ex9busadj.c | 145 Vm = PetscSqrtScalar(Vr * Vr + Vi * Vi); in SetInitialGuess() 280 Vm = PetscSqrtScalar(Vd * Vd + Vq * Vq); in ResidualFunction() 296 Vm = PetscSqrtScalar(Vr * Vr + Vi * Vi); in ResidualFunction() 298 …Vm0 = PetscSqrtScalar(v0[2 * lbus[i]] * v0[2 * lbus[i]] + v0[2 * lbus[i] + 1] * v0[2 * lbus[i] + 1… in ResidualFunction() 590 Vm = PetscSqrtScalar(Vd * Vd + Vq * Vq); in ResidualJacobian() 661 Vm = PetscSqrtScalar(Vr * Vr + Vi * Vi); in ResidualJacobian() 664 …Vm0 = PetscSqrtScalar(v0[2 * lbus[i]] * v0[2 * lbus[i]] + v0[2 * lbus[i] + 1] * v0[2 * lbus[i] + 1… in ResidualJacobian()
|
| H A D | ex9busoptfd.c | 147 Vm = PetscSqrtScalar(Vr * Vr + Vi * Vi); in SetInitialGuess() 281 Vm = PetscSqrtScalar(Vd * Vd + Vq * Vq); in ResidualFunction() 297 Vm = PetscSqrtScalar(Vr * Vr + Vi * Vi); in ResidualFunction() 299 …Vm0 = PetscSqrtScalar(v0[2 * lbus[i]] * v0[2 * lbus[i]] + v0[2 * lbus[i] + 1] * v0[2 * lbus[i] + 1… in ResidualFunction() 591 Vm = PetscSqrtScalar(Vd * Vd + Vq * Vq); in ResidualJacobian() 663 Vm = PetscSqrtScalar(Vr * Vr + Vi * Vi); in ResidualJacobian() 666 …Vm0 = PetscSqrtScalar(v0[2 * lbus[i]] * v0[2 * lbus[i]] + v0[2 * lbus[i] + 1] * v0[2 * lbus[i] + 1… in ResidualJacobian()
|
| H A D | ex9busdmnetwork.c | 405 Vm = PetscSqrtScalar(Vr * Vr + Vi * Vi); in SetInitialGuess() 680 Vm = PetscSqrtScalar(Vd * Vd + Vq * Vq); in FormIFunction() 710 Vm = PetscSqrtScalar(Vr * Vr + Vi * Vi); in FormIFunction() 712 Vm0 = PetscSqrtScalar(Vr0 * Vr0 + Vi0 * Vi0); in FormIFunction() 921 Vm = PetscSqrtScalar(Vr * Vr + Vi * Vi); in AlgFunction() 923 Vm0 = PetscSqrtScalar(Vr0 * Vr0 + Vi0 * Vi0); in AlgFunction()
|
| H A D | ex9busopt.c | 184 Vm = PetscSqrtScalar(Vr * Vr + Vi * Vi); in SetInitialGuess() 272 Vm = PetscSqrtScalar(Vr * Vr + Vi * Vi); in InitialGuess() 426 Vm = PetscSqrtScalar(Vd * Vd + Vq * Vq); in ResidualFunction() 442 Vm = PetscSqrtScalar(Vr * Vr + Vi * Vi); in ResidualFunction() 444 …Vm0 = PetscSqrtScalar(v0[2 * lbus[i]] * v0[2 * lbus[i]] + v0[2 * lbus[i] + 1] * v0[2 * lbus[i] + 1… in ResidualFunction() 734 Vm = PetscSqrtScalar(Vd * Vd + Vq * Vq); in ResidualJacobian() 805 Vm = PetscSqrtScalar(Vr * Vr + Vi * Vi); in ResidualJacobian() 808 …Vm0 = PetscSqrtScalar(v0[2 * lbus[i]] * v0[2 * lbus[i]] + v0[2 * lbus[i] + 1] * v0[2 * lbus[i] + 1… in ResidualJacobian()
|
| /petsc/src/ksp/ksp/utils/lmvm/tests/ |
| H A D | ex2.c | 51 PetscScalar i = PetscSqrtScalar(-1.0); in main()
|
| /petsc/src/tao/leastsquares/impls/pounders/ |
| H A D | gqt.c | 280 if (par <= pars && paru > 0) par = PetscMax(p001, PetscSqrtScalar(parl / paru)) * paru; in gqt() 325 alpha = temp / (PetscAbs(prod) + PetscSqrtScalar(prod * prod + temp / delta)); in gqt()
|