Skip to content

Commit

Permalink
Merge pull request #549 from thelfer/548-generic-interface-fix-initia…
Browse files Browse the repository at this point in the history
…lisation-of-array-of-material-properties-when-quantities-are-used

Fix Issue 548
  • Loading branch information
thelfer authored May 6, 2024
2 parents 4f7c3c9 + 0ee1513 commit 273f933
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions docs/web/release-notes-4.1.2.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ eqnPrefixTemplate: "($$i$$)"

# Issues fixed

## Issue 548: [generic-interface] Fix initialisation of array of material properties when quantities are used

For more details, see <https://github.com/thelfer/tfel/issues/548.

## Issue 540: Allow behaviour to call models with more than one output

For more details, see <https://github.com/thelfer/tfel/issues/540.
Expand Down
8 changes: 4 additions & 4 deletions mfront/src/GenericBehaviourInterface.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1936,8 +1936,8 @@ namespace mfront {
os << "for(unsigned short idx=0; idx != " << v.arraySize
<< "; ++idx){\n";
if (v.isScalar()) {
os << "this->" << v.name << "[idx] = " << src << "[" << get_offset(o)
<< "+idx];\n";
os << "this->" << v.name << "[idx] = " << v.type << "{" << src << "["
<< get_offset(o) << "+idx]};\n";
} else {
os << "this->" << v.name << "[idx] = tfel::math::map<" << v.type
<< ">(" << src << " + " << get_offset(o) << "+idx * "
Expand All @@ -1947,8 +1947,8 @@ namespace mfront {
} else {
for (unsigned short index = 0; index != v.arraySize; ++index) {
if (v.isScalar()) {
os << "this->" << v.name << "[" << index << "] = " << src << "["
<< get_offset(o) << "];\n";
os << "this->" << v.name << "[" << index << "] = " << v.type << "{"
<< src << "[" << get_offset(o) << "]};\n";
} else {
os << "this->" << v.name << "[" << index << "] = tfel::math::map<"
<< v.type << ">(" << src << " + " << get_offset(o) << ");\n";
Expand Down

0 comments on commit 273f933

Please sign in to comment.