42
static boost::shared_ptr<Form> a(const Mesh& mesh)
42
static std::shared_ptr<Form> a(const Mesh& mesh)
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));;
56
static boost::shared_ptr<Form> a(const Mesh& mesh)
56
static std::shared_ptr<Form> a(const Mesh& mesh)
58
boost::shared_ptr<FunctionSpace> _V(new NavierStokes::FunctionSpace(mesh));
58
std::shared_ptr<FunctionSpace> _V(new NavierStokes::FunctionSpace(mesh));
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));
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));
77
boost::shared_ptr<Form> a(new NavierStokes::BilinearForm(_V, _V));
77
std::shared_ptr<Form> a(new NavierStokes::BilinearForm(_V, _V));
79
79
a->set_coefficient(0, w0);
80
80
a->set_coefficient(1, w1);
89
double bench(std::string form, boost::shared_ptr<const Form> a)
89
double bench(std::string form, std::shared_ptr<const Form> a)
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();
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)));