Lines Matching refs:dim
54 PetscInt dim; in CreateSwarm() local
57 PetscCall(DMGetDimension(dm, &dim)); in CreateSwarm()
60 PetscCall(DMSetDimension(*sw, dim)); in CreateSwarm()
64 PetscCall(DMSwarmRegisterPetscDatatypeField(*sw, "velocity", dim, PETSC_REAL)); in CreateSwarm()
66 PetscCall(DMSwarmRegisterPetscDatatypeField(*sw, "initCoordinates", dim, PETSC_REAL)); in CreateSwarm()
67 PetscCall(DMSwarmRegisterPetscDatatypeField(*sw, "initVelocity", dim, PETSC_REAL)); in CreateSwarm()
99 PetscInt dim, d, Np, p; in RHSFunction() local
103 PetscCall(DMGetDimension(sw, &dim)); in RHSFunction()
109 Np /= 2 * dim; in RHSFunction()
111 const PetscReal x0 = coords[p * dim + 0]; in RHSFunction()
112 const PetscReal vy0 = vel[p * dim + 1]; in RHSFunction()
115 for (d = 0; d < dim; ++d) { in RHSFunction()
116 g[(p * 2 + 0) * dim + d] = u[(p * 2 + 1) * dim + d]; in RHSFunction()
117 g[(p * 2 + 1) * dim + d] = -PetscSqr(omega) * u[(p * 2 + 0) * dim + d]; in RHSFunction()
135 PetscInt dim, d, Np, p, rStart; in RHSJacobian() local
139 PetscCall(DMGetDimension(sw, &dim)); in RHSJacobian()
144 Np /= 2 * dim; in RHSJacobian()
146 const PetscReal x0 = coords[p * dim + 0]; in RHSJacobian()
147 const PetscReal vy0 = vel[p * dim + 1]; in RHSJacobian()
151 for (d = 0; d < dim; ++d) { in RHSJacobian()
152 const PetscInt rows[2] = {(p * 2 + 0) * dim + d + rStart, (p * 2 + 1) * dim + d + rStart}; in RHSJacobian()
168 PetscInt Np, p, dim, d; in RHSFunctionX() local
172 PetscCall(DMGetDimension(sw, &dim)); in RHSFunctionX()
176 Np /= dim; in RHSFunctionX()
178 for (d = 0; d < dim; ++d) xres[p * dim + d] = v[p * dim + d]; in RHSFunctionX()
190 PetscInt Np, p, dim, d; in RHSFunctionV() local
194 PetscCall(DMGetDimension(sw, &dim)); in RHSFunctionV()
200 PetscCheck(dim == 2, PETSC_COMM_SELF, PETSC_ERR_ARG_WRONG, "Dimension must be 2"); in RHSFunctionV()
201 Np /= dim; in RHSFunctionV()
203 const PetscReal x0 = coords[p * dim + 0]; in RHSFunctionV()
204 const PetscReal vy0 = vel[p * dim + 1]; in RHSFunctionV()
207 for (d = 0; d < dim; ++d) vres[p * dim + d] = -PetscSqr(omega) * x[p * dim + d]; in RHSFunctionV()
220 PetscInt dim, Np; in CreateSolution() local
224 PetscCall(DMGetDimension(sw, &dim)); in CreateSolution()
227 PetscCall(VecSetBlockSize(u, dim)); in CreateSolution()
228 PetscCall(VecSetSizes(u, 2 * Np * dim, PETSC_DECIDE)); in CreateSolution()
246 PetscInt dim, Np; in SetProblem() local
248 PetscCall(DMGetDimension(sw, &dim)); in SetProblem()
251 PetscCall(MatSetSizes(J, 2 * Np * dim, 2 * Np * dim, PETSC_DECIDE, PETSC_DECIDE)); in SetProblem()
252 PetscCall(MatSetBlockSize(J, 2 * dim)); in SetProblem()
264 PetscInt dim, Np, rstart; in SetProblem() local
267 PetscCall(DMGetDimension(sw, &dim)); in SetProblem()
270 PetscCall(ISCreateStride(PETSC_COMM_WORLD, Np, (rstart / dim) + 0, 2, &istmp)); in SetProblem()
272 PetscCall(ISCreateBlock(PETSC_COMM_WORLD, dim, Np, idx, PETSC_COPY_VALUES, &isx)); in SetProblem()
275 PetscCall(ISCreateStride(PETSC_COMM_WORLD, Np, (rstart / dim) + 1, 2, &istmp)); in SetProblem()
277 PetscCall(ISCreateBlock(PETSC_COMM_WORLD, dim, Np, idx, PETSC_COPY_VALUES, &isv)); in SetProblem()
325 PetscErrorCode circleSingleX(PetscInt dim, PetscReal time, const PetscReal unused[], PetscInt p, Pe… in circleSingleX() argument
332 PetscErrorCode circleSingleV(PetscInt dim, PetscReal time, const PetscReal unused[], PetscInt p, Pe… in circleSingleV() argument
340 PetscErrorCode circleMultipleX(PetscInt dim, PetscReal time, const PetscReal unused[], PetscInt p, … in circleMultipleX() argument
352 PetscErrorCode circleMultipleV(PetscInt dim, PetscReal time, const PetscReal unused[], PetscInt p, … in circleMultipleV() argument
431 PetscInt dim, Np, p; in ComputeError() local
437 PetscCall(DMGetDimension(sw, &dim)); in ComputeError()
444 Np /= 2 * dim; in ComputeError()
447 const PetscReal r0 = DMPlex_NormD_Internal(dim, &coords[p * dim]); in ComputeError()
448 const PetscReal th0 = PetscAtan2Real(coords[p * dim + 1], coords[p * dim + 0]); in ComputeError()
449 const PetscReal v0 = DMPlex_NormD_Internal(dim, &vel[p * dim]); in ComputeError()
453 const PetscScalar *x = &u[(p * 2 + 0) * dim]; in ComputeError()
454 const PetscScalar *v = &u[(p * 2 + 1) * dim]; in ComputeError()
459 for (d = 0; d < dim; ++d) { in ComputeError()
460 e[(p * 2 + 0) * dim + d] = x[d] - xe[d]; in ComputeError()
461 e[(p * 2 + 1) * dim + d] = v[d] - ve[d]; in ComputeError()
464 const PetscReal en = 0.5 * DMPlex_DotRealD_Internal(dim, v, v); in ComputeError()
466 … p, (double)DMPlex_NormD_Internal(dim, &e[(p * 2 + 0) * dim]), (double)DMPlex_NormD_Internal(dim, … in ComputeError()
481 PetscInt dim, Np, p; in EnergyMonitor() local
486 PetscCall(DMGetDimension(sw, &dim)); in EnergyMonitor()
489 Np /= 2 * dim; in EnergyMonitor()
492 … const PetscReal v2 = DMPlex_DotRealD_Internal(dim, &u[(p * 2 + 1) * dim], &u[(p * 2 + 1) * dim]); in EnergyMonitor()