Lines Matching refs:dim

92   PetscInt  dim;  in CreateSwarm()  local
95 PetscCall(DMGetDimension(dm, &dim)); in CreateSwarm()
98 PetscCall(DMSetDimension(*sw, dim)); in CreateSwarm()
102 PetscCall(DMSwarmRegisterPetscDatatypeField(*sw, "velocity", dim, PETSC_REAL)); in CreateSwarm()
104 PetscCall(DMSwarmRegisterPetscDatatypeField(*sw, "initCoordinates", dim, PETSC_REAL)); in CreateSwarm()
135 PetscInt dim, d, Np, p; in RHSFunction() local
139 PetscCall(DMGetDimension(sw, &dim)); in RHSFunction()
143 Np /= 2 * dim; in RHSFunction()
145 for (d = 0; d < dim; ++d) { in RHSFunction()
146 g[(p * 2 + 0) * dim + d] = u[(p * 2 + 1) * dim + d]; in RHSFunction()
147 g[(p * 2 + 1) * dim + d] = -PetscSqr(omega) * u[(p * 2 + 0) * dim + d]; in RHSFunction()
163 PetscInt dim, d, Np, p, rStart; in RHSJacobian() local
167 PetscCall(DMGetDimension(sw, &dim)); in RHSJacobian()
170 Np /= 2 * dim; in RHSJacobian()
172 for (d = 0; d < dim; ++d) { in RHSJacobian()
173 const PetscInt rows[2] = {(p * 2 + 0) * dim + d + rStart, (p * 2 + 1) * dim + d + rStart}; in RHSJacobian()
219 PetscInt dim, d, Np, p, rStart; in RHSJacobianS() local
223 PetscCall(DMGetDimension(sw, &dim)); in RHSJacobianS()
226 Np /= 2 * dim; in RHSJacobianS()
228 for (d = 0; d < dim; ++d) { in RHSJacobianS()
229 const PetscInt rows[2] = {(p * 2 + 0) * dim + d + rStart, (p * 2 + 1) * dim + d + rStart}; in RHSJacobianS()
243 PetscInt dim, Np, p; in RHSObjectiveF() local
247 PetscCall(DMGetDimension(sw, &dim)); in RHSObjectiveF()
250 Np /= 2 * dim; in RHSObjectiveF()
252 … const PetscReal x2 = DMPlex_DotRealD_Internal(dim, &u[(p * 2 + 0) * dim], &u[(p * 2 + 0) * dim]); in RHSObjectiveF()
253 … const PetscReal v2 = DMPlex_DotRealD_Internal(dim, &u[(p * 2 + 1) * dim], &u[(p * 2 + 1) * dim]); in RHSObjectiveF()
269 PetscInt dim, d, Np, p; in RHSFunctionG() local
273 PetscCall(DMGetDimension(sw, &dim)); in RHSFunctionG()
277 Np /= 2 * dim; in RHSFunctionG()
279 for (d = 0; d < dim; ++d) { in RHSFunctionG()
280 g[(p * 2 + 0) * dim + d] = PetscSqr(omega) * u[(p * 2 + 0) * dim + d]; in RHSFunctionG()
281 g[(p * 2 + 1) * dim + d] = u[(p * 2 + 1) * dim + d]; in RHSFunctionG()
293 PetscInt dim, Np; in CreateSolution() local
297 PetscCall(DMGetDimension(sw, &dim)); in CreateSolution()
300 PetscCall(VecSetBlockSize(u, dim)); in CreateSolution()
301 PetscCall(VecSetSizes(u, 2 * Np * dim, PETSC_DECIDE)); in CreateSolution()
319 PetscInt dim, Np; in SetProblem() local
321 PetscCall(DMGetDimension(sw, &dim)); in SetProblem()
324 PetscCall(MatSetSizes(J, 2 * Np * dim, 2 * Np * dim, PETSC_DECIDE, PETSC_DECIDE)); in SetProblem()
325 PetscCall(MatSetBlockSize(J, 2 * dim)); in SetProblem()
336 PetscInt dim, Np; in SetProblem() local
338 PetscCall(DMGetDimension(sw, &dim)); in SetProblem()
342 PetscCall(ISCreateBlock(PETSC_COMM_SELF, dim, Np, idx, PETSC_COPY_VALUES, &isx)); in SetProblem()
347 PetscCall(ISCreateBlock(PETSC_COMM_SELF, dim, Np, idx, PETSC_COPY_VALUES, &isv)); in SetProblem()
402 PetscInt dim, d, Np, p; in ComputeError() local
408 PetscCall(DMGetDimension(sw, &dim)); in ComputeError()
414 Np /= 2 * dim; in ComputeError()
419 const PetscReal x0 = DMPlex_NormD_Internal(dim, &coords[p * dim]); in ComputeError()
422 …const PetscReal x = DMPlex_DotRealD_Internal(dim, &u[(p * 2 + 0) * dim], &coords[p * dim]) / x… in ComputeError()
423 …const PetscReal v = DMPlex_DotRealD_Internal(dim, &u[(p * 2 + 1) * dim], &coords[p * dim]) / x… in ComputeError()
430 for (d = 0; d < dim; ++d) { in ComputeError()
431 e[(p * 2 + 0) * dim + d] = u[(p * 2 + 0) * dim + d] - coords[p * dim + d] * ct; in ComputeError()
432 e[(p * 2 + 1) * dim + d] = u[(p * 2 + 1) * dim + d] + coords[p * dim + d] * omega * st; in ComputeError()
448 PetscInt dim, Np, p; in EnergyMonitor() local
456 PetscCall(DMGetDimension(sw, &dim)); in EnergyMonitor()
459 Np /= 2 * dim; in EnergyMonitor()
462 … const PetscReal x2 = DMPlex_DotRealD_Internal(dim, &u[(p * 2 + 0) * dim], &u[(p * 2 + 0) * dim]); in EnergyMonitor()
463 … const PetscReal v2 = DMPlex_DotRealD_Internal(dim, &u[(p * 2 + 1) * dim], &u[(p * 2 + 1) * dim]); in EnergyMonitor()