thelfer / tfel

Main repository of TFEL/MFront project
https://thelfer.github.io/tfel/web/index.html
Other
87 stars 40 forks source link

Some Bricks, laws, etc appear as undocumented, when they are actually documented #621

Closed Irvise closed 4 weeks ago

Irvise commented 1 month ago

Hi Thomas,

I compiled v5.0 about a month ago and I was talking to the OpenRADIOSS people about MFront (see https://github.com/orgs/OpenRadioss/discussions/2943#discussioncomment-10553584) and while checking a couple of things, I noticed that some parts of MFront are incorrectly set to (undocumented) when in reality, they are. See the example below:

fernando@localhost:~> mfront --list-behaviour-bricks
- DDIF2                         (documented)
- FiniteStrainSingleCrystal     (undocumented)
- StandardElasticity            (documented)
- StandardElastoViscoPlasticity (undocumented)
fernando@localhost:~> mfront --list-isotropic-hardening-rules
- Data        (undocumented)
- Linear      (undocumented)
- Power       (undocumented)
- Swift       (undocumented)
- UserDefined (undocumented)
- Voce        (undocumented)
fernando@localhost:~> 

StandrardElastoViscoPlasticity brick is documented, as well as its different isotropic hardening laws... I found the following src in MFront/src/MFront.cxx, which seems to be the one generating the incorrect output:

  [[noreturn]] static void displayList(const std::string& d,
                                       const std::vector<std::string>& names) {
    using tfel::utilities::TerminalColors;
    auto msize = std::string::size_type{};
    for (const auto& n : names) {
      msize = std::max(msize, n.size());
    }
    for (const auto& n : names) {
      const auto fp = getDocumentationFilePath(d, n);
      auto l = n;
      l.resize(msize, ' ');
      std::cout << "- " << l << " ";
      if (!fp.empty()) {
        std::cout.write(TerminalColors::Green, sizeof(TerminalColors::Green));
        std::cout << "(documented)";
      } else {
        std::cout.write(TerminalColors::Red, sizeof(TerminalColors::Red));
        std::cout << "(undocumented)";
      }
      std::cout.write(TerminalColors::Reset, sizeof(TerminalColors::Reset));
      std::cout << std::endl;
    }
    std::exit(EXIT_SUCCESS);
  }  // end of displayList

So it seems that for whatever reason, getDocumentationFilePath(d, n); is not finding the docs for those entries... I don't have time to fix this myself. I just wanted to bring this to your attention before releasing v5.0 :)

As always, great job! Best regards, Fer

thelfer commented 1 month ago

@Irvise Thanks for reporting this. I'll have a look.

Concerning OpenRADIOSS, it could be a very nice target. I understood from your post that this solver already has an user interface. Don't hesitate if you need help for linking the tools or if you think that is appropriate to have a meeting with the OpenRADIOSS devs.

thelfer commented 1 month ago

I think that getDocumentationFilePath works as expected. In the MFront sources, you can do:

ls ./docs/mfront/bricks/
DDIF2.md  StandardElasticity.md

So only the DDIF2 and StandardElasticity bricks are not documented (on the command line)...

Irvise commented 4 weeks ago

Oh... You are right... Well... Mmm... Maybe the webpage documentation for the StandardElastoViscoplastic brick could be transformed into its own documentation, no? That is where I have been taking all the info for it and it is pretty well documented (apart from the damage model).

I will be closing it now as you are right :)