Commits

Satish Balay committed a8291ba

DMPlex: use PETSC_HAVE_TGAMMA to get the build working on windows

Comments (0)

Files changed (1)

src/dm/dt/interface/dt.c

 {
   PetscInt       maxIter = 100;
   PetscReal      eps     = 1.0e-8;
-  PetscReal      a1      = pow(2, a+b+1);
-  PetscReal      a2      = gamma(a + npoints + 1);
-  PetscReal      a3      = gamma(b + npoints + 1);
-  PetscReal      a4      = gamma(a + b + npoints + 1);
-  PetscReal      a5, a6;
+  PetscReal      a1, a2, a3, a4, a5, a6;
   PetscInt       k;
   PetscErrorCode ierr;
 
   PetscFunctionBegin;
+
+  a1      = pow(2, a+b+1);
+#if defined(PETSC_HAVE_TGAMMA)
+  a2      = tgamma(a + npoints + 1);
+  a3      = tgamma(b + npoints + 1);
+  a4      = tgamma(a + b + npoints + 1);
+#else
+  SETERRQ(PETSC_COMM_SELF,PETSC_ERR_SUP,"tgamma() - math routine is unavailable.");
+#endif
+
   ierr = PetscDTFactorial_Internal(npoints, &a5);CHKERRQ(ierr);
   a6   = a1 * a2 * a3 / a4 / a5;
   /* Computes the m roots of P_{m}^{a,b} on [-1,1] by Newton's method with Chebyshev points as initial guesses.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.