Commits

Johan Hake  committed a555eeb Merge

Merge branch 'master' into fix-issue-111

  • Participants
  • Parent commits 6d7c1cc, 2e8c939

Comments (0)

Files changed (21)

File cmake/modules/FindSCOTCH.cmake

   DOC "The PTSCOTCH library"
   )
 
-# Check for ptesmumps  
+# Check for ptesmumps
 find_library(PTESMUMPS_LIBRARY
   NAMES ptesmumps esmumps
   HINTS ${SCOTCH_DIR}/lib $ENV{SCOTCH_DIR}/lib ${PETSC_DIR}/lib
   )
 
 #set(SCOTCH_DEBUG 1)
-set(CMAKE_CXX_FLAGS "-DMPICH_IGNORE_CXX_SEEK")
 set(SCOTCH_LIBRARIES ${PTSCOTCH_LIBRARY})
 if (PTESMUMPS_LIBRARY)
   set(SCOTCH_LIBRARIES ${SCOTCH_LIBRARIES}  ${PTESMUMPS_LIBRARY})

File cmake/scripts/generate-cmakefiles

 # Compiler definitions
 add_definitions(${DOLFIN_CXX_DEFINITIONS})
 
-# Add special DOLFIN compiler flags
-set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${DOLFIN_CXX_FLAGS}")
-
 # Include directories
 include_directories(${DOLFIN_INCLUDE_DIRS})
 include_directories(SYSTEM ${DOLFIN_3RD_PARTY_INCLUDE_DIRS})

File demo/undocumented/mesh-generation/cpp/main.cpp

   domain_vertices.push_back(Point(0.0,  0.0));
 
   // Generate 2D mesh and plot
+  cout << "Generate mesh of polygonal domain . . ." << endl;
   PolygonalMeshGenerator::generate(mesh, domain_vertices, 0.25);
   plot(mesh);
 
   faces[3][2] = 2;
 
   // Generate volume mesh (tetrahedral cells)
-  PolyhedralMeshGenerator::generate(mesh, face_vertices, faces, 0.04);
-  cout << "Dim: " << mesh.topology().dim() << endl;
+  cout << "Generate volume mesh of polyhedral domain . . ." << endl;
+  PolyhedralMeshGenerator::generate(mesh, face_vertices, faces, 0.05);
   plot(mesh);
   interactive();
 
   // Generate surface mesh (triangular cells)
+  cout << "Generate surface mesh of polyhedral domain . . ." << endl;
   PolyhedralMeshGenerator::generate_surface_mesh(mesh, face_vertices, faces,
-                                                 0.04);
-  cout << "Dim: " << mesh.topology().dim() << endl;
+                                                 0.05);
   plot(mesh);
   interactive();
 
   // Generate volume mesh from OFF file input (a cube) and plot
+  cout << "Generate volume mesh of polyhedral domain from OFF file . . ." << endl;
   PolyhedralMeshGenerator::generate(mesh, "../cube.off", 0.05);
-  cout << "Dim: " << mesh.topology().dim() << endl;
   plot(mesh);
   interactive();
 
   // Generate surface mesh from OFF file input (a cube) and plot
+  cout << "Generate surface mesh of polyhedral domain from OFF file . . ." << endl;
   PolyhedralMeshGenerator::generate_surface_mesh(mesh, "../cube.off", 0.05);
-  cout << "Dim: " << mesh.topology().dim() << endl;
-  plot(mesh);
-  interactive();
-
-  // Generate surface in 3D mesh from OFF file input (a cube) and plot
-  PolyhedralMeshGenerator::generate_surface_mesh(mesh, "../cube.off", 0.05);
-  cout << "Dim: " << mesh.topology().dim() << endl;
   plot(mesh);
   interactive();
 
   // Create warped sphere object
   WarpedSphere surface;
 
-  // Generate surface mesh
-  ImplicitDomainMeshGenerator::generate_surface(mesh, surface, 0.1);
-  cout << "Dim: " << mesh.topology().dim() << endl;
+  // Generate volume mesh
+  cout << "Generate volume mesh of implicitly define domain . . ." << endl;
+  ImplicitDomainMeshGenerator::generate(mesh, surface, 0.15);
   plot(mesh);
   interactive();
 
-  // Generate volume mesh
-  ImplicitDomainMeshGenerator::generate(mesh, surface, 0.15);
-  cout << "Dim: " << mesh.topology().dim() << endl;
+  // Generate surface mesh
+  cout << "Generate surface mesh of implicitly define domain . . ." << endl;
+  ImplicitDomainMeshGenerator::generate_surface(mesh, surface, 0.1);
   plot(mesh);
   interactive();
+
 }
 
 #else

File demo/undocumented/mesh-generation/python/demo_mesh-generation.py

