Skip to content

Shape function gradients are incorrectly assumed to be constant within wedge elements #634

Description

@dseyler

Description

In Code/Source/solver/nn_elem_props.h, the flag mshType::lshpF is set to indicate whether shape functions are linear (including wedge elements). This flag is then used in several places throughout the code to decide whether the derivative of the shape functions is constant across the element or needs to be computed per Gauss point. This is true for LIN1, TRI3, and TET4 elements but not for WDG elements.

for (int g = 0; g < lM.nG; g++) {
  if (g == 0 || !lM.lShpF) {
    nn::gnn(eNoN, nsd, nsd, Nx_g, xl, Nx, Jac, ksix);   // Nx and Jac
  }
  double w = lM.w(g) * Jac;
  ...
}

This bug appears 35 times in the codebase, and there are currently no wedge element test cases to catch it.

file line number
post.cpp 263, 433, 581, 678, 762, 921, 1775, 2060
fluid.cpp 634, 642, 706, 715
fsi.cpp 181, 189, 281, 290
all_fun.cpp 390, 589, 656
stokes.cpp 137, 169, 178
ustruct.cpp 330, 363, 371
cep.cpp 490
cmm.cpp 876
eq_assem.cpp 248
heatf.cpp 112
heats.cpp 89
Integrator.cpp 1171
l_elas.cpp 112
mesh.cpp 114
set_bc.cpp 1416
sv_struct.cpp 297

Reproduction

There are no wedge element test cases to reproduce this bug.

Expected behavior

Either a new flag should be added to indicate that an element has a constant shape function gradient or these locations in the code should be gated on element type rather than lshpF

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct and Contributing Guidelines

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions