### copying of a DrichletBC object

43
views
0
12 weeks ago by
Hello,

I want to create a flexible domain in dolfin such that I test different geometries with minimum rework.

To achieve this I need to create a vector of DrichletBC instead of hard coding each boundary condition separately. So instead of code like this:

DirichletBC bc0(V, u0, boundary0);
DirichletBC bc1(V, u1, boundary1);
DirichletBC bc2(V, u2, boundary2);

std::vector<const DirichletBC*> bcs = {{&bc0, &bc1, &bc2}};​

I want to define a vector of DrichletBC objects. I tried something like this:

std::vector<DirichletBC> bcs_vect;
for (unsigned int t = 0; t < n; t++)
{
const DirichletBC bb(V, u0[t], boundary[t]);
bcs_vect.push_back(&bb);
}

std::vector<const DirichletBC*> bcs(n);
for (unsigned int t = 0; t < n; t++)
{
bcs[t] = &bcs_vect[t];
}​

but I got complains about the copy constructor of DrichletBC class.