gridap / GridapEmbedded.jl

Embedded finite element methods in Julia
Other
36 stars 13 forks source link

[Distributed] Support for discrete geometries #89

Open zjwegert opened 3 weeks ago

zjwegert commented 3 weeks ago

Discrete geometries are not currently available. It looks like the best way to go about this would be a type DistributedDiscreteGeometry. I have created a starting PR with the new struct and the bare minimum of functionality to implement a Poisson test.

The constructor for DistributedDiscreteGeometry is currently poorly optimised and requires the evaluation of an FEFunction at point_to_coords. See below:

function DistributedDiscreteGeometry(φh::CellField,model::DistributedDiscreteModel)
  gids = get_cell_gids(model)
  geometries = map(local_views(model),local_views(gids),local_views(φh)) do model,gids,φh
    ownmodel = remove_ghost_cells(model,gids)
    point_to_coords = collect1d(get_node_coordinates(ownmodel))
    DiscreteGeometry(φh(point_to_coords),point_to_coords)
  end
  DistributedDiscreteGeometry(geometries)
end
zjwegert commented 1 week ago

The above now avoids evaluating a cell field along point_to_coords. I have also added some tests.