1. Vijay Mahadevan
  2. libmesh

Commits

jwpeterson  committed 2ec37dc

Use libmesh_error_msg() where appropriate.

  • Participants
  • Parent commits 37ed726
  • Branches master

Comments (0)

Files changed (47)

File include/quadrature/quadrature.h

View file
  • Ignore whitespace
   {}
 #else
   {
-    libMesh::err << "ERROR: Seems as if this quadrature rule" << std::endl
-                 << " is not implemented for 2D." << std::endl;
-    libmesh_error();
+    libmesh_error_msg("ERROR: Seems as if this quadrature rule \nis not implemented for 2D.");
   }
 #endif
 
   {}
 #else
   {
-    libMesh::err << "ERROR: Seems as if this quadrature rule" << std::endl
-                 << " is not implemented for 3D." << std::endl;
-    libmesh_error();
+    libmesh_error_msg("ERROR: Seems as if this quadrature rule \nis not implemented for 3D.");
   }
 #endif
 

File include/quadrature/quadrature_conical.h

View file
  • Ignore whitespace
                 unsigned int =0)
   {
     // See about making this non-pure virtual in the base class
-    libmesh_error();
+    libmesh_not_implemented();
   }
 
   /**

File include/quadrature/quadrature_gm.h

View file
  • Ignore whitespace
                 unsigned int =0)
   {
     // See about making this non-pure virtual in the base class
-    libmesh_error();
+    libmesh_not_implemented();
   }
 
   /**

File include/quadrature/quadrature_jacobi.h

View file
  • Ignore whitespace
     return QJACOBI_2_0;
 
   else
-    {
-      libmesh_error();
-      return INVALID_Q_RULE;
-    }
+    libmesh_error_msg("Invalid Jacobi quadrature rule: alpha = " << _alpha << ", beta = " << _beta);
 }
 
 

File include/quadrature/quadrature_monomial.h

View file
  • Ignore whitespace
                 unsigned int =0)
   {
     // See about making this non-pure virtual in the base class?
-    libmesh_error();
+    libmesh_not_implemented();
   }
 
   /**

File src/error_estimation/exact_solution.C

View file
  • Ignore whitespace
     _errors.find(sys_name);
 
   if (sys_iter == _errors.end())
-    {
-      libMesh::err << "Sorry, couldn't find the requested system '"
-                   << sys_name << "'."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Sorry, couldn't find the requested system '" << sys_name << "'.");
 
   // Make sure the requested unknown_name exists.
   SystemErrorMap::iterator var_iter = (*sys_iter).second.find(unknown_name);
 
   if (var_iter == (*sys_iter).second.end())
-    {
-      libMesh::err << "Sorry, couldn't find the requested variable '"
-                   << unknown_name << "'."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Sorry, couldn't find the requested variable '" << unknown_name << "'.");
 
   // Return a reference to the proper error entry
   return (*var_iter).second;
         break;
       }
     default:
-      libmesh_error();
+      libmesh_error_msg("Invalid variable type!");
     }
-
-  return;
 }
 
 
     case HCURL:
       {
         if(FEInterface::field_type(fe_type) == TYPE_SCALAR)
-          {
-            libMesh::err << "Cannot compute HCurl error norm of scalar-valued variables!" << std::endl;
-            libmesh_error();
-          }
+          libmesh_error_msg("Cannot compute HCurl error norm of scalar-valued variables!");
         else
           return std::sqrt(error_vals[0] + error_vals[5]);
       }
     case HDIV:
       {
         if(FEInterface::field_type(fe_type) == TYPE_SCALAR)
-          {
-            libMesh::err << "Cannot compute HDiv error norm of scalar-valued variables!" << std::endl;
-            libmesh_error();
-          }
+          libmesh_error_msg("Cannot compute HDiv error norm of scalar-valued variables!");
         else
           return std::sqrt(error_vals[0] + error_vals[6]);
       }
     case HCURL_SEMINORM:
       {
         if(FEInterface::field_type(fe_type) == TYPE_SCALAR)
-          {
-            libMesh::err << "Cannot compute HCurl error seminorm of scalar-valued variables!" << std::endl;
-            libmesh_error();
-          }
+          libmesh_error_msg("Cannot compute HCurl error seminorm of scalar-valued variables!");
         else
           return std::sqrt(error_vals[5]);
       }
     case HDIV_SEMINORM:
       {
         if(FEInterface::field_type(fe_type) == TYPE_SCALAR)
-          {
-            libMesh::err << "Cannot compute HDiv error seminorm of scalar-valued variables!" << std::endl;
-            libmesh_error();
-          }
+          libmesh_error_msg("Cannot compute HDiv error seminorm of scalar-valued variables!");
         else
           return std::sqrt(error_vals[6]);
       }
     case L_INF:
       return error_vals[4];
 
-      // Currently only Sobolev norms/seminorms are supported
     default:
-      libmesh_error();
+      libmesh_error_msg("Currently only Sobolev norms/seminorms are supported!");
     }
 }
 

File src/error_estimation/fourth_error_estimators.C

View file
  • Ignore whitespace
                                     ErrorVector&,
                                     bool)
 {
-  libMesh::err << "Error: LaplacianErrorEstimator requires second "
-               << "derivative support; try configuring libmesh with "
-               << "--enable-second" << std::endl;
-  libmesh_error();
+  libmesh_error_msg("Error: LaplacianErrorEstimator requires second " \
+                    << "derivative support; try configuring libmesh with " \
+                    << "--enable-second");
 }
 
 
 void
 LaplacianErrorEstimator::internal_side_integration ()
 {
-  libMesh::err << "Error: LaplacianErrorEstimator requires second "
-               << "derivative support; try configuring libmesh with "
-               << "--enable-second" << std::endl;
-  libmesh_error();
+  libmesh_error_msg("Error: LaplacianErrorEstimator requires second "   \
+                    << "derivative support; try configuring libmesh with " \
+                    << "--enable-second");
 }
 
 } // namespace libMesh

File src/error_estimation/hp_coarsentest.C

View file
  • Ignore whitespace
   if (!component_scale.empty())
     {
       if (component_scale.size() != n_vars)
-        {
-          libMesh::err << "ERROR: component_scale is the wrong size:"
-                       << std::endl
-                       << " component_scale.size()=" << component_scale.size()
-                       << std::endl
-                       << " n_vars=" << n_vars
-                       << std::endl;
-          libmesh_error();
-        }
+        libmesh_error_msg("ERROR: component_scale is the wrong size:\n" \
+                          << " component_scale.size()=" \
+                          << component_scale.size()     \
+                          << "\n n_vars=" \
+                          << n_vars);
     }
   else
     {

File src/error_estimation/patch_recovery_error_estimator.C

View file
  • Ignore whitespace
           }
 
         default:
-          libmesh_error();
+          libmesh_error_msg("Invalid dimension dim " << dim);
         }
     }
 
 #endif
                         }
 #else
-                      libMesh::err << "ERROR:  --enable-second-derivatives is required\n"
-                                   << "        for _sobolev_order == 2!\n";
-                      libmesh_error();
+                      libmesh_error_msg("ERROR:  --enable-second-derivatives is required \nfor _sobolev_order == 2!");
 #endif
                     }
                   else
-                    libmesh_error();
+                    libmesh_error_msg("Unsupported error norm type!");
                 } // end quadrature loop
             } // end patch loop
 
                       temperr[5] -= hess_u_h(1,2);
 #endif
 #else
-                      libMesh::err << "ERROR:  --enable-second-derivatives is required\n"
-                                   << "        for _sobolev_order == 2!\n";
-                      libmesh_error();
+                      libmesh_error_msg("ERROR:  --enable-second-derivatives is required \nfor _sobolev_order == 2!");
 #endif
                     }
                   // Add up relevant terms.  We can easily optimize the
                        error_estimator.error_norm.type(var) == H2_SEMINORM)
                 new_error_per_cell[e] += error_estimator.error_norm.weight_sq(var) * element_error;
               else
-                libmesh_error();
+                libmesh_error_msg("Unsupported error norm type!");
             }  // End (re) loop over patch elements
 
         } // end variables loop

File src/error_estimation/weighted_patch_recovery_estimator.C

View file
  • Ignore whitespace
 #endif
                         }
 #else
-                      libMesh::err << "ERROR:  --enable-second-derivatives is required\n"
-                                   << "        for _sobolev_order == 2!\n";
-                      libmesh_error();
+                      libmesh_error_msg("ERROR:  --enable-second-derivatives is required \nfor _sobolev_order == 2!");
 #endif
                     }
                   else
-                    libmesh_error();
+                    libmesh_error_msg("Unsupported error norm type!");
                 } // end quadrature loop
             } // end patch loop
 
                       temperr[5] -= hess_u_h(1,2);
 #endif
 #else
-                      libMesh::err << "ERROR:  --enable-second-derivatives is required\n"
-                                   << "        for _sobolev_order == 2!\n";
-                      libmesh_error();
+                      libmesh_error_msg("ERROR:  --enable-second-derivatives is required \nfor _sobolev_order == 2!");
 #endif
                     }
 
                        error_estimator.error_norm.type(var) == H2_SEMINORM)
                 new_error_per_cell[e] += error_estimator.error_norm.weight_sq(var) * element_error;
               else
-                libmesh_error();
+                libmesh_error_msg("Unsupported error norm type!");
             }  // End (re) loop over patch elements
 
         } // end variables loop

File src/quadrature/quadrature.C

View file
  • Ignore whitespace
       return;
 
     default:
-      libmesh_error();
+      libmesh_error_msg("Invalid dimension _dim = " << _dim);
     }
 }
 

File src/quadrature/quadrature_build.C

View file
  • Ignore whitespace
       }
 
     default:
-      {
-        libMesh::err << "ERROR: Bad qt=" << _qt << std::endl;
-        libmesh_error();
-      }
+      libmesh_error_msg("ERROR: Bad qt=" << _qt);
     }
 
 
-  libmesh_error();
+  libmesh_error_msg("We'll never get here!");
   AutoPtr<QBase> ap(NULL);
   return ap;
 }

File src/quadrature/quadrature_clough_2D.C

View file
  • Ignore whitespace
       //---------------------------------------------
       // Unsupported type
     default:
-      {
-        libMesh::err << "Element type not supported!:" << type_in << std::endl;
-        libmesh_error();
-      }
+      libmesh_error_msg("Element type not supported!:" << type_in);
     }
-
-  libmesh_error();
-
-  return;
-
 #endif
 }
 

File src/quadrature/quadrature_clough_3D.C

View file
  • Ignore whitespace
     {
       // Unsupported type
     default:
-      {
-        libMesh::err << "ERROR: Unsupported type: " << type_in << std::endl;
-        libmesh_error();
-      }
+      libmesh_error_msg("ERROR: Unsupported type: " << type_in);
     }
-
-  libmesh_error();
-
-  return;
-
 #endif
 }
 

File src/quadrature/quadrature_conical_2D.C

View file
  • Ignore whitespace
       {
         this->conical_product_tri(p);
         return;
-
       } // end case TRI3, TRI6
 
-
-
       //---------------------------------------------
       // Unsupported element type
     default:
-      {
-        libMesh::err << "ERROR: Unsupported element type: " << type_in << std::endl;
-        libmesh_error();
-      }
+      libmesh_error_msg("ERROR: Unsupported element type: " << type_in);
     } // end switch (type_in)
-
-  // We must have returned or errored-out by this point.  If not,
-  // throw an error now.
-  libmesh_error();
-  return;
 }
 
 } // namespace libMesh

File src/quadrature/quadrature_conical_3D.C

View file
  • Ignore whitespace
       {
         this->conical_product_tet(p);
         return;
-
       } // end case TET4, TET10
 
     case PYRAMID5:
       {
         this->conical_product_pyramid(p);
         return;
-
       } // end case PYRAMID5
 
 
       //---------------------------------------------
       // Unsupported element type
     default:
-      {
-        libMesh::err << "ERROR: Unsupported element type: " << type_in << std::endl;
-        libmesh_error();
-      }
+      libmesh_error_msg("ERROR: Unsupported element type: " << type_in);
     } // end switch (type_in)
-
-  // We must have returned or errored-out by this point.  If not,
-  // throw an error now.
-  libmesh_error();
-  return;
 }
 
 } // namespace libMesh

File src/quadrature/quadrature_gauss.C

View file
  • Ignore whitespace
           }
 
         default:
-          {
-            libMesh::err << "Don't know what to do with this many permutation points!" << std::endl;
-            libmesh_error();
-          }
+          libmesh_error_msg("Don't know what to do with this many permutation points!");
         }
 
     }
           }
 
         default:
-          {
-            libMesh::err << "Unknown permutation id: " << permutation_ids[p] << "!" << std::endl;
-            libmesh_error();
-          }
+          libmesh_error_msg("Unknown permutation id: " << permutation_ids[p] << "!");
         }
     }
 
           }
 
         default:
-          {
-            libMesh::err << "Don't know what to do with this many permutation points!" << std::endl;
-            libmesh_error();
-          }
+          libmesh_error_msg("Don't know what to do with this many permutation points!");
         }
     }
 }

File src/quadrature/quadrature_gauss_1D.C

View file
  • Ignore whitespace
 
 
     default:
-      {
-        libMesh::err << "Quadrature rule " << _order
-                     << " not supported!" << std::endl;
-
-        libmesh_error();
-      }
+      libmesh_error_msg("Quadrature rule " << _order << " not supported!");
     }
-
-
-
-  return;
 }
 
 } // namespace libMesh

File src/quadrature/quadrature_gauss_2D.C

View file
  • Ignore whitespace
       //---------------------------------------------
       // Unsupported type
     default:
-      {
-        libMesh::err << "Element type not supported!:" << type_in << std::endl;
-        libmesh_error();
-      }
+      libmesh_error_msg("Element type not supported!:" << type_in);
     }
-
-  libmesh_error();
-
-  return;
-
 #endif
 }
 

File src/quadrature/quadrature_gauss_3D.C

View file
  • Ignore whitespace
       //---------------------------------------------
       // Unsupported type
     default:
-      {
-        libMesh::err << "ERROR: Unsupported type: " << type_in << std::endl;
-        libmesh_error();
-      }
+      libmesh_error_msg("ERROR: Unsupported type: " << type_in);
     }
-
-  libmesh_error();
-
-  return;
-
 #endif
 }
 

File src/quadrature/quadrature_gm_3D.C

View file
  • Ignore whitespace
   // Nearly all GM rules contain negative weights, so if you are not
   // allowing rules with negative weights, we cannot continue!
   if (!allow_rules_with_negative_weights)
-    {
-      libMesh::err << "You requested a Grundmann-Moller rule but\n"
-                   << "are not allowing rules with negative weights!\n"
-                   << "Either select a different quadrature class or\n"
-                   << "set allow_rules_with_negative_weights==true."
-                   << std::endl;
-
-      libmesh_error();
-    }
+    libmesh_error_msg("You requested a Grundmann-Moller rule but\n"        \
+                      << "are not allowing rules with negative weights!\n" \
+                      << "Either select a different quadrature class or\n" \
+                      << "set allow_rules_with_negative_weights==true.");
 
   switch (type_in)
     {
         // Untested above _order=23 but should work...
         gm_rule( (_order + 2*p)/2 );
         return;
-
       } // end case TET4, TET10
 
 
       //---------------------------------------------
       // Unsupported element type
     default:
-      {
-        libMesh::err << "ERROR: Unsupported element type: " << type_in << std::endl;
-        libmesh_error();
-      }
+      libmesh_error_msg("ERROR: Unsupported element type: " << type_in);
     } // end switch (type_in)
-
-  // We must have returned or errored-out by this point.  If not,
-  // throw an error now.
-  libmesh_error();
-  return;
 }
 
 } // namespace libMesh

File src/quadrature/quadrature_grid_2D.C

View file
  • Ignore whitespace
       //---------------------------------------------
       // Unsupported type
     default:
-      {
-        libMesh::err << "Element type not supported!:" << type_in << std::endl;
-        libmesh_error();
-      }
+      libmesh_error_msg("Element type not supported!:" << type_in);
     }
-
-  libmesh_error();
-
-  return;
-
 #endif
 }
 

File src/quadrature/quadrature_grid_3D.C

View file
  • Ignore whitespace
       //---------------------------------------------
       // Unsupported type
     default:
-      {
-        libMesh::err << "ERROR: Unsupported type: " << type_in << std::endl;
-        libmesh_error();
-      }
+      libmesh_error_msg("ERROR: Unsupported type: " << type_in);
     }
-
-  libmesh_error();
-
-  return;
-
 #endif
 }
 

File src/quadrature/quadrature_jacobi_1D.C

View file
  • Ignore whitespace
           }
 
         default:
-          {
-            libMesh::err << "Quadrature rule " << _order
-                         << " not supported!" << std::endl;
-
-            libmesh_error();
-          }
+          libmesh_error_msg("Quadrature rule " << _order << " not supported!");
         } // end switch(_order + 2*p)
-
-      libmesh_error();
     } // end if ((_alpha == 1) && (_beta == 0))
 
 
 
 
         default:
-          {
-            libMesh::err << "Quadrature rule " << _order
-                         << " not supported!" << std::endl;
-
-            libmesh_error();
-          }
+          libmesh_error_msg("Quadrature rule " << _order << " not supported!");
         } // end switch(_order + 2*p)
-
-      libmesh_error();
     } // end else if ((_alpha == 2) && (_beta == 0))
 
   else
                    << ") requested in Jacobi-Gauss quadrature rule."
                    << std::endl;
     }
-
-
-  return;
 }
 
 } // namespace libMesh

File src/quadrature/quadrature_monomial.C

View file
  • Ignore whitespace
             break;
           }
         default:
-          {
-            libMesh::err << "Unknown symmetry!" << std::endl;
-            libmesh_error();
-          }
+          libmesh_error_msg("Unknown symmetry!");
         } // end switch(rule_symmetry[i])
     }
 }
             break;
           }
         default:
-          {
-            libMesh::err << "Unknown rule ID: " << rule_id[i] << "!" << std::endl;
-            libmesh_error();
-          }
+          libmesh_error_msg("Unknown rule ID: " << rule_id[i] << "!");
         } // end switch(rule_id[i])
     }
 }

File src/quadrature/quadrature_rules.C

View file
  • Ignore whitespace
       its_name = "Trapezoidal Rule";
       break;
 
-
-    default:
-      {
-        libMesh::err << "ERROR: Bad qt=" << q << std::endl;
-        libmesh_error();
-      }
+   default:
+      libmesh_error_msg("ERROR: Bad qt=" << q);
     }
 
   return its_name;

File src/quadrature/quadrature_simpson_2D.C

View file
  • Ignore whitespace
       //---------------------------------------------
       // Unsupported type
     default:
-      {
-        libMesh::err << "Element type not supported!:" << type_in << std::endl;
-        libmesh_error();
-      }
+      libmesh_error_msg("Element type not supported!:" << type_in);
     }
-
-  libmesh_error();
-
-  return;
-
 #endif
 }
 

File src/quadrature/quadrature_simpson_3D.C

View file
  • Ignore whitespace
       //---------------------------------------------
       // Unsupported type
     default:
-      {
-        libMesh::err << "ERROR: Unsupported type: " << type_in << std::endl;
-        libmesh_error();
-      }
+      libmesh_error_msg("ERROR: Unsupported type: " << type_in);
     }
-
-  libmesh_error();
-
-  return;
-
 #endif
 }
 

File src/quadrature/quadrature_trap_2D.C

View file
  • Ignore whitespace
       //---------------------------------------------
       // Unsupported type
     default:
-      {
-        libMesh::err << "Element type not supported!:" << type_in << std::endl;
-        libmesh_error();
-      }
+      libmesh_error_msg("Element type not supported!:" << type_in);
     }
-
-  libmesh_error();
-
-  return;
-
 #endif
 }
 

File src/quadrature/quadrature_trap_3D.C

View file
  • Ignore whitespace
       //---------------------------------------------
       // Unsupported type
     default:
-      {
-        libMesh::err << "ERROR: Unsupported type: " << type_in << std::endl;
-        libmesh_error();
-      }
+      libmesh_error_msg("ERROR: Unsupported type: " << type_in);
     }
-
-  libmesh_error();
-
-  return;
-
 #endif
 }
 

File src/reduced_basis/derived_rb_evaluation.C

View file
  • Ignore whitespace
           std::ofstream derived_bf_out(file_name.str().c_str());
 
           if ( !derived_bf_out.good() )
-            {
-              libMesh::err << "Error opening derived_bf" << i << ".dat" << std::endl;
-              libmesh_error();
-            }
+            libmesh_error_msg("Error opening derived_bf" << i << ".dat");
 
           derived_bf_out.precision(precision_level);
           for(unsigned int j=0; j<derived_basis_functions[i].size(); j++)
           derived_bf_size_out.open(bf_file_name.str().c_str());
         }
         if ( !derived_bf_size_out.good() )
-          {
-            libMesh::err << "Error opening derived_bf_size.dat" << std::endl;
-            libmesh_error();
-          }
+          libmesh_error_msg("Error opening derived_bf_size.dat");
+
         derived_bf_size_out << derived_basis_functions[0].size();
         derived_bf_size_out.close();
       }
     std::ifstream derived_bf_size_in(file_name.str().c_str());
 
     if ( !derived_bf_size_in.good() )
-      {
-        libMesh::err << "Error opening derived_bf_size.dat" << std::endl;
-        libmesh_error();
-      }
+      libmesh_error_msg("Error opening derived_bf_size.dat");
 
     derived_bf_size_in >> derived_bf_size;
     derived_bf_size_in.close();
           int stat_result = stat(file_name.str().c_str(), &stat_info);
 
           if (stat_result != 0)
-            {
-              libMesh::out << "File does not exist: " << file_name.str() << std::endl;
-              libmesh_error();
-            }
+            libmesh_error_msg("File does not exist: " << file_name.str());
         }
 
       derived_basis_functions[i].resize(derived_bf_size);

File src/reduced_basis/rb_assembly_expansion.C

View file
  • Ignore whitespace
                                                       FEMContext& context)
 {
   if(q >= get_n_A_terms())
-    {
-      libMesh::err << "Error: We must have q < get_n_A_terms in perform_A_interior_assembly."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: We must have q < get_n_A_terms in perform_A_interior_assembly.");
 
   libmesh_assert(_A_assembly_vector[q]);
 
                                                       FEMContext& context)
 {
   if(q >= get_n_A_terms())
-    {
-      libMesh::err << "Error: We must have q < get_n_A_terms in perform_A_boundary_assembly."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: We must have q < get_n_A_terms in perform_A_boundary_assembly.");
 
   libmesh_assert(_A_assembly_vector[q]);
 
                                                       FEMContext& context)
 {
   if(q >= get_n_F_terms())
-    {
-      libMesh::err << "Error: We must have q < get_n_F_terms in perform_F_interior_assembly."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: We must have q < get_n_F_terms in perform_F_interior_assembly.");
 
   libmesh_assert(_A_assembly_vector[q]);
 
                                                       FEMContext& context)
 {
   if(q >= get_n_F_terms())
-    {
-      libMesh::err << "Error: We must have q < get_n_F_terms in perform_F_interior_assembly."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: We must have q < get_n_F_terms in perform_F_interior_assembly.");
 
   libmesh_assert(_A_assembly_vector[q]);
 
                                                            FEMContext& context)
 {
   if( (output_index >= get_n_outputs()) || (q_l >= get_n_output_terms(output_index)) )
-    {
-      libMesh::err << "Error: We must have output_index < n_outputs and "
-                   << "q_l < get_n_output_terms(output_index) in perform_output_interior_assembly."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: We must have output_index < n_outputs and " \
+                      << "q_l < get_n_output_terms(output_index) in perform_output_interior_assembly.");
 
   libmesh_assert(_output_assembly_vector[output_index][q_l]);
 
                                                            FEMContext& context)
 {
   if( (output_index >= get_n_outputs()) || (q_l >= get_n_output_terms(output_index)) )
-    {
-      libMesh::err << "Error: We must have output_index < n_outputs and "
-                   << "q_l < get_n_output_terms(output_index) in perform_output_boundary_assembly."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: We must have output_index < n_outputs and " \
+                      << "q_l < get_n_output_terms(output_index) in perform_output_boundary_assembly.");
 
   libmesh_assert(_output_assembly_vector[output_index][q_l]);
 
 unsigned int RBAssemblyExpansion::get_n_output_terms(unsigned int index) const
 {
   if(index >= get_n_outputs())
-    {
-      libMesh::err << "Error: We must have index < n_outputs in get_Q_l."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: We must have index < n_outputs in get_Q_l.");
+
   return libmesh_cast_int<unsigned int>
     (_output_assembly_vector[index].size());
 }
 ElemAssembly& RBAssemblyExpansion::get_A_assembly(unsigned int q)
 {
   if(q >= get_n_A_terms())
-    {
-      libMesh::err << "Error: We must have q < get_n_A_terms in get_A_assembly."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: We must have q < get_n_A_terms in get_A_assembly.");
 
   return *_A_assembly_vector[q];
 }
 ElemAssembly& RBAssemblyExpansion::get_F_assembly(unsigned int q)
 {
   if(q >= get_n_F_terms())
-    {
-      libMesh::err << "Error: We must have q < get_n_F_terms in get_F_assembly."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: We must have q < get_n_F_terms in get_F_assembly.");
 
   return *_F_assembly_vector[q];
 }
                                                        unsigned int q_l)
 {
   if( (output_index >= get_n_outputs()) || (q_l >= get_n_output_terms(output_index)) )
-    {
-      libMesh::err << "Error: We must have output_index < n_outputs and "
-                   << "q_l < get_n_output_terms(output_index) in get_output_assembly."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: We must have output_index < n_outputs and " \
+                      << "q_l < get_n_output_terms(output_index) in get_output_assembly.");
 
   return *_output_assembly_vector[output_index][q_l];
 }

File src/reduced_basis/rb_construction.C

View file
  • Ignore whitespace
 RBEvaluation& RBConstruction::get_rb_evaluation()
 {
   if(!rb_eval)
-    {
-      libMesh::out << "Error: RBEvaluation object hasn't been initialized yet" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: RBEvaluation object hasn't been initialized yet");
 
   return *rb_eval;
 }
 RBAssemblyExpansion& RBConstruction::get_rb_assembly_expansion()
 {
   if(!rb_assembly_expansion)
-    {
-      libMesh::out << "Error: RBAssemblyExpansion object hasn't been initialized yet" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: RBAssemblyExpansion object hasn't been initialized yet");
 
   return *rb_assembly_expansion;
 }
 ElemAssembly& RBConstruction::get_inner_product_assembly()
 {
   if(!inner_product_assembly)
-    {
-      libMesh::out << "Error: inner_product_assembly hasn't been initialized yet" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: inner_product_assembly hasn't been initialized yet");
 
   return *inner_product_assembly;
 }
 ElemAssembly& RBConstruction::get_constraint_assembly()
 {
   if(!constraint_assembly)
-    {
-      libMesh::out << "Error: constraint_assembly hasn't been initialized yet" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: constraint_assembly hasn't been initialized yet");
 
   return *constraint_assembly;
 }
 void RBConstruction::assemble_Aq_matrix(unsigned int q, SparseMatrix<Number>* input_matrix, bool apply_dof_constraints)
 {
   if(q >= get_rb_theta_expansion().get_n_A_terms())
-    {
-      libMesh::err << "Error: We must have q < Q_a in assemble_Aq_matrix."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: We must have q < Q_a in assemble_Aq_matrix.");
 
   input_matrix->zero();
 
   START_LOG("add_scaled_Aq()", "RBConstruction");
 
   if(q_a >= get_rb_theta_expansion().get_n_A_terms())
-    {
-      libMesh::err << "Error: We must have q < Q_a in add_scaled_Aq."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: We must have q < Q_a in add_scaled_Aq.");
 
   if(!symmetrize)
     {
                                         bool apply_dof_constraints)
 {
   if(q >= get_rb_theta_expansion().get_n_F_terms())
-    {
-      libMesh::err << "Error: We must have q < Q_f in assemble_Fq_vector."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: We must have q < Q_f in assemble_Fq_vector.");
 
   input_vector->zero();
 
 const RBParameters& RBConstruction::get_greedy_parameter(unsigned int i)
 {
   if( i >= get_rb_evaluation().greedy_param_list.size() )
-    {
-      libMesh::out << "Error: Argument in RBConstruction::get_greedy_parameter is too large."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: Argument in RBConstruction::get_greedy_parameter is too large.");
 
   return get_rb_evaluation().greedy_param_list[i];
 }
   solution->zero();
 
   if(get_rb_evaluation().RB_solution.size() > get_rb_evaluation().get_n_basis_functions())
-    {
-      libMesh::err << "ERROR: System contains " << get_rb_evaluation().get_n_basis_functions() << " basis functions."
-                   << " RB_solution vector constains " << get_rb_evaluation().RB_solution.size() << " entries."
-                   << " RB_solution in RBConstruction::load_rb_solution is too long!" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("ERROR: System contains " << get_rb_evaluation().get_n_basis_functions() << " basis functions." \
+                      << " RB_solution vector constains " << get_rb_evaluation().RB_solution.size() << " entries." \
+                      << " RB_solution in RBConstruction::load_rb_solution is too long!");
 
   for(unsigned int i=0; i<get_rb_evaluation().RB_solution.size(); i++)
     {
 //       (this->final_linear_residual() >
 //        this->get_equation_systems().parameters.get<Real>("linear solver tolerance")) )
 //   {
-//     libMesh::out << "Warning: Linear solver may not have converged! Final linear residual = "
-//                  << this->final_linear_residual() << ", number of iterations = "
-//                  << this->n_linear_iterations() << std::endl << std::endl;
-// //     libmesh_error();
+//     libmesh_error_msg("Warning: Linear solver may not have converged! Final linear residual = "
+//                       << this->final_linear_residual() << ", number of iterations = "
+//                       << this->n_linear_iterations());
 //   }
 //
 //   inner_product_matrix->vector_mult(*inner_product_storage_vector, *solution);
 SparseMatrix<Number>* RBConstruction::get_non_dirichlet_inner_product_matrix()
 {
   if(!store_non_dirichlet_operators)
-    {
-      libMesh::err << "Error: Must have store_non_dirichlet_operators==true "
-                   << "to access non_dirichlet_inner_product_matrix." << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: Must have store_non_dirichlet_operators==true to access non_dirichlet_inner_product_matrix.");
 
   return non_dirichlet_inner_product_matrix.get();
 }
 SparseMatrix<Number>* RBConstruction::get_Aq(unsigned int q)
 {
   if(q >= get_rb_theta_expansion().get_n_A_terms())
-    {
-      libMesh::err << "Error: We must have q < Q_a in get_Aq."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: We must have q < Q_a in get_Aq.");
 
   return Aq_vector[q];
 }
 SparseMatrix<Number>* RBConstruction::get_non_dirichlet_Aq(unsigned int q)
 {
   if(!store_non_dirichlet_operators)
-    {
-      libMesh::err << "Error: Must have store_non_dirichlet_operators==true to access non_dirichlet_Aq." << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: Must have store_non_dirichlet_operators==true to access non_dirichlet_Aq.");
 
   if(q >= get_rb_theta_expansion().get_n_A_terms())
-    {
-      libMesh::err << "Error: We must have q < Q_a in get_Aq."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: We must have q < Q_a in get_Aq.");
 
   return non_dirichlet_Aq_vector[q];
 }
 NumericVector<Number>* RBConstruction::get_Fq(unsigned int q)
 {
   if(q >= get_rb_theta_expansion().get_n_F_terms())
-    {
-      libMesh::err << "Error: We must have q < Q_f in get_Fq."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: We must have q < Q_f in get_Fq.");
 
   return Fq_vector[q];
 }
 NumericVector<Number>* RBConstruction::get_non_dirichlet_Fq(unsigned int q)
 {
   if(!store_non_dirichlet_operators)
-    {
-      libMesh::err << "Error: Must have store_non_dirichlet_operators==true to access non_dirichlet_Fq." << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: Must have store_non_dirichlet_operators==true to access non_dirichlet_Fq.");
 
   if(q >= get_rb_theta_expansion().get_n_F_terms())
-    {
-      libMesh::err << "Error: We must have q < Q_f in get_Fq."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: We must have q < Q_f in get_Fq.");
 
   return non_dirichlet_Fq_vector[q];
 }
 NumericVector<Number>* RBConstruction::get_output_vector(unsigned int n, unsigned int q_l)
 {
   if( (n >= get_rb_theta_expansion().get_n_outputs()) || (q_l >= get_rb_theta_expansion().get_n_output_terms(n)) )
-    {
-      libMesh::err << "Error: We must have n < n_outputs and "
-                   << "q_l < get_rb_theta_expansion().get_n_output_terms(n) in get_output_vector."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: We must have n < n_outputs and "          \
+                      << "q_l < get_rb_theta_expansion().get_n_output_terms(n) in get_output_vector.");
 
   return outputs_vector[n][q_l];
 }
 NumericVector<Number>* RBConstruction::get_non_dirichlet_output_vector(unsigned int n, unsigned int q_l)
 {
   if( (n >= get_rb_theta_expansion().get_n_outputs()) || (q_l >= get_rb_theta_expansion().get_n_output_terms(n)) )
-    {
-      libMesh::err << "Error: We must have n < n_outputs and "
-                   << "q_l < get_rb_theta_expansion().get_n_output_terms(n) in get_non_dirichlet_output_vector."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: We must have n < n_outputs and "          \
+                      << "q_l < get_rb_theta_expansion().get_n_output_terms(n) in get_non_dirichlet_output_vector.");
 
   return non_dirichlet_outputs_vector[n][q_l];
 }
   for (unsigned int i=0; i<Fq_representor.size(); ++i)
     {
       if (Fq_representor[i] != NULL)
-        {
-          libMesh::out << "Error, must delete existing Fq_representor before reading in from file."
-                       << std::endl;
-          libmesh_error();
-        }
+        libmesh_error_msg("Error, must delete existing Fq_representor before reading in from file.");
     }
 
   for (unsigned int i=0; i<Fq_representor.size(); i++)
           int stat_result = stat(file_name.str().c_str(), &stat_info);
 
           if (stat_result != 0)
-            {
-              libMesh::out << "File does not exist: " << file_name.str() << std::endl;
-              libmesh_error();
-            }
+            libmesh_error_msg("File does not exist: " << file_name.str());
         }
 
       Xdr fqr_data(file_name.str(),
     for (unsigned int j=0; j<get_rb_evaluation().Aq_representor[i].size(); ++j)
       {
         if (get_rb_evaluation().Aq_representor[i][j] != NULL)
-          {
-            libMesh::out << "Error, must delete existing Aq_representor before reading in from file."
-                         << std::endl;
-            libmesh_error();
-          }
+          libmesh_error_msg("Error, must delete existing Aq_representor before reading in from file.");
       }
 
   // Now ready to read them in from file!
             int stat_result = stat(file_name.str().c_str(), &stat_info);
 
             if (stat_result != 0)
-              {
-                libMesh::out << "File does not exist: " << file_name.str() << std::endl;
-                libmesh_error();
-              }
+              libmesh_error_msg("File does not exist: " << file_name.str());
           }
 
         Xdr aqr_data(file_name.str(), read_binary_residual_representors ? DECODE : READ);
     libMesh::LinearConvergenceReason conv_flag;
     conv_flag = get_linear_solver()->get_converged_reason();
     if(conv_flag < 0)
-    {
-      libmesh_error();
-    }
+      libmesh_error_msg("Error, conv_flag < 0!");
 }
 
 bool RBConstruction::get_convergence_assertion_flag() const

File src/reduced_basis/rb_construction_base.C

View file
  • Ignore whitespace
   // First, make sure that an initial training set has already been
   // generated
   if(!training_parameters_initialized)
-    {
-      libMesh::out << "Error: load_training_set cannot be used to initialize parameters"
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: load_training_set cannot be used to initialize parameters");
 
   // Make sure that the training set has the correct number of parameters
   if(new_training_set.size() != get_n_params())
-    {
-      libMesh::out << "Error: Incorrect number of parameters in load_training_set."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: Incorrect number of parameters in load_training_set.");
 
   // Clear the training set
   std::map< std::string, NumericVector<Number>* >::iterator it           = training_parameters.begin();
       // First make sure n_training_samples_in is a square number
       unsigned int n_training_parameters_per_var = static_cast<unsigned int>( std::sqrt(static_cast<Real>(n_training_samples_in)) );
       if( (n_training_parameters_per_var*n_training_parameters_per_var) != n_training_samples_in)
-        {
-          libMesh::out << "Error: Number of training parameters = " << n_training_samples_in << "." << std::endl
-                       << "Deterministic training set generation with two parameters requires " << std::endl
-                       << "the number of training parameters to be a perfect square." << std::endl;
-          libmesh_error();
-        }
+        libmesh_error_msg("Error: Number of training parameters = " \
+                          << n_training_samples_in \
+                          << ".\n" \
+                          << "Deterministic training set generation with two parameters requires\n " \
+                          << "the number of training parameters to be a perfect square.");
 
       // make a matrix to store all the parameters, put them in vector form afterwards
       std::vector< std::vector<Real> > training_parameters_matrix(num_params);

File src/reduced_basis/rb_eim_construction.C

View file
  • Ignore whitespace
         best_fit_type_flag = EIM_BEST_FIT;
       }
     else
-      {
-        libMesh::out << "Error: invalid best_fit_type in input file" << std::endl;
-        libmesh_error();
-      }
+      libmesh_error_msg("Error: invalid best_fit_type in input file");
 }
 
 void RBEIMConstruction::print_info()
 void RBEIMConstruction::initialize_parametrized_functions_in_training_set()
 {
   if(!serial_training_set)
-    {
-      libMesh::err << "Error: We must have serial_training_set==true in "
-                   << "RBEIMConstruction::initialize_parametrized_functions_in_training_set"
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: We must have serial_training_set==true in " \
+                      << "RBEIMConstruction::initialize_parametrized_functions_in_training_set");
 
   libMesh::out << "Initializing parametrized functions in training set..." << std::endl;
   // initialize rb_eval's parameters
         break;
       }
     default:
-      {
-        libMesh::out << "Should not reach here" << std::endl;
-        libmesh_error();
-      }
+      libmesh_error_msg("Should not reach here");
     }
 
   // load the error into solution

File src/reduced_basis/rb_eim_evaluation.C

View file
  • Ignore whitespace
                                                        const Elem& elem)
 {
   if(var_index >= get_n_parametrized_functions())
-    {
-      libMesh::err << "Error: We must have var_index < get_n_parametrized_functions() in evaluate_parametrized_function."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: We must have var_index < get_n_parametrized_functions() in evaluate_parametrized_function.");
 
   return _parametrized_functions[var_index]->evaluate(get_parameters(), p, elem);
 }
   START_LOG("rb_solve()", "RBEIMEvaluation");
 
   if(N > get_n_basis_functions())
-    {
-      libMesh::err << "ERROR: N cannot be larger than the number "
-                   << "of basis functions in rb_solve" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("ERROR: N cannot be larger than the number of basis functions in rb_solve");
+
   if(N==0)
-    {
-      libMesh::err << "ERROR: N must be greater than 0 in rb_solve" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("ERROR: N must be greater than 0 in rb_solve");
 
   // Get the rhs by sampling parametrized_function
   // at the first N interpolation_points
   START_LOG("rb_solve()", "RBEIMEvaluation");
 
   if(EIM_rhs.size() > get_n_basis_functions())
-    {
-      libMesh::err << "ERROR: N cannot be larger than the number "
-                   << "of basis functions in rb_solve" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("ERROR: N cannot be larger than the number of basis functions in rb_solve");
+
   if(EIM_rhs.size()==0)
-    {
-      libMesh::err << "ERROR: N must be greater than 0 in rb_solve" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("ERROR: N must be greater than 0 in rb_solve");
 
   const unsigned int N = EIM_rhs.size();
   DenseMatrix<Number> interpolation_matrix_N;

File src/reduced_basis/rb_evaluation.C

View file
  • Ignore whitespace
 RBThetaExpansion& RBEvaluation::get_rb_theta_expansion()
 {
   if(!is_rb_theta_expansion_initialized())
-    {
-      libMesh::out << "Error: rb_theta_expansion hasn't been initialized yet" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: rb_theta_expansion hasn't been initialized yet");
 
   return *rb_theta_expansion;
 }
   START_LOG("resize_data_structures()", "RBEvaluation");
 
   if(Nmax < this->get_n_basis_functions())
-    {
-      libMesh::err << "Error: Cannot set Nmax to be less than the "
-                   << "current number of basis functions."  << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: Cannot set Nmax to be less than the current number of basis functions.");
 
   // Resize/clear inner product matrix
   if(compute_RB_inner_product)
   START_LOG("rb_solve()", "RBEvaluation");
 
   if(N > get_n_basis_functions())
-    {
-      libMesh::err << "ERROR: N cannot be larger than the number "
-                   << "of basis functions in rb_solve" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("ERROR: N cannot be larger than the number of basis functions in rb_solve");
 
   const RBParameters& mu = get_parameters();
 
       //     Sometimes this is negative due to rounding error,
       //     but when this occurs the error is on the order of 1.e-10,
       //     so shouldn't affect error bound much...
-      //     libmesh_error();
       residual_norm_sq = std::abs(residual_norm_sq);
     }
 
               int stat_result = stat(file_name.str().c_str(), &stat_info);
 
               if (stat_result != 0)
-                {
-                  libMesh::out << "File does not exist: " << file_name.str() << std::endl;
-                  libmesh_error();
-                }
+                libmesh_error_msg("File does not exist: " << file_name.str());
             }
 
           Xdr vector_data(file_name.str(),
           int stat_result = stat(file_name.str().c_str(), &stat_info);
 
           if (stat_result != 0)
-            {
-              libMesh::out << "File does not exist: " << file_name.str() << std::endl;
-              libmesh_error();
-            }
+            libmesh_error_msg("File does not exist: " << file_name.str());
         }
 
       Xdr vector_data(file_name.str(),

File src/reduced_basis/rb_parameters.C

View file
  • Ignore whitespace
 
   // throw and error if the parameter doesn't exist
   if( it == _parameters.end() )
-    {
-      libMesh::err << "Error: parameter " << param_name << " does not exist in RBParameters object."
-                   << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: parameter " << param_name << " does not exist in RBParameters object.");
 
   return it->second;
 }

File src/reduced_basis/rb_parametrized.C

View file
  • Ignore whitespace
     const std::string err_string = "Error: Invalid mu_min/mu_max in RBParameters constructor.";
     bool valid_min_max = (mu_min_in.n_parameters() == mu_max_in.n_parameters());
     if(!valid_min_max)
-      {
-        libMesh::err << err_string << std::endl;
-        libmesh_error();
-      }
+      libmesh_error_msg(err_string);
+
     else
       {
         RBParameters::const_iterator it     = mu_min_in.begin();
           {
             std::string param_name = it->first;
             if(mu_min_in.get_value(param_name) > mu_max_in.get_value(param_name))
-              {
-                libMesh::err << err_string << std::endl;
-                libmesh_error();
-              }
+              libmesh_error_msg(err_string);
           }
       }
   }
     for( ; it != it_end; ++it)
       {
         if(it->second.empty())
-          {
-            libMesh::err << "Error: List of discrete parameters for " << it->first << " is empty."
-                         << std::endl;
-            libmesh_error();
-          }
+          libmesh_error_msg("Error: List of discrete parameters for " << it->first << " is empty.");
 
         Real min_val = *std::min_element(it->second.begin(), it->second.end());
         Real max_val = *std::max_element(it->second.begin(), it->second.end());
 unsigned int RBParametrized::get_n_params() const
 {
   if(!parameters_initialized)
-    {
-      libMesh::err << "Error: parameters not initialized in RBParametrized::get_n_params" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_n_params");
 
   libmesh_assert_equal_to ( parameters_min.n_parameters(), parameters_max.n_parameters() );
 
 unsigned int RBParametrized::get_n_continuous_params() const
 {
   if(!parameters_initialized)
-    {
-      libMesh::err << "Error: parameters not initialized in RBParametrized::get_n_continuous_params" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_n_continuous_params");
 
   libmesh_assert(get_n_params() >= get_n_discrete_params());
 
 unsigned int RBParametrized::get_n_discrete_params() const
 {
   if(!parameters_initialized)
-    {
-      libMesh::err << "Error: parameters not initialized in RBParametrized::get_n_discrete_params" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_n_discrete_params");
 
   return get_discrete_parameter_values().size();
 }
 std::set<std::string> RBParametrized::get_parameter_names() const
 {
   if(!parameters_initialized)
-    {
-      libMesh::err << "Error: parameters not initialized in RBParametrized::get_parameter_names" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_parameter_names");
 
   std::set<std::string> parameter_names;
   parameters_min.get_parameter_names(parameter_names);
 void RBParametrized::set_parameters(const RBParameters& params)
 {
   if(!parameters_initialized)
-    {
-      libMesh::err << "Error: parameters not initialized in RBParametrized::set_current_parameters" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: parameters not initialized in RBParametrized::set_current_parameters");
 
   valid_params(params); // Terminates if params has the wrong number of parameters
 
 const RBParameters& RBParametrized::get_parameters() const
 {
   if(!parameters_initialized)
-    {
-      libMesh::err << "Error: parameters not initialized in RBParametrized::get_current_parameters" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_current_parameters");
 
   return parameters;
 }
 const RBParameters& RBParametrized::get_parameters_min() const
 {
   if(!parameters_initialized)
-    {
-      libMesh::err << "Error: parameters not initialized in RBParametrized::get_parameters_min" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_parameters_min");
 
   return parameters_min;
 }
 const RBParameters& RBParametrized::get_parameters_max() const
 {
   if(!parameters_initialized)
-    {
-      libMesh::err << "Error: parameters not initialized in RBParametrized::get_parameters_max" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_parameters_max");
 
   return parameters_max;
 }
 Real RBParametrized::get_parameter_min(const std::string& param_name) const
 {
   if(!parameters_initialized)
-    {
-      libMesh::err << "Error: parameters not initialized in RBParametrized::get_parameter_min" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_parameter_min");
 
   return parameters_min.get_value(param_name);
 }
 Real RBParametrized::get_parameter_max(const std::string& param_name) const
 {
   if(!parameters_initialized)
-    {
-      libMesh::err << "Error: parameters not initialized in RBParametrized::get_parameter_max" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_parameter_max");
 
   return parameters_max.get_value(param_name);
 }
 void RBParametrized::print_parameters() const
 {
   if(!parameters_initialized)
-    {
-      libMesh::err << "Error: parameters not initialized in RBParametrized::print_current_parameters" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: parameters not initialized in RBParametrized::print_current_parameters");
 
   get_parameters().print();
 }
 bool RBParametrized::is_discrete_parameter(const std::string& mu_name) const
 {
   if(!parameters_initialized)
-    {
-      libMesh::err << "Error: parameters not initialized in RBParametrized::is_discrete_parameter" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: parameters not initialized in RBParametrized::is_discrete_parameter");
 
   return (_discrete_parameter_values.find(mu_name) != _discrete_parameter_values.end());
 }
 const std::map< std::string, std::vector<Real> >& RBParametrized::get_discrete_parameter_values() const
 {
   if(!parameters_initialized)
-    {
-      libMesh::err << "Error: parameters not initialized in RBParametrized::get_discrete_parameter_values" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: parameters not initialized in RBParametrized::get_discrete_parameter_values");
 
   return _discrete_parameter_values;
 }
 bool RBParametrized::valid_params(const RBParameters& params)
 {
   if(params.n_parameters() != get_n_params())
-    {
-      libMesh::out << "Error: Number of parameters don't match" << std::endl;
-      libmesh_error();
-      return false;
-    }
+    libmesh_error_msg("Error: Number of parameters don't match");
+
   else
     {
       bool valid = true;
 Real RBParametrized::get_closest_value(Real value, const std::vector<Real>& list_of_values)
 {
   if(list_of_values.empty())
-    {
-      libMesh::err << "Error: list_of_values is empty." << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: list_of_values is empty.");
 
   std::vector<Real>::const_iterator it = list_of_values.begin();
   std::vector<Real>::const_iterator it_end = list_of_values.end();

File src/reduced_basis/rb_scm_construction.C

View file
  • Ignore whitespace
 RBSCMEvaluation& RBSCMConstruction::get_rb_scm_evaluation()
 {
   if(!rb_scm_eval)
-    {
-      libMesh::out << "Error: RBSCMEvaluation object hasn't been initialized yet" << std::endl;
-      libmesh_error();
-    }
+    libmesh_error_msg("Error: RBSCMEvaluation object hasn't been initialized yet");
 
   return *rb_scm_eval;
 }
           libMesh::out << std::endl << "B_min("<<q<<") = " << rb_scm_eval->get_B_min(q) << std::endl;
         }
       else
-        {
-          libMesh::err << "Eigen solver for computing B_min did not converge" << std::endl;
-          libmesh_error();
-        }
+        libmesh_error_msg("Eigen solver for computing B_min did not converge");
 
       // Compute B_max(q)
       eigen_solver->set_position_of_spectrum(LARGEST_REAL);
           libMesh::out << "B_max("<<q<<") = " << rb_scm_eval->get_B_max(q) << std::endl;
         }
       else
-        {