Skip to content

MappedGrid does not override get_cell_map #1225

@Ady0333

Description

@Ady0333

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions