Skip to content

Instantly share code, notes, and snippets.

View wence-'s full-sized avatar

Lawrence Mitchell wence-

View GitHub Profile
diff --git a/pyop2/compilation.py b/pyop2/compilation.py
index 0d27c23..92c90ba 100644
--- a/pyop2/compilation.py
+++ b/pyop2/compilation.py
@@ -85,6 +85,10 @@ class Compiler(object):
# atomically (avoiding races).
tmpname = os.path.join(cachedir, "%s.so.tmp" % basename)
+ if configuration['debug']:
+ basenames = MPI.comm.allgather(basename)
#include <math.h>
#define compute_jacobian_inverse_triangle_3d(K, det, J) \
do { const double d_0 = J[2]*J[5] - J[4]*J[3]; \
const double d_1 = J[4]*J[1] - J[0]*J[5]; \
const double d_2 = J[0]*J[3] - J[2]*J[1]; \
const double c_0 = J[0]*J[0] + J[2]*J[2] + J[4]*J[4]; \
const double c_1 = J[1]*J[1] + J[3]*J[3] + J[5]*J[5]; \
const double c_2 = J[0]*J[1] + J[2]*J[3] + J[4]*J[5]; \
const double den = c_0*c_1 - c_2*c_2; \
#!/usr/bin/python
if __name__ == '__main__':
import sys
import os
sys.path.insert(0, os.path.abspath('config'))
import configure
configure_options = [
'--download-chaco=1',
'--download-ctetgen=1',
'--download-exodusii=1',
2014-10-08 15:58:55 +0100
./configure
--disable-debug
--disable-dependency-tracking
--prefix=/usr/local/Cellar/freeciv/2.4.3
CFLAGS=-I/usr/local/Cellar/gettext/0.19.2/include
LDFLAGS=-L/usr/local/Cellar/gettext/0.19.2/lib
--enable-client=sdl
diff --git a/src/dm/impls/plex/plexrefine.c b/src/dm/impls/plex/plexrefine.c
index c6acb18..5667f07 100644
--- a/src/dm/impls/plex/plexrefine.c
+++ b/src/dm/impls/plex/plexrefine.c
@@ -6139,6 +6139,12 @@ static PetscErrorCode CellRefinerCreateLabels(CellRefiner
ierr = DMLabelGetStratumIS(label, values[val], &pointIS);CHKERRQ(ierr);
ierr = ISGetLocalSize(pointIS, &numPoints);CHKERRQ(ierr);
ierr = ISGetIndices(pointIS, &points);CHKERRQ(ierr);
+ /* Ensure refined label is created with same number of strata as
+ * original (even if no entries here). */
diff --git a/src/mat/impls/baij/seq/baij2.c b/src/mat/impls/baij/seq/baij2.c
index aa1ed44..ab8e5a5 100644
--- a/src/mat/impls/baij/seq/baij2.c
+++ b/src/mat/impls/baij/seq/baij2.c
@@ -2709,8 +2709,8 @@ PetscErrorCode MatZeroEntries_SeqBAIJ_Kernel(PetscInt thread_id,Mat A)
PetscInt n,start,end;
Mat_SeqBAIJ *a = (Mat_SeqBAIJ*)A->data;
- start = trstarts[thread_id];
- end = trstarts[thread_id+1];
import petsc4py
import sys
petsc4py.init(sys.argv)
from petsc4py import PETSc
bdy = PETSc.DMPlex().create()
bdy.setDimension(1)
bdy.createSquareBoundary([0, 0], [1, 1], [4, 4])
diff --git a/src/dm/impls/plex/plexrefine.c b/src/dm/impls/plex/plexrefine.c
index c6acb18..5667f07 100644
--- a/src/dm/impls/plex/plexrefine.c
+++ b/src/dm/impls/plex/plexrefine.c
@@ -6139,6 +6139,12 @@ static PetscErrorCode CellRefinerCreateLabels(CellRefiner refiner, DM dm, PetscI
ierr = DMLabelGetStratumIS(label, values[val], &pointIS);CHKERRQ(ierr);
ierr = ISGetLocalSize(pointIS, &numPoints);CHKERRQ(ierr);
ierr = ISGetIndices(pointIS, &points);CHKERRQ(ierr);
+ /* Ensure refined label is created with same number of strata as
+ * original (even if no entries here). */
diff --git a/source/pressuresolver/operators.py b/source/pressuresolver/operators.py
index 9cae976..707bcb1 100644
--- a/source/pressuresolver/operators.py
+++ b/source/pressuresolver/operators.py
@@ -51,6 +51,13 @@ class Operator(object):
self.timer_label = ''
self.timer_label += str(ncells)
+ self.B_phi_form = div(self.w)*self.phi_tmp*self.dx
+ self.B_phi = Function(self.V_velocity)
import gc
def howmany(cls):
return len([x for x in gc.get_objects() if isinstance(x, cls)])
from firedrake.matrix import Matrix
from firedrake.petsc import PETSc
import gc