File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2929#include "libmesh/quadrature.h"
3030#include "libmesh/string_to_enum.h"
3131#include "libmesh/utility.h"
32+ #include "libmesh/enum_to_string.h"
3233
3334// C++ includes
3435#include <functional> // std::reference_wrapper
@@ -139,8 +140,10 @@ void VariationalSmootherSystem::prepare_for_smoothing()
139140 target_elem_inverse_jacobian_dets [elem -> type ()] =
140141 std ::vector < Real > (nq_points , 1.0 );
141142
143+ const auto type_str = Utility ::enum_to_string (elem -> type ());
144+
142145 // Elems deriving from Tri
143- if (elem -> type () == TRI3 || elem -> type ( ) == TRI6 )
146+ if (type_str . compare ( 0 , 3 , "TRI" ) == 0 )
144147 {
145148
146149 // The target element will be an equilateral triangle with area equal to
@@ -180,7 +183,7 @@ void VariationalSmootherSystem::prepare_for_smoothing()
180183 }
181184
182185 default :
183- libmesh_error_msg ("Unsupported triangular element!" );
186+ libmesh_error_msg ("Unsupported triangular element: " << type_str );
184187 break ;
185188 }
186189
Original file line number Diff line number Diff line change 1414#include <libmesh/system.h> // LIBMESH_HAVE_SOLVER define
1515#include "libmesh/face_tri.h"
1616#include "libmesh/utility.h"
17+ #include "libmesh/enum_to_string.h"
1718
1819#include "test_comm.h"
1920#include "libmesh_cppunit.h"
@@ -283,7 +284,7 @@ public:
283284 // Get mesh dimension, determine whether type is triangular
284285 const auto * ref_elem = & (ReferenceElem ::get (type ));
285286 const auto dim = ref_elem -> dim ();
286- const bool type_is_tri = dynamic_cast < const Tri * > ( ref_elem ) ;
287+ const bool type_is_tri = Utility :: enum_to_string ( type ). compare ( 0 , 3 , "TRI" ) == 0 ;
287288
288289 unsigned int n_elems_per_side = 5 ;
289290
You can’t perform that action at this time.
0 commit comments