Skip to content

Commit c58157e

Browse files
committed
fix(TetSolid): better naming
1 parent ad9e07e commit c58157e

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/geode/mesh/core/tetrahedral_solid.cpp

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,7 @@ namespace
4040
absl::optional< geode::PolyhedronFacet > tetrahedron_facet_from_vertices(
4141
const geode::TetrahedralSolid< dimension >& solid,
4242
const geode::PolyhedronFacet& facet,
43-
const geode::PolyhedronVertices& vertices,
44-
geode::index_t polyhedron,
43+
const geode::PolyhedronVertices& vertices_adj,
4544
geode::index_t polyhedron_adj )
4645
{
4746
std::array< geode::index_t, 3 > facet_vertices;
@@ -52,7 +51,7 @@ namespace
5251
std::array< bool, 4 > candidates{ true, true, true, true };
5352
for( const auto v : geode::LRange{ 4 } )
5453
{
55-
const auto opp_adj_vertex_id = vertices[v];
54+
const auto opp_adj_vertex_id = vertices_adj[v];
5655
if( absl::c_find( facet_vertices, opp_adj_vertex_id )
5756
!= facet_vertices.end() )
5857
{
@@ -67,22 +66,23 @@ namespace
6766
candidates[other_v] = false;
6867
}
6968
}
69+
const auto polyhedron = facet.polyhedron_id;
7070
for( const auto f : geode::LRange{ 4 } )
7171
{
7272
if( !candidates[f] )
7373
{
7474
continue;
7575
}
76-
if( solid.polyhedron_adjacent( { polyhedron, f } )
77-
!= polyhedron_adj )
76+
if( solid.polyhedron_adjacent( { polyhedron_adj, f } )
77+
!= polyhedron )
7878
{
7979
continue;
8080
}
8181
return absl::optional< geode::PolyhedronFacet >{ absl::in_place,
82-
polyhedron, f };
82+
polyhedron_adj, f };
8383
}
8484
throw geode::OpenGeodeException{
85-
"[SolidMesh::polyhedron_adjacent_"
85+
"[TetrahedralSolid3D::polyhedron_adjacent_"
8686
"facet] Wrong adjacency with polyhedra: ",
8787
polyhedron, " and ", polyhedron_adj
8888
};
@@ -108,14 +108,14 @@ namespace
108108
result.push_back( adj );
109109
absl::InlinedVector< geode::local_index_t, 1 > v0;
110110
absl::InlinedVector< geode::local_index_t, 1 > v1;
111-
const auto vertices = solid.polyhedron_vertices( adj );
111+
const auto vertices_adj = solid.polyhedron_vertices( adj );
112112
for( const auto v : geode::LRange{ 4 } )
113113
{
114-
if( vertices[v] == edge_vertices[0] )
114+
if( vertices_adj[v] == edge_vertices[0] )
115115
{
116116
v0.push_back( v );
117117
}
118-
else if( vertices[v] == edge_vertices[1] )
118+
else if( vertices_adj[v] == edge_vertices[1] )
119119
{
120120
v1.push_back( v );
121121
}
@@ -125,14 +125,14 @@ namespace
125125
return std::make_pair( false, false );
126126
}
127127
const auto adj_facet = ::tetrahedron_facet_from_vertices(
128-
solid, facet, vertices, adj, facet.polyhedron_id );
128+
solid, facet, vertices_adj, adj );
129129
for( const auto f : geode::LRange{ 4 } )
130130
{
131131
if( f == adj_facet->facet_id )
132132
{
133133
continue;
134134
}
135-
const auto vertex_id = vertices[f];
135+
const auto vertex_id = vertices_adj[f];
136136
if( vertex_id == edge_vertices[0]
137137
|| vertex_id == edge_vertices[1] )
138138
{
@@ -449,8 +449,8 @@ namespace geode
449449
}
450450
const auto polyhedron_adj = opt_polyhedron_adj.value();
451451
const auto adj_vertices = this->polyhedron_vertices( polyhedron_adj );
452-
return ::tetrahedron_facet_from_vertices( *this, polyhedron_facet,
453-
adj_vertices, polyhedron_adj, polyhedron_facet.polyhedron_id );
452+
return ::tetrahedron_facet_from_vertices(
453+
*this, polyhedron_facet, adj_vertices, polyhedron_adj );
454454
}
455455

456456
template < index_t dimension >

0 commit comments

Comments
 (0)