Skip to content

Commit

Permalink
fix compiler error with attribute's to/from matrix
Browse files Browse the repository at this point in the history
  • Loading branch information
Ahdhn committed Dec 13, 2024
1 parent 5ae223f commit 44cec69
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions include/rxmesh/attribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -196,31 +196,28 @@ class Attribute : public AttributeBase
std::make_shared<DenseMatrix<T>>(*m_rxmesh, rows(), cols());

if constexpr (std::is_same_v<HandleT, VertexHandle>) {
m_rxmesh->for_each_vertex(HOST, [&](const VertexHandle vh) {
uint32_t i = m_rxmesh->linear_id(vh);
m_rxmesh->for_each_vertex(HOST, [&](const VertexHandle vh) {

for (uint32_t j = 0; j < cols(); ++j) {
(*mat)(i, j) = this->operator()(vh, j);
(*mat)(vh, j) = this->operator()(vh, j);
}
});
}

if constexpr (std::is_same_v<HandleT, EdgeHandle>) {
m_rxmesh->for_each_edge(HOST, [&](const EdgeHandle eh) {
uint32_t i = m_rxmesh->linear_id(eh);
m_rxmesh->for_each_edge(HOST, [&](const EdgeHandle eh) {

for (uint32_t j = 0; j < cols(); ++j) {
(*mat)(i, j) = this->operator()(eh, j);
(*mat)(eh, j) = this->operator()(eh, j);
}
});
}

if constexpr (std::is_same_v<HandleT, FaceHandle>) {
m_rxmesh->for_each_face(HOST, [&](const FaceHandle fh) {
uint32_t i = m_rxmesh->linear_id(fh);
m_rxmesh->for_each_face(HOST, [&](const FaceHandle fh) {

for (uint32_t j = 0; j < cols(); ++j) {
(*mat)(i, j) = this->operator()(fh, j);
(*mat)(fh, j) = this->operator()(fh, j);
}
});
}
Expand All @@ -244,30 +241,24 @@ class Attribute : public AttributeBase

if constexpr (std::is_same_v<HandleT, VertexHandle>) {
m_rxmesh->for_each_vertex(HOST, [&](const VertexHandle vh) {
uint32_t i = m_rxmesh->linear_id(vh);

for (uint32_t j = 0; j < cols(); ++j) {
this->operator()(vh, j) = (*mat)(i, j);
this->operator()(vh, j) = (*mat)(vh, j);
}
});
}

if constexpr (std::is_same_v<HandleT, EdgeHandle>) {
m_rxmesh->for_each_edge(HOST, [&](const EdgeHandle eh) {
uint32_t i = m_rxmesh->linear_id(eh);

for (uint32_t j = 0; j < cols(); ++j) {
this->operator()(eh, j) = (*mat)(i, j);
this->operator()(eh, j) = (*mat)(eh, j);
}
});
}

if constexpr (std::is_same_v<HandleT, FaceHandle>) {
m_rxmesh->for_each_face(HOST, [&](const FaceHandle fh) {
uint32_t i = m_rxmesh->linear_id(fh);

for (uint32_t j = 0; j < cols(); ++j) {
this->operator()(fh, j) = (*mat)(i, j);
this->operator()(fh, j) = (*mat)(fh, j);
}
});
}
Expand Down

0 comments on commit 44cec69

Please sign in to comment.