SparseMatrix<double> &matrix) {
const FiniteElement<dim> &fe = dof.get_fe();
- const unsigned int total_dofs = fe.total_dofs;
+ const unsigned int dofs_per_cell = fe.total_dofs;
- FullMatrix<double> local_mass_matrix (total_dofs, total_dofs);
- vector<int> dofs_on_this_cell (total_dofs);
+ FullMatrix<double> local_mass_matrix (dofs_per_cell, dofs_per_cell);
+ vector<int> dofs_on_this_cell (dofs_per_cell);
DoFHandler<dim>::active_cell_iterator cell = dof.begin_active(),
endc = dof.end();
cell->get_dof_indices (dofs_on_this_cell);
fe.get_local_mass_matrix (cell, local_mass_matrix);
- for (unsigned int i=0; i<total_dofs; ++i)
- for (unsigned int j=0; j<total_dofs; ++j)
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
+ for (unsigned int j=0; j<dofs_per_cell; ++j)
matrix.add (dofs_on_this_cell[i], dofs_on_this_cell[j],
local_mass_matrix(i,j));
};
void MassMatrix<dim>::assemble (FullMatrix<double> &cell_matrix,
const FEValues<dim> &fe_values,
const typename DoFHandler<dim>::cell_iterator &) const {
- const unsigned int total_dofs = fe_values.total_dofs,
- n_q_points = fe_values.n_quadrature_points;
+ const unsigned int dofs_per_cell = fe_values.total_dofs,
+ n_q_points = fe_values.n_quadrature_points;
const FiniteElement<dim> &fe = fe_values.get_fe();
const unsigned int n_components = fe.n_components;
- Assert (cell_matrix.n() == total_dofs,
- Equation<dim>::ExcWrongSize(cell_matrix.n(), total_dofs));
- Assert (cell_matrix.m() == total_dofs,
- Equation<dim>::ExcWrongSize(cell_matrix.m(), total_dofs));
+ Assert (cell_matrix.n() == dofs_per_cell,
+ Equation<dim>::ExcWrongSize(cell_matrix.n(), dofs_per_cell));
+ Assert (cell_matrix.m() == dofs_per_cell,
+ Equation<dim>::ExcWrongSize(cell_matrix.m(), dofs_per_cell));
Assert (cell_matrix.all_zero(),
Equation<dim>::ExcObjectNotEmpty());
vector<double> coefficient_values (fe_values.n_quadrature_points);
coefficient->value_list (fe_values.get_quadrature_points(),
coefficient_values);
- for (unsigned int i=0; i<total_dofs; ++i)
- for (unsigned int j=0; j<total_dofs; ++j)
+ 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 ==
Vector<double>(n_components));
coefficient->vector_value_list (fe_values.get_quadrature_points(),
coefficient_values);
- for (unsigned int i=0; i<total_dofs; ++i)
- for (unsigned int j=0; j<total_dofs; ++j)
+ 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 ==
}
else
// no coefficient given
- for (unsigned int i=0; i<total_dofs; ++i)
- for (unsigned int j=0; j<total_dofs; ++j)
+ 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 ==
const DoFHandler<dim>::cell_iterator &) const {
Assert (right_hand_side != 0, ExcNoRHSSelected());
- const unsigned int total_dofs = fe_values.total_dofs,
- n_q_points = fe_values.n_quadrature_points;
+ const unsigned int dofs_per_cell = fe_values.total_dofs,
+ n_q_points = fe_values.n_quadrature_points;
const FiniteElement<dim> &fe = fe_values.get_fe();
const unsigned int n_components = fe.n_components;
// implemented at present
Assert (n_components==1, ExcNotImplemented());
- Assert (cell_matrix.n() == total_dofs,
- Equation<dim>::ExcWrongSize(cell_matrix.n(), total_dofs));
- Assert (cell_matrix.m() == total_dofs,
- Equation<dim>::ExcWrongSize(cell_matrix.m(), total_dofs));
- Assert (rhs.size() == total_dofs,
- Equation<dim>::ExcWrongSize(rhs.size(), total_dofs));
+ Assert (cell_matrix.n() == dofs_per_cell,
+ Equation<dim>::ExcWrongSize(cell_matrix.n(), dofs_per_cell));
+ Assert (cell_matrix.m() == dofs_per_cell,
+ Equation<dim>::ExcWrongSize(cell_matrix.m(), dofs_per_cell));
+ Assert (rhs.size() == dofs_per_cell,
+ Equation<dim>::ExcWrongSize(rhs.size(), dofs_per_cell));
Assert (cell_matrix.all_zero(),
Equation<dim>::ExcObjectNotEmpty());
Assert (rhs.all_zero(),
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<total_dofs; ++i)
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
{
- for (unsigned int j=0; j<total_dofs; ++j)
+ for (unsigned int j=0; j<dofs_per_cell; ++j)
cell_matrix(i,j) += (values(i,point) *
values(j,point) *
weights[point] *
}
else
for (unsigned int point=0; point<n_q_points; ++point)
- for (unsigned int i=0; i<total_dofs; ++i)
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
{
- for (unsigned int j=0; j<total_dofs; ++j)
+ for (unsigned int j=0; j<dofs_per_cell; ++j)
cell_matrix(i,j) += (values(i,point) *
values(j,point) *
weights[point]);
const DoFHandler<dim>::cell_iterator &) const {
Assert (right_hand_side != 0, ExcNoRHSSelected());
- const unsigned int total_dofs = fe_values.total_dofs,
- n_q_points = fe_values.n_quadrature_points;
+ const unsigned int dofs_per_cell = fe_values.total_dofs,
+ n_q_points = fe_values.n_quadrature_points;
const FiniteElement<dim> &fe = fe_values.get_fe();
const unsigned int n_components = fe.n_components;
// implemented at present
Assert (n_components==1, ExcNotImplemented());
- Assert (rhs.size() == total_dofs,
- Equation<dim>::ExcWrongSize(rhs.size(), total_dofs));
+ Assert (rhs.size() == dofs_per_cell,
+ Equation<dim>::ExcWrongSize(rhs.size(), dofs_per_cell));
Assert (rhs.all_zero(),
Equation<dim>::ExcObjectNotEmpty());
right_hand_side->value_list (fe_values.get_quadrature_points(), rhs_values);
for (unsigned int point=0; point<n_q_points; ++point)
- for (unsigned int i=0; i<total_dofs; ++i)
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
rhs(i) += values(i,point) *
rhs_values[point] *
weights[point];
const DoFHandler<dim>::cell_iterator &) const {
Assert (right_hand_side != 0, ExcNoRHSSelected());
- const unsigned int total_dofs = fe_values.total_dofs,
- n_q_points = fe_values.n_quadrature_points;
+ const unsigned int dofs_per_cell = fe_values.total_dofs,
+ n_q_points = fe_values.n_quadrature_points;
const FiniteElement<dim> &fe = fe_values.get_fe();
const unsigned int n_components = fe.n_components;
// at present
Assert (n_components==1, ExcNotImplemented());
- Assert (cell_matrix.n() == total_dofs,
- Equation<dim>::ExcWrongSize(cell_matrix.n(), total_dofs));
- Assert (cell_matrix.m() == total_dofs,
- Equation<dim>::ExcWrongSize(cell_matrix.m(), total_dofs));
- Assert (rhs.size() == total_dofs,
- Equation<dim>::ExcWrongSize(rhs.size(), total_dofs));
+ Assert (cell_matrix.n() == dofs_per_cell,
+ Equation<dim>::ExcWrongSize(cell_matrix.n(), dofs_per_cell));
+ Assert (cell_matrix.m() == dofs_per_cell,
+ Equation<dim>::ExcWrongSize(cell_matrix.m(), dofs_per_cell));
+ Assert (rhs.size() == dofs_per_cell,
+ Equation<dim>::ExcWrongSize(rhs.size(), dofs_per_cell));
Assert (cell_matrix.all_zero(),
Equation<dim>::ExcObjectNotEmpty());
Assert (rhs.all_zero(),
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<total_dofs; ++i)
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
{
- for (unsigned int j=0; j<total_dofs; ++j)
+ for (unsigned int j=0; j<dofs_per_cell; ++j)
cell_matrix(i,j) += (gradients[i][point] *
gradients[j][point]) *
weights[point] *
}
else
for (unsigned int point=0; point<n_q_points; ++point)
- for (unsigned int i=0; i<total_dofs; ++i)
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
{
- for (unsigned int j=0; j<total_dofs; ++j)
+ for (unsigned int j=0; j<dofs_per_cell; ++j)
cell_matrix(i,j) += (gradients[i][point] *
gradients[j][point]) *
weights[point];
void LaplaceMatrix<dim>::assemble (FullMatrix<double> &cell_matrix,
const FEValues<dim> &fe_values,
const DoFHandler<dim>::cell_iterator &) const {
- const unsigned int total_dofs = fe_values.total_dofs,
- n_q_points = fe_values.n_quadrature_points;
+ const unsigned int dofs_per_cell = fe_values.total_dofs,
+ n_q_points = fe_values.n_quadrature_points;
const FiniteElement<dim> &fe = fe_values.get_fe();
const unsigned int n_components = fe.n_components;
// at present
Assert ((n_components==1) || (coefficient==0), ExcNotImplemented());
- Assert (cell_matrix.n() == total_dofs,
- Equation<dim>::ExcWrongSize(cell_matrix.n(), total_dofs));
- Assert (cell_matrix.m() == total_dofs,
- Equation<dim>::ExcWrongSize(cell_matrix.m(), total_dofs));
+ Assert (cell_matrix.n() == dofs_per_cell,
+ Equation<dim>::ExcWrongSize(cell_matrix.n(), dofs_per_cell));
+ Assert (cell_matrix.m() == dofs_per_cell,
+ Equation<dim>::ExcWrongSize(cell_matrix.m(), dofs_per_cell));
Assert (cell_matrix.all_zero(),
Equation<dim>::ExcObjectNotEmpty());
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<total_dofs; ++i)
- for (unsigned int j=0; j<total_dofs; ++j)
+ 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] *
coefficient_values[point];
}
else
- for (unsigned int i=0; i<total_dofs; ++i)
- for (unsigned int j=0; j<total_dofs; ++j)
+ 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 ==
const DoFHandler<dim>::cell_iterator &) const {
Assert (right_hand_side != 0, ExcNoRHSSelected());
- const unsigned int total_dofs = fe_values.total_dofs,
- n_q_points = fe_values.n_quadrature_points;
+ const unsigned int dofs_per_cell = fe_values.total_dofs,
+ n_q_points = fe_values.n_quadrature_points;
const FiniteElement<dim> &fe = fe_values.get_fe();
const unsigned int n_components = fe.n_components;
// at present
Assert (n_components==1, ExcNotImplemented());
- Assert (rhs.size() == total_dofs,
- Equation<dim>::ExcWrongSize(rhs.size(), total_dofs));
+ Assert (rhs.size() == dofs_per_cell,
+ Equation<dim>::ExcWrongSize(rhs.size(), dofs_per_cell));
Assert (rhs.all_zero(),
Equation<dim>::ExcObjectNotEmpty());
right_hand_side->value_list (fe_values.get_quadrature_points(), rhs_values);
for (unsigned int point=0; point<n_q_points; ++point)
- for (unsigned int i=0; i<total_dofs; ++i)
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
rhs(i) += values(i,point) *
rhs_values[point] *
weights[point];