Need more documentation about TractionType
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 245
- Forks
- 36
- Avg merge
- 8d 23h
- Merged PRs (30d)
- 4
Description
https://github.com/LLNL/serac/blob/eb736b5abe45304aacc987ce6004286f721ab692/src/serac/physics/solid_mechanics.hpp#L496
I need more documentation about how the `TractionType` lambda needs to be defined (standard disclaimers about not being a mechanical engineer). I kind of expected that `x` would be a `::mfem::Vector` indicating the location of the point in space, and I expected that its size would be equal to the spatial dimension of the problem. Based on difficult to interpret compiler output, it appears to be a `::serac::tensor` which leaves me scratching my head about what `x` is here.
The second argument is named `normal`, so I would expect that it's a `::mfem::Vector` of size equal to the spatial dimension. Presumably, it's pointing in the direction from inside to outside? I am not currently using `normal`, so I don't know if these interpretations are wrong or right. Ideally, the documentation would make it clearer.
Our LiDO test that compiles, has a return value of `1*x`, so presumably, the return value is supposed to be a `::serac::tensor`. If `x` is the spatial location in some sense, why would the load be in the direction of the spatial location?
In the example I am working on, I am trying to set a point external load in the negative y direction at the top in y and in the middle in x for a three point bend problem. My incorrect intuitions led me to right this (in the LiDO API call that calls `setPiolaTraction`):
```c++
physics_->setBoundaryLoad([X_WIDTH,Y_WIDTH,X_LEN,Y_LEN](const auto &location, [[maybe_unused]] const auto &normal)
{
constexpr double LOAD=-0.5;
::mfem::Vector result(2);
const double signedDistanceFromXCenter(location[0]-X_LEN*0.5);
const double signedDistanceFromYTop(Y_LEN-location[1]);
result[0] = 0.0; // never any x-component
result[1] = ((::std::fabs(signedDistanceFromXCenter) < X_WIDTH) &&
(::std::fabs(signedDistanceFromYTop) < Y_WIDTH)) ? LOAD : 0.0;
return result;
});
```
There also appears to be a cut-and-paste error when the current documentation says "return the thermal flux value".
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/serac/physics/solid_mechanics.hpp around line 496 and trace setPiolaTraction/setBoundaryLoad, then inspect the compiling LiDO test mentioned in the issue. Document the types and meanings of TractionType's location and normal arguments, the expected return value, and correct the thermal flux wording.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100