File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1042,6 +1042,11 @@ class FEMap
10421042 * Work vector for compute_affine_map()
10431043 */
10441044 std::vector<const Node *> _elem_nodes;
1045+
1046+ /* *
1047+ * A mutex for locking the error stream for failed point inversions
1048+ */
1049+ static Threads::spin_mutex _point_inv_err_mutex;
10451050};
10461051
10471052
Original file line number Diff line number Diff line change 4040
4141namespace libMesh
4242{
43+ Threads ::spin_mutex FEMap ::_point_inv_err_mutex ;
4344
4445FEFamily
4546FEMap ::map_fe_type (const Elem & elem )
@@ -892,10 +893,11 @@ void FEMap::compute_single_point_map(const unsigned int dim,
892893 // Don't call print_info() recursively if we're already
893894 // failing. print_info() calls Elem::volume() which may
894895 // call FE::reinit() and trigger the same failure again.
895- static bool failing = false;
896+ thread_local bool failing = false;
896897 if (!failing )
897898 {
898899 failing = true;
900+ Threads ::spin_mutex ::scoped_lock lock (_point_inv_err_mutex );
899901 elem -> print_info (libMesh ::err );
900902 failing = false;
901903 if (calculate_xyz )
You can’t perform that action at this time.
0 commit comments