Skip to content

Commit f219b33

Browse files
committed
fix type access
1 parent 52e44fe commit f219b33

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/t8_schemes/t8_standalone/t8_standalone_implementation.hxx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ struct t8_standalone_scheme
154154
static constexpr void
155155
set_typebit (u_int8_t *type, u_int8_t pos, u_int8_t bit)
156156
{
157-
*type &= !(1 << pos);
157+
*type &= ~(1 << pos);
158158
set_typebit_from_zero (type, pos, bit);
159159
}
160160

@@ -2219,8 +2219,8 @@ struct t8_standalone_scheme
22192219
if constexpr (T8_ELEMENT_DIM[TFaceEclass] >= T8_ELEMENT_DIM[TEclass]) {
22202220
return;
22212221
}
2222-
22232222
else {
2223+
boundary->type = 0;
22242224
boundary->level = el->level;
22252225
/* Delete the coordinate orthogonal to the given face and combine the remaining coordinates*/
22262226
for (int idim = 0; idim < T8_ELEMENT_DIM[TEclass]; idim++) {
@@ -2245,7 +2245,7 @@ struct t8_standalone_scheme
22452245
for (int ieq = 0; ieq < T8_ELEMENT_NUM_EQUATIONS[TEclass]; ieq++) {
22462246
const int ifaceeq = t8_standalone_lut_rootface_eq_to_faceeq<TEclass>[root_face][ieq];
22472247
if (ifaceeq != -1) {
2248-
set_typebit_from_zero (&boundary->type, ifaceeq, get_typebit (el->type, ieq));
2248+
set_typebit (&boundary->type, ifaceeq, get_typebit (el->type, ieq));
22492249
}
22502250
}
22512251
T8_ASSERT (t8_standalone_scheme<TFaceEclass>::element_is_valid ((t8_element_t *) boundary));
@@ -2318,19 +2318,17 @@ struct t8_standalone_scheme
23182318
for (int ieq = 0; ieq < T8_ELEMENT_NUM_EQUATIONS[TEclass]; ieq++) {
23192319
const int ifaceeq = t8_standalone_lut_rootface_eq_to_faceeq<TEclass>[root_face][ieq];
23202320
if (ifaceeq != -1) {
2321-
set_typebit_from_zero (&el->type, ieq, get_typebit (face->type, ifaceeq));
2321+
set_typebit (&el->type, ieq, get_typebit (face->type, ifaceeq));
23222322
}
23232323
}
23242324
/** Set those typebits, that are connected to the face_normaldim of root_face*/
23252325
for (int ieq = 0; ieq < T8_ELEMENT_NUM_EQUATIONS[TEclass]; ieq++) {
23262326
const int facenormal_dim = t8_standalone_lut_type_face_to_facenormal_dim<TEclass>[root_type][root_face];
23272327
if (t8_type_edge_equations<TEclass>[ieq][0] == facenormal_dim) {
2328-
set_typebit_from_zero (&el->type, ieq,
2329-
!t8_standalone_lut_type_face_to_is_1_boundary<TEclass>[root_type][root_face]);
2328+
set_typebit (&el->type, ieq, !t8_standalone_lut_type_face_to_is_1_boundary<TEclass>[root_type][root_face]);
23302329
}
23312330
else if (t8_type_edge_equations<TEclass>[ieq][1] == facenormal_dim) {
2332-
set_typebit_from_zero (&el->type, ieq,
2333-
t8_standalone_lut_type_face_to_is_1_boundary<TEclass>[root_type][root_face]);
2331+
set_typebit (&el->type, ieq, t8_standalone_lut_type_face_to_is_1_boundary<TEclass>[root_type][root_face]);
23342332
}
23352333
}
23362334
return t8_standalone_lut_type_rootface_to_face<TEclass>[el->type][root_face];
@@ -2397,7 +2395,7 @@ struct t8_standalone_scheme
23972395
coord_v1 = (coord_v1 << level) & ((1 << T8_ELEMENT_MAXLEVEL[TEclass]) - 1);
23982396

23992397
if (coord_v0 == coord_v1) {
2400-
set_typebit_from_zero (&type, e, get_typebit (el->type, e) | get_typebit (type, e));
2398+
set_typebit (&type, e, get_typebit (el->type, e) | get_typebit (type, e));
24012399
}
24022400
else if (coord_v0 < coord_v1) {
24032401
type |= (1 << e);

0 commit comments

Comments
 (0)