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

« back to all changes in this revision

Viewing changes to bench/fem/multicore/cpp/main.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:
39
39
{
40
40
  public:
41
41
 
42
 
  static boost::shared_ptr<Form> a(const Mesh& mesh)
 
42
  static std::shared_ptr<Form> a(const Mesh& mesh)
43
43
  {
44
44
    // Create function space
45
 
    boost::shared_ptr<FunctionSpace> _V(new Poisson::FunctionSpace(mesh));
46
 
    boost::shared_ptr<Form> _a(new Poisson::BilinearForm(_V, _V));;
 
45
    std::shared_ptr<FunctionSpace> _V(new Poisson::FunctionSpace(mesh));
 
46
    std::shared_ptr<Form> _a(new Poisson::BilinearForm(_V, _V));;
47
47
    return _a;
48
48
  }
49
49
 
53
53
{
54
54
  public:
55
55
 
56
 
  static boost::shared_ptr<Form> a(const Mesh& mesh)
 
56
  static std::shared_ptr<Form> a(const Mesh& mesh)
57
57
  {
58
 
    boost::shared_ptr<FunctionSpace> _V(new NavierStokes::FunctionSpace(mesh));
 
58
    std::shared_ptr<FunctionSpace> _V(new NavierStokes::FunctionSpace(mesh));
59
59
 
60
 
    boost::shared_ptr<FunctionSpace>
 
60
    std::shared_ptr<FunctionSpace>
61
61
      W0(new NavierStokes::Form_a_FunctionSpace_2(mesh));
62
 
    boost::shared_ptr<FunctionSpace>
 
62
    std::shared_ptr<FunctionSpace>
63
63
      W1(new NavierStokes::Form_a_FunctionSpace_3(mesh));
64
 
    boost::shared_ptr<FunctionSpace>
 
64
    std::shared_ptr<FunctionSpace>
65
65
      W2(new NavierStokes::Form_a_FunctionSpace_4(mesh));
66
 
    boost::shared_ptr<FunctionSpace>
 
66
    std::shared_ptr<FunctionSpace>
67
67
      W3(new NavierStokes::Form_a_FunctionSpace_5(mesh));
68
 
    boost::shared_ptr<FunctionSpace>
 
68
    std::shared_ptr<FunctionSpace>
69
69
      W4(new NavierStokes::Form_a_FunctionSpace_6(mesh));
70
70
 
71
 
    boost::shared_ptr<Function> w0(new Function(W0));
72
 
    boost::shared_ptr<Function> w1(new Function(W1));
73
 
    boost::shared_ptr<Function> w2(new Function(W2));
74
 
    boost::shared_ptr<Function> w3(new Function(W3));
75
 
    boost::shared_ptr<Function> w4(new Function(W4));
 
71
    std::shared_ptr<Function> w0(new Function(W0));
 
72
    std::shared_ptr<Function> w1(new Function(W1));
 
73
    std::shared_ptr<Function> w2(new Function(W2));
 
74
    std::shared_ptr<Function> w3(new Function(W3));
 
75
    std::shared_ptr<Function> w4(new Function(W4));
76
76
 
77
 
    boost::shared_ptr<Form> a(new NavierStokes::BilinearForm(_V, _V));
 
77
    std::shared_ptr<Form> a(new NavierStokes::BilinearForm(_V, _V));
78
78
 
79
79
    a->set_coefficient(0, w0);
80
80
    a->set_coefficient(1, w1);
86
86
  }
87
87
};
88
88
 
89
 
double bench(std::string form, boost::shared_ptr<const Form> a)
 
89
double bench(std::string form, std::shared_ptr<const Form> a)
90
90
{
91
91
  std::size_t num_threads = parameters["num_threads"];
92
92
  info_underline("Benchmarking %s, num_threads = %d", form.c_str(),
128
128
  Mesh mesh = old_mesh.renumber_by_color();
129
129
 
130
130
  // Test cases
131
 
  std::vector<std::pair<std::string, boost::shared_ptr<const Form> > > forms;
 
131
  std::vector<std::pair<std::string, std::shared_ptr<const Form> > > forms;
132
132
  forms.push_back(std::make_pair("Poisson", PoissonFactory::a(mesh)));
133
133
  forms.push_back(std::make_pair("NavierStokes", NavierStokesFactory::a(mesh)));
134
134