Hello All,
I was trying to displace one vertex by a small value. Here is what I thought will work:
dealii::Point<dim> target_point(0,0,0);
double delta = 0.00001;
unsigned int component_num = 0
unsigned int vertices_per_cell=GeometryInfo<dim>::vertices_per_cell;
// Loop over each locally owned cell
typename DoFHandler<dim>::active_cell_iterator cell = dof_handler.begin_active(),
endc = dof_handler.end();
for (; cell!=endc; ++cell)
if (cell->is_locally_owned())
for (unsigned int i=0; i<vertices_per_cell; ++i)
// Check if the vertex is the target vertex
if (target_point.distance (cell->vertex(i)) < 1e-2 * cell->diameter())
{
unsigned int nodeID=cell->vertex_dof_index(i,component_num);
constraints.add_line(nodeID);
constraints.add_entry(nodeID,component_num,delta);
}
Is this the right approach? Thanks for any feedback.
Regards,
Rahul