Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/LevelSetCutters/DifferentiableTriangulations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,9 @@ function extract_dualized_cell_values(
bgcell_to_rcoords = lazy_map(get_vertex_coordinates,bgcell_to_polys)
bgcell_to_fields = CellData.get_data(φh)
bgcell_to_values = lazy_map(evaluate,bgcell_to_fields,bgcell_to_rcoords)
return bgcell_to_values
# When φh has complex-valued DOFs, we define the geometry using the real part.
bgcell_to_rvalues = lazy_map(real,bgcell_to_values)
return bgcell_to_rvalues
end

# TriangulationView
Expand Down
5 changes: 3 additions & 2 deletions src/LevelSetCutters/DiscreteGeometries.jl
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,15 @@ function DiscreteGeometry(
DiscreteGeometry(tree,point_to_coords)
end

# TODO: This assumes that the level set φh is 1st order, i.e that there is a 1-to-1 correspondence
# NOTE 1: This assumes that the level set φh is 1st order, i.e that there is a 1-to-1 correspondence
# between nodes in the mesh and dofs in φh.
# Even if we allowed higher order, the cuts are always linear. Not only it would be a waste
# of time to use higher order, but cuts could actually be wrong.
# This might be developped in the future.
# NOTE 2: When φh has complex-valued DOFs, we define the geometry using the real part of the dofs.
function DiscreteGeometry(
φh::CellField,model::DiscreteModel;name::String="")
point_to_value = get_free_dof_values(φh)
point_to_value = real(get_free_dof_values(φh))
point_to_coords = collect1d(get_node_coordinates(model))
DiscreteGeometry(point_to_value,point_to_coords;name)
end
Loading