DirichletBC.markers() wrong return value

Bug #1161524 reported by Felix Ospald
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
DOLFIN
New
Undecided
Unassigned

Bug Description

const std::vector<std::pair<std::size_t, std::size_t> >& DirichletBC::markers() const
{
  return facets;
}

should be

const std::vector<std::pair<std::size_t, std::size_t> >& DirichletBC::markers() const
{
  init_facets();
  return facets;
}

otherwise the array may be empty in some cases...
Also in

void DirichletBC::init_facets() const
{
  Timer timer("DirichletBC init facets");

  if (facets.size() > 0)
    return;

  if (_user_sub_domain)
    init_from_sub_domain(_user_sub_domain);
  else if (_user_mesh_function)
    init_from_mesh_function(*_user_mesh_function, _user_sub_domain_marker);
  else
    init_from_mesh(_user_sub_domain_marker);
}

it may be better to put the Timer after the if (facets.size() > 0) return; statement.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.