66namespace centering
77{
88
9- enum CenterStyle
9+ enum Centering
1010{
1111 NC , // node-centered
1212 EC , // edge-centered
@@ -24,16 +24,15 @@ CC | ccc ccc ccc
2424*/
2525
2626template <typename PATCH >
27- Double3 get_pos (PATCH patch, Int3 index, CenterStyle style , int component = -1 )
27+ Double3 get_pos (PATCH patch, Int3 index, Centering c , int component = -1 )
2828{
2929 if (component == -1 ) {
30- assert (style == NC || style == CC );
30+ assert (c == NC || c == CC );
3131 }
3232
3333 Double3 pos;
3434 for (int d = 0 ; d < 3 ; d++) {
35- if (style == CC || (style == FC && d != component) ||
36- (style == EC && d == component)) {
35+ if (c == CC || (c == FC && d != component) || (c == EC && d == component)) {
3736 pos[d] = patch.get_cc (index[d], d);
3837 } else {
3938 pos[d] = patch.get_nc (index[d], d);
@@ -44,13 +43,13 @@ Double3 get_pos(PATCH patch, Int3 index, CenterStyle style, int component = -1)
4443
4544struct Centerer
4645{
47- CenterStyle style ;
48- Centerer (CenterStyle style ) : style(style ) {}
46+ Centering c ;
47+ Centerer (Centering c ) : c(c ) {}
4948
5049 template <typename PATCH >
5150 inline Double3 get_pos (PATCH patch, Int3 index, int component = -1 ) const
5251 {
53- return centering::get_pos (patch, index, style , component);
52+ return centering::get_pos (patch, index, c , component);
5453 }
5554};
5655
0 commit comments