solution_names.emplace_back("z_displacement");
break;
default:
- Assert(false, ExcInternalError());
+ DEAL_II_NOT_IMPLEMENTED();
}
data_out.add_data_vector(localized_solution, solution_names);
return (1. / (R.norm() * 4 * numbers::PI));
default:
- Assert(false, ExcInternalError());
- return 0.;
+ DEAL_II_NOT_IMPLEMENTED();
}
}
return R / (-4 * numbers::PI * R.norm_square() * R.norm());
default:
- Assert(false, ExcInternalError());
- return Tensor<1, dim>();
+ DEAL_II_NOT_IMPLEMENTED();
}
}
} // namespace LaplaceKernel
loc_vel_dof_indices[joint_fe.system_to_base_index(i).second]);
break;
default:
- Assert(false, ExcInternalError());
+ DEAL_II_ASSERT_UNREACHABLE();
}
}
std::vector<std::string> joint_solution_names(dim, "v");
}
default:
- Assert(false, ExcInternalError());
+ DEAL_II_ASSERT_UNREACHABLE();
}
pcout << " Number of CG iterations: " << solver_control.last_step()
}
default:
- Assert(false, ExcMessage("This program only works in 2d and 3d."));
+ DEAL_II_NOT_IMPLEMENTED();
}
}
catch (std::exception &exc)
else if ((p[0] >= 0) && (p[1] >= 0)) // upper right quadrant
return 1000;
else
- {
- Assert(false, ExcInternalError());
- return 0;
- }
+ DEAL_II_ASSERT_UNREACHABLE();
}
@endcode
-(Adding the <code>Assert</code> at the end ensures that either an exception
+(Adding the `DEAL_II_ASSERT_UNREACHABLE();` call at the end ensures that either an exception
is thrown or that the program aborts if we ever get to that point
-- which of course we shouldn't,
-but this is a good way to insure yourself: we all make mistakes by
+but this is a good way to insure yourself: We all make mistakes by
sometimes not thinking of all cases, for example by checking
for <code>p[0]</code> to be less than and greater than zero,
rather than greater-or-equal to zero, and thereby forgetting
some cases that would otherwise lead to bugs that are awkward
-to find. The <code>return 0;</code> at the end is only there to
-avoid compiler warnings that the function does not end in a
-<code>return</code> statement -- the compiler cannot see that the
-function would never actually get to that point because of the
-preceding <code>Assert</code> statement.)
+to find.
By playing with such cases where four or more sectors come
together and on which the coefficient has different values, one can
elastic_constant = mu * (3 * lambda + 2 * mu) / (lambda + mu);
}
else
- {
- Assert(false, ExcInternalError());
- }
+ DEAL_II_NOT_IMPLEMENTED();
+
const double material_a_speed_of_sound =
std::sqrt(elastic_constant / material_a_rho);
const double material_a_wavelength =
break;
default:
- Assert(false, ExcInternalError());
- break;
+ DEAL_II_ASSERT_UNREACHABLE();
}
return base_weight + particle_weight * n_particles_in_cell;