Triangulation<dim> triangulation;
GridGenerator::hyper_cube(triangulation, -1, 1);
triangulation.refine_global(2);
- const FE_Q<dim> fe(1);
- const QGauss<dim> quadrature(4);
- const RightHandSide<dim> rhs_function{};
- const Solution<dim> boundary_values{};
+ const FE_Q<dim> fe(1);
+ const QGauss<dim> quadrature(4);
+ RightHandSide<dim> rhs_function;
+ Solution<dim> boundary_values;
// Create a solver object of the kind indicated by the argument to this
// function. If the name is not recognized, throw an exception!
update_quadrature_points |
update_JxW_values);
- const RightHandSide<dim> rhs_function{};
+ RightHandSide<dim> rhs_function;
FullMatrix<double> cell_matrix;
Vector<double> cell_rhs;
std::vector<double> rhs_values(n_q_points);
std::vector<types::global_dof_index> local_dof_indices(dofs_per_cell);
- const RightHandSide<spacedim> rhs{};
+ RightHandSide<spacedim> rhs;
for (const auto &cell : dof_handler.active_cell_iterators())
{
// the class declared above to generate the necessary data. Since this right
// hand side object is only used locally in the present function, we declare
// it here as a local variable:
- const RightHandSide<dim> right_hand_side{};
+ RightHandSide<dim> right_hand_side;
// Compared to the previous example, in order to evaluate the non-constant
// right hand side function we now also need the quadrature points on the
system_matrix = 0;
system_rhs = 0;
- const QGauss<dim> quadrature_formula(fe.degree + 1);
- const RightHandSide<dim> right_hand_side{};
+ const QGauss<dim> quadrature_formula(fe.degree + 1);
+ RightHandSide<dim> right_hand_side;
FEValues<dim> fe_values(fe,
quadrature_formula,
const unsigned int n_face_q_points = fe_face_values.get_quadrature().size();
- const RightHandSide<dim> right_hand_side{};
- std::vector<double> right_hand_side_values(n_q_points);
+ RightHandSide<dim> right_hand_side;
+ std::vector<double> right_hand_side_values(n_q_points);
const Coefficient<dim> coefficient;
std::vector<Tensor<2, dim>> coefficient_values(n_q_points);
scratch_data.fe_values.reinit(cell);
- const RightHandSide<dim> right_hand_side{};
- std::vector<double> rhs_values(n_q_points);
+ RightHandSide<dim> right_hand_side;
+ std::vector<double> rhs_values(n_q_points);
right_hand_side.value_list(scratch_data.fe_values.get_quadrature_points(),
rhs_values);
// Note that the operations we will do with the right hand side object are
// only querying data, never changing the object. We can therefore declare
// it <code>const</code>:
- const RightHandSide<dim> right_hand_side{};
- std::vector<double> rhs_values(n_q_points);
+ RightHandSide<dim> right_hand_side;
+ std::vector<double> rhs_values(n_q_points);
// Finally we define an object denoting the exact solution function. We
// will use it to compute the Neumann values at the boundary from
// Neumann values are prescribed. We will, however, be a little bit lazy
// and use what we already have in information. Real-life programs would
// to go other ways here, of course.
- const Solution<dim> exact_solution{};
+ Solution<dim> exact_solution;
// Now for the main loop over all cells. This is mostly unchanged from
// previous examples, so we only comment on the things that have changed.