Skip to content

Commit

Permalink
Merge pull request #1285 from DLR-AMR/fix-false-geometry-compat-checks
Browse files Browse the repository at this point in the history
Fix wrong return value when checking tree geometry compat.
  • Loading branch information
sandro-elsweijer authored Oct 31, 2024
2 parents caeb66d + bd1a3da commit 129b742
Showing 1 changed file with 16 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ struct t8_geometry_quadrangulated_disk: public t8_geometry_with_vertices
t8_productionf ("t8_geometry_quadrangulated_disk is not compatible with tree type %s\n"
"It is only compatible with quad elements.\n",
t8_eclass_to_string[active_tree_class]);
return true;
return false;
}
return false;
return true;
}

/* Load tree data is inherited from t8_geometry_with_vertices. */
Expand Down Expand Up @@ -155,9 +155,9 @@ struct t8_geometry_triangulated_spherical_surface: public t8_geometry_with_verti
t8_productionf ("t8_geometry_triangulated_spherical_surface is not compatible with tree type %s\n"
"It is only compatible with triangle elements.\n",
t8_eclass_to_string[active_tree_class]);
return true;
return false;
}
return false;
return true;
}

/* Load tree data is inherited from t8_geometry_with_vertices. */
Expand Down Expand Up @@ -209,12 +209,14 @@ struct t8_geometry_tessellated_spherical_surface: public t8_geometry_with_vertic
bool
t8_geom_check_tree_compatibility () const
{
if (active_tree_class != T8_ECLASS_QUAD) {
t8_productionf ("t8_geometry_quadrangulated_spherical_surface is not compatible with tree type %s\n"
"It is only compatible with quad elements.\n",
t8_eclass_to_string[active_tree_class]);
if (active_tree_class == T8_ECLASS_TRIANGLE || active_tree_class == T8_ECLASS_QUAD) {
return true;
}

t8_productionf ("t8_geometry_tessellated_spherical_surface is not compatible with tree type %s\n"
"It is only compatible with triangle and quad elements.\n",
t8_eclass_to_string[active_tree_class]);

return false;
}

Expand Down Expand Up @@ -271,9 +273,9 @@ struct t8_geometry_cubed_spherical_shell: public t8_geometry_with_vertices
t8_productionf ("t8_geometry_cubed_spherical_shell is not compatible with tree type %s\n"
"It is only compatible with hex elements.\n",
t8_eclass_to_string[active_tree_class]);
return true;
return false;
}
return false;
return true;
}

/* Load tree data is inherited from t8_geometry_with_vertices. */
Expand Down Expand Up @@ -329,9 +331,9 @@ struct t8_geometry_prismed_spherical_shell: public t8_geometry_with_vertices
t8_productionf ("t8_geometry_prismed_spherical_shell is not compatible with tree type %s\n"
"It is only compatible with prism elements.\n",
t8_eclass_to_string[active_tree_class]);
return true;
return false;
}
return false;
return true;
}

/* Load tree data is inherited from t8_geometry_with_vertices. */
Expand Down Expand Up @@ -387,9 +389,9 @@ struct t8_geometry_cubed_sphere: public t8_geometry_with_vertices
t8_productionf ("t8_geometry_cubed_sphere is not compatible with tree type %s\n"
"It is only compatible with hex elements.\n",
t8_eclass_to_string[active_tree_class]);
return true;
return false;
}
return false;
return true;
}

/* Load tree data is inherited from t8_geometry_with_vertices. */
Expand Down

0 comments on commit 129b742

Please sign in to comment.