Rocstar  1.0
Rocstar multiphysics simulation application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
roccom_assertion.h File Reference

This file contains a set of routines for error assertion. More...

#include "roccom_basic.h"
Include dependency graph for roccom_assertion.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define COM_assertion(EX)   ((EX)?((void)0): ::COM::assertion_fail( # EX , __FILE__, __LINE__, 0))
 Error checking utility similar to the assert macro of the C language. More...
 
#define COM_assertion_msg(EX, msg)   ((EX)?((void)0): ::COM::assertion_fail( # EX , __FILE__, __LINE__, msg))
 

Typedefs

typedef void(* Failure_function )(const char *, const char *, const char *, int, const char *)
 Function type for error handlers. More...
 

Enumerations

enum  Failure_behaviour {
  ABORT, EXIT, EXIT_WITH_SUCCESS, CONTINUE,
  ABORT, EXIT, EXIT_WITH_SUCCESS, CONTINUE
}
 Behavior of failures. More...
 

Functions

void assertion_fail (const char *, const char *, int, const char *)
 Default error handler. More...
 
Failure_behaviour set_error_behaviour (Failure_behaviour eb)
 Controls the behavior when an assertion fails. More...
 
Failure_function set_error_handler (Failure_function handler)
 Sets the handler for assertion-failures. More...
 

Detailed Description

This file contains a set of routines for error assertion.

See Also
assertion.C

Definition in file roccom_assertion.h.

Macro Definition Documentation

#define COM_assertion (   EX)    ((EX)?((void)0): ::COM::assertion_fail( # EX , __FILE__, __LINE__, 0))

Error checking utility similar to the assert macro of the C language.

If NDEBUG is not defined, then it will invoke the error handler set by set_error_handler, and then perform the action according to the Failure_behaviour set by set_error_behaviour. The default error handler is to print the assertion expression, file name and line number, and the default error behavior is to abort. If NDEBUG is defined, this macro has no effect.

Definition at line 62 of file roccom_assertion.h.

Referenced by Window_manifold_2::accumulate_bd_values(), Halfedge::addr(), Window_manifold_2::assign_global_nodeIDs(), Overlay::associate_green_vertices(), Pane_communicator::begin_update(), Propagation_3::bound_facial_speed(), FaceOffset_3::build_ridge_neighbor_list(), Scheduler::buildDDG(), COM_F_FUNC2(), com_get_address_f(), com_set_address_f(), Rocsurf::compute_element_areas(), Rocsurf::compute_element_normals(), Window_manifold_2::compute_mcn(), comtype2hdftype(), Pane::connectivity(), convert2mpiop(), Propagation_3::convert_constraints(), Pane_manifold_2::convert_pconn_edge2ghost(), Pane_connectivity::create_b2map(), Pane::delete_attribute(), Simple_manifold_2::determine_incident_halfedges(), Simple_manifold_2::determine_opposite_halfedges(), Element_node_enumerator::Element_node_enumerator(), Pane_communicator::end_update(), FaceOffset_3::filter_and_identify_ridge_edges(), Pane_ghost_connectivity::finalize_pconn(), get_comm_rank(), get_comm_size(), Pane_manifold_2::get_counterpart(), get_deformed_normal(), Simple_manifold_2::get_incident_edge(), Simple_manifold_2::get_incident_real_edge(), Simple_manifold_2::get_next_ghost_edge_interior(), Simple_manifold_2::get_next_real_edge_interior(), Simple_manifold_2::get_opposite_edge_border(), Simple_manifold_2::get_opposite_ghost_edge(), Simple_manifold_2::get_opposite_ghost_edge_border(), Simple_manifold_2::get_opposite_ghost_edge_interior(), Simple_manifold_2::get_opposite_real_edge_border(), Simple_manifold_2::get_opposite_real_edge_interior(), Simple_manifold_2::get_prev_ghost_edge_interior(), Simple_manifold_2::get_prev_real_edge_interior(), Pane_manifold_2::get_primary(), Connectivity::get_size_info(), Attribute::get_sizeof(), Roccom_base::get_window_handle(), Pane_dual_connectivity::incident_elements(), Pane::inherit(), Pane_communicator::init(), Pane::insert(), Rocsurf::integrate(), io_hdf_data(), io_pane_attribute(), io_pane_header(), Pane_manifold_2::is_primary(), Pane_communicator::lpaneid(), main(), max_element(), max_sqrt_element(), min_element(), min_sqrt_element(), Pane::new_attribute(), Pane_node_enumerator::next(), Element_node_enumerator::next(), Element_node_vectors_k_const< Value >::operator()(), Element_vectors_k_const< Value >::operator()(), Window::pane(), Pane_node_enumerator::Pane_node_enumerator(), Rocprop::propagate(), PointPropagate::propagate_gp_of_element(), Neutral_Reader::read_pane_coors(), Neutral_Reader::read_pane_elems(), FaceOffset_3::reclassify_ridge_vertices(), Pane_communicator::reduce_diff_on_shared_nodes(), Pane_communicator::reduce_maxabs_on_shared_nodes(), Pane_communicator::reduce_minabs_on_shared_nodes(), Pane_communicator::reduce_on_shared_nodes(), Window_manifold_2::reduce_on_shared_nodes(), Pane::reinit_attr(), Window::reinit_attr(), Window::reinit_conn(), Rocprop::remesh_serial(), Pane_ghost_connectivity::send_pane_info(), Window_manifold_2::serialize_window(), Element_node_vectors_k_const< Value >::set(), Element_vectors_k_const< Value >::set(), FaceOffset_3::set_courant_constant(), FaceOffset_3::set_eigen_threshold(), Rocprop::set_option(), Connectivity::set_pointer(), Attribute::set_size(), Connectivity::size_of_elements(), Connectivity::size_of_ghost_elements(), Connectivity::size_of_ghost_nodes(), Connectivity::size_of_nodes(), Connectivity::size_of_real_elements(), Connectivity::size_of_real_nodes(), Overlay_primitives::snap_blue_ridge_vertex(), squared_sum(), MarkerParticles_3::time_stepping(), Window_manifold_2::update_bd_flags(), Window_manifold_2::update_bd_normals(), Window_manifold_2::update_bdedge_bitmap(), Pane_communicator::update_ghost_values(), Element_node_enumerator::vertex(), write_attr_CGNS(), write_attr_HDF4(), and Scheduler::writes().

#define COM_assertion_msg (   EX,
  msg 
)    ((EX)?((void)0): ::COM::assertion_fail( # EX , __FILE__, __LINE__, msg))

Definition at line 64 of file roccom_assertion.h.

Referenced by Window_manifold_2::accumulate_bd_values(), Rocblas::acos(), Rocblas::add(), Rocmop::add_aspect_ratios(), Agent::add_bcaction(), add_ghost_nodes2D(), Rocblas::add_scalar(), Node::addr(), Halfedge::addr(), Window::append_array(), AttributeBase::assign(), Node::attr(), Halfedge::attr(), Rocblas::axpy(), Rocblas::axpy_gen(), Pane_communicator::begin_update(), Propagation_3::bound_facial_speed(), Propagation_3::bound_nodal_motion(), Rocon::burnout(), Rocon::burnout_filter(), Rocblas::calc(), Rocblas::calcDot(), Roccom_base::call_function(), COM_call_function(), COM_F_FUNC2(), COM_get_roccom(), COM_icall_function(), COM_set_object(), FaceOffset_3::compute_eigenvectors(), Rocmop::compute_eigenvectors(), Rocsurf::compute_element_areas(), Rocsurf::compute_mcn(), Window_manifold_2::compute_nodal_normals(), Rocsurf::compute_normals(), Window_manifold_2::compute_normals(), FaceOffset_3::compute_quadrics(), Pane::connectivity(), Rocon::constrain_displacements(), Pane_dual_connectivity::construct_connectivity_str_2(), Propagation_3::convert_constraints(), Rocblas::copy(), Rocblas::copy_scalar(), Pane_connectivity::create_b2map(), SolidAgent::create_buffer_all(), create_coupling(), Pane_boundary::determine_border_nodes_3(), Pane_boundary::determine_borders(), Window_manifold_2::determine_counterparts(), Simple_manifold_2::determine_ghosts(), Simple_manifold_2::determine_incident_halfedges(), Rocmop::determine_physical_border(), Window_manifold_2::determine_primaries(), Pane_ghost_connectivity::determine_shared_border(), Rocmop::determine_shared_border(), Rocblas::div(), Rocblas::div_scalar(), Rocblas::dot_MPI(), Rocblas::dot_scalar_MPI(), MesqPane::element_get_topology(), MesqPane::elements_get_attached_vertices(), Rocsurf::elements_to_nodes(), Window_manifold_2::elements_to_nodes(), Propagation_3::enforce_nodal_constraint(), Rocmop::evaluate_face_normals(), InterpolateBase::extrapolate_Linear(), Facet_node_enumerator::Facet_node_enumerator(), Scheduler::finalize_actions(), Pane_ghost_connectivity::finalize_pconn(), Rocon::find_intersections(), Rocblas::gen2arg(), MesqPane::get_all_elements(), MesqPane::get_all_mesh(), MesqPane::get_all_vertices(), Action::get_attribute_handle(), Action::get_attribute_handle_const(), Pane_manifold_2::get_bd_flag(), Pane_manifold_2::get_bd_normal(), Pane_manifold_2::get_bdedge_flag(), Propagation_3::get_constraint_directions(), Rocmop::get_constraint_directions(), get_deformed_normal(), Pane_ghost_connectivity::get_ents_to_send(), Roccom_base::get_f90pntoffsets(), Roccom_base::get_f90pointer(), Simple_manifold_2::get_incident_ghost_edge(), Simple_manifold_2::get_incident_real_edge(), Pane_manifold_2::get_next_edge(), Pane_manifold_2::get_opposite_edge(), get_parameter_list(), Pane_manifold_2::get_prev_edge(), RFC_Window_base::get_sdv_fname(), Rocmop::get_usr_disp(), Pane::inherit(), InterpolateBase::init(), LoadTransfer_FS::init(), Extrapolate_Central::init(), LoadTransfer_FSc_ALE::init(), LoadTransferOnly_FSc_ALE::init(), Pane_communicator::init(), HeatTransfer_FS::init(), Window_manifold_2::init(), Simple_manifold_2::init(), Scheduler::init_actions(), Agent::init_function_handles(), Pane_communicator::init_pane_comm_buffers(), Geo_Metric_Base_2::initialize(), Rocprop::initialize(), Geo_Metric_Base_3::initialize(), Alg_Metric_Base_2::initialize(), Rocon::initialize(), Rocsurf::initialize(), Rocsurf::integrate(), Interpolate_Constant::Interpolate_Constant(), io_pane(), Pane_manifold_2::is_border_edge(), Rocblas::limit1(), BurnAgent::load_module(), FluidAgent::load_module(), SolidAgent::load_module(), LoadTransfer_FS::LoadTransfer_FS(), main(), Rocblas::maxof_scalar(), MeshMotionTransferISS::MeshMotionTransferISS(), Rocblas::mul(), Rocblas::mul_scalar(), Rocblas::neg(), Window::new_attribute(), FaceOffset_3::nulaplacian_smooth(), Overlay::number_subfaces(), Rocin::obtain_attribute(), FaceOffset_3::obtain_face_offset(), Window::owner_rank(), Window::panes(), Rocmop::perform_iterative_smoothing(), Rocmop::perform_noniterative_smoothing(), Rocmop::perform_smoothing(), Rocprop::perturb_mesh(), Rocmop::perturb_stationary(), Rocmop::print_mquality(), Rocmop::print_quality(), project_edge(), Rocprop::propagate(), PointPropagate::propagate_faces(), PointPropagate::propagate_nodes(), Rocblas::rand(), Rocblas::rand_scalar(), Propagation_3::reached_nodal_bound(), Rocin::read_by_control_file(), read_control_file(), read_in_mesh(), MSH_Reader::read_pane_coors(), SMF_Reader::read_pane_coors(), SMF_Reader::read_pane_elems(), MSH_Reader::read_pane_elems(), Rocin::read_parameter_file(), Pane_communicator::reduce_average_on_shared_nodes(), Pane_communicator::reduce_diff_on_shared_nodes(), Pane_communicator::reduce_maxabs_on_shared_nodes(), Pane_communicator::reduce_minabs_on_shared_nodes(), Rocblas::reduce_MPI(), Pane_communicator::reduce_on_shared_nodes(), Rocblas::reduce_scalar_MPI(), FaceOffset_3::rescale_displacements(), LoadTransfer_FS::run(), Extrapolate_Linear::run(), Extrapolate_Central::run(), LoadTransfer_FSc_ALE::run(), Interpolate_Linear::run(), Interpolate_Central::run(), LoadTransferOnly_FSc_ALE::run(), ComputeMeshMotion::run(), HeatTransfer_FS::run(), Scheduler::run_actions(), Scheduler::sanityCheck(), scan_files_HDF4(), Scheduler::schedule(), Rocsurf::serialize_mesh(), Rocprop::set_bounds(), Propagation_3::set_bounds(), Rocprop::set_constraints(), Propagation_3::set_constraints(), Roccom_base::set_f90pointer(), Roccom_base::set_object(), Rocprop::set_option(), Rocout::set_option(), Pane::set_size(), Overlay::set_tolerance(), Rocmop::set_value(), Window_manifold_2::shortest_edge_length(), Remesher_Simmetrix::simmesh_to_window(), Pane_connectivity::size_of_cpanes(), Pane_manifold_2::size_of_edges(), Connectivity::size_of_elements(), Pane_manifold_2::size_of_nodes(), Connectivity::size_of_nodes(), Rocmop::smooth(), Rocmop::smooth_in_place(), Rocmop::smooth_surf_medial(), Rocmop::smooth_vol_mesq_ng(), Rocmop::smoother_specific_init(), Rocblas::sqrt(), Rocblas::sub(), Rocblas::sub_scalar(), Rocblas::swap(), MesqPane::tag_create(), MesqPane::tag_delete(), MesqPane::tag_set_element_data(), MesqPane::tag_set_vertex_data(), TemperatureTransfer_SF::TemperatureTransfer_SF(), FaceOffset_3::time_stepping(), Rocon::unload(), Rocprop::unload(), BurnAgent::unload_module(), Rocmop::update_buf_real_nc(), Pane_communicator::update_ghost_values(), Function::validate_object(), MesqPane::vertex_is_fixed(), MesqPane::vertices_get_coordinates(), Remesher_Simmetrix::window_to_simmesh(), write_attr_CGNS(), Rocout::write_parameter_file(), and Rocout::write_rocin_control_file().

Typedef Documentation

typedef void(* Failure_function)(const char *, const char *, const char *, int, const char *)

Function type for error handlers.

Definition at line 42 of file roccom_assertion.h.

Enumeration Type Documentation

Behavior of failures.

Enumerator
ABORT 
EXIT 
EXIT_WITH_SUCCESS 
CONTINUE 
ABORT 
EXIT 
EXIT_WITH_SUCCESS 
CONTINUE 

Definition at line 38 of file roccom_assertion.h.

Function Documentation

void assertion_fail ( const char *  ,
const char *  ,
int  ,
const char *   
)

Default error handler.

Definition at line 71 of file assertion.C.

75 {
76  extern void printStackBacktrace();
77 
78  (*_error_handler)("assertion", expr, file, line, msg);
79  printStackBacktrace(); // Print stack backtrace
80  switch (_error_behaviour) {
81  case ABORT:
82  abort();
83  case EXIT:
84  exit(1); // EXIT_FAILURE
85  case EXIT_WITH_SUCCESS:
86  exit(0); // EXIT_SUCCESS
87  case CONTINUE:
88  ;
89  }
90 }
COM_BEGIN_NAME_SPACE void printStackBacktrace()
Print the stack backtrace.
static Failure_behaviour _error_behaviour
Definition: assertion.C:66
Failure_behaviour set_error_behaviour ( Failure_behaviour  eb)

Controls the behavior when an assertion fails.

Definition at line 93 of file assertion.C.

94 {
96  _error_behaviour = eb;
97  return result;
98 }
Failure_behaviour
Behavior of failures.
static Failure_behaviour _error_behaviour
Definition: assertion.C:66
Failure_function set_error_handler ( Failure_function  handler)

Sets the handler for assertion-failures.

Definition at line 104 of file assertion.C.

105 {
107  _error_handler = handler;
108  return( result);
109 }
void(* Failure_function)(const char *, const char *, const char *, int, const char *)
Function type for error handlers.
static Failure_function _error_handler
Definition: assertion.C:65