Skip to content

Commit

Permalink
Merge pull request #616 from thelfer/615-mfront-c++-interface-missing…
Browse files Browse the repository at this point in the history
…-declaration-of-the-physicalconstants-class

Fix Issue #615
  • Loading branch information
thelfer authored Aug 27, 2024
2 parents e89edd3 + f18af62 commit 69a5a73
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/web/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,7 @@ pandoc_html(release-notes-4.0 "--toc" "--toc-depth=2" "--number-sections")
pandoc_html(release-notes-4.0.1 "--toc" "--toc-depth=2" "--number-sections")
pandoc_html(release-notes-4.0.2 "--toc" "--toc-depth=2" "--number-sections")
pandoc_html(release-notes-4.0.3 "--toc" "--toc-depth=2" "--number-sections")
pandoc_html(release-notes-4.0.4 "--toc" "--toc-depth=2" "--number-sections")
pandoc_html(release-notes-4.1 "--toc" "--toc-depth=2" "--number-sections")
pandoc_html(release-notes-4.1.1 "--toc" "--toc-depth=2" "--number-sections")
pandoc_html(release-notes-4.1.2 "--toc" "--toc-depth=2" "--number-sections")
Expand Down
2 changes: 2 additions & 0 deletions docs/web/mfront-template.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,8 @@
<li><a href="release-notes-4.0.html">Version 4.0.0</a></li>
<li><a href="release-notes-4.0.1.html">Version 4.0.1</a></li>
<li><a href="release-notes-4.0.2.html">Version 4.0.2</a></li>
<li><a href="release-notes-4.0.3.html">Version 4.0.3</a></li>
<li><a href="release-notes-4.0.4.html">Version 4.0.4</a></li>
</ul>
</li>
<li><a>Versions 4.1.x</a>
Expand Down
16 changes: 15 additions & 1 deletion mfront/src/CppMaterialPropertyInterface.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,21 @@ namespace mfront {
}
}
src << ") const\n{\n"
<< "using namespace std;\n";
<< "using namespace std;\n"
<< "using tfel::math::invert_type;\n"
<< "using tfel::math::result_type;\n"
<< "using tfel::math::derivative_type;\n";
if (useQuantities(mpd)) {
src << "using PhysicalConstants [[maybe_unused]] = "
<< "tfel::PhysicalConstants<double, true>;\n";
} else {
src << "using PhysicalConstants [[maybe_unused]] = "
<< "tfel::PhysicalConstants<double, false>;\n";
}
src << "[[maybe_unused]] auto min = [](const auto a, const auto b) "
<< "{ return a < b ? a : b; };\n"
<< "[[maybe_unused]] auto max = [](const auto a, const auto b) "
<< "{ return a > b ? a : b; };\n";
writeMaterialLaws(src, mpd.materialLaws);
writeStaticVariables(src, mpd.staticVars, fd.fileName);
for (const auto& i : mpd.inputs) {
Expand Down

0 comments on commit 69a5a73

Please sign in to comment.