SimVascular / SimVascular/svMultiPhysics

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

Open
#634 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C++
Stars
45
Forks
61
Avg merge
5d 23h
Merged PRs (30d)
11

Description

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

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 Code/Source/solver/nn_elem_props.h to understand how mshType::lshpF is set for WDG elements. Review the listed call sites in post.cpp, fluid.cpp, fsi.cpp, and the other named files, then add wedge-element test coverage; done means wedge gradients and Jacobians are handled correctly at each Gauss point.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
50/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.