template<int dim>
void ElasticityEquation<dim>::apply_boundary_conditions(const double time, const double velocity)
{
// Begin timer
TimerOutput::Scope t(computing_timer, "Apply Boundary Condition");
boundary_values.clear();
VectorTools::interpolate_boundary_values (dof_handler,2,ZeroFunction<dim>(dim),boundary_values);
VectorTools::interpolate_boundary_values (dof_handler,3,BoundaryValues<dim>(time, velocity) , boundary_values);
// The range of owned dofs
std::pair<unsigned int, unsigned int> range = solution.local_range();
// Set the boundary conditions
for (typename std::map<unsigned int, double>::const_iterator i = boundary_values.begin(); i != boundary_values.end(); ++i){
if (i->first >= range.first && i->first < range.second){
completely_distributed_solution(i->first) = i->second;
}
}
completely_distributed_solution.compress(VectorOperation::insert);
hanging_constraints.distribute( completely_distributed_solution);
solution = completely_distributed_solution;
}