~ubuntu-branches/ubuntu/wily/dolfin/wily-proposed

« back to all changes in this revision

Viewing changes to dolfin/mesh/MeshQuality.cpp

  • Committer: Package Import Robot
  • Author(s): Johannes Ring
  • Date: 2014-09-22 14:35:34 UTC
  • mfrom: (1.1.17) (19.1.23 sid)
  • Revision ID: package-import@ubuntu.com-20140922143534-0yi89jyuqbgdxwm9
Tags: 1.4.0+dfsg-4
* debian/control: Disable libcgal-dev on i386, mipsel and sparc.
* debian/rules: Remove bad directives in pkg-config file dolfin.pc
  (closes: #760658).
* Remove debian/libdolfin-dev.lintian-overrides.

Show diffs side-by-side

added added

removed removed

Lines of Context:
29
29
 
30
30
//-----------------------------------------------------------------------------
31
31
dolfin::CellFunction<double>
32
 
MeshQuality::radius_ratios(boost::shared_ptr<const Mesh> mesh)
 
32
MeshQuality::radius_ratios(std::shared_ptr<const Mesh> mesh)
33
33
{
34
34
  // Create CellFunction
35
35
  CellFunction<double> cf(mesh, 0.0);
52
52
    qmax = std::max(qmax, cell->radius_ratio());
53
53
  }
54
54
 
55
 
  qmin = MPI::min(qmin);
56
 
  qmax = MPI::max(qmax);
 
55
  qmin = MPI::min(mesh.mpi_comm(), qmin);
 
56
  qmax = MPI::max(mesh.mpi_comm(), qmax);
57
57
  return std::make_pair(qmin, qmax);
58
58
}
59
59
//-----------------------------------------------------------------------------
80
80
  }
81
81
 
82
82
  for (std::size_t i = 0; i < values.size(); ++i)
83
 
    values[i] = MPI::sum(values[i]);
 
83
    values[i] = MPI::sum(mesh.mpi_comm(), values[i]);
84
84
 
85
85
  return std::make_pair(bins, values);
86
86
}
87
87
//-----------------------------------------------------------------------------
88
 
std::string 
 
88
std::string
89
89
MeshQuality::radius_ratio_matplotlib_histogram(const Mesh& mesh,
90
90
                                               std::size_t num_intervals)
91
91
{
99
99
  // Create Matplotlib string
100
100
  std::stringstream matplotlib;
101
101
  matplotlib << "def plot_histogram():" << std::endl;
102
 
  matplotlib << "    import pylab" <<  std::endl;
103
102
  std::stringstream bins, values;
104
103
  bins   << "    bins = [" << data.first[0];
105
104
  values << "    values = [" << data.second[0];