Lines Matching refs:hx
79 PetscScalar *xx, *ff, hx; in ComputeFunction() local
89 hx = 1.0 / (PetscReal)(Mx - 1); in ComputeFunction()
117 thrust::constant_iterator<PetscScalar>(hx))), in ComputeFunction()
126 thrust::constant_iterator<PetscScalar>(hx))), in ComputeFunction()
141 if (i == 0 || i == Mx - 1) ff[i] = xx[i] / hx; in ComputeFunction()
142 else ff[i] = (2.0 * xx[i] - xx[i - 1] - xx[i + 1]) / hx - hx * PetscExpScalar(xx[i]); in ComputeFunction()
154 PetscScalar hx, *xx; in ComputeJacobian() local
159 hx = 1.0 / (PetscReal)(Mx - 1); in ComputeJacobian()
168 PetscCall(MatSetValue(J, i, i, 1.0 / hx, INSERT_VALUES)); in ComputeJacobian()
170 PetscCall(MatSetValue(J, i, i - 1, -1.0 / hx, INSERT_VALUES)); in ComputeJacobian()
171 PetscCall(MatSetValue(J, i, i, 2.0 / hx - hx * PetscExpScalar(xx[i]), INSERT_VALUES)); in ComputeJacobian()
172 PetscCall(MatSetValue(J, i, i + 1, -1.0 / hx, INSERT_VALUES)); in ComputeJacobian()