+# Copyright (C) 2012 Garth N. Wells
+#
+# This file is part of DOLFIN.
+#
+# DOLFIN is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# DOLFIN is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public License
+# along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
+#
+# First added:  2012-02-02
+# Last changed:
+#
+# This program generates a mesh for a polygonal domain that is
+# represented by a list of its vertices.
+
+from dolfin import *
+
+if not has_cgal():
+    print "DOLFIN must be compiled with CGAL to run this demo."
+    exit(0)
+
+# Create empty Mesh
+mesh = Mesh()
+
+# Create list of polygonal domain vertices
+domain_vertices = [Point(0.0, 0.0),
+                   Point(10.0, 0.0),
+                   Point(10.0, 2.0),
+                   Point(8.0, 2.0),
+                   Point(7.5, 1.0),
+                   Point(2.5, 1.0),
+                   Point(2.0, 4.0),
+                   Point(0.0, 4.0),
+                   Point(0.0, 0.0)]
+
+# Generate mesh and plot
+print("Generate mesh of polygonal domain . . .")
+PolygonalMeshGenerator.generate(mesh, domain_vertices, 0.25);
+plot(mesh, interactive=True)
+
+# Polyhedron face vertices
+face_vertices = [Point(0.0, 0.0, 0.0),
+                 Point(0.0, 0.0, 1.0),
+                 Point(0.0, 1.0, 0.0),
+                 Point(1.0, 0.0, 0.0)]
+
+# Polyhedron faces (of a tetrahedron)
+face0 = [3, 2, 1]
+face1 = [0, 3, 1]
+face2 = [0, 2, 3]
+face3 = [0, 1, 2]
+faces = [face0, face1, face2, face3]
+
+# Generate 3D mesh and plot
+print("Generate volume mesh of polyhedral domain . . .")
+PolyhedralMeshGenerator.generate(mesh, face_vertices, faces, 0.05)
+plot(mesh, interactive=True)
+
+# Generate 3D surface mesh and plot
+print("Generate surface mesh of polyhedral domain . . .")
+PolyhedralMeshGenerator.generate_surface_mesh(mesh, face_vertices, faces, 0.05)
+plot(mesh, interactive=True)
+
+# Generate volume mesh from OFF file input (cube)
+print("Generate volume mesh of polyhedral domain from OFF file . . .")
+PolyhedralMeshGenerator.generate(mesh, "../cube.off", 0.05)
+plot(mesh, interactive=True)
+
+# Generate surface mesh from OFF file input (cube)
+print("Generate surface mesh of polyhedral domain from OFF file . . .")
+PolyhedralMeshGenerator.generate(mesh, "../cube.off", 0.05)
+plot(mesh, interactive=True)

File demo/undocumented/mesh-generation/python/demo_mesh_generation.py

-# Copyright (C) 2012 Garth N. Wells
-#
-# This file is part of DOLFIN.
-#
-# DOLFIN is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Lesser General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# DOLFIN is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Lesser General Public License for more details.
-#
-# You should have received a copy of the GNU Lesser General Public License
-# along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
-#
-# First added:  2012-02-02
-# Last changed:
-#
-# This program generates a mesh for a polygonal domain that is
-# represented by a list of its vertices.
-
-from dolfin import *
-
-if not has_cgal():
-    print "DOLFIN must be compiled with CGAL to run this demo."
-    exit(0)
-
-# Create empty Mesh
-mesh = Mesh()
-
-# Create list of polygonal domain vertices
-domain_vertices = [Point(0.0, 0.0),
-                   Point(10.0, 0.0),
-                   Point(10.0, 2.0),
-                   Point(8.0, 2.0),
-                   Point(7.5, 1.0),
-                   Point(2.5, 1.0),
-                   Point(2.0, 4.0),
-                   Point(0.0, 4.0),
-                   Point(0.0, 0.0)]
-
-# Generate mesh and plot
-PolygonalMeshGenerator.generate(mesh, domain_vertices, 0.25);
-plot(mesh, interactive=True)
-
-# Polyhedron face vertices
-face_vertices = [Point(0.0, 0.0, 0.0),
-                 Point(0.0, 0.0, 1.0),
-                 Point(0.0, 1.0, 0.0),
-                 Point(1.0, 0.0, 0.0)]
-
-# Polyhedron faces (of a tetrahedron)
-face0 = [3, 2, 1]
-face1 = [0, 3, 1]
-face2 = [0, 2, 3]
-face3 = [0, 1, 2]
-faces = [face0, face1, face2, face3]
-
-# Generate 3D mesh and plot
-PolyhedralMeshGenerator.generate(mesh, face_vertices, faces, 0.05)
-plot(mesh, interactive=True)
-
-# Generate 3D mesh from OFF file input (cube)
-PolyhedralMeshGenerator.generate(mesh, "../cube.off", 0.05)
-plot(mesh, interactive=True)

File dolfin/common/Timer.cpp

+// Copyright (C) 2010 Garth N. Wells
+//
+// This file is part of DOLFIN.
+//
+// DOLFIN is free software: you can redistribute it and/or modify
+// it under the terms of the GNU Lesser General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
+//
+// DOLFIN is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public License
+// along with DOLFIN. If not, see <http://www.gnu.org/licenses/>.
+//
+// First added:  2013-09-08
+// Last changed:
+
+#include <dolfin/parameter/GlobalParameters.h>
+#include <dolfin/log/LogManager.h>
+#include "timing.h"
+#include "Timer.h"
+
+using namespace dolfin;
+
+//-----------------------------------------------------------------------------
+Timer::Timer(std::string task) : _task(""), t(time()), stopped(false)
+{
+  const std::string prefix = parameters["timer_prefix"];
+  _task = prefix + task;
+}
+//-----------------------------------------------------------------------------
+Timer::~Timer()
+{
+ if (!stopped)
+   stop();
+}
+//-----------------------------------------------------------------------------
+void Timer::start()
+{
+  t = time();
+  stopped = false;
+}
+//-----------------------------------------------------------------------------
+double Timer::stop()
+{
+  t = time() - t;
+  LogManager::logger.register_timing(_task, t);
+  stopped = true;
+  return t;
+}
+//-----------------------------------------------------------------------------
+double Timer::value() const
+{
+  return t;
+}
+//-----------------------------------------------------------------------------

