const bool preserve_symmetry)
{
Assert (matrix.n() == matrix.m(),
- ExcDimensionsDontMatch(matrix.n(), matrix.m()));
+ ExcDimensionMismatch(matrix.n(), matrix.m()));
Assert (matrix.n() == right_hand_side.size(),
- ExcDimensionsDontMatch(matrix.n(), right_hand_side.size()));
+ ExcDimensionMismatch(matrix.n(), right_hand_side.size()));
Assert (matrix.n() == solution.size(),
- ExcDimensionsDontMatch(matrix.n(), solution.size()));
+ ExcDimensionMismatch(matrix.n(), solution.size()));
// if no boundary values are to be applied
// simply return
if (boundary_values.size() == 0)
const unsigned int blocks = matrix.n_block_rows();
Assert (matrix.n() == matrix.m(),
- ExcDimensionsDontMatch(matrix.n(), matrix.m()));
+ ExcDimensionMismatch(matrix.n(), matrix.m()));
Assert (matrix.n() == right_hand_side.size(),
- ExcDimensionsDontMatch(matrix.n(), right_hand_side.size()));
+ ExcDimensionMismatch(matrix.n(), right_hand_side.size()));
Assert (matrix.n() == solution.size(),
- ExcDimensionsDontMatch(matrix.n(), solution.size()));
+ ExcDimensionMismatch(matrix.n(), solution.size()));
Assert (matrix.n_block_rows() == matrix.n_block_cols(),
ExcMatrixNotBlockSquare());
Assert (matrix.get_sparsity_pattern().get_row_indices() ==
cell_matrix.clear ();
cell->get_dof_indices (dof_indices);
- const FullMatrix<double> &values = fe_values.get_shape_values ();
- const std::vector<double> &weights = fe_values.get_JxW_values ();
-
if (coefficient != 0)
{
if (coefficient->n_components==1)
coefficient->value_list (fe_values.get_quadrature_points(),
coefficient_values);
for (unsigned int point=0; point<n_q_points; ++point)
- for (unsigned int i=0; i<dofs_per_cell; ++i)
- for (unsigned int j=0; j<dofs_per_cell; ++j)
- if ((n_components==1) ||
- (fe.system_to_component_index(i).first ==
- fe.system_to_component_index(j).first))
- cell_matrix(i,j) += (values(i,point) *
- values(j,point) *
- weights[point] *
- coefficient_values[point]);
+ {
+ const double weight = fe_values.JxW(point);
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
+ {
+ const double v = fe_values.shape_value(i,point);
+ for (unsigned int j=0; j<dofs_per_cell; ++j)
+ {
+ const double u = fe_values.shape_value(j,point);
+
+ if ((n_components==1) ||
+ (fe.system_to_component_index(i).first ==
+ fe.system_to_component_index(j).first))
+ cell_matrix(i,j) +=
+ (u * v * weight * coefficient_values[point]);
+ }
+ }
+ }
}
else
{
coefficient->vector_value_list (fe_values.get_quadrature_points(),
coefficient_vector_values);
for (unsigned int point=0; point<n_q_points; ++point)
- 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 j=0; j<dofs_per_cell; ++j)
- if ((n_components==1) ||
- (fe.system_to_component_index(j).first == component_i))
- cell_matrix(i,j) += (values(i,point) *
- values(j,point) *
- weights[point] *
- coefficient_vector_values[point](component_i));
- }
+ {
+ const double weight = fe_values.JxW(point);
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
+ {
+ const double v = fe_values.shape_value(i,point);
+ const unsigned int component_i=
+ fe.system_to_component_index(i).first;
+ for (unsigned int j=0; j<dofs_per_cell; ++j)
+ {
+ const double u = fe_values.shape_value(j,point);
+ if ((n_components==1) ||
+ (fe.system_to_component_index(j).first == component_i))
+ cell_matrix(i,j) +=
+ (u * v * weight *
+ coefficient_vector_values[point](component_i));
+ }
+ }
+ }
}
}
else
for (unsigned int point=0; point<n_q_points; ++point)
- for (unsigned int i=0; i<dofs_per_cell; ++i)
- for (unsigned int j=0; j<dofs_per_cell; ++j)
- if ((n_components==1) ||
- (fe.system_to_component_index(i).first ==
- fe.system_to_component_index(j).first))
- cell_matrix(i,j) += (values(i,point) *
- values(j,point) *
- weights[point]);
-
+ {
+ const double weight = fe_values.JxW(point);
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
+ {
+ const double v = fe_values.shape_value(i,point);
+ for (unsigned int j=0; j<dofs_per_cell; ++j)
+ {
+ const double u = fe_values.shape_value(j,point);
+ if ((n_components==1) ||
+ (fe.system_to_component_index(i).first ==
+ fe.system_to_component_index(j).first))
+ cell_matrix(i,j) += (u * v * weight);
+ }
+ }
+ }
// transfer everything into the
// global object
mutex.acquire ();