Dear Praveen,
if you have an implicit description of your curve, let's say a level-set like DoF-vector,
VectorType level_set_vector;
The latter is set up via
GridTools::MarchingCubeAlgorithm<dim, VectorType> mc(mapping,
dof_handler.get_fe());
Then, you could loop over the cells in your triangulation, and check whether the processed cell is cut or not:
std::vector<const typename Triangulation<dim, dim>::cell_iterator> cut_cells
for (const auto &cell : dof_handler.active_cell_iterators())
{
if (cell->is_locally_owned())
{
// determine points and cells of aux surface triangulation
std::vector<Point<dim>> surface_vertices;
std::vector<CellData<dim == 1 ? 1 : dim - 1>> surface_cells;
if (dim > 1)
mc.process_cell(cell, level_set_vector, contour_value, surface_vertices, surface_cells);
// no surface cells are written
else
mc.process_cell(cell, level_set_vector, contour_value, surface_vertices);
// append cell if it is cut by the interface
if (surface_vertices.size() == 0)
cut_cells.emplace_back(cell);
}
}
I hope this matches for your purpose.
Best,
Magdalena