| /petsc/src/ts/tutorials/ |
| H A D | ex9.c | 290 static PetscErrorCode PhysicsRiemann_Advect(void *vctx, PetscInt m, const PetscScalar *uL, const Pe… in PhysicsRiemann_Advect() argument 297 flux[0] = PetscMax(0, speed) * uL[0] + PetscMin(0, speed) * uR[0]; in PhysicsRiemann_Advect() 426 static PetscErrorCode PhysicsRiemann_Burgers_Exact(void *vctx, PetscInt m, const PetscScalar *uL, c… in PhysicsRiemann_Burgers_Exact() argument 429 if (uL[0] < uR[0]) { /* rarefaction */ in PhysicsRiemann_Burgers_Exact() 430 flux[0] = (uL[0] * uR[0] < 0) ? 0 /* sonic rarefaction */ in PhysicsRiemann_Burgers_Exact() 431 : 0.5 * PetscMin(PetscSqr(uL[0]), PetscSqr(uR[0])); in PhysicsRiemann_Burgers_Exact() 433 flux[0] = 0.5 * PetscMax(PetscSqr(uL[0]), PetscSqr(uR[0])); in PhysicsRiemann_Burgers_Exact() 435 *maxspeed = (PetscAbs(uL[0]) > PetscAbs(uR[0])) ? uL[0] : uR[0]; in PhysicsRiemann_Burgers_Exact() 439 static PetscErrorCode PhysicsRiemann_Burgers_Roe(void *vctx, PetscInt m, const PetscScalar *uL, con… in PhysicsRiemann_Burgers_Roe() argument 444 speed = 0.5 * (uL[0] + uR[0]); in PhysicsRiemann_Burgers_Roe() [all …]
|
| H A D | ex11.h | 176 const SWNode *uL = (const SWNode *)xL, *uR = (const SWNode *)xR; in PhysicsRiemann_SW_Rusanov() local 179 const SWNode *uL = &uLreal.swnode; in PhysicsRiemann_SW_Rusanov() local 194 if (uL->h < 0 || uR->h < 0) { in PhysicsRiemann_SW_Rusanov() 205 ierr = SWFlux(phys, nn, uL, &fL.swnode); in PhysicsRiemann_SW_Rusanov() 217 cL = PetscSqrtReal(sw->gravity * uL->h); in PhysicsRiemann_SW_Rusanov() 219 …speed = PetscMax(PetscAbsReal(Dot2Real(uL->uh, nn) / uL->h) + cL, PetscAbsReal(Dot2Real(uR->uh, nn… in PhysicsRiemann_SW_Rusanov() 276 const SWNode *uL = (const SWNode *)xL, *uR = (const SWNode *)xR; in PhysicsRiemann_SW_HLL() local 279 const SWNode *uL = &uLreal.swnode; in PhysicsRiemann_SW_HLL() local 293 if (uL->h <= 0 || uR->h <= 0) { in PhysicsRiemann_SW_HLL() 302 ierr = SWFlux(phys, nn, uL, &fL.swnode); in PhysicsRiemann_SW_HLL() [all …]
|
| H A D | ex18.c | 286 …, PetscInt Nf, const PetscReal *qp, const PetscReal *n, const PetscScalar *uL, const PetscScalar *… in riemann_advection() argument 291 flux[0] = (wn > 0 ? uL[dim] : uR[dim]) * wn; in riemann_advection() 294 …, PetscInt Nf, const PetscReal *qp, const PetscReal *n, const PetscScalar *uL, const PetscScalar *… in riemann_coupled_advection() argument 296 PetscReal wn = DMPlex_DotD_Internal(dim, uL, n); in riemann_coupled_advection() 299 flux[0] = (wn > 0 ? uL[dim] : uR[dim]) * wn; in riemann_coupled_advection() 303 flux[0] = 0.5 * ((uL[dim] + uR[dim]) + (uL[dim] - uR[dim]) * tanh(1.0e5 * wn)) * wn; in riemann_coupled_advection()
|
| /petsc/src/ts/tutorials/multirate/ |
| H A D | ex8.c | 31 static PetscErrorCode PhysicsRiemann_Advect(void *vctx, PetscInt m, const PetscScalar *uL, const Pe… in PhysicsRiemann_Advect() argument 38 flux[0] = PetscMax(0, speed) * uL[0] + PetscMin(0, speed) * uR[0]; in PhysicsRiemann_Advect() 288 PetscScalar *uL, *uR; in FVRHSFunction_3WaySplit() local 289 uL = &ctx->uLR[0]; in FVRHSFunction_3WaySplit() 293 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hxs / 2; in FVRHSFunction_3WaySplit() 296 PetscCall((*ctx->physics2.riemann2)(ctx->physics2.user, dof, uL, uR, ctx->flux, &maxspeed)); in FVRHSFunction_3WaySplit() 305 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hxs / 2; in FVRHSFunction_3WaySplit() 308 PetscCall((*ctx->physics2.riemann2)(ctx->physics2.user, dof, uL, uR, ctx->flux, &maxspeed)); in FVRHSFunction_3WaySplit() 317 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hxm / 2; in FVRHSFunction_3WaySplit() 320 PetscCall((*ctx->physics2.riemann2)(ctx->physics2.user, dof, uL, uR, ctx->flux, &maxspeed)); in FVRHSFunction_3WaySplit() [all …]
|
| H A D | ex6.c | 38 static PetscErrorCode PhysicsRiemann_Advect(void *vctx, PetscInt m, const PetscScalar *uL, const Pe… in PhysicsRiemann_Advect() argument 45 flux[0] = PetscMax(0, speed) * uL[0] + PetscMin(0, speed) * uR[0]; in PhysicsRiemann_Advect() 271 PetscScalar *uL, *uR; in FVRHSFunction_2WaySplit() local 272 uL = &ctx->uLR[0]; in FVRHSFunction_2WaySplit() 276 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hxs / 2; in FVRHSFunction_2WaySplit() 279 PetscCall((*ctx->physics2.riemann2)(ctx->physics2.user, dof, uL, uR, ctx->flux, &maxspeed)); in FVRHSFunction_2WaySplit() 288 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hxs / 2; in FVRHSFunction_2WaySplit() 291 PetscCall((*ctx->physics2.riemann2)(ctx->physics2.user, dof, uL, uR, ctx->flux, &maxspeed)); in FVRHSFunction_2WaySplit() 300 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hxf / 2; in FVRHSFunction_2WaySplit() 303 PetscCall((*ctx->physics2.riemann2)(ctx->physics2.user, dof, uL, uR, ctx->flux, &maxspeed)); in FVRHSFunction_2WaySplit() [all …]
|
| H A D | ex4.c | 57 static PetscErrorCode PhysicsRiemann_Advect(void *vctx, PetscInt m, const PetscScalar *uL, const Pe… in PhysicsRiemann_Advect() argument 64 flux[0] = PetscMax(0, speed) * uL[0] + PetscMin(0, speed) * uR[0]; in PhysicsRiemann_Advect() 159 static PetscErrorCode PhysicsRiemann_Shallow_Exact(void *vctx, PetscInt m, const PetscScalar *uL, c… in PhysicsRiemann_Shallow_Exact() argument 165 } L = {uL[0], uL[1] / uL[0]}, R = {uR[0], uR[1] / uR[0]}, star; in PhysicsRiemann_Shallow_Exact() 220 ShallowFlux(phys, uL, flux); in PhysicsRiemann_Shallow_Exact() 233 static PetscErrorCode PhysicsRiemann_Shallow_Rusanov(void *vctx, PetscInt m, const PetscScalar *uL,… in PhysicsRiemann_Shallow_Rusanov() argument 239 } L = {uL[0], uL[1] / uL[0]}, R = {uR[0], uR[1] / uR[0]}; in PhysicsRiemann_Shallow_Rusanov() 251 ShallowFlux(phys, uL, fL); in PhysicsRiemann_Shallow_Rusanov() 256 flux[1] = 0.5 * (fL[1] + fR[1]) + 0.5 * s * (uL[1] - uR[1]); in PhysicsRiemann_Shallow_Rusanov() 640 PetscScalar *uL, *uR; in FVRHSFunction_2WaySplit() local [all …]
|
| H A D | ex5.c | 46 static PetscErrorCode PhysicsRiemann_Advect(void *vctx, PetscInt m, const PetscScalar *uL, const Pe… in PhysicsRiemann_Advect() argument 54 …flux[0] = PetscMax(0, (speed[0] + speed[1]) / 2.0) * uL[0] + PetscMin(0, (speed[0] + speed[1]) / 2… in PhysicsRiemann_Advect() 55 …else if (x < 0) flux[0] = PetscMax(0, speed[0]) * uL[0] + PetscMin(0, speed[0]) * uR[0]; … in PhysicsRiemann_Advect() 56 else flux[0] = PetscMax(0, speed[1]) * uL[0] + PetscMin(0, speed[1]) * uR[0]; in PhysicsRiemann_Advect() 252 PetscScalar *uL, *uR; in FVRHSFunctionslow() local 254 uL = &ctx->uLR[0]; in FVRHSFunctionslow() 257 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hx / 2; in FVRHSFunctionslow() 260 …PetscCall((*ctx->physics.riemann)(ctx->physics.user, dof, uL, uR, ctx->flux, &maxspeed, ctx->xmin … in FVRHSFunctionslow() 270 uL = &ctx->uLR[0]; in FVRHSFunctionslow() 273 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hx / 2; in FVRHSFunctionslow() [all …]
|
| H A D | finitevolume1d.c | 586 PetscScalar *uL, *uR; in FVRHSFunction() local 587 uL = &ctx->uLR[0]; in FVRHSFunction() 590 uL[j] = x[(i - 1) * dof + j] + slope[(i - 1) * dof + j] * hx / 2; in FVRHSFunction() 593 …PetscCall((*ctx->physics.riemann)(ctx->physics.user, dof, uL, uR, ctx->flux, &maxspeed, ctx->xmin … in FVRHSFunction()
|
| /petsc/src/dm/dt/interface/ftn-custom/ |
| H A D | zdsf.c | 14 …, PetscInt Nf, const PetscReal x[], const PetscReal n[], const PetscScalar uL[], const PetscScalar… in ourriemannsolver() argument 16 … PetscInt *Nf, const PetscReal x[], const PetscReal n[], const PetscScalar uL[], const PetscScalar… in ourriemannsolver() 19 if (func) (*func)(&dim, &Nf, x, n, uL, uR, &numConstants, constants, flux, _ctx); in ourriemannsolver()
|
| /petsc/src/dm/impls/plex/ftn-custom/ |
| H A D | zplexfemf90.c | 76 PetscScalar *uL, *uR; in dmplexgetfacefields_() local 79 …elds(*dm, *fStart, *fEnd, *locX, *locX_t, *faceGeometry, *cellGeometry, *locGrad, Nface, &uL, &uR); in dmplexgetfacefields_() 85 …*ierr = F90Array1dCreate((void *)uL, MPIU_SCALAR, 1, numFaces * totDim, uLPtr PETSC_F90_2PTR_PARAM… in dmplexgetfacefields_() 93 PetscScalar *uL, *uR; in dmplexrestorefacefields_() local 95 *ierr = F90Array1dAccess(uLPtr, MPIU_SCALAR, (void **)&uL PETSC_F90_2PTR_PARAM(uLPtrd)); in dmplexrestorefacefields_() 99 …eFaceFields(*dm, *fStart, *fEnd, *locX, NULL, *faceGeometry, *cellGeometry, NULL, Nface, &uL, &uR); in dmplexrestorefacefields_()
|
| /petsc/include/ |
| H A D | petscdstypes.h | 263 …, PetscInt Nf, const PetscReal x[], const PetscReal n[], const PetscScalar uL[], const PetscScalar…
|
| /petsc/src/dm/dt/fv/interface/ |
| H A D | fv.c | 1731 …, PetscInt Nf, PetscFVFaceGeom *fgeom, PetscReal *neighborVol, PetscScalar uL[], PetscScalar uR[],… in PetscFVIntegrateRHSFunction() argument 1735 …PetscTryTypeMethod(fvm, integraterhsfunction, prob, field, Nf, fgeom, neighborVol, uL, uR, fluxL, … in PetscFVIntegrateRHSFunction() 1907 …, PetscInt Nf, PetscFVFaceGeom *fgeom, PetscReal *neighborVol, PetscScalar uL[], PetscScalar uR[],… in PetscFVIntegrateRHSFunction_Upwind() argument 1925 …(*riemann)(dim, pdim, fgeom[f].centroid, fgeom[f].normal, &uL[f * Nc], &uR[f * Nc], numConstants, … in PetscFVIntegrateRHSFunction_Upwind() 2189 …, PetscInt Nf, PetscFVFaceGeom *fgeom, PetscReal *neighborVol, PetscScalar uL[], PetscScalar uR[],… in PetscFVIntegrateRHSFunction_LeastSquares() argument 2207 …(*riemann)(dim, pdim, fgeom[f].centroid, fgeom[f].normal, &uL[f * Nc], &uR[f * Nc], numConstants, … in PetscFVIntegrateRHSFunction_LeastSquares()
|
| /petsc/src/dm/impls/plex/ |
| H A D | plexfem.c | 4090 …eometry, Vec cellGeometry, PeOp Vec locGrad, PetscInt *Nface, PetscScalar *uL[], PetscScalar *uR[]) in DMPlexGetFaceFields() argument 4107 PetscAssertPointer(uL, 10); in DMPlexGetFaceFields() 4139 PetscCall(DMGetWorkArray(dm, numFaces * Nc, MPIU_SCALAR, uL)); in DMPlexGetFaceFields() 4147 PetscScalar *uLl = *uL, *uRl = *uR; in DMPlexGetFaceFields() 4254 …eometry, Vec cellGeometry, PeOp Vec locGrad, PetscInt *Nface, PetscScalar *uL[], PetscScalar *uR[]) in DMPlexRestoreFaceFields() argument 4257 PetscCall(DMRestoreWorkArray(dm, 0, MPIU_SCALAR, uL)); in DMPlexRestoreFaceFields() 4401 PetscScalar *u = NULL, *u_t, *a, *uL = NULL, *uR = NULL; in DMPlexComputeResidual_Patch_Internal() local 4533 PetscCall(PetscFVIntegrateRHSFunction(fv, prob, f, Ne, fgeom, vol, uL, uR, fluxL, fluxR)); in DMPlexComputeResidual_Patch_Internal() 5191 PetscScalar *u = NULL, *u_t, *a, *uL, *uR; in DMPlexComputeResidualByKey() local 5294 …eFields(dm, fS, fE, locX, locX_t, faceGeometryFVM, cellGeometryFVM, locGrad, &numFaces, &uL, &uR)); in DMPlexComputeResidualByKey() [all …]
|