Commit 98999a15 authored by Praetorius, Simon's avatar Praetorius, Simon
Browse files

Merge branch 'issue/secondOrderDivTestvecDivTrialvec' into 'master'

Fix an issue in SecondOrderDivTestvecDivTrialvec.hpp that made the...

See merge request amdis/amdis!84
parents cd9a6096 f9f42048
......@@ -27,6 +27,7 @@
- Corrected a bug that emerged in the copy of `LocalView`, by removing the self-defined
copy and move operations and instead relying on the rule-of-zero.
- Fix issue #14 with a wrong dimension used in the `checkInside` function in `DataTransfer`.
- Fix implementation of local operator `SecondOrderDivTestvecDivTrialvec`.
### Changed
......
......@@ -89,11 +89,13 @@ namespace AMDiS
for (std::size_t i = 0; i < rowSize; ++i) {
for (std::size_t j = 0; j < colSize; ++j) {
for (std::size_t k = 0; k < rowNode.degree(); ++k) {
const auto local_ki = rowNode.child(k).localIndex(i);
const auto local_kj = colNode.child(k).localIndex(j);
elementMatrix[local_ki][local_kj] += factor * rowGradients[i][k] * colGradients[j][k];
}
for (std::size_t k = 0; k < CG::dow; ++k) {
for (std::size_t l = 0; l < CG::dow; ++l) {
const auto local_ki = rowNode.child(k).localIndex(i);
const auto local_kj = colNode.child(l).localIndex(j);
elementMatrix[local_ki][local_kj] += factor * rowGradients[i][k] * colGradients[j][l];
}
}
}
}
}
......@@ -130,16 +132,18 @@ namespace AMDiS
for (std::size_t i = 0; i < gradients.size(); ++i)
jacobian.mv(shapeGradients[i][0], gradients[i]);
for (std::size_t k = 0; k < node.degree(); ++k) {
for (std::size_t i = 0; i < size; ++i) {
const auto local_ki = node.child(k).localIndex(i);
const auto value = factor * gradients[i][k];
elementMatrix[local_ki][local_ki] += value * gradients[i][k];
for (std::size_t j = i+1; j < size; ++j) {
const auto local_kj = node.child(k).localIndex(j);
elementMatrix[local_ki][local_kj] += value * gradients[j][k];
elementMatrix[local_kj][local_ki] += value * gradients[j][k];
for (std::size_t k = 0; k < CG::dow; ++k) {
for (std::size_t l = 0; l < CG::dow; ++l) {
for (std::size_t i = 0; i < size; ++i) {
const auto local_ki = node.child(k).localIndex(i);
const auto value = factor * gradients[i][k];
elementMatrix[local_ki][local_ki] += value * gradients[i][k];
for (std::size_t j = i + 1; j < size; ++j) {
const auto local_kj = node.child(l).localIndex(j);
elementMatrix[local_ki][local_kj] += value * gradients[j][l];
elementMatrix[local_kj][local_ki] += value * gradients[j][l];
}
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment