Lines Matching refs:dim

6 static PetscErrorCode testOrthogonality(PetscInt dim, PetscInt deg)  in testOrthogonality()  argument
14 PetscCall(PetscDTStroudConicalQuadrature(dim, 1, deg + 1, -1., 1., &q)); in testOrthogonality()
16 PetscCall(PetscDTBinomialInt(dim + deg, dim, &Npoly)); in testOrthogonality()
18 PetscCall(PetscDTPKDEvalJet(dim, npoints, points, deg, 0, p)); in testOrthogonality()
33 static PetscErrorCode testDerivativesLegendre(PetscInt dim, PetscInt deg, PetscInt k) in testDerivativesLegendre() argument
53 PetscCall(PetscDTBinomialInt(dim + deg, dim, &Np)); in testDerivativesLegendre()
54 PetscCall(PetscDTBinomialInt(dim + k, dim, &Nk)); in testDerivativesLegendre()
57 PetscCall(PetscDTStroudConicalQuadrature(dim, 1, deg + 1, -1., 1., &q)); in testDerivativesLegendre()
60 PetscCall(PetscDTPKDEvalJet(dim, npoints, points, deg, 0, proj)); in testDerivativesLegendre()
71 PetscCall(PetscMalloc2(dim, &degtup, dim, &ktup)); in testDerivativesLegendre()
78 PetscCall(PetscMalloc1(dim, &B)); in testDerivativesLegendre()
79 for (d = 0; d < dim; d++) { in testDerivativesLegendre()
82 for (i = 0; i < npoints; i++) points1d[i] = points[i * dim + d]; in testDerivativesLegendre()
93 PetscCall(PetscDTIndexToGradedOrder(dim, j, degtup)); in testDerivativesLegendre()
94 for (l = 0; l < dim; l++) valj *= B[l][i * (deg + 1) + degtup[l]]; in testDerivativesLegendre()
99 for (i = 0; i < dim; i++) PetscCall(PetscFree(B[i])); in testDerivativesLegendre()
103 PetscCall(PetscMalloc1(dim, &point)); in testDerivativesLegendre()
104 for (i = 0; i < dim; i++) PetscCall(PetscRandomGetValueReal(rand, &point[i])); in testDerivativesLegendre()
105 for (i = dim - 1; i > 0; i--) { in testDerivativesLegendre()
114 PetscCall(PetscDTPKDEvalJet(dim, 1, point, deg, k, pkd_jet_basis)); in testDerivativesLegendre()
122 PetscCall(PetscMalloc1(dim, &D)); in testDerivativesLegendre()
123 for (i = 0; i < dim; i++) { in testDerivativesLegendre()
132 PetscCall(PetscDTIndexToGradedOrder(dim, i, degtup)); in testDerivativesLegendre()
136 PetscCall(PetscDTIndexToGradedOrder(dim, j, ktup)); in testDerivativesLegendre()
137 for (l = 0; l < dim; l++) val *= D[l][degtup[l] * (k + 1) + ktup[l]]; in testDerivativesLegendre()
141 for (i = 0; i < dim; i++) PetscCall(PetscFree(D[i])); in testDerivativesLegendre()
165 PetscInt dim, deg, k; in main() local
169 dim = 3; in main()
173 PetscCall(PetscOptionsInt("-dim", "Dimension of the simplex", "ex9.c", dim, &dim, NULL)); in main()
177 PetscCall(testOrthogonality(dim, deg)); in main()
178 PetscCall(testDerivativesLegendre(dim, deg, k)); in main()