Hi Wolfgang,

I've come back to this question after discovering some Grid tools.  I am 
now assessing GridTools::find_closest_vertex and 
GridTools::find_active_cell_around_point

const Point<3> pt1(0.0, 15.0,  8.20754);
std::vector<bool>  marked_vertices(triangulation.n_vertices(), true);

// Find the vertex closest to the point
unsigned int closest_v1 = GridTools::find_closest_vertex( dof_handler, pt1);

// Mark the vertex for a faster cell search
marked_vertices[closest_v1] = true;

// Find the cell containing the point (or a cell containing, if there are 
multiple)
auto cell_and_ref_point = GridTools::find_active_cell_around_point(
          dof_handler,    pt1,  marked_vertices, 1.e-4);

//  Search the vertices, then apply constraints
  for (unsigned int v = 0; v<cell_and_ref_point->n_vertices() ; v++)  // 
might be able to use 'vertex_iterator'
         if (cell_and_ref_point->vertex(v).distance(load1) < 1.e-4)
                
constraints.add_line(cell_and_ref_point->vertex_dof_index(v,0, 
cell_and_ref_point->active_fe_index() ));

I'm curious what your thoughts are on this approach.  I imagine it could 
have an advantage in some situations, depending on the size of the mesh and 
the number of constraints to be added.

I have not done any speed testing on this yet, tho.  Do you think it would 
be looking into?  Or do you see some fatal flaw with this approach?

Thanks,
Alex

On Wednesday, January 18, 2023 at 8:31:11 AM UTC-5 Alex Quinlan wrote:

> Thanks Wolfgang.  I appreciate the feedback.  I'll see if I can implement 
> some of the cost-saving tips that you suggested.
>
>
>
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dealii/ce083242-20b0-4091-b93a-142ddcc2534bn%40googlegroups.com.

Reply via email to