template <int dim> class Boundary;
-template <int dim> struct FiniteElementData;
+template <int dim> class FiniteElementData;
/**
- * Dimension dependent data for finite elements. See the #FiniteElementBase#
+ * Dimension independent data for finite elements. See the #FiniteElementBase#
* class for more information.
*/
-struct FiniteElementData<1> {
+template<int dim>
+class FiniteElementData
+{
+ public:
/**
* Number of degrees of freedom on
* a vertex.
*/
const unsigned int dofs_per_line;
+ /** Number of degrees of freedom
+ * on a quadrilateral.
+ */
+ const unsigned int dofs_per_quad;
+
+ /** Number of degrees of freedom
+ * on a hexahedron.
+ */
+ const unsigned int dofs_per_hex;
+
/**
* Number of degrees of freedom on a
* face. This information is
const unsigned int dofs_per_face;
/**
- * Total number of degrees of freedom
- * on a cell. This information is
- * redundant to some fields in the
- * derived classes but makes
- * writing dimension independant
- * programs easier.
- */
- const unsigned int total_dofs;
-
- /**
- * Number of basis functions used for the
- * transformation from unit cell to real
- * cell. For a linear mapping, this number
- * equals the number of vertices.
+ * First index of dof on a line.
*/
- const unsigned int n_transform_functions;
+ const unsigned int first_line_index;
- /**
- * Number of components.
- */
- const unsigned int n_components;
-
- /**
- * Default constructor. Constructs an element
- * which is not so useful. Checking
- * #total_dofs# is therefore a good way to
- * check if something went wrong.
- */
- FiniteElementData ();
-
- /**
- * A more useful version to construct
- * an object of this type.
- */
- FiniteElementData (const unsigned int dofs_per_vertex,
- const unsigned int dofs_per_line,
- const unsigned int n_transform_functions,
- const unsigned int n_components = 1);
-
- /**
- * Another frequently used useful
- * constructor, copying the data from
- * another object.
- */
- FiniteElementData (const FiniteElementData<1> &fe_data);
-
- /**
- * Comparison operator. It is not clear to
- * me why we have to declare and implement
- * this one explicitely.
- */
- bool operator == (const FiniteElementData<1> &) const;
-
- /**
- * Exception
- */
- DeclException0 (ExcInternalError);
-};
-
-
-
-
-/**
- * Dimension dependent data for finite elements. See the #FiniteElementBase#
- * class for more information.
- */
-struct FiniteElementData<2> {
/**
- * Number of degrees of freedom on
- * a vertex.
- */
- const unsigned int dofs_per_vertex;
-
- /** Number of degrees of freedom
- * on a line.
- */
- const unsigned int dofs_per_line;
-
- /** Number of degrees of freedom
- * on a quad.
+ * First index of dof on a quad.
*/
- const unsigned int dofs_per_quad;
-
+ const unsigned int first_quad_index;
+
/**
- * Number of degrees of freedom on a
- * face. This information is
- * redundant to some fields in the
- * derived classes but makes
- * writing dimension independant
- * programs easier.
+ * First index of dof on a hexahedron.
*/
- const unsigned int dofs_per_face;
+ const unsigned int first_hex_index;
/**
* Total number of degrees of freedom
FiniteElementData ();
/**
- * A more useful version to construct
- * an object of this type.
+ * Constructor for a 1-dimensional
+ * object.
+ */
+ FiniteElementData (const unsigned int dofs_per_vertex,
+ const unsigned int dofs_per_line,
+ const unsigned int n_transform_functions,
+ const unsigned int n_components);
+
+ /**
+ * Constructor for a 2-dimensional
+ * object.
*/
FiniteElementData (const unsigned int dofs_per_vertex,
const unsigned int dofs_per_line,
const unsigned int dofs_per_quad,
const unsigned int n_transform_functions,
- const unsigned int n_components = 1);
+ const unsigned int n_components);
- /**
- * Another frequently used useful
- * constructor, copying the data from
- * another object.
+ /**
+ * Constructor for a 3-dimensional
+ * object.
*/
- FiniteElementData (const FiniteElementData<2> &fe_data);
+ FiniteElementData (const unsigned int dofs_per_vertex,
+ const unsigned int dofs_per_line,
+ const unsigned int dofs_per_quad,
+ const unsigned int dofs_per_hex,
+ const unsigned int n_transform_functions,
+ const unsigned int n_components);
+
+// /**
+// * Another frequently used useful
+// * constructor, copying the data from
+// * another object.
+// */
+// FiniteElementData (const FiniteElementData<2> &fe_data);
/**
* Comparison operator. It is not clear to
/**
* Exception
*/
- DeclException0 (ExcInternalError);
+ DeclException2 (ExcDimensionMismatch, int, int,
+ << "used " << arg1 << "-d constructor for " << arg2 << "-d object");
};
template <int dim>
inline unsigned
-FiniteElementBase<dim>::component_to_system_index (unsigned component,
+FiniteElementBase<dim>::component_to_system_index (unsigned /*component*/,
unsigned component_index) const
{
Assert(false, ExcNotImplemented());
*/
FEValuesBase (const unsigned int n_q_points,
const unsigned int n_support_points,
- const unsigned int n_dofs,
+ const unsigned int total_dofs,
const unsigned int n_transform_functions,
const unsigned int n_values_array,
const UpdateFlags update_flags,
*/
FEFaceValuesBase (const unsigned int n_q_points,
const unsigned int n_support_points,
- const unsigned int n_dofs,
+ const unsigned int total_dofs,
const unsigned int n_transform_functions,
const unsigned int n_faces_or_subfaces,
const UpdateFlags update_flags,
void
DoFCellAccessor<dim>::get_interpolated_dof_values (const dVector &values,
dVector &interpolated_values) const {
- const unsigned int total_dofs = dof_handler->get_fe().total_dofs;
+ const unsigned int n_dofs = dof_handler->get_fe().total_dofs;
Assert (dof_handler != 0, ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
- Assert (interpolated_values.size() == total_dofs,
+ Assert (interpolated_values.size() == n_dofs,
ExcVectorDoesNotMatch());
Assert (values.size() == dof_handler->n_dofs(),
ExcVectorDoesNotMatch());
else
// otherwise clobber them from the children
{
- dVector tmp1(total_dofs);
- dVector tmp2(total_dofs);
+ dVector tmp1(n_dofs);
+ dVector tmp2(n_dofs);
interpolated_values.clear ();
// end in adding up the contribution
// from nodes on boundaries of
// children more than once.
- for (unsigned int i=0; i<total_dofs; ++i)
+ for (unsigned int i=0; i<n_dofs; ++i)
if (tmp2(i) != 0)
interpolated_values(i) = tmp2(i);
};
void
DoFCellAccessor<dim>::set_dof_values_by_interpolation (const dVector &local_values,
dVector &values) const {
- const unsigned int total_dofs = dof_handler->get_fe().total_dofs;
+ const unsigned int n_dofs = dof_handler->get_fe().total_dofs;
Assert (dof_handler != 0, ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, ExcInvalidObject());
- Assert (local_values.size() == total_dofs,
+ Assert (local_values.size() == n_dofs,
ExcVectorDoesNotMatch());
Assert (values.size() == dof_handler->n_dofs(),
ExcVectorDoesNotMatch());
else
// otherwise distribute them to the children
{
- dVector tmp(total_dofs);
+ dVector tmp(n_dofs);
for (unsigned int child=0; child<GeometryInfo<dim>::children_per_cell;
++child)
constraints.condense (sparsity);
};
- int n_dofs = sparsity.n_rows();
+ int total_dofs = sparsity.n_rows();
// store the new dof numbers; -1 means
// that no new number was chosen yet
//
// delete disallowed elements
for (unsigned int i=0; i<last_round_dofs.size(); ++i)
- if ((last_round_dofs[i]<0) || (last_round_dofs[i]>=n_dofs))
+ if ((last_round_dofs[i]<0) || (last_round_dofs[i]>=total_dofs))
last_round_dofs[i] = -1;
remove_if (last_round_dofs.begin(), last_round_dofs.end(),
if (last_round_dofs.size() == 0)
{
int starting_point = -1;
- unsigned int min_coordination = n_dofs;
- for (int row=0; row<n_dofs; ++row)
+ unsigned int min_coordination = total_dofs;
+ for (int row=0; row<total_dofs; ++row)
{
unsigned int j;
for (j=sparsity.get_rowstart_indices()[row];
// test for all indices numbered
if (find (new_number.begin(), new_number.end(), -1) != new_number.end())
Assert (false, ExcRenumberingIncomplete());
- Assert (next_free_number == n_dofs,
+ Assert (next_free_number == total_dofs,
ExcRenumberingIncomplete());
#endif
case reverse_Cuthill_McKee:
{
for (vector<int>::iterator i=new_number.begin(); i!=new_number.end(); ++i)
- *i = n_dofs-*i;
+ *i = total_dofs-*i;
break;
};
default:
Assert (sparsity.n_cols() == n_dofs(level),
ExcDifferentDimensions (sparsity.n_cols(), n_dofs(level)));
- const unsigned int total_dofs = selected_fe->total_dofs;
- vector<int> dofs_on_this_cell(total_dofs);
+ const unsigned int n_dofs = selected_fe->total_dofs;
+ vector<int> dofs_on_this_cell(n_dofs);
cell_iterator cell = begin_active(level),
endc = end(level);
for (; cell!=endc; ++cell)
{
cell->get_mg_dof_indices (dofs_on_this_cell);
// make sparsity pattern for this cell
- for (unsigned int i=0; i<total_dofs; ++i)
- for (unsigned int j=0; j<total_dofs; ++j)
+ for (unsigned int i=0; i<n_dofs; ++i)
+ for (unsigned int j=0; j<n_dofs; ++j)
sparsity.add (dofs_on_this_cell[i],
dofs_on_this_cell[j]);
};
#include <grid/tria_boundary.h>
-
+#define UNDEF 0
/*------------------------------- FiniteElementData ----------------------*/
-#if deal_II_dimension == 1
-
-FiniteElementData<1>::FiniteElementData () :
- dofs_per_vertex(0),
- dofs_per_line(0),
- dofs_per_face(0),
- total_dofs(0),
- n_transform_functions(0),
- n_components(0)
+template <int dim>
+FiniteElementData<dim>::FiniteElementData ()
{
- Assert (false, ExcInternalError());
+ Assert (false, ExcNotImplemented());
};
-
-FiniteElementData<1>::FiniteElementData (const unsigned int dofs_per_vertex,
- const unsigned int dofs_per_line,
- const unsigned int n_transform_functions,
- const unsigned int n_components) :
+template <int dim>
+FiniteElementData<dim>::FiniteElementData (const unsigned int dofs_per_vertex,
+ const unsigned int dofs_per_line,
+ const unsigned int dofs_per_quad,
+ const unsigned int dofs_per_hex,
+ const unsigned int n_transform_functions,
+ const unsigned int n_components) :
dofs_per_vertex(dofs_per_vertex),
dofs_per_line(dofs_per_line),
- dofs_per_face(dofs_per_vertex),
- total_dofs (2*dofs_per_vertex+dofs_per_line),
- n_transform_functions(n_transform_functions),
+ dofs_per_quad(dofs_per_quad),
+ dofs_per_hex(dofs_per_hex),
+ dofs_per_face(GeometryInfo<dim>::vertices_per_face * dofs_per_vertex+
+ GeometryInfo<dim>::faces_per_cell * dofs_per_quad),
+ first_line_index(GeometryInfo<dim>::vertices_per_cell * dofs_per_vertex),
+ first_quad_index(first_line_index+
+ 12*dofs_per_line),
+ first_hex_index(first_quad_index+
+ GeometryInfo<dim>::faces_per_cell * dofs_per_quad),
+ total_dofs (first_hex_index+dofs_per_hex),
+ n_transform_functions (n_transform_functions),
n_components(n_components)
-{};
-
-
-
-FiniteElementData<1>::FiniteElementData (const FiniteElementData<1> &fe_data) :
- dofs_per_vertex(fe_data.dofs_per_vertex),
- dofs_per_line(fe_data.dofs_per_line),
- dofs_per_face(fe_data.dofs_per_face),
- total_dofs (fe_data.total_dofs),
- n_transform_functions(fe_data.n_transform_functions),
- n_components(fe_data.n_components)
-{};
-
-
-
-bool FiniteElementData<1>::operator== (const FiniteElementData<1> &f) const {
- return ((dofs_per_vertex == f.dofs_per_vertex) &&
- (dofs_per_line == f.dofs_per_line) &&
- (total_dofs == f.total_dofs) &&
- (n_components == f.n_components));
-};
-
-#endif
-
-
-
-#if deal_II_dimension == 2
-
-
-FiniteElementData<2>::FiniteElementData () :
- dofs_per_vertex(0),
- dofs_per_line(0),
- dofs_per_quad(0),
- dofs_per_face(0),
- total_dofs(0),
- n_transform_functions(0),
- n_components(0)
{
- Assert (false, ExcInternalError());
+ Assert(dim==3, ExcDimensionMismatch(3,dim));
};
-
-
-FiniteElementData<2>::FiniteElementData (const unsigned int dofs_per_vertex,
- const unsigned int dofs_per_line,
- const unsigned int dofs_per_quad,
- const unsigned int n_transform_functions,
- const unsigned int n_components) :
+template <int dim>
+FiniteElementData<dim>::FiniteElementData (const unsigned int dofs_per_vertex,
+ const unsigned int dofs_per_line,
+ const unsigned int dofs_per_quad,
+ const unsigned int n_transform_functions,
+ const unsigned int n_components) :
dofs_per_vertex(dofs_per_vertex),
dofs_per_line(dofs_per_line),
dofs_per_quad(dofs_per_quad),
- dofs_per_face(2*dofs_per_vertex+
- dofs_per_line),
- total_dofs (4*dofs_per_vertex+
- 4*dofs_per_line+
- dofs_per_quad),
+ dofs_per_hex(0),
+ dofs_per_face(GeometryInfo<dim>::vertices_per_face * dofs_per_vertex+
+ GeometryInfo<dim>::faces_per_cell * dofs_per_line),
+ first_line_index(GeometryInfo<dim>::vertices_per_cell * dofs_per_vertex),
+ first_quad_index(first_line_index+
+ GeometryInfo<dim>::lines_per_cell * dofs_per_line),
+ first_hex_index(first_quad_index+
+ GeometryInfo<dim>::quads_per_cell*dofs_per_quad),
+ total_dofs (first_quad_index+dofs_per_quad),
n_transform_functions (n_transform_functions),
n_components(n_components)
-{};
+{
+ Assert(dim==2, ExcDimensionMismatch(2,dim));
+};
+template <int dim>
+FiniteElementData<dim>::FiniteElementData (const unsigned int dofs_per_vertex,
+ const unsigned int dofs_per_line,
+ const unsigned int n_transform_functions,
+ const unsigned int n_components) :
+ dofs_per_vertex(dofs_per_vertex),
+ dofs_per_line(dofs_per_line),
+ dofs_per_quad(0),
+ dofs_per_hex(0),
+ dofs_per_face(GeometryInfo<dim>::vertices_per_face * dofs_per_vertex),
+ first_line_index(GeometryInfo<dim>::vertices_per_cell * dofs_per_vertex),
+ first_quad_index(first_line_index+
+ GeometryInfo<dim>::lines_per_cell * dofs_per_line),
+ first_hex_index(first_quad_index+
+ GeometryInfo<dim>::quads_per_cell*dofs_per_quad),
+ total_dofs (first_line_index+dofs_per_line),
+ n_transform_functions (n_transform_functions),
+ n_components(n_components)
+{
+ Assert(dim==1, ExcDimensionMismatch(1,dim));
+};
-FiniteElementData<2>::FiniteElementData (const FiniteElementData<2> &fe_data) :
- dofs_per_vertex(fe_data.dofs_per_vertex),
- dofs_per_line(fe_data.dofs_per_line),
- dofs_per_quad(fe_data.dofs_per_quad),
- dofs_per_face(fe_data.dofs_per_face),
- total_dofs (fe_data.total_dofs),
- n_transform_functions (fe_data.n_transform_functions),
- n_components(fe_data.n_components)
-{};
+// FiniteElementData<2>::FiniteElementData (const FiniteElementData<2> &fe_data) :
+// dofs_per_vertex(fe_data.dofs_per_vertex),
+// dofs_per_line(fe_data.dofs_per_line),
+// dofs_per_quad(fe_data.dofs_per_quad),
+// dofs_per_face(fe_data.dofs_per_face),
+// total_dofs (fe_data.total_dofs),
+// n_transform_functions (fe_data.n_transform_functions),
+// n_components(fe_data.n_components)
+// {};
-bool FiniteElementData<2>::operator== (const FiniteElementData<2> &f) const {
+template<int dim>
+bool FiniteElementData<dim>::operator== (const FiniteElementData<2> &f) const
+{
return ((dofs_per_vertex == f.dofs_per_vertex) &&
(dofs_per_line == f.dofs_per_line) &&
(dofs_per_quad == f.dofs_per_quad) &&
- (total_dofs == f.total_dofs) &&
+ (dofs_per_hex == f.dofs_per_hex) &&
+ (n_transform_functions == f.n_transform_functions) &&
(n_components == f.n_components));
};
-#endif
-
/*------------------------------- FiniteElementBase ----------------------*/
template <>
FiniteElementBase<1>::FiniteElementBase (const FiniteElementData<1> &fe_data) :
- FiniteElementData<1> (fe_data)
+ FiniteElementData<1> (fe_data),
+ system_to_component_table(total_dofs)
{
const unsigned int dim=1;
for (unsigned int i=0; i<GeometryInfo<dim>::children_per_cell; ++i)
template <>
FiniteElementBase<2>::FiniteElementBase (const FiniteElementData<2> &fe_data) :
- FiniteElementData<2> (fe_data)
+ FiniteElementData<2> (fe_data),
+ system_to_component_table(total_dofs)
{
const unsigned int dim=2;
for (unsigned int i=0; i<GeometryInfo<dim>::children_per_cell; ++i)
/*------------------------------- Explicit Instantiations -------------*/
+template class FiniteElementData<deal_II_dimension>;
template class FiniteElementBase<deal_II_dimension>;
template class FiniteElement<deal_II_dimension>;
template <>
FECrissCross<1>::FECrissCross () :
// set more or less invalid data
- FiniteElement<1> (FiniteElementData<1> (0,0,0))
+ FiniteElement<1> (FiniteElementData<1> (0,0,0,0))
{
Assert (false, ExcNotUseful());
};
template <>
FECrissCross<2>::FECrissCross () :
- FiniteElement<2> (FiniteElementData<2> (1,0,1,5))
+ FiniteElement<2> (FiniteElementData<2> (1,0,1,5,1))
{
interface_constraints(0,0) = 1./2.;
interface_constraints(0,1) = 1./2.;
const unsigned int dofs_per_quad) :
FiniteElement<1> (FiniteElementData<1> (dofs_per_vertex,
dofs_per_line,
- GeometryInfo<1>::vertices_per_cell))
+ GeometryInfo<1>::vertices_per_cell,
+ 1))
{
Assert (dofs_per_quad==0, ExcInvalidData());
};
FiniteElement<2> (FiniteElementData<2> (dofs_per_vertex,
dofs_per_line,
dofs_per_quad,
- GeometryInfo<2>::vertices_per_cell))
+ GeometryInfo<2>::vertices_per_cell,
+ 1))
{};
template <int dim>
FEValuesBase<dim>::FEValuesBase (const unsigned int n_q_points,
const unsigned int n_support_points,
- const unsigned int n_dofs,
+ const unsigned int total_dofs,
const unsigned int n_transform_functions,
const unsigned int n_values_arrays,
const UpdateFlags update_flags,
const FiniteElement<dim> &fe) :
n_quadrature_points (n_q_points),
- total_dofs (n_dofs),
+ total_dofs (total_dofs),
n_transform_functions (n_transform_functions),
- shape_values (n_values_arrays, dFMatrix(n_dofs, n_q_points)),
- shape_gradients (n_dofs, vector<Tensor<1,dim> >(n_q_points)),
- shape_2nd_derivatives (n_dofs, vector<Tensor<2,dim> >(n_q_points)),
+ shape_values (n_values_arrays, dFMatrix(total_dofs, n_q_points)),
+ shape_gradients (total_dofs, vector<Tensor<1,dim> >(n_q_points)),
+ shape_2nd_derivatives (total_dofs, vector<Tensor<2,dim> >(n_q_points)),
weights (n_q_points, 0),
JxW_values (n_q_points, 0),
quadrature_points (n_q_points, Point<dim>()),
template <int dim>
FEFaceValuesBase<dim>::FEFaceValuesBase (const unsigned int n_q_points,
const unsigned int n_support_points,
- const unsigned int n_dofs,
+ const unsigned int total_dofs,
const unsigned int n_transform_functions,
const unsigned int n_faces_or_subfaces,
const UpdateFlags update_flags,
const FiniteElement<dim> &fe) :
FEValuesBase<dim> (n_q_points,
n_support_points,
- n_dofs,
+ total_dofs,
n_transform_functions,
n_faces_or_subfaces,
update_flags,
fe),
unit_shape_gradients (n_faces_or_subfaces,
- vector<vector<Tensor<1,dim> > >(n_dofs,
+ vector<vector<Tensor<1,dim> > >(total_dofs,
vector<Tensor<1,dim> >(n_q_points))),
unit_shape_2nd_derivatives(n_faces_or_subfaces,
- vector<vector<Tensor<2,dim> > >(n_dofs,
+ vector<vector<Tensor<2,dim> > >(total_dofs,
vector<Tensor<2,dim> >(n_q_points))),
unit_shape_gradients_transform (n_faces_or_subfaces,
vector<vector<Tensor<1,dim> > >(n_transform_functions,
Assert (sparsity.n_cols() == n_dofs(level),
ExcDifferentDimensions (sparsity.n_cols(), n_dofs(level)));
- const unsigned int total_dofs = selected_fe->total_dofs;
- vector<int> dofs_on_this_cell(total_dofs);
+ const unsigned int n_dofs = selected_fe->total_dofs;
+ vector<int> dofs_on_this_cell(n_dofs);
cell_iterator cell = begin_active(level),
endc = end(level);
for (; cell!=endc; ++cell)
{
cell->get_mg_dof_indices (dofs_on_this_cell);
// make sparsity pattern for this cell
- for (unsigned int i=0; i<total_dofs; ++i)
- for (unsigned int j=0; j<total_dofs; ++j)
+ for (unsigned int i=0; i<n_dofs; ++i)
+ for (unsigned int j=0; j<n_dofs; ++j)
sparsity.add (dofs_on_this_cell[i],
dofs_on_this_cell[j]);
};
const FiniteElement<dim> &fe,
const Boundary<dim> &boundary,
dSMatrix &matrix) {
- const unsigned int total_dofs = fe.total_dofs;
+ const unsigned int n_dofs = fe.total_dofs;
- dFMatrix local_mass_matrix (total_dofs, total_dofs);
- vector<int> dofs_on_this_cell (total_dofs);
+ dFMatrix local_mass_matrix (n_dofs, n_dofs);
+ vector<int> dofs_on_this_cell (n_dofs);
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, boundary, 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<n_dofs; ++i)
+ for (unsigned int j=0; j<n_dofs; ++j)
matrix.add (dofs_on_this_cell[i], dofs_on_this_cell[j],
local_mass_matrix(i,j));
};
void MassMatrix<dim>::assemble (dFMatrix &cell_matrix,
const FEValues<dim> &fe_values,
const typename Triangulation<dim>::cell_iterator &) const {
- const unsigned int total_dofs = fe_values.total_dofs,
+ const unsigned int n_dofs = fe_values.total_dofs,
n_q_points = fe_values.n_quadrature_points;
- Assert (cell_matrix.n() == total_dofs,
- ExcWrongSize(cell_matrix.n(), total_dofs));
- Assert (cell_matrix.m() == total_dofs,
- ExcWrongSize(cell_matrix.m(), total_dofs));
+ Assert (cell_matrix.n() == n_dofs,
+ ExcWrongSize(cell_matrix.n(), n_dofs));
+ Assert (cell_matrix.m() == n_dofs,
+ ExcWrongSize(cell_matrix.m(), n_dofs));
Assert (cell_matrix.all_zero(), ExcObjectNotEmpty());
const dFMatrix &values = fe_values.get_shape_values ();
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<n_dofs; ++i)
+ for (unsigned int j=0; j<n_dofs; ++j)
for (unsigned int point=0; point<n_q_points; ++point)
cell_matrix(i,j) += (values(i,point) *
values(j,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<n_dofs; ++i)
+ for (unsigned int j=0; j<n_dofs; ++j)
for (unsigned int point=0; point<n_q_points; ++point)
cell_matrix(i,j) += (values(i,point) *
values(j,point) *
const Triangulation<dim>::cell_iterator &) const {
Assert (right_hand_side != 0, ExcNoRHSSelected());
- const unsigned int total_dofs = fe_values.total_dofs,
+ const unsigned int n_dofs = fe_values.total_dofs,
n_q_points = fe_values.n_quadrature_points;
- Assert (cell_matrix.n() == total_dofs,
- ExcWrongSize(cell_matrix.n(), total_dofs));
- Assert (cell_matrix.m() == total_dofs,
- ExcWrongSize(cell_matrix.m(), total_dofs));
- Assert (rhs.size() == total_dofs,
- ExcWrongSize(rhs.size(), total_dofs));
+ Assert (cell_matrix.n() == n_dofs,
+ ExcWrongSize(cell_matrix.n(), n_dofs));
+ Assert (cell_matrix.m() == n_dofs,
+ ExcWrongSize(cell_matrix.m(), n_dofs));
+ Assert (rhs.size() == n_dofs,
+ ExcWrongSize(rhs.size(), n_dofs));
Assert (cell_matrix.all_zero(), ExcObjectNotEmpty());
Assert (rhs.all_zero(), 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 i=0; i<n_dofs; ++i)
{
- for (unsigned int j=0; j<total_dofs; ++j)
+ for (unsigned int j=0; j<n_dofs; ++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<n_dofs; ++i)
{
- for (unsigned int j=0; j<total_dofs; ++j)
+ for (unsigned int j=0; j<n_dofs; ++j)
cell_matrix(i,j) += (values(i,point) *
values(j,point) *
weights[point]);
const Triangulation<dim>::cell_iterator &) const {
Assert (right_hand_side != 0, ExcNoRHSSelected());
- const unsigned int total_dofs = fe_values.total_dofs,
+ const unsigned int n_dofs = fe_values.total_dofs,
n_q_points = fe_values.n_quadrature_points;
- Assert (rhs.size() == total_dofs, ExcWrongSize(rhs.size(), total_dofs));
+ Assert (rhs.size() == n_dofs, ExcWrongSize(rhs.size(), n_dofs));
Assert (rhs.all_zero(), ExcObjectNotEmpty());
const dFMatrix &values = fe_values.get_shape_values ();
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<n_dofs; ++i)
rhs(i) += values(i,point) *
rhs_values[point] *
weights[point];
const Triangulation<dim>::cell_iterator &) const {
Assert (right_hand_side != 0, ExcNoRHSSelected());
- const unsigned int total_dofs = fe_values.total_dofs,
+ const unsigned int n_dofs = fe_values.total_dofs,
n_q_points = fe_values.n_quadrature_points;
- Assert (cell_matrix.n() == total_dofs,
- ExcWrongSize(cell_matrix.n(), total_dofs));
- Assert (cell_matrix.m() == total_dofs,
- ExcWrongSize(cell_matrix.m(), total_dofs));
- Assert (rhs.size() == total_dofs,
- ExcWrongSize(rhs.size(), total_dofs));
+ Assert (cell_matrix.n() == n_dofs,
+ ExcWrongSize(cell_matrix.n(), n_dofs));
+ Assert (cell_matrix.m() == n_dofs,
+ ExcWrongSize(cell_matrix.m(), n_dofs));
+ Assert (rhs.size() == n_dofs,
+ ExcWrongSize(rhs.size(), n_dofs));
Assert (cell_matrix.all_zero(), ExcObjectNotEmpty());
Assert (rhs.all_zero(), 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 i=0; i<n_dofs; ++i)
{
- for (unsigned int j=0; j<total_dofs; ++j)
+ for (unsigned int j=0; j<n_dofs; ++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<n_dofs; ++i)
{
- for (unsigned int j=0; j<total_dofs; ++j)
+ for (unsigned int j=0; j<n_dofs; ++j)
cell_matrix(i,j) += (gradients[i][point] *
gradients[j][point]) *
weights[point];
void LaplaceMatrix<dim>::assemble (dFMatrix &cell_matrix,
const FEValues<dim> &fe_values,
const Triangulation<dim>::cell_iterator &) const {
- const unsigned int total_dofs = fe_values.total_dofs,
+ const unsigned int n_dofs = fe_values.total_dofs,
n_q_points = fe_values.n_quadrature_points;
- Assert (cell_matrix.n() == total_dofs,
- ExcWrongSize(cell_matrix.n(), total_dofs));
- Assert (cell_matrix.m() == total_dofs,
- ExcWrongSize(cell_matrix.m(), total_dofs));
+ Assert (cell_matrix.n() == n_dofs,
+ ExcWrongSize(cell_matrix.n(), n_dofs));
+ Assert (cell_matrix.m() == n_dofs,
+ ExcWrongSize(cell_matrix.m(), n_dofs));
Assert (cell_matrix.all_zero(), ExcObjectNotEmpty());
const vector<vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
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<n_dofs; ++i)
+ for (unsigned int j=0; j<n_dofs; ++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 j=0; j<total_dofs; ++j)
+ for (unsigned int i=0; i<n_dofs; ++i)
+ for (unsigned int j=0; j<n_dofs; ++j)
cell_matrix(i,j) += (gradients[i][point] *
gradients[j][point]) *
weights[point];
const Triangulation<dim>::cell_iterator &) const {
Assert (right_hand_side != 0, ExcNoRHSSelected());
- const unsigned int total_dofs = fe_values.total_dofs,
+ const unsigned int n_dofs = fe_values.total_dofs,
n_q_points = fe_values.n_quadrature_points;
- Assert (rhs.size() == total_dofs, ExcWrongSize(rhs.size(), total_dofs));
+ Assert (rhs.size() == n_dofs, ExcWrongSize(rhs.size(), n_dofs));
Assert (rhs.all_zero(), ExcObjectNotEmpty());
const dFMatrix &values = fe_values.get_shape_values ();
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<n_dofs; ++i)
rhs(i) += values(i,point) *
rhs_values[point] *
weights[point];