};
-fe_values.reinit (cell);
+ fe_values.reinit (cell);
fe_values_primal.reinit (primal_cell);
fe_values_primal.get_function_values (*v, local_v);
fe_values_primal.get_function_grads (*u, local_u_grad);
stiffness->value_list (fe_values.get_quadrature_points(),
stiffness_values);
- const std::vector<std::vector<Tensor<1,dim> > > &shape_grads = fe_values.get_shape_grads ();
- const FullMatrix<double> &shape_values = fe_values.get_shape_values ();
- const std::vector<double> &JxW_values (fe_values.get_JxW_values());
-
std::vector<double> local_functional1 (dofs_per_cell, 0);
std::vector<double> local_functional2 (dofs_per_cell, 0);
for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
for (unsigned int point=0; point<n_q_points; ++point)
{
local_functional1[shape_func] += local_u_grad[point] *
- shape_grads[shape_func][point] *
+ fe_values.shape_grad(shape_func,point) *
stiffness_values[point] *
- JxW_values[point];
+ fe_values.JxW(point);
local_functional2[shape_func] += local_v[point] *
- shape_values(shape_func,point) *
+ fe_values.shape_value(shape_func,point) *
density_values[point] *
- JxW_values[point];
+ fe_values.JxW(point);
};
cell->get_dof_indices (cell_dof_indices);
(face->vertex(1)(1) == y_offset))
{
fe_face_values.reinit (cell, face_no);
- const FullMatrix<double> &shape_values = fe_face_values.
- get_shape_values ();
- const std::vector<double> &JxW_values (fe_face_values.
- get_JxW_values());
const std::vector<Point<dim> > &q_points (fe_face_values.get_quadrature_points());
std::vector<double> local_integral (dofs_per_cell, 0);
for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
for (unsigned int point=0; point<n_q_points; ++point)
- local_integral[shape_func] += shape_values(shape_func,point) *
+ local_integral[shape_func] += fe_face_values.shape_value(shape_func,point) *
(EvaluateSeismicSignal<dim>
::weight(q_points[point], time)) *
- JxW_values[point];
+ fe_face_values.JxW(point);
cell->get_dof_indices (cell_dof_indices);
for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
continue;
fe_face_values.reinit (cell, face_no);
- const FullMatrix<double> &shape_values = fe_face_values.get_shape_values ();
- const std::vector<double> &JxW_values = fe_face_values.get_JxW_values();
cell->get_dof_indices (dof_indices);
for (unsigned int i=0; i<dofs_per_cell; ++i)
{
double sum=0;
for (unsigned int j=0; j<n_q_points; ++j)
- sum += shape_values(i,j)*JxW_values[j];
+ sum += fe_face_values.shape_value(i,j)*fe_face_values.JxW(j);
j1(dof_indices[i]) += sum * time_step / 2;
};
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());
-
std::vector<double> local_functional (dofs_per_cell, 0);
for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
for (unsigned int point=0; point<n_q_points; ++point)
- local_functional[shape_func] += shape_values(shape_func,point) *
- JxW_values[point];
+ local_functional[shape_func] += fe_values.shape_value(shape_func,point) *
+ fe_values.JxW(point);
cell->get_dof_indices (cell_dof_indices);
for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
(cell->center()(0) < -0.4))
{
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();
cell->get_dof_indices (dof_indices);
for (unsigned int i=0; i<dofs_per_cell; ++i)
{
double sum=0;
for (unsigned int j=0; j<n_q_points; ++j)
- sum += shape_values(i,j)
- *JxW_values[j];
+ sum += fe_values.shape_value(i,j)
+ *fe_values.JxW(j);
j1(dof_indices[i]) += sum;
};
(cell->center()(0) < 0.03))
{
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();
cell->get_dof_indices (dof_indices);
for (unsigned int i=0; i<dofs_per_cell; ++i)
{
double sum=0;
for (unsigned int j=0; j<n_q_points; ++j)
- sum += shape_values(i,j)
- *JxW_values[j];
+ sum += fe_values.shape_value(i,j)
+ *fe_values.JxW(j);
j1(dof_indices[i]) += sum / time_step;
};
};
-fe_values.reinit (cell);
- const FullMatrix<double> &values = fe_values.get_shape_values();
- const std::vector<std::vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
- const std::vector<double> &weights = fe_values.get_JxW_values ();
-
+ fe_values.reinit (cell);
cell->get_dof_values (*u, local_u);
cell->get_dof_values (*v, local_v);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
for (unsigned int i=0; i<fe->dofs_per_cell; ++i)
for (unsigned int j=0; j<fe->dofs_per_cell; ++j)
- cell_matrix(i,j) += (values(i,point) *
- values(j,point)) *
- weights[point] *
+ cell_matrix(i,j) += (fe_values.shape_value(i,point) *
+ fe_values.shape_value(j,point)) *
+ fe_values.JxW(point) *
density_values[point];
total_energy += 1./2. * cell_matrix.matrix_norm_square (local_v);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
for (unsigned int i=0; i<fe->dofs_per_cell; ++i)
for (unsigned int j=0; j<fe->dofs_per_cell; ++j)
- cell_matrix(i,j) += (gradients[i][point] *
- gradients[j][point]) *
- weights[point] *
+ cell_matrix(i,j) += (fe_values.shape_grad(i,point) *
+ fe_values.shape_grad(j,point)) *
+ fe_values.JxW(point) *
stiffness_values[point];
total_energy += 1./2. * cell_matrix.matrix_norm_square (local_u);
};
{
face_values.reinit (cell, face);
face_values.get_function_values (*u, face_u);
- const std::vector<double> &JxW_values (face_values.get_JxW_values());
const std::vector<Point<dim> > &q_points (face_values.get_quadrature_points());
double local_integral = 0;
for (unsigned int point=0; point<n_q_points; ++point)
local_integral += face_u[point] *
weight (q_points[point], time) *
- JxW_values[point];
+ face_values.JxW(point);
u_integrated += local_integral;
out << time
face_values.reinit (cell, face_no);
face_values.get_function_values (*u, face_u);
- const std::vector<double> &JxW_values (face_values.get_JxW_values());
double local_integral = 0;
for (unsigned int point=0; point<n_q_points; ++point)
local_integral += face_u[point] *
- JxW_values[point];
+ face_values.JxW(point);
u_integrated += local_integral;
};
{
fe_values.reinit (cell);
fe_values.get_function_values (*u, cell_u);
- const std::vector<double> &JxW_values (fe_values.get_JxW_values());
double local_integral = 0;
for (unsigned int point=0; point<n_q_points; ++point)
local_integral += cell_u[point] *
- JxW_values[point];
+ fe_values.JxW(point);
u_integrated += local_integral;
};
result += u_integrated;
{
fe_values.reinit (cell);
fe_values.get_function_values (*u, cell_u);
- const std::vector<double> &JxW_values (fe_values.get_JxW_values());
- const std::vector<Point<1> > &quadrature_points (fe_values.get_quadrature_points());
-
double local_integral = 0;
for (unsigned int point=0; point<n_q_points; ++point)
local_integral += cell_u[point] *
- JxW_values[point];
+ fe_values.JxW(point);
u_integrated += local_integral;
};
result += u_integrated;
FullMatrix<double> cell_laplace_matrix (dofs_per_cell, dofs_per_cell);
-for (typename DoFHandler<dim>::active_cell_iterator cell=dof_handler->begin_active();
+ for (typename DoFHandler<dim>::active_cell_iterator cell=dof_handler->begin_active();
cell != dof_handler->end(); ++cell)
{
fe_values.reinit (cell);
cell_laplace_matrix.clear ();
cell->get_dof_indices (dof_indices_on_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 ();
-
if (!density_constant || !stiffness_constant)
{
- const std::vector<Point<dim> > &quadrature_points = fe_values.get_quadrature_points ();
if (!density_constant)
- parameters.density->value_list (quadrature_points,
+ parameters.density->value_list (fe_values.get_quadrature_points (),
density_values);
if (!stiffness_constant)
- parameters.stiffness->value_list (quadrature_points,
+ parameters.stiffness->value_list (fe_values.get_quadrature_points (),
stiffness_values);
};
for (unsigned int i=0; i<dofs_per_cell; ++i)
for (unsigned int j=0; j<dofs_per_cell; ++j)
{
- cell_mass_matrix(i,j) += (shape_values(i, q_point) *
- shape_values(j, q_point) *
- JxW_values[q_point] *
+ cell_mass_matrix(i,j) += (fe_values.shape_value(i, q_point) *
+ fe_values.shape_value(j, q_point) *
+ fe_values.JxW(q_point) *
density_values[q_point]);
- cell_laplace_matrix(i,j) += (shape_grads[i][q_point] *
- shape_grads[j][q_point] *
- JxW_values[q_point] *
+ cell_laplace_matrix(i,j) += (fe_values.shape_grad(i,q_point) *
+ fe_values.shape_grad(j,q_point) *
+ fe_values.JxW(q_point) *
stiffness_values[q_point]);
};
if (!old_cell->has_children() && !new_cell->has_children())
{
fe_values.reinit (old_cell);
- const FullMatrix<double> &values = fe_values.get_shape_values ();
- const std::vector<std::vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
- const std::vector<double> &weights = fe_values.get_JxW_values ();
-
FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
std::vector<double> density_values(fe_values.n_quadrature_points);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++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) += (values(i,point) *
- values(j,point)) *
- weights[point] *
+ cell_matrix(i,j) += (fe_values.shape_value(i,point) *
+ fe_values.shape_value(j,point)) *
+ fe_values.JxW(point) *
density_values[point];
Vector<double> tmp (dofs_per_cell);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++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) += (gradients[i][point] *
- gradients[j][point]) *
- weights[point] *
+ cell_matrix(i,j) += (fe_values.shape_grad(i,point) *
+ fe_values.shape_grad(j,point)) *
+ fe_values.JxW(point) *
stiffness_values[point];
cell_matrix.vmult (local_A_v, old_dof_values_v);
else
{
fe_values.reinit (old_child);
- const FullMatrix<double> &values = fe_values.get_shape_values();
- const std::vector<std::vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
- const std::vector<double> &weights = fe_values.get_JxW_values ();
-
old_child->get_dof_values (previous_time_level.u, local_old_dof_values_u);
old_child->get_dof_values (previous_time_level.v, local_old_dof_values_v);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++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) += (values(i,point) *
- values(j,point)) *
- weights[point] *
+ cell_matrix(i,j) += (fe_values.shape_value(i,point) *
+ fe_values.shape_value(j,point)) *
+ fe_values.JxW(point) *
density_values[point];
cell_matrix.vmult (local_M_u, local_old_dof_values_u);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++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) += (gradients[i][point] *
- gradients[j][point]) *
- weights[point] *
+ cell_matrix(i,j) += (fe_values.shape_grad(i,point) *
+ fe_values.shape_grad(j,point)) *
+ fe_values.JxW(point) *
stiffness_values[point];
cell_matrix.vmult (local_A_v, local_old_dof_values_v);
else
{
fe_values.reinit (new_child);
- const FullMatrix<double> &values = fe_values.get_shape_values();
- const std::vector<std::vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
- const std::vector<double> &weights = fe_values.get_JxW_values ();
-
cell_matrix.clear ();
std::vector<double> density_values(fe_values.n_quadrature_points);
parameters.density->value_list (fe_values.get_quadrature_points(),
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++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) += (values(i,point) *
- values(j,point)) *
- weights[point] *
+ cell_matrix(i,j) += (fe_values.shape_value(i,point) *
+ fe_values.shape_value(j,point)) *
+ fe_values.JxW(point) *
density_values[point];
cell_matrix.vmult (local_M_u, local_old_dof_values_u);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++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) += (gradients[i][point] *
- gradients[j][point]) *
- weights[point] *
+ cell_matrix(i,j) += (fe_values.shape_grad(i,point) *
+ fe_values.shape_grad(j,point)) *
+ fe_values.JxW(point) *
stiffness_values[point];
cell_matrix.vmult (local_A_v, local_old_dof_values_v);
FullMatrix<double> laplace_matrix (tmp1.size(), tmp1.size());
fe_values.reinit (cell);
- const FullMatrix<double> &values = fe_values.get_shape_values();
- const std::vector<std::vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
- const std::vector<std::vector<Tensor<2,dim> > >&second_derivatives
- = fe_values.get_shape_2nd_derivatives ();
- const std::vector<double> &weights = fe_values.get_JxW_values ();
-
std::vector<double> density_values(fe_values.n_quadrature_points);
parameters.density->value_list (fe_values.get_quadrature_points(),
density_values);
for (unsigned int i=0; i<dofs_per_cell; ++i)
for (unsigned int j=0; j<dofs_per_cell; ++j)
{
- mass_matrix(i,j) += (values(i,point) *
- values(j,point)) *
- weights[point] *
+ mass_matrix(i,j) += (fe_values.shape_value(i,point) *
+ fe_values.shape_value(j,point)) *
+ fe_values.JxW(point) *
density_values[point];
double laplace_phi_i = 0;
for (unsigned int t=0; t<dim; ++t)
- laplace_phi_i += second_derivatives[i][point][t][t];
+ laplace_phi_i += fe_values.shape_2nd_derivative(i,point)[t][t];
- laplace_matrix(i,j) += (gradients[i][point] *
- gradients[j][point]) *
- weights[point] *
+ laplace_matrix(i,j) += (fe_values.shape_grad(i,point) *
+ fe_values.shape_grad(j,point)) *
+ fe_values.JxW(point) *
stiffness[point];
};
fe_values.reinit (old_cell);
FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
- const FullMatrix<double> &values = fe_values.get_shape_values ();
- const std::vector<std::vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
- const std::vector<double> &weights = fe_values.get_JxW_values ();
-
std::vector<double> density_values(fe_values.n_quadrature_points);
parameters.density->value_list (fe_values.get_quadrature_points(),
density_values);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++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) += (values(i,point) *
- values(j,point)) *
- weights[point] *
+ cell_matrix(i,j) += (fe_values.shape_value(i,point) *
+ fe_values.shape_value(j,point)) *
+ fe_values.JxW(point) *
density_values[point];
Vector<double> tmp (dofs_per_cell);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++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) += (gradients[i][point] *
- gradients[j][point]) *
- weights[point] *
+ cell_matrix(i,j) += (fe_values.shape_grad(i,point) *
+ fe_values.shape_grad(j,point)) *
+ fe_values.JxW(point) *
stiffness_values[point];
cell_matrix.vmult (local_A_u, old_dof_values_u);
else
{
fe_values.reinit (old_child);
- const FullMatrix<double> &values = fe_values.get_shape_values ();
- const std::vector<std::vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
- const std::vector<double> &weights = fe_values.get_JxW_values ();
-
old_child->get_dof_values (previous_time_level.u, local_old_dof_values_u);
old_child->get_dof_values (previous_time_level.v, local_old_dof_values_v);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++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) += (values(i,point) *
- values(j,point)) *
- weights[point] *
+ cell_matrix(i,j) += (fe_values.shape_value(i,point) *
+ fe_values.shape_value(j,point)) *
+ fe_values.JxW(point) *
density_values[point];
cell_matrix.vmult (local_M_u, local_old_dof_values_u);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++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) += (gradients[i][point] *
- gradients[j][point]) *
- weights[point] *
+ cell_matrix(i,j) += (fe_values.shape_grad(i,point) *
+ fe_values.shape_grad(j,point)) *
+ fe_values.JxW(point) *
stiffness_values[point];
cell_matrix.vmult (local_A_u, local_old_dof_values_u);
else
{
fe_values.reinit (new_child);
- const FullMatrix<double> &values = fe_values.get_shape_values ();
- const std::vector<std::vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
- const std::vector<double> &weights = fe_values.get_JxW_values ();
-
cell_matrix.clear ();
std::vector<double> density_values(fe_values.n_quadrature_points);
parameters.density->value_list (fe_values.get_quadrature_points(),
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++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) += (values(i,point) *
- values(j,point)) *
- weights[point] *
+ cell_matrix(i,j) += (fe_values.shape_value(i,point) *
+ fe_values.shape_value(j,point)) *
+ fe_values.JxW(point) *
density_values[point];
cell_matrix.vmult (local_M_u, local_old_dof_values_u);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++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) += (gradients[i][point] *
- gradients[j][point]) *
- weights[point] *
+ cell_matrix(i,j) += (fe_values.shape_grad(i,point) *
+ fe_values.shape_grad(j,point)) *
+ fe_values.JxW(point) *
stiffness_values[point];
cell_matrix.vmult (local_A_u, local_old_dof_values_u);