gridap / gridap/Gridap.jl

MappedGrid does not override get_cell_map

Open
#1,225 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Julia
Stars
879
Forks
120
Avg merge
6d 3h
Merged PRs (30d)
4

Description

Describe the bug

MappedGrid computes and stores a composed geometric map

geo_map = phys_map ∘ model_map

in its constructor, but it does not override get_cell_map.

Because of this, calling get_cell_map on a MappedGrid falls back to the default implementation for Grid, which reconstructs the map using linear interpolation of the deformed node coordinates.

function get_cell_map(trian::Grid)
  cell_to_coords = get_cell_coordinates(trian)
  cell_to_shapefuns = get_cell_shapefuns(trian)
  lazy_map(linear_combination, cell_to_coords, cell_to_shapefuns)
end

This reconstruction ignores the stored geo_map.


Impact

For nonlinear or curved phys_map, the reconstructed map becomes a piecewise linear approximation of the geometry instead of the intended composed map. This can lead to incorrect Jacobians and integration results during FE assembly.


Affected file

src/Geometry/MappedDiscreteModels.jl

Possible fix

Return the stored map from MappedGrid:

get_cell_map(grid::MappedGrid) = grid.geo_map

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/Geometry/MappedDiscreteModels.jl and inspect MappedGrid alongside the Grid implementation of get_cell_map. Verify that the stored geo_map is returned for MappedGrid rather than reconstructing a piecewise linear map, then run the relevant Gridap tests and confirm curved geometries use the composed map.

Written by the indexing model from the issue text.

Assessment

Tech stack
julia
Domain
backend
Issue type
Bug
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.