cell_matrix.clear ();
fe_values.reinit (cell);
- const std::vector<std::vector<Tensor<1,dim> > >
- & shape_grads = fe_values.get_shape_grads();
- const std::vector<double>
- & JxW_values = fe_values.get_JxW_values();
for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
for (unsigned int i=0; i<dofs_per_cell; ++i)
for (unsigned int j=0; j<dofs_per_cell; ++j)
- cell_matrix(i,j) += (shape_grads[i][q_point] *
- shape_grads[j][q_point] *
- JxW_values[q_point]);
+ cell_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
+ fe_values.shape_grad(j,q_point) *
+ fe_values.JxW(q_point));
cell->get_dof_indices (local_dof_indices);
cell_rhs.clear ();
fe_values.reinit (cell);
- const FullMatrix<double>
- & shape_values = fe_values.get_shape_values();
- const std::vector<double>
- & JxW_values = fe_values.get_JxW_values();
- const std::vector<Point<dim> >
- & q_points = fe_values.get_quadrature_points();
-
- rhs_function->value_list (q_points, rhs_values);
+
+ rhs_function->value_list (fe_values.get_quadrature_points(),
+ rhs_values);
for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
for (unsigned int i=0; i<dofs_per_cell; ++i)
- cell_rhs(i) += (shape_values (i,q_point) *
+ cell_rhs(i) += (fe_values.shape_value(i,q_point) *
rhs_values[q_point] *
- JxW_values[q_point]);
+ fe_values.JxW(q_point));
cell->get_dof_indices (local_dof_indices);
for (unsigned int i=0; i<dofs_per_cell; ++i)
cell_rhs.clear ();
fe_values.reinit (cell);
- const FullMatrix<double>
- & shape_values = fe_values.get_shape_values();
- const std::vector<std::vector<Tensor<1,dim> > >
- & shape_grads = fe_values.get_shape_grads();
- const std::vector<double>
- & JxW_values = fe_values.get_JxW_values();
- const std::vector<Point<dim> >
- & q_points = fe_values.get_quadrature_points();
-
- right_hand_side.value_list (q_points, rhs_values);
+
+ right_hand_side.value_list (fe_values.get_quadrature_points(), rhs_values);
for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
for (unsigned int i=0; i<dofs_per_cell; ++i)
// their gradients,
// which is the second
// term below:
- cell_matrix(i,j) += ((shape_grads[i][q_point] *
- shape_grads[j][q_point] *
- JxW_values[q_point])
+ cell_matrix(i,j) += ((fe_values.shape_grad(i,q_point) *
+ fe_values.shape_grad(j,q_point) *
+ fe_values.JxW(q_point))
+
- (shape_values[i][q_point] *
- shape_values[j][q_point] *
- JxW_values[q_point]));
+ (fe_values.shape_value(i,q_point) *
+ fe_values.shape_value(j,q_point) *
+ fe_values.JxW(q_point)));
- cell_rhs(i) += (shape_values (i,q_point) *
+ cell_rhs(i) += (fe_values.shape_value(i,q_point) *
rhs_values [q_point] *
- JxW_values[q_point]);
+ fe_values.JxW(q_point));
};
// Then there is that second
// class:
fe_face_values.reinit (cell, face);
- // Then, for simpler
- // access, we alias the
- // various quantities to
- // local variables:
- const FullMatrix<double>
- & face_shape_values = fe_face_values.get_shape_values();
- const std::vector<double>
- & face_JxW_values = fe_face_values.get_JxW_values();
- const std::vector<Point<dim> >
- & face_q_points = fe_face_values.get_quadrature_points();
- const std::vector<Point<dim> >
- & face_normal_vectors = fe_face_values.get_normal_vectors ();
-
// And we can then
// perform the
// integration by using a
// present quadrature
// point:
const double neumann_value
- = (exact_solution.gradient (face_q_points[q_point]) *
- face_normal_vectors[q_point]);
+ = (exact_solution.gradient (fe_face_values.quadrature_point(q_point)) *
+ fe_face_values.normal_vector(q_point));
// Using this, we can
// compute the
// shape function:
for (unsigned int i=0; i<dofs_per_cell; ++i)
cell_rhs(i) += (neumann_value *
- face_shape_values[i][q_point] *
- face_JxW_values[q_point]);
+ fe_face_values.shape_value(i,q_point) *
+ fe_face_values.JxW(q_point));
};
};
cell_rhs.clear ();
fe_values.reinit (cell);
-
- // As in previous examples, we
- // define some abbreviations
- // for the various data that
- // the ``FEValues'' class
- // offers:
- const FullMatrix<double>
- & shape_values = fe_values.get_shape_values();
- const std::vector<std::vector<Tensor<1,dim> > >
- & shape_grads = fe_values.get_shape_grads();
- const std::vector<double>
- & JxW_values = fe_values.get_JxW_values();
- const std::vector<Point<dim> >
- & q_points = fe_values.get_quadrature_points();
// Next we get the values of
// the coefficients at the
// quadrature points:
- lambda.value_list (q_points, lambda_values);
- mu.value_list (q_points, mu_values);
+ lambda.value_list (fe_values.get_quadrature_points(), lambda_values);
+ mu.value_list (fe_values.get_quadrature_points(), mu_values);
// Then assemble the entries of
// the local stiffness matrix
// This first term is
// ((lambda+mu) d_i u_i, d_j v_j).
// Note that
- // ``shape_grads[i][q_point]''
+ // ``shape_grad(i,q_point)''
// returns the
// gradient of
// the i-th shape
// the appended
// brackets.
(
- (shape_grads[i][q_point][component_i] *
- shape_grads[j][q_point][component_j] *
+ (fe_values.shape_grad(i,q_point)[component_i] *
+ fe_values.shape_grad(j,q_point)[component_j] *
(lambda_values[q_point] +
mu_values[q_point]))
+
// away by the
// compiler).
((component_i == component_j) ?
- (shape_grads[i][q_point] *
- shape_grads[j][q_point] *
+ (fe_values.shape_grad(i,q_point) *
+ fe_values.shape_grad(j,q_point) *
mu_values[q_point]) :
0)
)
*
- JxW_values[q_point];
+ fe_values.JxW(q_point);
};
};
};
// introduction. We will
// therefore not discuss it
// further.
- right_hand_side.vector_value_list (q_points, rhs_values);
+ right_hand_side.vector_value_list (fe_values.get_quadrature_points(),
+ rhs_values);
for (unsigned int i=0; i<dofs_per_cell; ++i)
{
const unsigned int
component_i = fe.system_to_component_index(i).first;
for (unsigned int q_point=0; q_point<n_q_points; ++q_point)
- cell_rhs(i) += shape_values[i][q_point] *
+ cell_rhs(i) += fe_values.shape_value(i,q_point) *
rhs_values[q_point](component_i) *
- JxW_values[q_point];
+ fe_values.JxW(q_point);
};
// The transfer from local
cell_rhs.clear ();
// ... then initialize
- // ``FEValues'' object and
- // define aliases to the data
- // it provides...
+ // the ``FEValues'' object...
fe_values.reinit (cell);
- const FullMatrix<double>
- & shape_values = fe_values.get_shape_values();
- const std::vector<std::vector<Tensor<1,dim> > >
- & shape_grads = fe_values.get_shape_grads();
- const std::vector<double>
- & JxW_values = fe_values.get_JxW_values();
- const std::vector<Point<dim> >
- & q_points = fe_values.get_quadrature_points();
// ... obtain the values of
// right hand side and
// advection directions at the
// quadrature points...
- advection_field.value_list (q_points, advection_directions);
- right_hand_side.value_list (q_points, rhs_values);
+ advection_field.value_list (fe_values.get_quadrature_points(),
+ advection_directions);
+ right_hand_side.value_list (fe_values.get_quadrature_points(),
+ rhs_values);
// ... set the value of the
// streamline diffusion
{
for (unsigned int j=0; j<dofs_per_cell; ++j)
cell_matrix(i,j) += ((advection_directions[q_point] *
- shape_grads[j][q_point] *
- (shape_values[i][q_point] +
+ fe_values.shape_grad(j,q_point) *
+ (fe_values.shape_value(i,q_point) +
delta *
(advection_directions[q_point] *
- shape_grads[i][q_point]))) *
- JxW_values[q_point]);
+ fe_values.shape_grad(i,q_point)))) *
+ fe_values.JxW(q_point));
- cell_rhs(i) += ((shape_values[i][q_point] +
+ cell_rhs(i) += ((fe_values.shape_value(i,q_point) +
delta *
(advection_directions[q_point] *
- shape_grads[i][q_point]) ) *
+ fe_values.shape_grad(i,q_point)) ) *
rhs_values[i] *
fe_values.JxW (q_point));
};
// above, we have to
// reinitialize the
// FEFaceValues object
- // for the present face,
- // and we also define the
- // usual aliases to the
- // fields holding values
- // of shape functions,
- // normal vectors, or
- // quadrature points.
+ // for the present face:
fe_face_values.reinit (cell, face);
- const FullMatrix<double>
- & face_shape_values = fe_face_values.get_shape_values();
- const std::vector<double>
- & face_JxW_values = fe_face_values.get_JxW_values();
- const std::vector<Point<dim> >
- & face_q_points = fe_face_values.get_quadrature_points();
- const std::vector<Point<dim> >
- & normal_vectors = fe_face_values.get_normal_vectors();
-
// For the quadrature
// points at hand, we ask
// for the values of the
// inflow function and
// for the direction of
// flow:
- boundary_values.value_list (face_q_points, face_boundary_values);
- advection_field.value_list (face_q_points, face_advection_directions);
+ boundary_values.value_list (fe_face_values.get_quadrature_points(),
+ face_boundary_values);
+ advection_field.value_list (fe_face_values.get_quadrature_points(),
+ face_advection_directions);
// Now loop over all
// quadrature points and
// normal vector must be
// negative):
for (unsigned int q_point=0; q_point<n_face_q_points; ++q_point)
- if (normal_vectors[q_point] * face_advection_directions[q_point] < 0)
+ if (fe_face_values.normal_vector(q_point) *
+ face_advection_directions[q_point]
+ < 0)
// If the is part of
// the inflow
// boundary, then
{
for (unsigned int j=0; j<dofs_per_cell; ++j)
cell_matrix(i,j) -= (face_advection_directions[q_point] *
- normal_vectors[q_point] *
- face_shape_values[i][q_point] *
- face_shape_values[j][q_point] *
- face_JxW_values[q_point]);
+ fe_face_values.normal_vector(q_point) *
+ fe_face_values.shape_value(i,q_point) *
+ fe_face_values.shape_value(j,q_point) *
+ fe_face_values.JxW(q_point));
cell_rhs(i) -= (face_advection_directions[q_point] *
- normal_vectors[q_point] *
- face_boundary_values[q_point] *
- face_shape_values[i][q_point] *
- face_JxW_values[q_point]);
+ fe_face_values.normal_vector(q_point) *
+ face_boundary_values[q_point] *
+ fe_face_values.shape_value(i,q_point) *
+ fe_face_values.JxW(q_point));
};
};