- changed status to resolved
Adjacencies problem with quadratic wedge cell (15 nodes)
Issue #153
resolved
It seems that ther is a problem with the adjacencies of the “wedge15” cells, which looks like this:
5
,/|`\
14 | 13
,/ | `\
3------12-----4
| 11 |
| | |
| | |
| | |
9 | 10
| 2 |
| ,/ `\ |
| ,8 `7 |
|,/ `\|
0------6------1
Let’s consider the following snippet:
#include "moab/Core.hpp"
#include <vector>
#include <iostream>
int main() {
moab::Core mb;
std::vector<moab::EntityHandle> conn;
double coords[3];
for (int i=0; i<15; ++i) {
moab::EntityHandle h;
mb.create_vertex(coords, h);
conn.push_back(h);
}
moab::EntityHandle w;
mb.create_element(moab::MBPRISM, conn.data(), 15, w);
// this leads to the failure
{
std::vector<moab::EntityHandle> adj;
mb.get_adjacencies(&w, 1, 2, true, adj);
}
std::vector<moab::EntityHandle> nodes;
mb.get_entities_by_dimension (0, 0, nodes);
for (const auto &n: nodes) {
std::vector<moab::EntityHandle> adj;
std::cout << "node " << n << " connection: ";
adj.clear();
mb.get_adjacencies(&n, 1, 1, true, adj);
std::cout << adj.size() << " edges,";
adj.clear();
mb.get_adjacencies(&n, 1, 2, true, adj);
std::cout << adj.size() << " faces,";
adj.clear();
mb.get_adjacencies(&n, 1, 3, true, adj);
std::cout << adj.size() << " volumes\n";
}
}
This gives:
node 1 connection: 3 edges,3 faces,1 volumes
node 2 connection: 3 edges,3 faces,1 volumes
node 3 connection: 3 edges,3 faces,1 volumes
node 4 connection: 3 edges,3 faces,1 volumes
node 5 connection: 3 edges,3 faces,1 volumes
node 6 connection: 3 edges,3 faces,1 volumes
node 7 connection: 1 edges,2 faces,1 volumes
node 8 connection: 1 edges,2 faces,1 volumes
node 9 connection: 1 edges,2 faces,1 volumes
node 10 connection: 2 edges,2 faces,1 volumes
node 11 connection: 1 edges,2 faces,1 volumes
node 12 connection: 0 edges,2 faces,1 volumes
node 13 connection: 1 edges,2 faces,1 volumes
node 14 connection: 1 edges,2 faces,1 volumes
node 15 connection: 1 edges,2 faces,1 volumes
which is wrong: the vertices should be connected to either 1 or 3 edges, but not 2 or 0 as it is reported for nodes 10 and 12.
If I comment the line 23 in the snippet, the output is OK.
This has been tested with moab-5.3.1, with g++-10 and clang++-11.
Comments (3)
-
-
- changed status to open
it is not merged yet to master, PR was not approved
https://bitbucket.org/fathomteam/moab/pull-requests/579 -
- changed status to resolved
merged to master
- Log in to comment
fix issue
#153reported by Olivier Jamond
→ <<cset 9bab774d076c>>