File dolfin/common/Timer.h

 #ifndef __TIMER_H
 #define __TIMER_H
 
-#include <iostream>
-
-#include <dolfin/parameter/GlobalParameters.h>
-#include <dolfin/log/LogManager.h>
-#include "timing.h"
+#include <string>
 
 namespace dolfin
 {
   public:
 
     /// Create timer
-    Timer(std::string task) : _task(""), t(time()), stopped(false)
-    {
-      const std::string prefix = parameters["timer_prefix"];
-      _task = prefix + task;
-    }
+    Timer(std::string task);
 
     /// Destructor
-    ~Timer()
-    { if (!stopped) stop(); }
+    ~Timer();
 
     /// Start timer
-    void start()
-    { t = time(); stopped = false; }
+    void start();
 
     /// Stop timer
-    double stop()
-    {
-      t = time() - t;
-      LogManager::logger.register_timing(_task, t);
-      stopped = true;
-      return t;
-    }
+    double stop();
 
     /// Return value of timer (or time at start if not stopped)
-    double value() const
-    { return t; }
+    double value() const;
 
   private:
 

File dolfin/fem/DofMapBuilder.cpp

 #include <dolfin/mesh/Restriction.h>
 #include <dolfin/mesh/SubDomain.h>
 #include <dolfin/mesh/Vertex.h>
+#include <dolfin/parameter/GlobalParameters.h>
 #include "DofMap.h"
 #include "UFCCell.h"
 #include "DofMapBuilder.h"
 
-#include <dolfin/common/utils.h>
-
 using namespace dolfin;
 
 //-----------------------------------------------------------------------------

File dolfin/generation/CGALMeshBuilder.h

 #include <dolfin/mesh/Mesh.h>
 #include <dolfin/mesh/MeshEditor.h>
 
+// This file should not be indlued in any header files to avoid
+// polluting DOLFIN with CGAL code.
+
 namespace dolfin
 {
 

File dolfin/generation/CSGCGALMeshGenerator3D.cpp

 #ifdef HAS_CGAL
 
 #include "cgal_csg3d.h"
-#include <dolfin/generation/triangulate_polyhedron.h>
+#include <dolfin/generation/cgal_triangulate_polyhedron.h>
 
 //-----------------------------------------------------------------------------
 static void build_dolfin_mesh(const csg::C3t3& c3t3, Mesh& mesh)

File dolfin/generation/PolyhedralMeshGenerator.cpp

 
 // The below two files are from the CGAL demos. Path can be changed
 // once they are included with the CGAL code.
-#include "triangulate_polyhedron.h"
+#include "cgal_triangulate_polyhedron.h"
 #include "compute_normal.h"
 
 #include <dolfin/common/MPI.h>
 typedef CGAL::Polyhedral_mesh_domain_with_features_3<K> Mesh_domain;
 
 // CGAL 3D triangulation vertex typedefs
-typedef CGAL::Triangulation_vertex_base_3<Geom_traits> Tvb3test_base;
-typedef CGAL::Triangulation_vertex_base_with_info_3<int, Geom_traits, Tvb3test_base> Tvb3test;
-typedef CGAL::Mesh_vertex_base_3<Geom_traits, Mesh_domain, Tvb3test> Vertex_base;
+typedef CGAL::Triangulation_vertex_base_3<Geom_traits> Tvb3_base;
+typedef CGAL::Triangulation_vertex_base_with_info_3<int, Geom_traits,
+                                                    Tvb3_base> Tvb3;
+typedef CGAL::Mesh_vertex_base_3<Geom_traits, Mesh_domain, Tvb3> Vertex_base;
 
 // CGAL 3D triangulation cell typedefs
-typedef CGAL::Triangulation_cell_base_3<Geom_traits> Tcb3test_base;
-typedef CGAL::Triangulation_cell_base_with_info_3<int, Geom_traits, Tcb3test_base> Tcb3test;
-typedef CGAL::Mesh_cell_base_3<Geom_traits, Mesh_domain, Tcb3test> Cell_base;
+typedef CGAL::Triangulation_cell_base_3<Geom_traits> Tcb3_base;
+typedef CGAL::Triangulation_cell_base_with_info_3<int, Geom_traits,
+                                                  Tcb3_base> Tcb3;
+typedef CGAL::Mesh_cell_base_3<Geom_traits, Mesh_domain, Tcb3> Cell_base;
 
 // CGAL 3D triangulation typedefs
 typedef CGAL::Triangulation_data_structure_3<Vertex_base, Cell_base> Tds_mesh;
 
   BuildSurface(const std::vector<Point>& vertices,
                const std::vector<std::vector<std::size_t> >& facets)
-             : _vertices(vertices), _facets(facets)  {}
+    : _vertices(vertices), _facets(facets)  {}
 
   void operator()(HDS& hds)
   {
 
   const std::vector<Point>& _vertices;
   const std::vector<std::vector<std::size_t> >& _facets;
-
 };
 //-----------------------------------------------------------------------------
-void PolyhedralMeshGenerator::generate(Mesh& mesh, const std::string off_file,
+void PolyhedralMeshGenerator::generate(Mesh& mesh,
+                                       const std::string off_file,
                                        double cell_size,
                                        bool detect_sharp_features)
 {
   const Mesh_criteria criteria(CGAL::parameters::facet_angle = 25,
                                CGAL::parameters::facet_size = cell_size,
                                CGAL::parameters::cell_radius_edge_ratio = 3.0,
-                               CGAL::parameters::edge_size = 0.5*cell_size,
+                               CGAL::parameters::edge_size = 0.6*cell_size,
                                CGAL::parameters::cell_size = cell_size);
 
   // Generate CGAL mesh
 //-----------------------------------------------------------------------------
 template<typename T>
 void PolyhedralMeshGenerator::cgal_generate_surface_mesh(Mesh& mesh, T& p,
-                                                         double cell_size,
-                                                         bool detect_sharp_features)
+                                                    double cell_size,
+                                                    bool detect_sharp_features)
 {
   // Check if any facets are not triangular and triangulate if
   // necessary.  The CGAL mesh generation only supports polyhedra with

File dolfin/generation/PolyhedronUtils.h

 #include "cgal_csg3d.h"
 #include "self_intersect.h"
 
+// This file should be be included in any other header files to avoid
+// CGAL leaking into the DOLFIN code.
+
 namespace dolfin
 {
+
   class PolyhedronUtils
   {
   public:

File dolfin/generation/cgal_triangulate_polyhedron.h

+// Copyright (c) 2010-2011  GeometryFactory Sarl (France).
+// All rights reserved.
+//
+// This file is part of CGAL (www.cgal.org).
+// You can redistribute it and/or modify it under the terms of the GNU
+// General Public License as published by the Free Software Foundation,
+// either version 3 of the License, or (at your option) any later version.
+//
+// Licensees holding a valid commercial license may use this file in
+// accordance with the commercial license agreement provided with the software.
+//
+// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
+// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+//
+// $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal/branches/next/Polyhedron/demo/Polyhedron/include/CGAL/triangulate_polyhedron.h $
+// $Id: triangulate_polyhedron.h 67117 2012-01-13 18:14:48Z lrineau $
+//
+//
+// Author(s)     : Laurent Rineau
+
+#ifndef CGAL_TRIANGULATE_POLYHEDRON_H
+
+#include <CGAL/Modifier_base.h>
+#include <CGAL/HalfedgeDS_decorator.h>
+
+#include <CGAL/Triangulation_vertex_base_with_info_2.h>
+#include <CGAL/Triangulation_face_base_with_info_2.h>
+#include <CGAL/Constrained_Delaunay_triangulation_2.h>
+#include <CGAL/Constrained_triangulation_plus_2.h>
+#include <CGAL/Triangulation_2_filtered_projection_traits_3.h>
+
+// TODO: submit this file to CGAL too
+#include "compute_normal.h"
+
+#include <queue>
+#include <vector>
+#include <utility>
+
+namespace CGAL {
+
+template <class Polyhedron>
+class Triangulate_modifier
+  : public CGAL::Modifier_base<typename Polyhedron::HalfedgeDS>
+{
+  typedef typename Polyhedron::HalfedgeDS HDS;
+  typedef typename Polyhedron::Traits Traits;
+
+  typedef typename Polyhedron::Halfedge_handle Halfedge_handle;
+  typedef typename Polyhedron::Facet Facet;
+  typedef typename Polyhedron::Facet_iterator Facet_iterator;
+  typedef typename Polyhedron::Facet_handle Facet_handle;
+
+  typedef CGAL::Triangulation_2_filtered_projection_traits_3<Traits> P_traits;
+
+  typedef CGAL::Triangulation_vertex_base_with_info_2<Halfedge_handle,
+                                                      P_traits> Vb;
+
+  struct Face_info
+  {
+    typename Polyhedron::Halfedge_handle e[3];
+    bool is_external;
+  };
+
+  typedef CGAL::Triangulation_face_base_with_info_2<Face_info,
+                                                    P_traits>          Fb1;
+
+  typedef CGAL::Constrained_triangulation_face_base_2<P_traits, Fb1>   Fb;
+  typedef CGAL::Triangulation_data_structure_2<Vb,Fb>                  TDS;
+  typedef CGAL::No_intersection_tag                                    Itag;
+  typedef CGAL::Constrained_Delaunay_triangulation_2<P_traits,
+                                                     TDS,
+                                                     Itag>             CDTbase;
+  typedef CGAL::Constrained_triangulation_plus_2<CDTbase>              CDT;
+
+public:
+  Triangulate_modifier() {}
+
+  bool is_external(typename CDT::Face_handle fh) const
+  { return fh->info().is_external; }
+
+  void operator()(HDS& hds)
+  {
+    CGAL::HalfedgeDS_decorator<HDS> decorator(hds);
+    typedef typename HDS::Halfedge Halfedge;
+
+    // One need to store facet handles into a vector, because the list of
+    // facets of the polyhedron will be modified during the loop, and
+    // that invalidates the range [facets_begin(), facets_end()[.
+    std::vector<Facet_handle> facets;
+    facets.reserve(hds.size_of_faces());
+    for(Facet_iterator fit = hds.faces_begin(),
+          end = hds.faces_end(); fit != end; ++fit)
+    {
+      facets.push_back(fit);
+    }
+
+    // Iterates on the vector of facet handles
+    for (typename std::vector<Facet_handle>::iterator fit_it = facets.begin(),
+          end0 = facets.end(); fit_it != end0; ++fit_it)
+    {
+      Facet_handle fit0 = *fit_it;
+      typename Traits::Vector_3 normal
+        = compute_facet_normal<Facet, Traits>(*fit0);
+
+      P_traits cdt_traits(normal);
+      CDT cdt(cdt_traits);
+
+      typename Facet::Halfedge_around_facet_circulator
+        he_circ = fit0->facet_begin(),
+        he_circ_end(he_circ);
+      typename CDT::Vertex_handle previous, first;
+      do
+      {
+        typename CDT::Vertex_handle vh = cdt.insert(he_circ->vertex()->point());
+        if (first == 0)
+          first = vh;
+        vh->info() = he_circ;
+        if(previous != 0 && previous != vh)
+          cdt.insert_constraint(previous, vh);
+        previous = vh;
+      } while (++he_circ != he_circ_end);
+      cdt.insert_constraint(previous, first);
+
+      // sets mark is_external
+      for(typename CDT::All_faces_iterator
+            fit = cdt.all_faces_begin(),
+            end = cdt.all_faces_end();
+          fit != end; ++fit)
+      {
+        fit->info().is_external = false;
+      }
+      std::queue<typename CDT::Face_handle> face_queue;
+      face_queue.push(cdt.infinite_vertex()->face());
+      while (!face_queue.empty())
+      {
+        typename CDT::Face_handle fh = face_queue.front();
+        face_queue.pop();
+        if(fh->info().is_external)
+          continue;
+        fh->info().is_external = true;
+        for (int i = 0; i < 3; ++i)
+        {
+          if (!cdt.is_constrained(std::make_pair(fh, i)))
+            face_queue.push(fh->neighbor(i));
+        }
+      }
+
+      // then modify the polyhedron
+      decorator.make_hole(fit0->halfedge());
+      for(typename CDT::Finite_edges_iterator
+            eit = cdt.finite_edges_begin(),
+            end = cdt.finite_edges_end();
+          eit != end; ++eit)
+      {
+        typename CDT::Face_handle fh = eit->first;
+        const int index = eit->second;
+        typename CDT::Face_handle opposite_fh = fh->neighbor(eit->second);
+        const int opposite_index = opposite_fh->index(fh);
+        const typename CDT::Vertex_handle va = fh->vertex(cdt. cw(index));
+        const typename CDT::Vertex_handle vb = fh->vertex(cdt.ccw(index));
+
+        if (!(is_external(fh) && is_external(opposite_fh)) &&
+            ! cdt.is_constrained(*eit) )
+        {
+          // strictly internal edge
+          Halfedge_handle h = hds.edges_push_back(Halfedge(),
+                                                  Halfedge());
+          fh->info().e[index] = h;
+          opposite_fh->info().e[opposite_index] = h->opposite();
+
+          decorator.set_vertex(h, va->info()->vertex());
+          decorator.set_vertex(h->opposite(), vb->info()->vertex());
+        }
+        if( cdt.is_constrained(*eit) )
+        {
+          if(!is_external(fh))
+            fh->info().e[index] = va->info();
+          if(!is_external(opposite_fh))
+            opposite_fh->info().e[opposite_index] = vb->info();
+        }
+      }
+      for (typename CDT::Finite_faces_iterator fit = cdt.finite_faces_begin(),
+            end = cdt.finite_faces_end(); fit != end; ++fit)
+      {
+        if (!is_external(fit))
+        {
+          Halfedge_handle h0 = fit->info().e[0];
+          Halfedge_handle h1 = fit->info().e[1];
+          Halfedge_handle h2 = fit->info().e[2];
+          CGAL_assertion(h0 != Halfedge_handle());
+          CGAL_assertion(h1 != Halfedge_handle());
+          CGAL_assertion(h2 != Halfedge_handle());
+
+          typedef typename Halfedge::Base HBase;
+          h0->HBase::set_next(h1);
+          decorator.set_prev(h1, h0);
+          h1->HBase::set_next(h2);
+          decorator.set_prev(h2, h1);
+          h2->HBase::set_next(h0);
+          decorator.set_prev(h0, h2);
+
+          decorator.fill_hole(h0);
+        }
+      }
+    } // end loop on facets of the input polyhedron
+  }
+}; // end class Triangulate_modifier
+
+template <typename Polyhedron>
+void triangulate_polyhedron(Polyhedron& p)
+{
+  CGAL::Triangulate_modifier<Polyhedron> modifier;
+  p.delegate(modifier);
+}
+
+} // end namespace CGAL
+
+#endif // CGAL_TRIANGULATE_POLYHEDRON_H

File dolfin/generation/triangulate_polyhedron.h

-// Copyright (c) 2010-2011  GeometryFactory Sarl (France).
-// All rights reserved.
-//
-// This file is part of CGAL (www.cgal.org).
-// You can redistribute it and/or modify it under the terms of the GNU
-// General Public License as published by the Free Software Foundation,
-// either version 3 of the License, or (at your option) any later version.
-//
-// Licensees holding a valid commercial license may use this file in
-// accordance with the commercial license agreement provided with the software.
-//
-// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
-// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
-//
-// $URL: svn+ssh://scm.gforge.inria.fr/svn/cgal/branches/next/Polyhedron/demo/Polyhedron/include/CGAL/triangulate_polyhedron.h $
-// $Id: triangulate_polyhedron.h 67117 2012-01-13 18:14:48Z lrineau $
-//
-//
-// Author(s)     : Laurent Rineau
-
-#ifndef CGAL_TRIANGULATE_POLYHEDRON_H
-
-#include <CGAL/Modifier_base.h>
-#include <CGAL/HalfedgeDS_decorator.h>
-
-#include <CGAL/Triangulation_vertex_base_with_info_2.h>
-#include <CGAL/Triangulation_face_base_with_info_2.h>
-#include <CGAL/Constrained_Delaunay_triangulation_2.h>
-#include <CGAL/Constrained_triangulation_plus_2.h>
-#include <CGAL/Triangulation_2_filtered_projection_traits_3.h>
-
-// TODO: submit this file to CGAL too
-#include "compute_normal.h"
-
-#include <queue>
-#include <vector>
-#include <utility>
-
-namespace CGAL {
-
-template <class Polyhedron>
-class Triangulate_modifier
-  : public CGAL::Modifier_base<typename Polyhedron::HalfedgeDS>
-{
-  typedef typename Polyhedron::HalfedgeDS HDS;
-  typedef typename Polyhedron::Traits Traits;
-
-  typedef typename Polyhedron::Halfedge_handle Halfedge_handle;
-  typedef typename Polyhedron::Facet Facet;
-  typedef typename Polyhedron::Facet_iterator Facet_iterator;
-  typedef typename Polyhedron::Facet_handle Facet_handle;
-
-  typedef CGAL::Triangulation_2_filtered_projection_traits_3<Traits> P_traits;
-
-  typedef CGAL::Triangulation_vertex_base_with_info_2<Halfedge_handle,
-                                                      P_traits> Vb;
-
-  struct Face_info
-  {
-    typename Polyhedron::Halfedge_handle e[3];
-    bool is_external;
-  };
-
-  typedef CGAL::Triangulation_face_base_with_info_2<Face_info,
-                                                    P_traits>          Fb1;
-
-  typedef CGAL::Constrained_triangulation_face_base_2<P_traits, Fb1>   Fb;
-  typedef CGAL::Triangulation_data_structure_2<Vb,Fb>                  TDS;
-  typedef CGAL::No_intersection_tag                                    Itag;
-  typedef CGAL::Constrained_Delaunay_triangulation_2<P_traits,
-                                                     TDS,
-                                                     Itag>             CDTbase;
-  typedef CGAL::Constrained_triangulation_plus_2<CDTbase>              CDT;
-
-public:
-  Triangulate_modifier() {}
-
-  bool is_external(typename CDT::Face_handle fh) const
-  { return fh->info().is_external; }
-
-  void operator()(HDS& hds)
-  {
-    CGAL::HalfedgeDS_decorator<HDS> decorator(hds);
-    typedef typename HDS::Halfedge Halfedge;
-
-    // One need to store facet handles into a vector, because the list of
-    // facets of the polyhedron will be modified during the loop, and
-    // that invalidates the range [facets_begin(), facets_end()[.
-    std::vector<Facet_handle> facets;
-    facets.reserve(hds.size_of_faces());
-    for(Facet_iterator fit = hds.faces_begin(),
-          end = hds.faces_end(); fit != end; ++fit)
-    {
-      facets.push_back(fit);
-    }
-
-    // Iterates on the vector of facet handles
-    for (typename std::vector<Facet_handle>::iterator fit_it = facets.begin(),
-          end0 = facets.end(); fit_it != end0; ++fit_it)
-    {
-      Facet_handle fit0 = *fit_it;
-      typename Traits::Vector_3 normal
-        = compute_facet_normal<Facet, Traits>(*fit0);
-
-      P_traits cdt_traits(normal);
-      CDT cdt(cdt_traits);
-
-      typename Facet::Halfedge_around_facet_circulator
-        he_circ = fit0->facet_begin(),
-        he_circ_end(he_circ);
-      typename CDT::Vertex_handle previous, first;
-      do
-      {
-        typename CDT::Vertex_handle vh = cdt.insert(he_circ->vertex()->point());
-        if (first == 0)
-          first = vh;
-        vh->info() = he_circ;
-        if(previous != 0 && previous != vh)
-          cdt.insert_constraint(previous, vh);
-        previous = vh;
-      } while (++he_circ != he_circ_end);
-      cdt.insert_constraint(previous, first);
-
-      // sets mark is_external
-      for(typename CDT::All_faces_iterator
-            fit = cdt.all_faces_begin(),
-            end = cdt.all_faces_end();
-          fit != end; ++fit)
-      {
-        fit->info().is_external = false;
-      }
-      std::queue<typename CDT::Face_handle> face_queue;
-      face_queue.push(cdt.infinite_vertex()->face());
-      while (!face_queue.empty())
-      {
-        typename CDT::Face_handle fh = face_queue.front();
-        face_queue.pop();
-        if(fh->info().is_external)
-          continue;
-        fh->info().is_external = true;
-        for (int i = 0; i < 3; ++i)
-        {
-          if (!cdt.is_constrained(std::make_pair(fh, i)))
-            face_queue.push(fh->neighbor(i));
-        }
-      }
-
-      // then modify the polyhedron
-      decorator.make_hole(fit0->halfedge());
-      for(typename CDT::Finite_edges_iterator
-            eit = cdt.finite_edges_begin(),
-            end = cdt.finite_edges_end();
-          eit != end; ++eit)
-      {
-        typename CDT::Face_handle fh = eit->first;
-        const int index = eit->second;
-        typename CDT::Face_handle opposite_fh = fh->neighbor(eit->second);
-        const int opposite_index = opposite_fh->index(fh);
-        const typename CDT::Vertex_handle va = fh->vertex(cdt. cw(index));
-        const typename CDT::Vertex_handle vb = fh->vertex(cdt.ccw(index));
-
-        if (!(is_external(fh) && is_external(opposite_fh)) &&
-            ! cdt.is_constrained(*eit) )
-        {
-          // strictly internal edge
-          Halfedge_handle h = hds.edges_push_back(Halfedge(),
-                                                  Halfedge());
-          fh->info().e[index] = h;
-          opposite_fh->info().e[opposite_index] = h->opposite();
-
-          decorator.set_vertex(h, va->info()->vertex());
-          decorator.set_vertex(h->opposite(), vb->info()->vertex());
-        }
-        if( cdt.is_constrained(*eit) )
-        {
-          if(!is_external(fh))
-            fh->info().e[index] = va->info();
-          if(!is_external(opposite_fh))
-            opposite_fh->info().e[opposite_index] = vb->info();
-        }
-      }
-      for (typename CDT::Finite_faces_iterator fit = cdt.finite_faces_begin(),
-            end = cdt.finite_faces_end(); fit != end; ++fit)
-      {
-        if (!is_external(fit))
-        {
-          Halfedge_handle h0 = fit->info().e[0];
-          Halfedge_handle h1 = fit->info().e[1];
-          Halfedge_handle h2 = fit->info().e[2];
-          CGAL_assertion(h0 != Halfedge_handle());
-          CGAL_assertion(h1 != Halfedge_handle());
-          CGAL_assertion(h2 != Halfedge_handle());
-
-          typedef typename Halfedge::Base HBase;
-          h0->HBase::set_next(h1);
-          decorator.set_prev(h1, h0);
-          h1->HBase::set_next(h2);
-          decorator.set_prev(h2, h1);
-          h2->HBase::set_next(h0);
-          decorator.set_prev(h0, h2);
-
-          decorator.fill_hole(h0);
-        }
-      }
-    } // end loop on facets of the input polyhedron
-  }
-}; // end class Triangulate_modifier
-
-template <typename Polyhedron>
-void triangulate_polyhedron(Polyhedron& p)
-{
-  CGAL::Triangulate_modifier<Polyhedron> modifier;
-  p.delegate(modifier);
-}
-
-} // end namespace CGAL
-
-#endif // CGAL_TRIANGULATE_POLYHEDRON_H

File dolfin/geometry/BoundingBoxTree3D.h

     }
 
     // Check whether point (x) is in bounding box (node)
-    bool point_in_bbox(const double* x, const uint node) const
+    bool point_in_bbox(const double* x, const unsigned int node) const
     {
       const double* b = _bbox_coordinates.data() + 6*node;
       return (b[0] - DOLFIN_EPS <= x[0] && x[0] <= b[3] + DOLFIN_EPS &&

File dolfin/io/HDF5File.cpp

 
   dolfin_assert(hdf5_file_open);
 
-  // FIXME: This routine is long and involves a lot of MPI,
-  // but it should work for the general case
-  // of reading a function that was written from
-  // a different number of processes.
-  // Memory efficiency could be improved by
-  // limiting the scope of some of the temporary
+  // FIXME: This routine is long and involves a lot of MPI, but it
+  // should work for the general case of reading a function that was
+  // written from a different number of processes.  Memory efficiency
+  // could be improved by limiting the scope of some of the temporary
   // variables
 
   // Check datasets exist
   }
 
   // Divide cells equally between processes
-  const std::pair<std::size_t, std::size_t> cell_range =
-    MPI::local_range(num_global_cells);
+  const std::pair<std::size_t, std::size_t> cell_range
+    = MPI::local_range(num_global_cells);
 
   // Read cells
   std::vector<std::size_t> input_cells;
   const std::size_t num_global_dofs = vector_size[0];
   dolfin_assert(num_global_dofs == x.size(0));
   const std::pair<dolfin::la_index, dolfin::la_index>
-    input_vector_range = MPI::local_range(vector_size[0]);  
+    input_vector_range = MPI::local_range(vector_size[0]);
 
   std::vector<double> input_values;
   HDF5Interface::read_dataset(hdf5_file_id, name + "/vector",
   mesh_data.clear();
 
   // --- Topology ---
+
   // Discover size of topology dataset
   std::vector<std::size_t> topology_dim
       = HDF5Interface::get_dataset_size(hdf5_file_id, topology_name);

File dolfin/io/HDF5Utility.h

   {
   public:
 
-    /// Generate two vectors, in the range of "vector_range" 
+    /// Generate two vectors, in the range of "vector_range"
     /// of the global DOFs.
     /// global_cells is a list of cells which point to the DOF (non-unique)
     /// and remote_local_dofi is the pertinent local_dof of the cell.
     /// input_cells is a list of cells held on this process, and
     /// input_cell_dofs/x_cell_dofs list their local_dofs.
-
     static void map_gdof_to_cell(const std::vector<std::size_t>& input_cells,
                           const std::vector<dolfin::la_index>& input_cell_dofs,
                           const std::vector<std::size_t>& x_cell_dofs,

File dolfin/la/KrylovSolver.cpp

 // Last changed: 2012-08-21
 
 #include <dolfin/common/Timer.h>
+#include <dolfin/parameter/GlobalParameters.h>
 #include <dolfin/parameter/Parameters.h>
 #include <dolfin/log/LogStream.h>
 #include "GenericMatrix.h"

File dolfin/quadrature/dolfin_quadrature.h

 
 // DOLFIN quadrature interface
 
-#include <dolfin/quadrature/BarycenterQuadrature.h>
+//#include <dolfin/quadrature/BarycenterQuadrature.h>
 
 #endif

File dolfin/swig/typemaps/std_vector.i

   $1 = PySequence_Check($input) ? 1 : 0;
 }
 
-%typemap (in, fragment=Py_convert_frag(TYPE_NAME)) const std::vector<std::vector<TYPE> >& ARG_NAME (std::vector<std::vector<TYPE> > tmp_vec, std::vector<TYPE> inner_vec, PyObject* inner_list, PyObject* item, TYPE value, dolfin::uint i, dolfin::uint j)
+%typemap (in, fragment=Py_convert_frag(TYPE_NAME)) const std::vector<std::vector<TYPE> >& ARG_NAME (std::vector<std::vector<TYPE> > tmp_vec, std::vector<TYPE> inner_vec, PyObject* inner_list, PyObject* item, TYPE value, std::size_t i, std::size_t j)
 {
   // IN_TYPEMAP_STD_VECTOR_OF_STD_VECTOR_OF_PRIMITIVES(TYPE, TYPE_UPPER,
   //                                    ARG_NAME, TYPE_NAME)
 IN_TYPEMAP_STD_VECTOR_OF_PRIMITIVES(unsigned int, INT32, , NPY_UINT, uint, uintc)
 IN_TYPEMAP_STD_VECTOR_OF_PRIMITIVES(std::size_t, INT64, , NPY_UINTP, uintp, uintp)
 
-// This typemap handles PETSc index typemap. Untested for 46-bit integers
+// This typemap handles PETSc index typemap. Untested for 64-bit integers
 IN_TYPEMAP_STD_VECTOR_OF_PRIMITIVES(PetscInt, INT32, , NPY_INT, intc, intc)
 
 PY_SEQUENCE_OF_SCALARS_TO_VECTOR_OF_PRIMITIVES(std::size_t, INT32, coloring_type, std_size_t, -1)
 
 IN_TYPEMAP_STD_VECTOR_OF_SMALL_DOLFIN_TYPES(Point)
 IN_TYPEMAP_STD_VECTOR_OF_SMALL_DOLFIN_TYPES(MeshEntity)
-
-IN_TYPEMAP_STD_VECTOR_OF_STD_VECTOR_OF_PRIMITIVES(unsigned int, INT32, facets, uint)
+IN_TYPEMAP_STD_VECTOR_OF_STD_VECTOR_OF_PRIMITIVES(std::size_t, INT32, facets, std_size_t)

File test/unit/quadrature/cpp/BaryCenter.cpp

 #include <dolfin.h>
 #include <dolfin/common/unittest.h>
 
+using namespace dolfin;
+
+/*
 #ifdef HAS_CGAL
 
 #include <CGAL/Nef_polyhedron_3.h>
 #include <CGAL/Polyhedron_3.h>
 
-using namespace dolfin;
-
 typedef Nef_polyhedron_3::Aff_transformation_3 Aff_transformation_3;
 typedef Nef_polyhedron_3::Plane_3 Plane_3;
 typedef Nef_polyhedron_3::Vector_3 Vector_3;
 };
 
 #else
+*/
 
 //No tests if CGAL is not available.
 
   CPPUNIT_TEST_SUITE_END();
 };
 
-#endif
+//#endif
+
 
 CPPUNIT_TEST_SUITE_REGISTRATION(BaryCenter);
 
 int main()
 {
+  dolfin::cout << "Barycenter test does nothing" << dolfin::endl;
   DOLFIN_TEST;
+  return 0;
 }