| /petsc/src/ts/tutorials/power_grid/stability_9bus/ |
| H A D | ex9busdmnetwork.c | 490 PetscScalar *farr; in FormIFunction() local 514 PetscCall(VecGetArray(localF, &farr)); in FormIFunction() 559 … farr[offsetbus] += Yffi * Vr + Yffr * Vi; /* imaginary current due to diagonal elements */ in FormIFunction() 560 farr[offsetbus + 1] += Yffr * Vr - Yffi * Vi; /* real current due to diagonal elements */ in FormIFunction() 592 farr[offsetfrom] += Yftr * Vti + Yfti * Vtr; in FormIFunction() 593 farr[offsetfrom + 1] += Yftr * Vtr - Yfti * Vti; in FormIFunction() 595 farr[offsetto] += Yftr * Vfi + Yfti * Vfr; in FormIFunction() 596 farr[offsetto + 1] += Yftr * Vfr - Yfti * Vfi; in FormIFunction() 634 farr[offsetgen] = (Eqp + (Xd - Xdp) * Id - Efd) / Td0p + xdotarr[offsetgen]; in FormIFunction() 635 farr[offsetgen + 1] = (Edp - (Xq - Xqp) * Iq) / Tq0p + xdotarr[offsetgen + 1]; in FormIFunction() [all …]
|
| /petsc/src/snes/tutorials/network/power/ |
| H A D | pffunctions.c | 245 PetscScalar *farr; in FormFunction_Power() local 257 PetscCall(VecGetArray(localF, &farr)); in FormFunction_Power() 273 farr[offset] = xarr[offset] - bus->va * PETSC_PI / 180.0; in FormFunction_Power() 274 farr[offset + 1] = xarr[offset + 1] - bus->vm; in FormFunction_Power() 282 farr[offset] += Vm * Vm * bus->gl / Sbase; in FormFunction_Power() 283 if (bus->ide != PV_BUS) farr[offset + 1] += -Vm * Vm * bus->bl / Sbase; in FormFunction_Power() 321 …farr[offsetfrom] += Gff * Vmf * Vmf + Vmf * Vmt * (Gft * PetscCosScalar(thetaft) + Bft * PetscSinS… in FormFunction_Power() 322 …farr[offsetfrom + 1] += -Bff * Vmf * Vmf + Vmf * Vmt * (-Bft * PetscCosScalar(thetaft) + Gft * Pet… in FormFunction_Power() 324 …farr[offsetto] += Gtt * Vmt * Vmt + Vmt * Vmf * (Gtf * PetscCosScalar(thetatf) + Btf * PetscSinSca… in FormFunction_Power() 325 …farr[offsetto + 1] += -Btt * Vmt * Vmt + Vmt * Vmf * (-Btf * PetscCosScalar(thetatf) + Gtf * Petsc… in FormFunction_Power() [all …]
|
| H A D | power2.c | 16 PetscScalar *farr; in FormFunction_Subnet() local 21 PetscCall(VecGetArray(localF, &farr)); in FormFunction_Subnet() 46 farr[offset] = xarr[offset] - bus->va * PETSC_PI / 180.0; in FormFunction_Subnet() 47 farr[offset + 1] = xarr[offset + 1] - bus->vm; in FormFunction_Subnet() 55 farr[offset] += Vm * Vm * bus->gl / Sbase; in FormFunction_Subnet() 56 if (bus->ide != PV_BUS) farr[offset + 1] += -Vm * Vm * bus->bl / Sbase; in FormFunction_Subnet() 94 …farr[offsetfrom] += Gff * Vmf * Vmf + Vmf * Vmt * (Gft * PetscCosScalar(thetaft) + Bft * PetscSinS… in FormFunction_Subnet() 95 …farr[offsetfrom + 1] += -Bff * Vmf * Vmf + Vmf * Vmt * (-Bft * PetscCosScalar(thetaft) + Gft * Pet… in FormFunction_Subnet() 97 …farr[offsetto] += Gtt * Vmt * Vmt + Vmt * Vmf * (Gtf * PetscCosScalar(thetatf) + Btf * PetscSinSca… in FormFunction_Subnet() 98 …farr[offsetto + 1] += -Btt * Vmt * Vmt + Vmt * Vmf * (-Btf * PetscCosScalar(thetatf) + Gtf * Petsc… in FormFunction_Subnet() [all …]
|
| /petsc/src/snes/tutorials/network/water/ |
| H A D | waterfunctions.c | 25 PetscScalar *farr, hf, ht, flow; in FormFunction_Water() local 38 PetscCall(VecGetArray(localF, &farr)); in FormFunction_Water() 71 if (vertexnode1->type == VERTEX_TYPE_JUNCTION) farr[offsetnode1] -= flow; in FormFunction_Water() 72 if (vertexnode2->type == VERTEX_TYPE_JUNCTION) farr[offsetnode2] += flow; in FormFunction_Water() 85 farr[offset] -= vertex->junc.demand; in FormFunction_Water() 88 farr[offset] = xarr[offset] - reservoir->head; in FormFunction_Water() 91 farr[offset] = xarr[offset] - (tank->elev + tank->initlvl); in FormFunction_Water() 96 PetscCall(VecRestoreArray(localF, &farr)); in FormFunction_Water()
|
| /petsc/src/dm/impls/plex/ |
| H A D | plexfluent.c | 349 const PetscInt *cone, *ornt, *fcone, *fornt, *farr, faces[4] = {0, 1, 3, 2}; in ReorderTetrahedron() local 357 farr = DMPolytopeTypeGetArrangement(DM_POLYTOPE_TRIANGLE, newOrnt[0]); in ReorderTetrahedron() 360 … PetscInt edge = fcone[farr[e * 2 + 0]], eornt = DMPolytopeTypeComposeOrientation(DM_POLYTOPE_SEGM… in ReorderTetrahedron() 410 const PetscInt *cone, *ornt, *fcone, *fornt, *farr; in ReorderHexahedron() local 420 farr = DMPolytopeTypeGetArrangement(DM_POLYTOPE_QUADRILATERAL, newOrnt[0]); in ReorderHexahedron() 423 … PetscInt edge = fcone[farr[e * 2 + 0]], eornt = DMPolytopeTypeComposeOrientation(DM_POLYTOPE_SEGM… in ReorderHexahedron() 468 farr = DMPolytopeTypeGetArrangement(DM_POLYTOPE_QUADRILATERAL, newOrnt[2]); in ReorderHexahedron() 473 … PetscInt edge = fcone[farr[e * 2 + 0]], eornt = DMPolytopeTypeComposeOrientation(DM_POLYTOPE_SEGM… in ReorderHexahedron() 500 const PetscInt *cone, *ornt, *fcone, *fornt, *farr; in ReorderWedge() local 521 farr = DMPolytopeTypeGetArrangement(DM_POLYTOPE_TRIANGLE, newOrnt[0]); in ReorderWedge() [all …]
|
| H A D | plex.c | 4108 …const PetscInt *farr = DMPolytopeTypeGetArrangement(ft, DMPolytopeTypeComposeOrientation(ft, arr[d… in DMPlexTransitiveClosure_Tensor_Internal() local 4111 const PetscInt cp = fcone[farr[fc * 2 + 0]]; in DMPlexTransitiveClosure_Tensor_Internal() 4112 const PetscInt co = farr[fc * 2 + 1]; in DMPlexTransitiveClosure_Tensor_Internal() 4119 pts[c++] = DMPolytopeTypeComposeOrientation(ft, co, fornt[farr[fc * 2 + 0]]); in DMPlexTransitiveClosure_Tensor_Internal()
|
| /petsc/src/snes/tutorials/network/ |
| H A D | ex1.c | 54 PetscScalar *farr; in UserMonitor() local 63 PetscCall(VecGetArray(F, &farr)); in UserMonitor() 73 *color = (PetscRealPart(farr[offset - rstart])); in UserMonitor() 78 PetscCall(VecRestoreArray(F, &farr)); in UserMonitor() 138 PetscScalar *farr; in FormFunction_Dummy() local 147 PetscCall(VecGetArray(localF, &farr)); in FormFunction_Dummy() 155 for (j = 0; j < nvar; j++) farr[offset + j] = xarr[offset + j] - xoldarr[offset + j]; in FormFunction_Dummy() 160 PetscCall(VecRestoreArray(localF, &farr)); in FormFunction_Dummy()
|
| /petsc/src/ts/tutorials/network/ |
| H A D | pipes.c | 108 PetscScalar *farr, *juncf, *pipef; in WASHIFunction() local 139 PetscCall(VecGetArray(localF, &farr)); in WASHIFunction() 157 juncf = (PetscScalar *)(farr + varoffset); in WASHIFunction() 174 pipef = (PetscScalar *)(farr + varoffset); in WASHIFunction() 196 juncf = (PetscScalar *)(farr + offsetfrom); in WASHIFunction() 205 juncf = (PetscScalar *)(farr + offsetto); in WASHIFunction() 214 PetscCall(VecRestoreArray(localF, &farr)); in WASHIFunction()
|