*/
const unsigned int dofs_per_hex;
- /**
- * 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.
- */
- const unsigned int dofs_per_face;
-
/**
* First index of dof on a line.
*/
*/
const unsigned int first_face_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.
+ */
+ const unsigned int dofs_per_face;
+
/**
* Total number of degrees of freedom
* on a cell. This information is
* writing dimension independant
* programs easier.
*/
- const unsigned int total_dofs;
+ const unsigned int dofs_per_cell;
/**
* Number of basis functions used for the
* cell. For a linear mapping, this number
* equals the number of vertices.
*/
- const unsigned int n_transform_functions;
+ const unsigned int transform_functions;
/**
* Number of components and dimension of
* the image space.
*/
- const unsigned int n_components;
+ const unsigned int components;
/**
* Default constructor. Constructs
* an element
* which is not so useful. Checking
- * #total_dofs# is therefore a good way to
+ * #dofs_per_cell# is therefore a good way to
* check if something went wrong.
*/
FiniteElementData ();
* in derived classes virtual as well.
*/
virtual ~FiniteElementData ();
+
+ /**
+ * Return the #dofs_per_vertex#.
+ */
+ unsigned int n_dofs_per_vertex () const;
+
+ /**
+ * Return the #dofs_per_line#.
+ */
+ unsigned int n_dofs_per_line () const;
+
+ /**
+ * Return the #dofs_per_quad#.
+ */
+ unsigned int n_dofs_per_quad () const;
+
+ /**
+ * Return the #dofs_per_hex#.
+ */
+ unsigned int n_dofs_per_hex () const;
+
+ /**
+ * Return the #dofs_per_face#.
+ */
+ unsigned int n_dofs_per_face () const;
+
+ /**
+ * Return the #dofs_per_cell#.
+ */
+ unsigned int n_dofs_per_cell () const;
+
+ /**
+ * Return the #components#.
+ */
+ unsigned int n_components () const;
+
+ /**
+ * Return the #transform_functions#.
+ */
+ unsigned int n_transform_functions () const;
+
/**
* Comparison operator. It is not clear to
- * me why we have to declare and implement
+ * me (WB) why we have to declare and implement
* this one explicitely.
*/
bool operator == (const FiniteElementData<dim> &) const;
/* ------------------------------- Inline functions ----------------------- */
+template <int dim>
+inline
+unsigned int
+FiniteElementData<dim>::n_dofs_per_vertex () const
+{
+ return dofs_per_vertex;
+};
+
+
+
+template <int dim>
+inline
+unsigned int
+FiniteElementData<dim>::n_dofs_per_line () const
+{
+ return dofs_per_line;
+};
+
+
+
+template <int dim>
+inline
+unsigned int
+FiniteElementData<dim>::n_dofs_per_quad () const
+{
+ return dofs_per_quad;
+};
+
+
+
+template <int dim>
+inline
+unsigned int
+FiniteElementData<dim>::n_dofs_per_hex () const
+{
+ return dofs_per_hex;
+};
+
+
+
+template <int dim>
+inline
+unsigned int
+FiniteElementData<dim>::n_dofs_per_face () const
+{
+ return dofs_per_face;
+};
+
+
+
+template <int dim>
+inline
+unsigned int
+FiniteElementData<dim>::n_dofs_per_cell () const
+{
+ return dofs_per_cell;
+};
+
+
+
+template <int dim>
+inline
+unsigned int
+FiniteElementData<dim>::n_components () const
+{
+ return components;
+};
+
+
+
+template <int dim>
+inline
+unsigned int
+FiniteElementData<dim>::n_transform_functions () const
+{
+ return transform_functions;
+};
+
+
+
template <int dim>
inline
unsigned int
FiniteElementBase<dim>::component_to_system_index (unsigned int component,
unsigned int component_index) const
{
- Assert(component<n_components,
- ExcIndexRange(component, 0, n_components));
+ Assert(component<n_components(),
+ ExcIndexRange(component, 0, n_components()));
Assert(component_index<component_to_system_table[component].size(),
ExcIndexRange(component_index, 0,
component_to_system_table[component].size()));
FiniteElementBase<dim>::face_component_to_system_index (unsigned int component,
unsigned int component_index) const
{
- Assert(component<n_components,
- ExcIndexRange(component, 0, n_components));
+ Assert(component<n_components(),
+ ExcIndexRange(component, 0, n_components()));
Assert(component_index<face_component_to_system_table[component].size(),
ExcIndexRange(component_index, 0,
face_component_to_system_table[component].size()));
return face_system_to_component_table[index];
}
+
+
template <int dim>
inline
unsigned int
FiniteElementBase<dim>::component_to_base (unsigned int index) const
{
- if (n_components == 1)
+ if (n_components() == 1)
return 0;
Assert(index < component_to_base_table.size(),
ExcIndexRange(index, 0, component_to_base_table.size()));
return component_to_base_table[index];
}
+
+
template <int dim>
inline
bool
FiniteElementBase<dim>::restriction_is_additive (const unsigned int component) const
{
- Assert(component<n_components,
- ExcIndexRange(component, 0, n_components));
+ Assert(component<n_components(),
+ ExcIndexRange(component, 0, n_components()));
return restriction_is_additive_flags[component];
}
fe2, n2)),
base_elements(2)
{
- Assert(fe1.n_transform_functions == fe2.n_transform_functions,
+ Assert(fe1.n_transform_functions() == fe2.n_transform_functions(),
ExcElementTransformNotEqual());
base_elements[0] = ElementPair(new FE1, n1);
fe3, n3)),
base_elements(3)
{
- Assert(fe1.n_transform_functions == fe2.n_transform_functions,
+ Assert(fe1.n_transform_functions() == fe2.n_transform_functions(),
ExcElementTransformNotEqual());
- Assert(fe1.n_transform_functions == fe3.n_transform_functions,
+ Assert(fe1.n_transform_functions() == fe3.n_transform_functions(),
ExcElementTransformNotEqual());
base_elements[0] = ElementPair(new FE1, n1);
* use. Later on, the #fill_fe_*# functions are passed pointers to these
* arrays, which they may use to extract the values and gradients of the
* transform functions. If a concrete finite element choses not to use this
- * field, it shall set its field #n_transform_functions# to zero.
+ * field, it shall set its field #transform_functions# to zero.
*
* The #unit_shape_grads_transform# array is provided by the derived classes
* to allow for the inclusion of multiple faces, etc.
* number of degrees of freedom per
* cell, not per face.
*/
- const unsigned int total_dofs;
+ const unsigned int dofs_per_cell;
/**
* Number of basis functions for the
*/
FEValuesBase (const unsigned int n_q_points,
const unsigned int n_support_points,
- const unsigned int total_dofs,
+ const unsigned int dofs_per_cell,
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 total_dofs,
+ const unsigned int dofs_per_cell,
const unsigned int n_transform_functions,
const unsigned int n_faces_or_subfaces,
const UpdateFlags update_flags,
void
MG<dim>::copy_to_mg(const Vector<number>& src)
{
- const unsigned int dofs_per_cell = mg_dof_handler->get_fe().total_dofs;
+ const unsigned int dofs_per_cell = mg_dof_handler->get_fe().dofs_per_cell;
const unsigned int dofs_per_face = mg_dof_handler->get_fe().dofs_per_face;
// set the elements of the vectors
void
MG<dim>::copy_from_mg(Vector<number> &dst) const
{
- const unsigned int dofs_per_cell = mg_dof_handler->get_fe().total_dofs;
+ const unsigned int dofs_per_cell = mg_dof_handler->get_fe().dofs_per_cell;
vector<int> global_dof_indices (dofs_per_cell);
vector<int> level_dof_indices (dofs_per_cell);
void
MG<dim>::copy_to_mg(const Vector<number>& src)
{
- const unsigned int dofs_per_cell = mg_dof_handler->get_fe().total_dofs;
+ const unsigned int dofs_per_cell = mg_dof_handler->get_fe().dofs_per_cell;
const unsigned int dofs_per_face = mg_dof_handler->get_fe().dofs_per_face;
// set the elements of the vectors
void
MG<dim>::copy_from_mg(Vector<number> &dst) const
{
- const unsigned int dofs_per_cell = mg_dof_handler->get_fe().total_dofs;
+ const unsigned int dofs_per_cell = mg_dof_handler->get_fe().dofs_per_cell;
vector<int> global_dof_indices (dofs_per_cell);
vector<int> level_dof_indices (dofs_per_cell);
Assert (dof_handler != 0, DoFAccessor<1>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<1>::ExcInvalidObject());
- Assert (local_values.size() == dof_handler->get_fe().total_dofs,
+ Assert (local_values.size() == dof_handler->get_fe().dofs_per_cell,
DoFAccessor<1>::ExcVectorDoesNotMatch());
Assert (values.size() == dof_handler->n_dofs(),
DoFAccessor<1>::ExcVectorDoesNotMatch());
Assert (dof_handler != 0, DoFAccessor<1>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<1>::ExcInvalidObject());
- Assert (local_values.size() == dof_handler->get_fe().total_dofs,
+ Assert (local_values.size() == dof_handler->get_fe().dofs_per_cell,
DoFAccessor<1>::ExcVectorDoesNotMatch());
Assert (values.size() == dof_handler->n_dofs(),
DoFAccessor<1>::ExcVectorDoesNotMatch());
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
- Assert (local_values.size() == dof_handler->get_fe().total_dofs,
+ Assert (local_values.size() == dof_handler->get_fe().dofs_per_cell,
DoFAccessor<dim>::ExcVectorDoesNotMatch());
Assert (values.size() == dof_handler->n_dofs(),
DoFAccessor<dim>::ExcVectorDoesNotMatch());
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
- Assert (local_values.size() == dof_handler->get_fe().total_dofs,
+ Assert (local_values.size() == dof_handler->get_fe().dofs_per_cell,
DoFAccessor<dim>::ExcVectorDoesNotMatch());
Assert (values.size() == dof_handler->n_dofs(),
DoFAccessor<dim>::ExcVectorDoesNotMatch());
Assert (dof_handler != 0, DoFAccessor<3>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<3>::ExcInvalidObject());
- Assert (local_values.size() == dof_handler->get_fe().total_dofs,
+ Assert (local_values.size() == dof_handler->get_fe().dofs_per_cell,
DoFAccessor<3>::ExcVectorDoesNotMatch());
Assert (values.size() == dof_handler->n_dofs(),
DoFAccessor<3>::ExcVectorDoesNotMatch());
Assert (dof_handler != 0, DoFAccessor<3>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<3>::ExcInvalidObject());
- Assert (local_values.size() == dof_handler->get_fe().total_dofs,
+ Assert (local_values.size() == dof_handler->get_fe().dofs_per_cell,
DoFAccessor<3>::ExcVectorDoesNotMatch());
Assert (values.size() == dof_handler->n_dofs(),
DoFAccessor<3>::ExcVectorDoesNotMatch());
void
DoFCellAccessor<dim>::get_interpolated_dof_values (const Vector<number> &values,
Vector<number> &interpolated_values) const {
- const unsigned int total_dofs = dof_handler->get_fe().total_dofs;
+ const unsigned int dofs_per_cell = dof_handler->get_fe().dofs_per_cell;
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
- Assert (interpolated_values.size() == total_dofs,
+ Assert (interpolated_values.size() == dofs_per_cell,
DoFAccessor<dim>::ExcVectorDoesNotMatch());
Assert (values.size() == dof_handler->n_dofs(),
DoFAccessor<dim>::ExcVectorDoesNotMatch());
else
// otherwise clobber them from the children
{
- Vector<number> tmp1(total_dofs);
- Vector<number> tmp2(total_dofs);
+ Vector<number> tmp1(dofs_per_cell);
+ Vector<number> tmp2(dofs_per_cell);
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<dofs_per_cell; ++i)
{
const unsigned int component
= dof_handler->get_fe().system_to_component_index(i).first;
void
DoFCellAccessor<dim>::set_dof_values_by_interpolation (const Vector<number> &local_values,
Vector<number> &values) const {
- const unsigned int total_dofs = dof_handler->get_fe().total_dofs;
+ const unsigned int dofs_per_cell = dof_handler->get_fe().dofs_per_cell;
Assert (dof_handler != 0, DoFAccessor<dim>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<dim>::ExcInvalidObject());
- Assert (local_values.size() == total_dofs,
+ Assert (local_values.size() == dofs_per_cell,
DoFAccessor<dim>::ExcVectorDoesNotMatch());
Assert (values.size() == dof_handler->n_dofs(),
DoFAccessor<dim>::ExcVectorDoesNotMatch());
else
// otherwise distribute them to the children
{
- Vector<number> tmp(total_dofs);
+ Vector<number> tmp(dofs_per_cell);
for (unsigned int child=0; child<GeometryInfo<dim>::children_per_cell;
++child)
Assert (sparsity.n_cols() == n_dofs(),
ExcDifferentDimensions (sparsity.n_cols(), n_dofs()));
- const unsigned int dofs_per_cell = selected_fe->total_dofs;
+ const unsigned int dofs_per_cell = selected_fe->dofs_per_cell;
vector<int> dofs_on_this_cell(dofs_per_cell);
active_cell_iterator cell = begin_active(),
endc = end();
DoFHandler<dim>::make_sparsity_pattern (const vector<vector<bool> > &mask,
SparseMatrixStruct &sparsity) const
{
- const unsigned int dofs_per_cell = selected_fe->total_dofs;
+ const unsigned int dofs_per_cell = selected_fe->dofs_per_cell;
Assert (selected_fe != 0, ExcNoFESelected());
Assert (sparsity.n_rows() == n_dofs(),
ExcDifferentDimensions (sparsity.n_rows(), n_dofs()));
Assert (sparsity.n_cols() == n_dofs(),
ExcDifferentDimensions (sparsity.n_cols(), n_dofs()));
- Assert (mask.size() == selected_fe->n_components,
- ExcInvalidMaskDimension(mask.size(), selected_fe->n_components));
+ Assert (mask.size() == selected_fe->n_components(),
+ ExcInvalidMaskDimension(mask.size(), selected_fe->n_components()));
for (unsigned int i=0; i<mask.size(); ++i)
- Assert (mask[i].size() == selected_fe->n_components,
- ExcInvalidMaskDimension(mask[i].size(), selected_fe->n_components));
+ Assert (mask[i].size() == selected_fe->n_components(),
+ ExcInvalidMaskDimension(mask[i].size(), selected_fe->n_components()));
// first build a mask for each dof,
// not like the one given which represents
Assert (cell_data.size()==tria->n_active_cells(),
ExcWrongSize (cell_data.size(), tria->n_active_cells()));
Assert (dof_data.size()==n_dofs(), ExcWrongSize (dof_data.size(), n_dofs()));
- Assert (component < selected_fe->n_components,
- ExcInvalidComponent(component, selected_fe->n_components));
+ Assert (component < selected_fe->n_components(),
+ ExcInvalidComponent(component, selected_fe->n_components()));
// store a flag whether we should care
// about different components. this is
// just a simplification, we could ask
// for this at every single place
// equally well
- const bool consider_components = (selected_fe->n_components != 1);
+ const bool consider_components = (selected_fe->n_components() != 1);
// count how often we have added a value
// in the sum for each dof
active_cell_iterator cell = begin_active(),
endc = end();
unsigned int present_cell = 0;
- const unsigned int dofs_per_cell = selected_fe->total_dofs;
+ const unsigned int dofs_per_cell = selected_fe->dofs_per_cell;
vector<int> dof_indices (dofs_per_cell);
for (; cell!=endc; ++cell, ++present_cell)
void DoFRenumbering::component_wise (DoFHandler<dim> &dof_handler,
const vector<unsigned int> &component_order_arg)
{
- const unsigned int dofs_per_cell = dof_handler.get_fe().total_dofs;
+ const unsigned int dofs_per_cell = dof_handler.get_fe().dofs_per_cell;
// do nothing if the FE has only
// one component
- if (dof_handler.get_fe().n_components == 1)
+ if (dof_handler.get_fe().n_components() == 1)
return;
vector<unsigned int> component_order (component_order_arg);
if (component_order.size() == 0)
- for (unsigned int i=0; i<dof_handler.get_fe().n_components; ++i)
+ for (unsigned int i=0; i<dof_handler.get_fe().n_components(); ++i)
component_order.push_back (i);
// check whether the component list has
// the right length and contains all
// component numbers
- Assert (component_order.size() == dof_handler.get_fe().n_components,
+ Assert (component_order.size() == dof_handler.get_fe().n_components(),
ExcInvalidComponentOrder());
- for (unsigned int i=0; i<dof_handler.get_fe().n_components; ++i)
+ for (unsigned int i=0; i<dof_handler.get_fe().n_components(); ++i)
Assert (find (component_order.begin(), component_order.end(), i)
!= component_order.end(),
ExcInvalidComponentOrder ());
// sorted by dof index. note also that some
// dof indices are entered multiply, so we
// will have to take care of that
- vector<vector<int> > component_to_dof_map (dof_handler.get_fe().n_components);
+ vector<vector<int> > component_to_dof_map (dof_handler.get_fe().n_components());
for (typename DoFHandler<dim>::active_cell_iterator cell=dof_handler.begin_active();
cell!=dof_handler.end(); ++cell)
{
// preserve the order within each component
// and during this also remove duplicate
// entries
- for (unsigned int component=0; component<dof_handler.get_fe().n_components; ++component)
+ for (unsigned int component=0; component<dof_handler.get_fe().n_components(); ++component)
{
sort (component_to_dof_map[component].begin(),
component_to_dof_map[component].end());
int next_free_index = 0;
vector<int> new_indices (dof_handler.n_dofs(), -1);
- for (unsigned int component=0; component<dof_handler.get_fe().n_components; ++component)
+ for (unsigned int component=0; component<dof_handler.get_fe().n_components(); ++component)
{
const typename vector<int>::const_iterator
begin_of_component = component_to_dof_map[component].begin(),
vector<bool> &selected_dofs)
{
const FiniteElement<dim> &fe = dof.get_fe();
- Assert(local_select.size() == fe.n_components,
- ExcDimensionMismatch(local_select.size(), fe.n_components));
+ Assert(local_select.size() == fe.n_components(),
+ ExcDimensionMismatch(local_select.size(), fe.n_components()));
Assert(selected_dofs.size() == dof.n_dofs(),
ExcDimensionMismatch(selected_dofs.size(), dof.n_dofs()));
// preset all values by false
fill_n (selected_dofs.begin(), dof.n_dofs(), false);
- vector<int> indices(fe.total_dofs);
+ vector<int> indices(fe.dofs_per_cell);
DoFHandler<dim>::active_cell_iterator c;
for (c = dof.begin_active() ; c != dof.end() ; ++ c)
{
c->get_dof_indices(indices);
- for (unsigned int i=0;i<fe.total_dofs;++i)
+ for (unsigned int i=0;i<fe.dofs_per_cell;++i)
{
const unsigned int component = fe.system_to_component_index(i).first;
vector<bool> &selected_dofs)
{
const FiniteElement<dim>& fe = dof.get_fe();
- Assert(local_select.size() == fe.n_components,
- ExcDimensionMismatch(local_select.size(), fe.n_components));
+ Assert(local_select.size() == fe.n_components(),
+ ExcDimensionMismatch(local_select.size(), fe.n_components()));
Assert(selected_dofs.size() == dof.n_dofs(level),
ExcDimensionMismatch(selected_dofs.size(), dof.n_dofs(level)));
// preset all values by false
fill_n (selected_dofs.begin(), dof.n_dofs(level), false);
- vector<int> indices(fe.total_dofs);
+ vector<int> indices(fe.dofs_per_cell);
MGDoFHandler<dim>::cell_iterator c;
for (c = dof.begin(level) ; c != dof.end(level) ; ++ c)
{
c->get_mg_dof_indices(indices);
- for (unsigned int i=0;i<fe.total_dofs;++i)
+ for (unsigned int i=0;i<fe.dofs_per_cell;++i)
{
const unsigned int component = fe.system_to_component_index(i).first;
if (local_select[component] == true)
Assert (dof_handler != 0, DoFAccessor<1>::DoFAccessor<1>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<1>::DoFAccessor<1>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<1>::DoFAccessor<1>::ExcInvalidObject());
- Assert (dof_values.size() == dof_handler->get_fe().total_dofs,
+ Assert (dof_values.size() == dof_handler->get_fe().dofs_per_cell,
ExcVectorDoesNotMatch());
Assert (values.size() == dof_handler->n_dofs(),
ExcVectorDoesNotMatch());
Assert (dof_handler != 0, DoFAccessor<2>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<2>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<2>::ExcInvalidObject());
- Assert (dof_values.size() == dof_handler->get_fe().total_dofs,
+ Assert (dof_values.size() == dof_handler->get_fe().dofs_per_cell,
DoFAccessor<2>::ExcVectorDoesNotMatch());
Assert (values.size() == mg_dof_handler->n_dofs(present_level),
DoFAccessor<2>::ExcVectorDoesNotMatch());
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 dofs_per_cell = selected_fe->dofs_per_cell;
+ vector<int> dofs_on_this_cell(dofs_per_cell);
cell_iterator cell = begin(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<dofs_per_cell; ++i)
+ for (unsigned int j=0; j<dofs_per_cell; ++j)
sparsity.add (dofs_on_this_cell[i],
dofs_on_this_cell[j]);
};
dofs_per_line(dofs_per_line),
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>::lines_per_face * dofs_per_line +
- dofs_per_quad),
first_line_index(GeometryInfo<dim>::vertices_per_cell
* dofs_per_vertex),
first_quad_index(first_line_index+
first_face_quad_index(first_face_line_index+
GeometryInfo<dim-1>::lines_per_cell
* dofs_per_line),
- total_dofs (first_hex_index+dofs_per_hex),
- n_transform_functions (n_transform_functions),
- n_components(n_components)
+ dofs_per_face(GeometryInfo<dim>::vertices_per_face * dofs_per_vertex+
+ GeometryInfo<dim>::lines_per_face * dofs_per_line +
+ dofs_per_quad),
+ dofs_per_cell (first_hex_index+dofs_per_hex),
+ transform_functions (n_transform_functions),
+ components(n_components)
{
Assert(dim==3, ExcDimensionMismatch(3,dim));
};
dofs_per_line(dofs_per_line),
dofs_per_quad(dofs_per_quad),
dofs_per_hex(0),
- dofs_per_face(GeometryInfo<dim>::vertices_per_face * dofs_per_vertex+
- 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_face_quad_index(first_line_index+
GeometryInfo<dim-1>::lines_per_cell
* dofs_per_line),
- total_dofs (first_quad_index+dofs_per_quad),
- n_transform_functions (n_transform_functions),
- n_components(n_components)
+ dofs_per_face(GeometryInfo<dim>::vertices_per_face * dofs_per_vertex+
+ dofs_per_line),
+ dofs_per_cell (first_quad_index+dofs_per_quad),
+ transform_functions (n_transform_functions),
+ components(n_components)
{
Assert(dim==2, ExcDimensionMismatch(2,dim));
};
dofs_per_line(dofs_per_line),
dofs_per_quad(0),
dofs_per_hex(0),
- dofs_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_face_quad_index(first_line_index+
GeometryInfo<dim-1>::lines_per_cell
* dofs_per_line),
- total_dofs (first_line_index+dofs_per_line),
- n_transform_functions (n_transform_functions),
- n_components(n_components)
+ dofs_per_face(dofs_per_vertex),
+ dofs_per_cell (first_line_index+dofs_per_line),
+ transform_functions (n_transform_functions),
+ components(n_components)
{
Assert(dim==1, ExcDimensionMismatch(1,dim));
};
(dofs_per_line == f.dofs_per_line) &&
(dofs_per_quad == f.dofs_per_quad) &&
(dofs_per_hex == f.dofs_per_hex) &&
- (n_transform_functions == f.n_transform_functions) &&
- (n_components == f.n_components));
+ (transform_functions == f.transform_functions) &&
+ (components == f.components));
};
FiniteElementBase<dim>::FiniteElementBase (const FiniteElementData<dim> &fe_data,
const vector<bool> &restriction_is_additive_flags) :
FiniteElementData<dim> (fe_data),
- system_to_component_table(total_dofs),
+ system_to_component_table(dofs_per_cell),
face_system_to_component_table(dofs_per_face),
- component_to_system_table(n_components, vector<unsigned>(total_dofs)),
- face_component_to_system_table(n_components, vector<unsigned>(dofs_per_face)),
- component_to_base_table(n_components),
+ component_to_system_table(components, vector<unsigned>(dofs_per_cell)),
+ face_component_to_system_table(components, vector<unsigned>(dofs_per_face)),
+ component_to_base_table(components),
restriction_is_additive_flags(restriction_is_additive_flags)
{
- Assert(restriction_is_additive_flags.size()==fe_data.n_components,
- ExcWrongFieldDimension(restriction_is_additive_flags.size(),fe_data.n_components));
+ Assert(restriction_is_additive_flags.size()==fe_data.components,
+ ExcWrongFieldDimension(restriction_is_additive_flags.size(),fe_data.components));
for (unsigned int i=0; i<GeometryInfo<dim>::children_per_cell; ++i)
{
- restriction[i].reinit (total_dofs, total_dofs);
- prolongation[i].reinit (total_dofs, total_dofs);
+ restriction[i].reinit (dofs_per_cell, dofs_per_cell);
+ prolongation[i].reinit (dofs_per_cell, dofs_per_cell);
};
switch (dim)
// one component; if there are several, then
// the constructor of the derived class needs
// to fill these arrays
- for (unsigned int j=0 ; j<total_dofs ; ++j)
+ for (unsigned int j=0 ; j<dofs_per_cell ; ++j)
{
system_to_component_table[j] = pair<unsigned,unsigned>(0,j);
component_to_system_table[0][j] = j;
ExcWrongFieldDimension(jacobians_grad.size(), unit_points.size()));
Assert ((!compute_q_points) || (q_points.size() == unit_points.size()),
ExcWrongFieldDimension(q_points.size(), unit_points.size()));
- Assert ((!compute_support_points) || (support_points.size() == total_dofs),
- ExcWrongFieldDimension(support_points.size(), total_dofs));
+ Assert ((!compute_support_points) || (support_points.size() == dofs_per_cell),
+ ExcWrongFieldDimension(support_points.size(), dofs_per_cell));
// local mesh width
template <>
void FiniteElement<1>::get_unit_support_points (vector<Point<1> > &support_points) const {
- Assert (support_points.size() == total_dofs,
- ExcWrongFieldDimension(support_points.size(), total_dofs));
+ Assert (support_points.size() == dofs_per_cell,
+ ExcWrongFieldDimension(support_points.size(), dofs_per_cell));
// compute support points. The first ones
// belong to vertex one, the second ones
// to vertex two, all following are
template <>
void FiniteElement<1>::get_support_points (const DoFHandler<1>::cell_iterator &cell,
vector<Point<1> > &support_points) const {
- Assert (support_points.size() == total_dofs,
- ExcWrongFieldDimension(support_points.size(), total_dofs));
+ Assert (support_points.size() == dofs_per_cell,
+ ExcWrongFieldDimension(support_points.size(), dofs_per_cell));
// compute support points. The first ones
// belong to vertex one, the second ones
// to vertex two, all following are
double FECrissCross<2>::shape_value (const unsigned int i,
const Point<2> &p) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
const double x = p(0),
y = p(1);
inline
Tensor<1,2> FECrissCross<2>::shape_grad (const unsigned int i, const Point<2> &p) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
const double x = p(0),
y = p(1);
FECrissCross<2>::shape_grad_grad (const unsigned int i,
const Point<2> &) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
// second derivatives on the unit cell
// are always zero, at least almost
// everywhere. see the doc for more
template <>
void FECrissCross<2>::get_unit_support_points (vector<Point<2> > &unit_points) const {
- Assert(unit_points.size()==total_dofs,
- ExcWrongFieldDimension (unit_points.size(), total_dofs));
+ Assert(unit_points.size()==dofs_per_cell,
+ ExcWrongFieldDimension (unit_points.size(), dofs_per_cell));
unit_points[0] = Point<2> (0,0);
unit_points[1] = Point<2> (1,0);
vector<Point<2> > &support_points) const {
const unsigned int dim = 2;
- Assert (support_points.size() == total_dofs,
- ExcWrongFieldDimension (support_points.size(), total_dofs));
+ Assert (support_points.size() == dofs_per_cell,
+ ExcWrongFieldDimension (support_points.size(), dofs_per_cell));
// copy vertices
for (unsigned int vertex=0; vertex<GeometryInfo<dim>::vertices_per_cell; ++vertex)
template <>
void FECrissCross<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell,
FullMatrix<double> &mass_matrix) const {
- Assert (mass_matrix.n() == total_dofs,
- ExcWrongFieldDimension(mass_matrix.n(),total_dofs));
- Assert (mass_matrix.m() == total_dofs,
- ExcWrongFieldDimension(mass_matrix.m(),total_dofs));
+ Assert (mass_matrix.n() == dofs_per_cell,
+ ExcWrongFieldDimension(mass_matrix.n(),dofs_per_cell));
+ Assert (mass_matrix.m() == dofs_per_cell,
+ ExcWrongFieldDimension(mass_matrix.m(),dofs_per_cell));
const double x[4] = { cell->vertex(0)(0),
cell->vertex(1)(0),
ExcWrongFieldDimension(jacobians.size(), unit_points.size()));
Assert (q_points.size() == unit_points.size(),
ExcWrongFieldDimension(q_points.size(), unit_points.size()));
- Assert (support_points.size() == total_dofs,
- ExcWrongFieldDimension(support_points.size(), total_dofs));
+ Assert (support_points.size() == dofs_per_cell,
+ ExcWrongFieldDimension(support_points.size(), dofs_per_cell));
unsigned int n_points=unit_points.size();
// N_j(xi_l) be the value of the associated
// basis function at xi_l, then
// x_l(xi_l) = sum_j p_j N_j(xi_l)
- for (unsigned int j=0; j<n_transform_functions; ++j)
+ for (unsigned int j=0; j<n_transform_functions(); ++j)
for (unsigned int l=0; l<n_points; ++l)
q_points[l] += support_points[j] * shape_values_transform(j, l);
};
FEQ3<1>::shape_value (const unsigned int i,
const Point<1> &p) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
const double xi = p(0);
switch (i)
{
FEQ3<1>::shape_grad (const unsigned int i,
const Point<1> &p) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
const double xi = p(0);
// originally, the return type of the
// function was Point<dim>, so we
FEQ3<1>::shape_grad_grad (const unsigned int i,
const Point<1> &p) const
{
- Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
+ Assert (i<dofs_per_cell, ExcIndexRange(i, 0, dofs_per_cell));
const double xi = p(0);
Tensor<2,1> return_value;
template <>
void FEQ3<1>::get_local_mass_matrix (const DoFHandler<1>::cell_iterator &cell,
FullMatrix<double> &local_mass_matrix) const {
- Assert (local_mass_matrix.n() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
- Assert (local_mass_matrix.m() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.m(),total_dofs));
+ Assert (local_mass_matrix.n() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell));
+ Assert (local_mass_matrix.m() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell));
const double h = cell->vertex(1)(0) - cell->vertex(0)(0);
Assert (h>0, ExcJacobiDeterminantHasWrongSign());
FEQ3<2>::shape_value (const unsigned int i,
const Point<2> &p) const
{
- Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
+ Assert (i<dofs_per_cell, ExcIndexRange(i, 0, dofs_per_cell));
const double xi = p(0),
eta= p(1);
FEQ3<2>::shape_grad (const unsigned int i,
const Point<2> &p) const
{
- Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
+ Assert (i<dofs_per_cell, ExcIndexRange(i, 0, dofs_per_cell));
const double xi = p(0),
eta= p(1);
FEQ3<2>::shape_grad_grad (const unsigned int i,
const Point<2> &p) const
{
- Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
+ Assert (i<dofs_per_cell, ExcIndexRange(i, 0, dofs_per_cell));
const double xi = p(0),
eta= p(1);
template <>
void FEQ3<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell,
FullMatrix<double> &local_mass_matrix) const {
- Assert (local_mass_matrix.n() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
- Assert (local_mass_matrix.m() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.m(),total_dofs));
+ Assert (local_mass_matrix.n() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell));
+ Assert (local_mass_matrix.m() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell));
const double x[4] = { cell->vertex(0)(0),
cell->vertex(1)(0),
template <>
void FEQ3<2>::get_unit_support_points (vector<Point<2> > &unit_points) const {
- Assert (unit_points.size() == total_dofs,
- ExcWrongFieldDimension (unit_points.size(), total_dofs));
+ Assert (unit_points.size() == dofs_per_cell,
+ ExcWrongFieldDimension (unit_points.size(), dofs_per_cell));
unit_points[0] = Point<2>(0,0);
unit_points[1] = Point<2>(1,0);
template <>
void FEQ3<2>::get_support_points (const DoFHandler<2>::cell_iterator &cell,
vector<Point<2> > &support_points) const {
- Assert (support_points.size() == total_dofs,
- ExcWrongFieldDimension (support_points.size(), total_dofs));
+ Assert (support_points.size() == dofs_per_cell,
+ ExcWrongFieldDimension (support_points.size(), dofs_per_cell));
const double x[4] = { cell->vertex(0)(0),
cell->vertex(1)(0),
FEQ3<3>::shape_value (const unsigned int i,
const Point<3> &p) const
{
- Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
+ Assert (i<dofs_per_cell, ExcIndexRange(i, 0, dofs_per_cell));
const double xi = p(0),
eta = p(1),
FEQ3<3>::shape_grad (const unsigned int i,
const Point<3> &p) const
{
- Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
+ Assert (i<dofs_per_cell, ExcIndexRange(i, 0, dofs_per_cell));
const double xi = p(0),
eta = p(1),
FEQ3<3>::shape_grad_grad (const unsigned int i,
const Point<3> &p) const
{
- Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
+ Assert (i<dofs_per_cell, ExcIndexRange(i, 0, dofs_per_cell));
const double xi = p(0),
eta = p(1),
FEQ3<3>::get_local_mass_matrix (const DoFHandler<3>::cell_iterator &,
FullMatrix<double> &local_mass_matrix) const
{
- Assert (local_mass_matrix.n() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
- Assert (local_mass_matrix.m() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.m(),total_dofs));
+ Assert (local_mass_matrix.n() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell));
+ Assert (local_mass_matrix.m() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell));
AssertThrow (false, ExcComputationNotUseful(3));
};
template <>
void FEQ3<3>::get_unit_support_points (vector<Point<3> > &unit_points) const {
- Assert (unit_points.size() == total_dofs,
- ExcWrongFieldDimension (unit_points.size(), total_dofs));
+ Assert (unit_points.size() == dofs_per_cell,
+ ExcWrongFieldDimension (unit_points.size(), dofs_per_cell));
unit_points[0] = Point<3>(0, 0, 0);
unit_points[1] = Point<3>(1, 0, 0);
unit_points[2] = Point<3>(1, 0, 1);
template <>
void FEQ3<3>::get_support_points (const typename DoFHandler<3>::cell_iterator &cell,
vector<Point<3> > &support_points) const {
- Assert (support_points.size() == total_dofs,
- ExcWrongFieldDimension (support_points.size(), total_dofs));
+ Assert (support_points.size() == dofs_per_cell,
+ ExcWrongFieldDimension (support_points.size(), dofs_per_cell));
const Point<3> vertices[8] = { cell->vertex(0),
cell->vertex(1),
FEDG_Q0<dim>::shape_value (const unsigned int i,
const Point<dim>&) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
return 1.;
};
FEDG_Q0<dim>::shape_grad (const unsigned int i,
const Point<dim>&) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
return Tensor<1,dim> ();
};
FEDG_Q0<dim>::shape_grad_grad (const unsigned int i,
const Point<dim> &) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
return Tensor<2,dim>();
};
template <int dim>
void FEDG_Q0<dim>::get_local_mass_matrix (const DoFHandler<dim>::cell_iterator &cell,
FullMatrix<double> &local_mass_matrix) const {
- Assert (local_mass_matrix.n() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
- Assert (local_mass_matrix.m() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.m(),total_dofs));
+ Assert (local_mass_matrix.n() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell));
+ Assert (local_mass_matrix.m() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell));
local_mass_matrix(0,0) = cell->measure();
};
template <int dim>
void
FEDG_Q0<dim>::get_unit_support_points (vector<Point<dim> > &unit_points) const {
- Assert (unit_points.size() == total_dofs,
- ExcWrongFieldDimension (unit_points.size(), total_dofs));
+ Assert (unit_points.size() == dofs_per_cell,
+ ExcWrongFieldDimension (unit_points.size(), dofs_per_cell));
for (unsigned int d=0; d<dim; ++d)
unit_points[0](d) = 0.5;
};
void
FEDG_Q0<dim>::get_support_points (const typename DoFHandler<dim>::cell_iterator &cell,
vector<Point<dim> > &support_points) const {
- Assert (support_points.size() == total_dofs,
- ExcWrongFieldDimension (support_points.size(), total_dofs));
+ Assert (support_points.size() == dofs_per_cell,
+ ExcWrongFieldDimension (support_points.size(), dofs_per_cell));
support_points[0] = cell->center();
};
FEQ1<1>::shape_value(const unsigned int i,
const Point<1> &p) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
switch (i)
{
case 0: return 1.-p(0);
FEQ1<1>::shape_grad(const unsigned int i,
const Point<1>&) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
// originally, the return type of the
// function was Point<dim>, so we
// still construct it as that. it should
FEQ1<1>::shape_grad_grad (const unsigned int i,
const Point<1> &) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
// second derivatives on the unit cell
// are always zero
return Tensor<2,1>();
template <>
void FEQ1<1>::get_local_mass_matrix (const DoFHandler<1>::cell_iterator &cell,
FullMatrix<double> &local_mass_matrix) const {
- Assert (local_mass_matrix.n() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
- Assert (local_mass_matrix.m() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.m(),total_dofs));
+ Assert (local_mass_matrix.n() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell));
+ Assert (local_mass_matrix.m() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell));
const double h = cell->vertex(1)(0) - cell->vertex(0)(0);
Assert (h>0, ExcJacobiDeterminantHasWrongSign());
FEQ1<2>::shape_value (const unsigned int i,
const Point<2>& p) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
switch (i)
{
case 0: return (1.-p(0)) * (1.-p(1));
FEQ1<2>::shape_grad (const unsigned int i,
const Point<2>& p) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
// originally, the return type of the
// function was Point<dim>, so we
// still construct it as that. it should
FEQ1<2>::shape_grad_grad (const unsigned int i,
const Point<2> &) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
switch (i)
{
template <>
void FEQ1<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell,
FullMatrix<double> &local_mass_matrix) const {
- Assert (local_mass_matrix.n() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
- Assert (local_mass_matrix.m() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.m(),total_dofs));
+ Assert (local_mass_matrix.n() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell));
+ Assert (local_mass_matrix.m() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell));
/* Get the computation of the local mass matrix by these lines in maple:
template <>
void FEQ1<2>::get_unit_support_points (vector<Point<2> > &unit_points) const {
- Assert (unit_points.size() == total_dofs,
- ExcWrongFieldDimension (unit_points.size(), total_dofs));
+ Assert (unit_points.size() == dofs_per_cell,
+ ExcWrongFieldDimension (unit_points.size(), dofs_per_cell));
unit_points[0] = Point<2> (0,0);
unit_points[1] = Point<2> (1,0);
FEQ1<3>::shape_value (const unsigned int i,
const Point<3>& p) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
switch (i)
{
case 0: return 1.0-p(0)+(-1.0+p(0))*p(1)+(-1.0+p(0)+(1.0-p(0))*p(1))*p(2);
FEQ1<3>::shape_grad (const unsigned int i,
const Point<3>& p) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
// originally, the return type of the
// function was Point<dim>, so we
// still construct it as that. it should
FEQ1<3>::shape_grad_grad (const unsigned int i,
const Point<3> &p) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
Tensor<2,3> return_value;
template <>
void FEQ1<3>::get_local_mass_matrix (const DoFHandler<3>::cell_iterator &,
FullMatrix<double> &local_mass_matrix) const {
- Assert (local_mass_matrix.n() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
- Assert (local_mass_matrix.m() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.m(),total_dofs));
+ Assert (local_mass_matrix.n() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell));
+ Assert (local_mass_matrix.m() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell));
AssertThrow (false, ExcComputationNotUseful(3));
};
template <>
void FEQ1<3>::get_unit_support_points (vector<Point<3> > &unit_points) const {
- Assert (unit_points.size() == total_dofs,
- ExcWrongFieldDimension (unit_points.size(), total_dofs));
+ Assert (unit_points.size() == dofs_per_cell,
+ ExcWrongFieldDimension (unit_points.size(), dofs_per_cell));
unit_points[0] = Point<3> (0,0,0);
unit_points[1] = Point<3> (1,0,0);
void
FEQ1<dim>::get_support_points (const typename DoFHandler<dim>::cell_iterator &cell,
vector<Point<dim> > &support_points) const {
- Assert (support_points.size() == total_dofs,
- ExcWrongFieldDimension (support_points.size(), total_dofs));
+ Assert (support_points.size() == dofs_per_cell,
+ ExcWrongFieldDimension (support_points.size(), dofs_per_cell));
for (unsigned int vertex=0; vertex<GeometryInfo<dim>::vertices_per_cell; ++vertex)
support_points[vertex] = cell->vertex(vertex);
FEQ2<1>::shape_value(const unsigned int i,
const Point<1> &p) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
const double xi = p(0);
switch (i)
{
FEQ2<1>::shape_grad(const unsigned int i,
const Point<1> &p) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
const double xi = p(0);
// originally, the return type of the
// function was Point<dim>, so we
FEQ2<1>::shape_grad_grad (const unsigned int i,
const Point<1> &) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
Tensor<2,1> return_value;
switch (i)
template <>
void FEQ2<1>::get_local_mass_matrix (const DoFHandler<1>::cell_iterator &cell,
FullMatrix<double> &local_mass_matrix) const {
- Assert (local_mass_matrix.n() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
- Assert (local_mass_matrix.m() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.m(),total_dofs));
+ Assert (local_mass_matrix.n() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell));
+ Assert (local_mass_matrix.m() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell));
const double h = cell->vertex(1)(0) - cell->vertex(0)(0);
Assert (h>0, ExcJacobiDeterminantHasWrongSign());
FEQ2<2>::shape_value (const unsigned int i,
const Point<2> &p) const
{
- Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
+ Assert (i<dofs_per_cell, ExcIndexRange(i, 0, dofs_per_cell));
const double xi = p(0),
eta= p(1);
FEQ2<2>::shape_grad (const unsigned int i,
const Point<2> &p) const
{
- Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
+ Assert (i<dofs_per_cell, ExcIndexRange(i, 0, dofs_per_cell));
const double xi = p(0),
eta= p(1);
FEQ2<2>::shape_grad_grad (const unsigned int i,
const Point<2> &p) const
{
- Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
+ Assert (i<dofs_per_cell, ExcIndexRange(i, 0, dofs_per_cell));
const double xi = p(0),
eta= p(1);
template <>
void FEQ2<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell,
FullMatrix<double> &local_mass_matrix) const {
- Assert (local_mass_matrix.n() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
- Assert (local_mass_matrix.m() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.m(),total_dofs));
+ Assert (local_mass_matrix.n() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell));
+ Assert (local_mass_matrix.m() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell));
/* Get the computation of the local mass matrix by these lines in maple. Note
that tphi[i] are the basis function of the linear finite element, which
template <>
void FEQ2<2>::get_unit_support_points (vector<Point<2> > &unit_points) const {
- Assert (unit_points.size() == total_dofs,
- ExcWrongFieldDimension (unit_points.size(), total_dofs));
+ Assert (unit_points.size() == dofs_per_cell,
+ ExcWrongFieldDimension (unit_points.size(), dofs_per_cell));
unit_points[0] = Point<2> (0,0);
unit_points[1] = Point<2> (1,0);
template <>
void FEQ2<2>::get_support_points (const DoFHandler<2>::cell_iterator &cell,
vector<Point<2> > &support_points) const {
- Assert (support_points.size() == total_dofs,
- ExcWrongFieldDimension (support_points.size(), total_dofs));
+ Assert (support_points.size() == dofs_per_cell,
+ ExcWrongFieldDimension (support_points.size(), dofs_per_cell));
for (unsigned int vertex=0; vertex<4; ++vertex)
support_points[vertex] = cell->vertex(vertex);
FEQ2<3>::shape_value (const unsigned int i,
const Point<3> &p) const
{
- Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
+ Assert (i<dofs_per_cell, ExcIndexRange(i, 0, dofs_per_cell));
const double xi = p(0),
eta = p(1),
FEQ2<3>::shape_grad (const unsigned int i,
const Point<3> &p) const
{
- Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
+ Assert (i<dofs_per_cell, ExcIndexRange(i, 0, dofs_per_cell));
const double xi = p(0),
eta = p(1),
FEQ2<3>::shape_grad_grad (const unsigned int i,
const Point<3> &p) const
{
- Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
+ Assert (i<dofs_per_cell, ExcIndexRange(i, 0, dofs_per_cell));
const double xi = p(0),
eta = p(1),
template <>
void FEQ2<3>::get_local_mass_matrix (const DoFHandler<3>::cell_iterator &,
FullMatrix<double> &local_mass_matrix) const {
- Assert (local_mass_matrix.n() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
- Assert (local_mass_matrix.m() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.m(),total_dofs));
+ Assert (local_mass_matrix.n() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell));
+ Assert (local_mass_matrix.m() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell));
AssertThrow (false, ExcComputationNotUseful(3));
};
template <>
void FEQ2<3>::get_unit_support_points (vector<Point<3> > &unit_points) const {
- Assert (unit_points.size() == total_dofs,
- ExcWrongFieldDimension (unit_points.size(), total_dofs));
+ Assert (unit_points.size() == dofs_per_cell,
+ ExcWrongFieldDimension (unit_points.size(), dofs_per_cell));
unit_points[0] = Point<3>(0, 0, 0);
unit_points[1] = Point<3>(1, 0, 0);
template <>
void FEQ2<3>::get_support_points (const DoFHandler<3>::cell_iterator &cell,
vector<Point<3> > &support_points) const {
- Assert (support_points.size() == total_dofs,
- ExcWrongFieldDimension (support_points.size(), total_dofs));
+ Assert (support_points.size() == dofs_per_cell,
+ ExcWrongFieldDimension (support_points.size(), dofs_per_cell));
const Point<3> vertices[8] = { cell->vertex(0),
cell->vertex(1),
FEQ4<1>::shape_value(const unsigned int i,
const Point<1> &p) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
const double xi = p(0);
switch (i)
{
FEQ4<1>::shape_grad(const unsigned int i,
const Point<1> &p) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
const double xi = p(0);
// originally, the return type of the
// function was Point<dim>, so we
FEQ4<1>::shape_grad_grad (const unsigned int i,
const Point<1> &p) const
{
- Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
+ Assert (i<dofs_per_cell, ExcIndexRange(i, 0, dofs_per_cell));
const double xi = p(0);
Tensor<2,1> return_value;
template <>
void FEQ4<1>::get_local_mass_matrix (const DoFHandler<1>::cell_iterator &cell,
FullMatrix<double> &local_mass_matrix) const {
- Assert (local_mass_matrix.n() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
- Assert (local_mass_matrix.m() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.m(),total_dofs));
+ Assert (local_mass_matrix.n() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell));
+ Assert (local_mass_matrix.m() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell));
const double h = cell->vertex(1)(0) - cell->vertex(0)(0);
Assert (h>0, ExcJacobiDeterminantHasWrongSign());
FEQ4<2>::shape_value (const unsigned int i,
const Point<2> &p) const
{
- Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
+ Assert (i<dofs_per_cell, ExcIndexRange(i, 0, dofs_per_cell));
const double xi = p(0),
eta= p(1);
FEQ4<2>::shape_grad (const unsigned int i,
const Point<2> &p) const
{
- Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
+ Assert (i<dofs_per_cell, ExcIndexRange(i, 0, dofs_per_cell));
const double xi = p(0),
eta= p(1);
FEQ4<2>::shape_grad_grad (const unsigned int i,
const Point<2> &p) const
{
- Assert (i<total_dofs, ExcIndexRange(i, 0, total_dofs));
+ Assert (i<dofs_per_cell, ExcIndexRange(i, 0, dofs_per_cell));
const double xi = p(0),
eta= p(1);
template <>
void FEQ4<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell,
FullMatrix<double> &local_mass_matrix) const {
- Assert (local_mass_matrix.n() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
- Assert (local_mass_matrix.m() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.m(),total_dofs));
+ Assert (local_mass_matrix.n() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell));
+ Assert (local_mass_matrix.m() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell));
const double x[4] = { cell->vertex(0)(0),
cell->vertex(1)(0),
template <>
void FEQ4<2>::get_unit_support_points (vector<Point<2> > &unit_points) const {
- Assert (unit_points.size() == total_dofs,
- ExcWrongFieldDimension (unit_points.size(), total_dofs));
+ Assert (unit_points.size() == dofs_per_cell,
+ ExcWrongFieldDimension (unit_points.size(), dofs_per_cell));
unit_points[0] = Point<2>(0,0);
unit_points[1] = Point<2>(1,0);
template <>
void FEQ4<2>::get_support_points (const DoFHandler<2>::cell_iterator &cell,
vector<Point<2> > &support_points) const {
- Assert (support_points.size() == total_dofs,
- ExcWrongFieldDimension (support_points.size(), total_dofs));
+ Assert (support_points.size() == dofs_per_cell,
+ ExcWrongFieldDimension (support_points.size(), dofs_per_cell));
const double x[4] = { cell->vertex(0)(0),
cell->vertex(1)(0),
// Initialize mapping from components to
// linear index. Fortunately, this is
// the inverse of what we just did.
- for (unsigned int comp=0 ; comp<n_components ; ++comp)
+ for (unsigned int comp=0 ; comp<n_components() ; ++comp)
component_to_system_table[comp]
- .resize(base_element(component_to_base_table[comp]).total_dofs);
+ .resize(base_element(component_to_base_table[comp]).dofs_per_cell);
- for (unsigned int sys=0 ; sys < total_dofs ; ++sys)
+ for (unsigned int sys=0 ; sys < dofs_per_cell ; ++sys)
component_to_system_table[system_to_component_table[sys].first]
[system_to_component_table[sys].second] = sys;
}
// Initialize mapping from components to
// linear index. Fortunately, this is
// the inverse of what we just did.
- for (unsigned comp=0 ; comp<n_components ; ++comp)
+ for (unsigned comp=0 ; comp<n_components() ; ++comp)
face_component_to_system_table[comp]
- .resize(base_element(component_to_base_table[comp]).total_dofs);
+ .resize(base_element(component_to_base_table[comp]).dofs_per_cell);
for (unsigned sys=0 ; sys < dofs_per_face ; ++sys)
face_component_to_system_table[face_system_to_component_table[sys].first]
// distribute the matrices of the base
// finite elements to the matrices of
// this object
- for (unsigned int component=0; component<n_components; ++component)
+ for (unsigned int component=0; component<n_components(); ++component)
// transform restriction and
// prolongation matrices
- for (unsigned int i=0; i<base_element(component_to_base_table[component]).total_dofs; ++i)
- for (unsigned int j=0; j<base_element(component_to_base_table[component]).total_dofs; ++j)
+ for (unsigned int i=0; i<base_element(component_to_base_table[component]).dofs_per_cell; ++i)
+ for (unsigned int j=0; j<base_element(component_to_base_table[component]).dofs_per_cell; ++j)
// only fill block diagonals, no
// intermixing of subelements
for (unsigned int child=0; child<GeometryInfo<dim>::children_per_cell; ++child)
{
return FiniteElementData<1> (fe_data.dofs_per_vertex * N,
fe_data.dofs_per_line * N,
- fe_data.n_transform_functions,
- fe_data.n_components * N);
+ fe_data.n_transform_functions(),
+ fe_data.n_components() * N);
};
{
return FiniteElementData<1> (fe1.dofs_per_vertex * N1 + fe2.dofs_per_vertex * N2 ,
fe1.dofs_per_line * N1 + fe2.dofs_per_line * N2 ,
- fe1.n_transform_functions,
- fe1.n_components * N1 + fe2.n_components * N2 );
+ fe1.n_transform_functions(),
+ fe1.n_components() * N1 + fe2.n_components() * N2 );
};
fe1.dofs_per_line * N1
+ fe2.dofs_per_line * N2
+ fe3.dofs_per_line * N3,
- fe1.n_transform_functions,
- fe1.n_components * N1
- + fe2.n_components * N2
- + fe3.n_components * N3);
+ fe1.n_transform_functions(),
+ fe1.n_components() * N1
+ + fe2.n_components() * N2
+ + fe3.n_components() * N3);
};
#endif
return FiniteElementData<2> (fe_data.dofs_per_vertex * N,
fe_data.dofs_per_line * N,
fe_data.dofs_per_quad * N,
- fe_data.n_transform_functions,
- fe_data.n_components * N);
+ fe_data.n_transform_functions(),
+ fe_data.n_components() * N);
};
template <>
return FiniteElementData<2> (fe1.dofs_per_vertex * N1 + fe2.dofs_per_vertex * N2 ,
fe1.dofs_per_line * N1 + fe2.dofs_per_line * N2 ,
fe1.dofs_per_quad * N1 + fe2.dofs_per_quad * N2 ,
- fe1.n_transform_functions,
- fe1.n_components * N1 + fe2.n_components * N2 );
+ fe1.n_transform_functions(),
+ fe1.n_components() * N1 + fe2.n_components() * N2 );
};
fe1.dofs_per_quad * N1
+ fe2.dofs_per_quad * N2
+ fe3.dofs_per_quad * N3 ,
- fe1.n_transform_functions,
- fe1.n_components * N1
- + fe2.n_components * N2
- + fe3.n_components * N3 );
+ fe1.n_transform_functions(),
+ fe1.n_components() * N1
+ + fe2.n_components() * N2
+ + fe3.n_components() * N3 );
};
#endif
fe_data.dofs_per_line * N,
fe_data.dofs_per_quad * N,
fe_data.dofs_per_hex * N,
- fe_data.n_transform_functions,
- fe_data.n_components * N);
+ fe_data.n_transform_functions(),
+ fe_data.n_components() * N);
};
template <>
fe1.dofs_per_line * N1 + fe2.dofs_per_line * N2 ,
fe1.dofs_per_quad * N1 + fe2.dofs_per_quad * N2 ,
fe1.dofs_per_hex * N1 + fe2.dofs_per_hex * N2 ,
- fe1.n_transform_functions,
- fe1.n_components * N1 + fe2.n_components * N2 );
+ fe1.n_transform_functions(),
+ fe1.n_components() * N1 + fe2.n_components() * N2 );
};
fe1.dofs_per_hex * N1
+ fe2.dofs_per_hex * N2
+ fe3.dofs_per_hex * N3 ,
- fe1.n_transform_functions,
- fe1.n_components * N1
- + fe2.n_components * N2
- + fe3.n_components * N3 );
+ fe1.n_transform_functions(),
+ fe1.n_components() * N1
+ + fe2.n_components() * N2
+ + fe3.n_components() * N3 );
};
#endif
{
vector<bool> tmp;
for (unsigned int i=0; i<n_elements; ++i)
- for (unsigned int component=0; component<fe.n_components; ++component)
+ for (unsigned int component=0; component<fe.n_components(); ++component)
tmp.push_back (fe.restriction_is_additive (component));
return tmp;
};
{
vector<bool> tmp;
for (unsigned int i=0; i<N1; ++i)
- for (unsigned int component=0; component<fe1.n_components; ++component)
+ for (unsigned int component=0; component<fe1.n_components(); ++component)
tmp.push_back (fe1.restriction_is_additive (component));
for (unsigned int i=0; i<N2; ++i)
- for (unsigned int component=0; component<fe2.n_components; ++component)
+ for (unsigned int component=0; component<fe2.n_components(); ++component)
tmp.push_back (fe2.restriction_is_additive (component));
return tmp;
};
{
vector<bool> tmp;
for (unsigned int i=0; i<N1; ++i)
- for (unsigned int component=0; component<fe1.n_components; ++component)
+ for (unsigned int component=0; component<fe1.n_components(); ++component)
tmp.push_back (fe1.restriction_is_additive (component));
for (unsigned int i=0; i<N2; ++i)
- for (unsigned int component=0; component<fe2.n_components; ++component)
+ for (unsigned int component=0; component<fe2.n_components(); ++component)
tmp.push_back (fe2.restriction_is_additive (component));
for (unsigned int i=0; i<N3; ++i)
- for (unsigned int component=0; component<fe3.n_components; ++component)
+ for (unsigned int component=0; component<fe3.n_components(); ++component)
tmp.push_back (fe3.restriction_is_additive (component));
return tmp;
};
FESystem<dim>::shape_value (const unsigned int i,
const Point<dim> &p) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
pair<unsigned,unsigned> comp = system_to_component_index(i);
FESystem<dim>::shape_grad (const unsigned int i,
const Point<dim> &p) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
pair<unsigned,unsigned> comp = system_to_component_index(i);
FESystem<dim>::shape_grad_grad (const unsigned int i,
const Point<dim> &p) const
{
- Assert((i<total_dofs), ExcIndexRange(i, 0, total_dofs));
+ Assert((i<dofs_per_cell), ExcIndexRange(i, 0, dofs_per_cell));
pair<unsigned,unsigned> comp = system_to_component_index(i);
void FESystem<dim>::get_unit_support_points (
vector<Point<dim> > &unit_support_points) const
{
- Assert(unit_support_points.size() == total_dofs,
- ExcWrongFieldDimension (unit_support_points.size(), total_dofs));
+ Assert(unit_support_points.size() == dofs_per_cell,
+ ExcWrongFieldDimension (unit_support_points.size(), dofs_per_cell));
- vector<Point<dim> > base_unit_support_points (base_element(0).total_dofs);
+ vector<Point<dim> > base_unit_support_points (base_element(0).dofs_per_cell);
unsigned int component = 0;
for (unsigned int base_el=0 ; base_el<n_base_elements(); ++base_el)
{
- const unsigned int base_element_total_dofs
- =base_element(base_el).total_dofs;
+ const unsigned int base_element_dofs_per_cell
+ =base_element(base_el).dofs_per_cell;
- base_unit_support_points.resize(base_element_total_dofs);
+ base_unit_support_points.resize(base_element_dofs_per_cell);
base_element(base_el).get_unit_support_points (base_unit_support_points);
for (unsigned int n = 0 ; n < element_multiplicity(base_el); ++n)
{
- for (unsigned int i=0; i<base_element_total_dofs; ++i)
+ for (unsigned int i=0; i<base_element_dofs_per_cell; ++i)
{
unit_support_points[component_to_system_index(component,i)]
= base_unit_support_points[i];
// vector<vector<Point<dim> > > base_us_points(n_base_elements());
// for (unsigned int base_el=0 ; base_el<n_base_elements(); ++base_el)
// {
-// const unsigned int base_element_total_dofs
-// =base_element(base_el).total_dofs;
+// const unsigned int base_element_dofs_per_cell
+// =base_element(base_el).dofs_per_cell;
-// base_us_points[base_el].resize(base_element_total_dofs);
+// base_us_points[base_el].resize(base_element_dofs_per_cell);
// base_element(base_el).get_unit_support_points (base_us_points[base_el]);
// }
-// for (unsigned int i=0; i<total_dofs; ++i)
+// for (unsigned int i=0; i<dofs_per_cell; ++i)
// {
// const unsigned int comp=system_to_component_index(i).first,
// base_dof=system_to_component_index(i).second,
void FESystem<dim>::get_support_points (const DoFHandler<dim>::cell_iterator &cell,
vector<Point<dim> > &support_points) const
{
- Assert(support_points.size() == total_dofs,
- ExcWrongFieldDimension (support_points.size(), total_dofs));
+ Assert(support_points.size() == dofs_per_cell,
+ ExcWrongFieldDimension (support_points.size(), dofs_per_cell));
- vector<Point<dim> > base_support_points (base_element(0).total_dofs);
+ vector<Point<dim> > base_support_points (base_element(0).dofs_per_cell);
unsigned int component = 0;
for (unsigned int base_el=0 ; base_el<n_base_elements(); ++base_el)
{
- const unsigned int base_element_total_dofs
- =base_element(base_el).total_dofs;
+ const unsigned int base_element_dofs_per_cell
+ =base_element(base_el).dofs_per_cell;
- base_support_points.resize(base_element_total_dofs);
+ base_support_points.resize(base_element_dofs_per_cell);
base_element(base_el).get_support_points (cell, base_support_points);
for (unsigned int n = 0 ; n < element_multiplicity(base_el); ++n)
{
- for (unsigned int i=0; i<base_element_total_dofs; ++i)
+ for (unsigned int i=0; i<base_element_dofs_per_cell; ++i)
{
support_points[component_to_system_index(component,i)]
= base_support_points[i];
void FESystem<dim>::get_local_mass_matrix (const DoFHandler<dim>::cell_iterator &cell,
FullMatrix<double> &local_mass_matrix) const
{
- Assert (local_mass_matrix.n() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.n(),total_dofs));
- Assert (local_mass_matrix.m() == total_dofs,
- ExcWrongFieldDimension(local_mass_matrix.m(),total_dofs));
+ Assert (local_mass_matrix.n() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.n(),dofs_per_cell));
+ Assert (local_mass_matrix.m() == dofs_per_cell,
+ ExcWrongFieldDimension(local_mass_matrix.m(),dofs_per_cell));
// track which component we are
// presently working with, since we
{
// first get the local mass matrix for
// the base object
- const unsigned int base_element_total_dofs=base_element(base_el).total_dofs;
- FullMatrix<double> base_mass_matrix (base_element_total_dofs,
- base_element_total_dofs);
+ const unsigned int base_element_dofs_per_cell=base_element(base_el).dofs_per_cell;
+ FullMatrix<double> base_mass_matrix (base_element_dofs_per_cell,
+ base_element_dofs_per_cell);
base_element(base_el).get_local_mass_matrix (cell, base_mass_matrix);
// now distribute it to the mass matrix
const unsigned int el_multiplicity=element_multiplicity(base_el);
for (unsigned int n=0; n<el_multiplicity; ++n)
{
- for (unsigned int i=0; i<base_element_total_dofs; ++i)
- for (unsigned int j=0; j<base_element_total_dofs; ++j)
+ for (unsigned int i=0; i<base_element_dofs_per_cell; ++i)
+ for (unsigned int j=0; j<base_element_dofs_per_cell; ++j)
// only fill diagonals of the blocks
local_mass_matrix (component_to_system_index(component,i),
component_to_system_index(component,j))
++component;
};
};
- Assert (component == n_components, ExcInternalError());
+ Assert (component == n_components(), ExcInternalError());
};
const FullMatrix<double> &shape_values_transform,
const vector<vector<Tensor<1,dim> > > &shape_grad_transform) const
{
- vector<Point<dim> > supp(base_elements[0].first->total_dofs);
+ vector<Point<dim> > supp(base_elements[0].first->dofs_per_cell);
base_elements[0].first->fill_fe_values (cell, unit_points, jacobians, compute_jacobians,
jacobians_grad, compute_jacobians_grad,
for (unsigned m=0 ; m < element_multiplicity(0) ; ++ m)
{
- for (unsigned i=0 ; i < base_element(0).total_dofs ; ++i)
+ for (unsigned i=0 ; i < base_element(0).dofs_per_cell ; ++i)
support_points[component_to_system_index(component,i)] = supp[i];
++component;
}
for (unsigned base=1 ; base < n_base_elements() ; ++base)
{
- supp.resize(base_elements[base].first->total_dofs);
+ supp.resize(base_elements[base].first->dofs_per_cell);
base_elements[base].first->fill_fe_values (cell, unit_points, jacobians, false,
jacobians_grad, false,
supp, true,
for (unsigned m=0 ; m < element_multiplicity(base) ; ++ m)
{
- for (unsigned i=0 ; i < base_element(base).total_dofs ; ++i)
+ for (unsigned i=0 ; i < base_element(base).dofs_per_cell ; ++i)
support_points[component_to_system_index(component,i)] = supp[i];
++component;
}
template <int dim>
FEValuesBase<dim>::FEValuesBase (const unsigned int n_q_points,
const unsigned int n_support_points,
- const unsigned int total_dofs,
+ const unsigned int dofs_per_cell,
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 (total_dofs),
+ dofs_per_cell (dofs_per_cell),
n_transform_functions (n_transform_functions),
- shape_values (n_values_arrays, FullMatrix<double>(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)),
+ shape_values (n_values_arrays, FullMatrix<double>(dofs_per_cell, n_q_points)),
+ shape_gradients (dofs_per_cell, vector<Tensor<1,dim> >(n_q_points)),
+ shape_2nd_derivatives (dofs_per_cell, 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>()),
void FEValuesBase<dim>::get_function_values (const Vector<double> &fe_function,
vector<double> &values) const
{
- Assert (fe->n_components == 1,
+ Assert (fe->n_components() == 1,
ExcWrongNoOfComponents());
Assert (selected_dataset<shape_values.size(),
ExcIndexRange (selected_dataset, 0, shape_values.size()));
// get function values of dofs
// on this cell
- Vector<double> dof_values (total_dofs);
+ Vector<double> dof_values (dofs_per_cell);
if (present_cell->active())
present_cell->get_dof_values (fe_function, dof_values);
else
// add up contributions of trial
// functions
for (unsigned int point=0; point<n_quadrature_points; ++point)
- for (unsigned int shape_func=0; shape_func<total_dofs; ++shape_func)
+ for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
values[point] += (dof_values(shape_func) *
shape_values[selected_dataset](shape_func, point));
};
Assert (selected_dataset<shape_values.size(),
ExcIndexRange (selected_dataset, 0, shape_values.size()));
for (unsigned i=0;i<values.size();++i)
- Assert (values[i].size() == fe->n_components,
+ Assert (values[i].size() == fe->n_components(),
ExcWrongNoOfComponents());
// get function values of dofs
// on this cell
- Vector<double> dof_values (total_dofs);
+ Vector<double> dof_values (dofs_per_cell);
if (present_cell->active())
present_cell->get_dof_values (fe_function, dof_values);
else
// add up contributions of trial
// functions
for (unsigned int point=0; point<n_quadrature_points; ++point)
- for (unsigned int shape_func=0; shape_func<total_dofs; ++shape_func)
+ for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
values[point](fe->system_to_component_index(shape_func).first)
+= (dof_values(shape_func) * shape_values[selected_dataset](shape_func, point));
};
void FEValuesBase<dim>::get_function_grads (const Vector<double> &fe_function,
vector<Tensor<1,dim> > &gradients) const
{
- Assert (fe->n_components == 1,
+ Assert (fe->n_components() == 1,
ExcWrongNoOfComponents());
Assert (gradients.size() == n_quadrature_points,
ExcWrongVectorSize(gradients.size(), n_quadrature_points));
// get function values of dofs
// on this cell
- Vector<double> dof_values (total_dofs);
+ Vector<double> dof_values (dofs_per_cell);
if (present_cell->active())
present_cell->get_dof_values (fe_function, dof_values);
else
// add up contributions of trial
// functions
for (unsigned int point=0; point<n_quadrature_points; ++point)
- for (unsigned int shape_func=0; shape_func<total_dofs; ++shape_func)
+ for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
{
Tensor<1,dim> tmp(shape_gradients[shape_func][point]);
tmp *= dof_values(shape_func);
Assert (selected_dataset<shape_values.size(),
ExcIndexRange (selected_dataset, 0, shape_values.size()));
for (unsigned i=0;i<gradients.size();++i)
- Assert (gradients[i].size() == fe->n_components,
- ExcWrongVectorSize(gradients[i].size(), fe->n_components));
+ Assert (gradients[i].size() == fe->n_components(),
+ ExcWrongVectorSize(gradients[i].size(), fe->n_components()));
// get function values of dofs
// on this cell
- Vector<double> dof_values (total_dofs);
+ Vector<double> dof_values (dofs_per_cell);
if (present_cell->active())
present_cell->get_dof_values (fe_function, dof_values);
else
// add up contributions of trial
// functions
for (unsigned int point=0; point<n_quadrature_points; ++point)
- for (unsigned int shape_func=0; shape_func<total_dofs; ++shape_func)
+ for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
{
Tensor<1,dim> tmp(shape_gradients[shape_func][point]);
tmp *= dof_values(shape_func);
void FEValuesBase<dim>::get_function_2nd_derivatives (const Vector<double> &fe_function,
vector<Tensor<2,dim> > &second_derivatives) const
{
- Assert (fe->n_components == 1,
+ Assert (fe->n_components() == 1,
ExcWrongNoOfComponents());
Assert (second_derivatives.size() == n_quadrature_points,
ExcWrongVectorSize(second_derivatives.size(), n_quadrature_points));
// get function values of dofs
// on this cell
- Vector<double> dof_values (total_dofs);
+ Vector<double> dof_values (dofs_per_cell);
if (present_cell->active())
present_cell->get_dof_values (fe_function, dof_values);
else
// add up contributions of trial
// functions
for (unsigned int point=0; point<n_quadrature_points; ++point)
- for (unsigned int shape_func=0; shape_func<total_dofs; ++shape_func)
+ for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
{
Tensor<2,dim> tmp(shape_2nd_derivatives[shape_func][point]);
tmp *= dof_values(shape_func);
const UpdateFlags update_flags)
:
FEValuesBase<dim> (quadrature.n_quadrature_points,
- fe.total_dofs,
- fe.total_dofs,
- fe.n_transform_functions,
+ fe.dofs_per_cell,
+ fe.dofs_per_cell,
+ fe.transform_functions,
1,
update_flags,
fe),
- unit_shape_gradients(fe.total_dofs,
+ unit_shape_gradients(fe.dofs_per_cell,
vector<Tensor<1,dim> >(quadrature.n_quadrature_points)),
- unit_shape_2nd_derivatives(fe.total_dofs,
+ unit_shape_2nd_derivatives(fe.dofs_per_cell,
vector<Tensor<2,dim> >(quadrature.n_quadrature_points)),
- unit_shape_gradients_transform(fe.n_transform_functions,
+ unit_shape_gradients_transform(fe.n_transform_functions(),
vector<Tensor<1,dim> >(quadrature.n_quadrature_points)),
unit_quadrature_points(quadrature.get_quad_points())
{
Assert ((update_flags & update_normal_vectors) == false,
ExcInvalidUpdateFlag());
- for (unsigned int i=0; i<fe.total_dofs; ++i)
+ for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
for (unsigned int j=0; j<n_quadrature_points; ++j)
{
shape_values[0](i,j) = fe.shape_value(i, unit_quadrature_points[j]);
// compute gradients on real element if
// requested
if (update_flags & update_gradients)
- for (unsigned int i=0; i<fe->total_dofs; ++i)
+ for (unsigned int i=0; i<fe->dofs_per_cell; ++i)
for (unsigned int j=0; j<n_quadrature_points; ++j)
for (unsigned int s=0; s<dim; ++s)
{
Tensor<2,dim> tmp1, tmp2;
if (update_flags & update_second_derivatives)
- for (unsigned int i=0; i<fe->total_dofs; ++i)
+ for (unsigned int i=0; i<fe->dofs_per_cell; ++i)
for (unsigned int j=0; j<n_quadrature_points; ++j)
{
// tmp1 := (d_k d_l phi) J_lj
template <int dim>
FEFaceValuesBase<dim>::FEFaceValuesBase (const unsigned int n_q_points,
const unsigned int n_support_points,
- const unsigned int total_dofs,
+ const unsigned int dofs_per_cell,
const unsigned int n_transform_functions,
const unsigned int n_faces_or_subfaces,
const UpdateFlags update_flags,
:
FEValuesBase<dim> (n_q_points,
n_support_points,
- total_dofs,
+ dofs_per_cell,
n_transform_functions,
n_faces_or_subfaces,
update_flags,
fe),
unit_shape_gradients (n_faces_or_subfaces,
- vector<vector<Tensor<1,dim> > >(total_dofs,
+ vector<vector<Tensor<1,dim> > >(dofs_per_cell,
vector<Tensor<1,dim> >(n_q_points))),
unit_shape_2nd_derivatives(n_faces_or_subfaces,
- vector<vector<Tensor<2,dim> > >(total_dofs,
+ vector<vector<Tensor<2,dim> > >(dofs_per_cell,
vector<Tensor<2,dim> >(n_q_points))),
unit_shape_gradients_transform (n_faces_or_subfaces,
vector<vector<Tensor<1,dim> > >(n_transform_functions,
:
FEFaceValuesBase<dim> (quadrature.n_quadrature_points,
fe.dofs_per_face,
- fe.total_dofs,
- fe.n_transform_functions,
+ fe.dofs_per_cell,
+ fe.n_transform_functions(),
GeometryInfo<dim>::faces_per_cell,
update_flags,
fe)
for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
QProjector<dim>::project_to_face (quadrature, face, unit_quadrature_points[face]);
- for (unsigned int i=0; i<fe.total_dofs; ++i)
+ for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
for (unsigned int j=0; j<n_quadrature_points; ++j)
for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
{
// compute gradients on real element if
// requested
if (update_flags & update_gradients)
- for (unsigned int i=0; i<fe->total_dofs; ++i)
+ for (unsigned int i=0; i<fe->dofs_per_cell; ++i)
{
fill_n (shape_gradients[i].begin(),
n_quadrature_points,
Tensor<2,dim> tmp1, tmp2;
if (update_flags & update_second_derivatives)
- for (unsigned int i=0; i<fe->total_dofs; ++i)
+ for (unsigned int i=0; i<fe->dofs_per_cell; ++i)
for (unsigned int j=0; j<n_quadrature_points; ++j)
{
// tmp1 := (d_k d_l phi) J_lj
:
FEFaceValuesBase<dim> (quadrature.n_quadrature_points,
0,
- fe.total_dofs,
- fe.n_transform_functions,
+ fe.dofs_per_cell,
+ fe.n_transform_functions(),
GeometryInfo<dim>::faces_per_cell * GeometryInfo<dim>::subfaces_per_face,
update_flags,
fe)
face, subface,
unit_quadrature_points[face*(1<<(dim-1))+subface]);
- for (unsigned int i=0; i<fe.total_dofs; ++i)
+ for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
for (unsigned int j=0; j<n_quadrature_points; ++j)
for (unsigned int face=0; face<GeometryInfo<dim>::faces_per_cell; ++face)
for (unsigned int subface=0; subface<GeometryInfo<dim>::subfaces_per_face; ++subface)
// compute gradients on real element if
// requested
if (update_flags & update_gradients)
- for (unsigned int i=0; i<fe->total_dofs; ++i)
+ for (unsigned int i=0; i<fe->dofs_per_cell; ++i)
{
fill_n (shape_gradients[i].begin(),
n_quadrature_points,
Tensor<2,dim> tmp1, tmp2;
if (update_flags & update_second_derivatives)
- for (unsigned int i=0; i<fe->total_dofs; ++i)
+ for (unsigned int i=0; i<fe->dofs_per_cell; ++i)
for (unsigned int j=0; j<n_quadrature_points; ++j)
{
// tmp1 := (d_k d_l phi) J_lj
ExcWrongFieldDimension(jacobians_grad.size(), unit_points.size()));
Assert ((!compute_q_points) || (q_points.size() == unit_points.size()),
ExcWrongFieldDimension(q_points.size(), unit_points.size()));
- Assert ((!compute_support_points) || (support_points.size() == total_dofs),
- ExcWrongFieldDimension(support_points.size(), total_dofs));
+ Assert ((!compute_support_points) || (support_points.size() == dofs_per_cell),
+ ExcWrongFieldDimension(support_points.size(), dofs_per_cell));
unsigned int n_points=unit_points.size();
Assert (dof_handler != 0, DoFAccessor<1>::DoFAccessor<1>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<1>::DoFAccessor<1>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<1>::DoFAccessor<1>::ExcInvalidObject());
- Assert (dof_values.size() == dof_handler->get_fe().total_dofs,
+ Assert (dof_values.size() == dof_handler->get_fe().dofs_per_cell,
ExcVectorDoesNotMatch());
Assert (values.size() == dof_handler->n_dofs(),
ExcVectorDoesNotMatch());
Assert (dof_handler != 0, DoFAccessor<2>::ExcInvalidObject());
Assert (mg_dof_handler != 0, DoFAccessor<2>::ExcInvalidObject());
Assert (&dof_handler->get_fe() != 0, DoFAccessor<2>::ExcInvalidObject());
- Assert (dof_values.size() == dof_handler->get_fe().total_dofs,
+ Assert (dof_values.size() == dof_handler->get_fe().dofs_per_cell,
DoFAccessor<2>::ExcVectorDoesNotMatch());
Assert (values.size() == mg_dof_handler->n_dofs(present_level),
DoFAccessor<2>::ExcVectorDoesNotMatch());
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 dofs_per_cell = selected_fe->dofs_per_cell;
+ vector<int> dofs_on_this_cell(dofs_per_cell);
cell_iterator cell = begin(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<dofs_per_cell; ++i)
+ for (unsigned int j=0; j<dofs_per_cell; ++j)
sparsity.add (dofs_on_this_cell[i],
dofs_on_this_cell[j]);
};
void MGTransferPrebuilt::build_matrices (const MGDoFHandler<dim> &mg_dof)
{
const unsigned int n_levels = mg_dof.get_tria().n_levels();
- const unsigned int dofs_per_cell = mg_dof.get_fe().total_dofs;
+ const unsigned int dofs_per_cell = mg_dof.get_fe().dofs_per_cell;
// reset the size of the array of
// matrices
const int index,
const AssemblerData *local_data) :
DoFCellAccessor<dim> (tria,level,index, &local_data->dof),
- cell_matrix (dof_handler->get_fe().total_dofs),
- cell_vector (Vector<double>(dof_handler->get_fe().total_dofs)),
+ cell_matrix (dof_handler->get_fe().dofs_per_cell),
+ cell_vector (Vector<double>(dof_handler->get_fe().dofs_per_cell)),
assemble_matrix (local_data->assemble_matrix),
assemble_rhs (local_data->assemble_rhs),
matrix(local_data->matrix),
void Assembler<dim>::assemble (const Equation<dim> &equation) {
// re-init fe values for this cell
fe_values.reinit (DoFHandler<dim>::cell_iterator (*this));
- const unsigned int n_dofs = dof_handler->get_fe().total_dofs;
+ const unsigned int n_dofs = dof_handler->get_fe().dofs_per_cell;
if (assemble_matrix)
cell_matrix.clear ();
vector< vector <Vector<double> > >
values (dof_data.size(),
vector< Vector<double> >(points.n_quadrature_points,
- Vector<double>(dofs->get_fe().n_components
+ Vector<double>(dofs->get_fe().n_components()
)));
unsigned int cell_index=0;
Point<dim> pt = fe.quadrature_point(supp_pt);
out << pt << " ";
for (unsigned int i=0; i!=dof_data.size(); ++i)
- for (unsigned int j=0; j < dofs->get_fe().n_components; ++j)
+ for (unsigned int j=0; j < dofs->get_fe().n_components(); ++j)
out << values[i][supp_pt](j)
<< ' ';
for (unsigned int i=0; i<cell_data.size(); ++i)
out << pt << " ";
for (unsigned int i=0; i!=dof_data.size(); ++i)
- for (unsigned int j=0; j < dofs->get_fe().n_components; ++j)
+ for (unsigned int j=0; j < dofs->get_fe().n_components(); ++j)
out << values[i][supp_pt](j)
<< ' ';
for (unsigned int i=0; i<cell_data.size(); ++i)
out << pt << " ";
for (unsigned int i=0; i!=dof_data.size(); ++i)
- for (unsigned int j=0; j < dofs->get_fe().n_components; ++j)
+ for (unsigned int j=0; j < dofs->get_fe().n_components(); ++j)
out << values[i][supp_pt](j)
<< ' ';
for (unsigned int i=0; i<cell_data.size(); ++i)
(names.size() == 1))
||
((vec.size() == dofs->n_dofs()) &&
- (names.size() == dofs->get_fe().n_components)),
- ExcInvalidNumberOfNames (names.size(), dofs->get_fe().n_components));
+ (names.size() == dofs->get_fe().n_components())),
+ ExcInvalidNumberOfNames (names.size(), dofs->get_fe().n_components()));
for (unsigned int i=0; i<names.size(); ++i)
Assert (names[i].find_first_not_of("abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
{
Assert (dofs != 0, ExcNoDoFHandlerSelected());
- const unsigned int n_components = dofs->get_fe().n_components;
+ const unsigned int n_components = dofs->get_fe().n_components();
const unsigned int n_datasets = dof_data.size() * n_components +
cell_data.size();
(names.size() == 1))
||
((vec.size() == dof_handler->n_dofs()) &&
- (names.size() == dof_handler->get_fe().n_components)),
- ExcInvalidNumberOfNames (names.size(), dof_handler->get_fe().n_components));
+ (names.size() == dof_handler->get_fe().n_components())),
+ ExcInvalidNumberOfNames (names.size(), dof_handler->get_fe().n_components()));
for (unsigned int i=0; i<names.size(); ++i)
Assert (names[i].find_first_not_of("abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Assert (dof_handler != 0, ExcNoDoFHandlerSelected());
- const unsigned int n_components = dof_handler->get_fe().n_components;
+ const unsigned int n_components = dof_handler->get_fe().n_components();
const unsigned int n_datasets = dof_data.size() * n_components +
cell_data.size();
const vector<bool> &component_mask_,
const Function<1> *coefficient)
{
- const unsigned int n_components = dof.get_fe().n_components;
+ const unsigned int n_components = dof.get_fe().n_components();
// if no mask given: treat all components
vector<bool> component_mask ((component_mask_.size() == 0) ?
const vector<bool> &component_mask_,
const Function<dim> *coefficient)
{
- const unsigned int n_components = dof.get_fe().n_components;
+ const unsigned int n_components = dof.get_fe().n_components();
// if no mask given: treat all components
vector<bool> component_mask ((component_mask_.size() == 0) ?
SparseMatrix<double> &matrix) {
const FiniteElement<dim> &fe = dof.get_fe();
- const unsigned int dofs_per_cell = fe.total_dofs;
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
FullMatrix<double> local_mass_matrix (dofs_per_cell, dofs_per_cell);
vector<int> dofs_on_this_cell (dofs_per_cell);
vector<int> &dof_to_boundary_mapping,
const Function<dim> *a) {
const FiniteElement<dim> &fe = dof.get_fe();
- const unsigned int n_components = fe.n_components;
+ const unsigned int n_components = fe.n_components();
const bool fe_is_system = (n_components != 1);
Assert (matrix.n() == dof.n_boundary_dofs(rhs), ExcInternalError());
Assert (n_components == rhs.begin()->second->n_components,
ExcComponentMismatch());
- const unsigned int dofs_per_cell = fe.total_dofs,
+ const unsigned int dofs_per_cell = fe.dofs_per_cell,
dofs_per_face = fe.dofs_per_face;
FullMatrix<double> cell_matrix(dofs_per_cell, dofs_per_cell);
a->vector_value_list (fe_values.get_quadrature_points(),
coefficient_values_system);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
- for (unsigned int i=0; i<fe_values.total_dofs; ++i)
+ for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
{
- for (unsigned int j=0; j<fe_values.total_dofs; ++j)
+ for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
if (fe.system_to_component_index(i).first ==
fe.system_to_component_index(j).first)
{
}
else
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
- for (unsigned int i=0; i<fe_values.total_dofs; ++i)
+ for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
{
- for (unsigned int j=0; j<fe_values.total_dofs; ++j)
+ for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
if (fe.system_to_component_index(i).first ==
fe.system_to_component_index(j).first)
{
a->value_list (fe_values.get_quadrature_points(),
coefficient_values_scalar);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
- for (unsigned int i=0; i<fe_values.total_dofs; ++i)
+ for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
{
- for (unsigned int j=0; j<fe_values.total_dofs; ++j)
+ for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
cell_matrix(i,j) += (values(i,point) *
values(j,point) *
weights[point] *
}
else
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
- for (unsigned int i=0; i<fe_values.total_dofs; ++i)
+ for (unsigned int i=0; i<fe_values.dofs_per_cell; ++i)
{
- for (unsigned int j=0; j<fe_values.total_dofs; ++j)
+ for (unsigned int j=0; j<fe_values.dofs_per_cell; ++j)
cell_matrix(i,j) += (values(i,point) *
values(j,point) *
weights[point]);
const Quadrature<dim> &q,
SparseMatrix<double> &matrix,
const Function<dim> * const a) {
- const unsigned int n_components = dof.get_fe().n_components;
+ const unsigned int n_components = dof.get_fe().n_components();
Assert ((n_components==1) || (a==0), ExcNotImplemented());
Vector<double> dummy; // no entries, should give an error if accessed
Vector<double> &rhs_vector,
const Function<dim> * const a)
{
- const unsigned int n_components = dof.get_fe().n_components;
+ const unsigned int n_components = dof.get_fe().n_components();
Assert ((n_components==1) || (a==0), ExcNotImplemented());
UpdateFlags update_flags = UpdateFlags(update_q_points |
void MassMatrix<dim>::assemble (FullMatrix<double> &cell_matrix,
const FEValues<dim> &fe_values,
const typename DoFHandler<dim>::cell_iterator &) const {
- const unsigned int dofs_per_cell = fe_values.total_dofs,
+ const unsigned int dofs_per_cell = fe_values.dofs_per_cell,
n_q_points = fe_values.n_quadrature_points;
const FiniteElement<dim> &fe = fe_values.get_fe();
- const unsigned int n_components = fe.n_components;
+ const unsigned int n_components = fe.n_components();
Assert (cell_matrix.n() == dofs_per_cell,
Equation<dim>::ExcWrongSize(cell_matrix.n(), dofs_per_cell));
const DoFHandler<dim>::cell_iterator &) const {
Assert (right_hand_side != 0, ExcNoRHSSelected());
- const unsigned int dofs_per_cell = fe_values.total_dofs,
+ const unsigned int dofs_per_cell = fe_values.dofs_per_cell,
n_q_points = fe_values.n_quadrature_points;
const FiniteElement<dim> &fe = fe_values.get_fe();
- const unsigned int n_components = fe.n_components;
+ const unsigned int n_components = fe.n_components();
// for system elements: not
// implemented at present
const DoFHandler<dim>::cell_iterator &) const {
Assert (right_hand_side != 0, ExcNoRHSSelected());
- const unsigned int dofs_per_cell = fe_values.total_dofs,
+ const unsigned int dofs_per_cell = fe_values.dofs_per_cell,
n_q_points = fe_values.n_quadrature_points;
const FiniteElement<dim> &fe = fe_values.get_fe();
- const unsigned int n_components = fe.n_components;
+ const unsigned int n_components = fe.n_components();
// for system elements: not
// implemented at present
const DoFHandler<dim>::cell_iterator &) const {
Assert (right_hand_side != 0, ExcNoRHSSelected());
- const unsigned int dofs_per_cell = fe_values.total_dofs,
+ const unsigned int dofs_per_cell = fe_values.dofs_per_cell,
n_q_points = fe_values.n_quadrature_points;
const FiniteElement<dim> &fe = fe_values.get_fe();
- const unsigned int n_components = fe.n_components;
+ const unsigned int n_components = fe.n_components();
// for system elements: might be
// not so useful, not implemented
void LaplaceMatrix<dim>::assemble (FullMatrix<double> &cell_matrix,
const FEValues<dim> &fe_values,
const DoFHandler<dim>::cell_iterator &) const {
- const unsigned int dofs_per_cell = fe_values.total_dofs,
+ const unsigned int dofs_per_cell = fe_values.dofs_per_cell,
n_q_points = fe_values.n_quadrature_points;
const FiniteElement<dim> &fe = fe_values.get_fe();
- const unsigned int n_components = fe.n_components;
+ const unsigned int n_components = fe.n_components();
// for system elements: might be
// not so useful, not implemented
const DoFHandler<dim>::cell_iterator &) const {
Assert (right_hand_side != 0, ExcNoRHSSelected());
- const unsigned int dofs_per_cell = fe_values.total_dofs,
+ const unsigned int dofs_per_cell = fe_values.dofs_per_cell,
n_q_points = fe_values.n_quadrature_points;
const FiniteElement<dim> &fe = fe_values.get_fe();
- const unsigned int n_components = fe.n_components;
+ const unsigned int n_components = fe.n_components();
// for system elements: might be
// not so useful, not implemented
const FiniteElement<dim> &low,
FullMatrix<double>& result)
{
- Assert (high.n_components == low.n_components,
+ Assert (high.n_components() == low.n_components(),
ExcInvalidFE());
- result.reinit (low.total_dofs, high.total_dofs);
+ result.reinit (low.dofs_per_cell, high.dofs_per_cell);
// Initialize FEValues at the support points
// of the low element.
- vector<double> phantom_weights(low.total_dofs,1.);
- vector<Point<dim> > support_points(low.total_dofs);
+ vector<double> phantom_weights(low.dofs_per_cell,1.);
+ vector<Point<dim> > support_points(low.dofs_per_cell);
low.get_unit_support_points(support_points);
Quadrature<dim> low_points(support_points,
phantom_weights);
FEValues<dim> fe(high, low_points, UpdateFlags(0));
- for (unsigned int i=0; i<low.total_dofs; ++i)
- for (unsigned int j=0; j<high.total_dofs; ++j)
+ for (unsigned int i=0; i<low.dofs_per_cell; ++i)
+ for (unsigned int j=0; j<high.dofs_per_cell; ++j)
// shape functions need to belong
// to the same component
if (low.system_to_component_index(i).first ==
void MGTransferPrebuilt::build_matrices (const MGDoFHandler<dim> &mg_dof)
{
const unsigned int n_levels = mg_dof.get_tria().n_levels();
- const unsigned int dofs_per_cell = mg_dof.get_fe().total_dofs;
+ const unsigned int dofs_per_cell = mg_dof.get_fe().dofs_per_cell;
// reset the size of the array of
// matrices
clear();
const unsigned int n_active_cells = dof_handler->get_tria().n_active_cells();
- const unsigned int dofs_per_cell = dof_handler->get_fe().total_dofs;
+ const unsigned int dofs_per_cell = dof_handler->get_fe().dofs_per_cell;
n_dofs_old=dof_handler->n_dofs();
indices_on_cell=vector<vector<int> > (n_active_cells,
Assert(out.size()==dof_handler->n_dofs(),
ExcWrongVectorSize(out.size(),dof_handler->n_dofs()));
- unsigned int dofs_per_cell=dof_handler->get_fe().total_dofs;
+ unsigned int dofs_per_cell=dof_handler->get_fe().dofs_per_cell;
Vector<number> local_values(dofs_per_cell);
DoFHandler<dim>::cell_iterator cell = dof_handler->begin(),
clear();
const unsigned int n_active_cells = dof_handler->get_tria().n_active_cells();
- const unsigned int dofs_per_cell = dof_handler->get_fe().total_dofs;
+ const unsigned int dofs_per_cell = dof_handler->get_fe().dofs_per_cell;
n_dofs_old=dof_handler->n_dofs();
for (unsigned int i=0; i<in_size; ++i)
};
- const unsigned int dofs_per_cell=dof_handler->get_fe().total_dofs;
+ const unsigned int dofs_per_cell=dof_handler->get_fe().dofs_per_cell;
Vector<number> local_values(dofs_per_cell);
vector<int> *indexptr;
const Function<dim> &function,
Vector<double> &vec)
{
- Assert (dof.get_fe().n_components == function.n_components,
+ Assert (dof.get_fe().n_components() == function.n_components,
ExcComponentMismatch());
const FiniteElement<dim> &fe = dof.get_fe();
- const unsigned int n_components = fe.n_components;
+ const unsigned int n_components = fe.n_components();
const bool fe_is_system = (n_components != 1);
DoFHandler<dim>::active_cell_iterator cell = dof.begin_active(),
// avoided to evaluate
// the vectorfunction multiply at
// the same point on a cell.
- vector<Point<dim> > unit_support_points (fe.total_dofs);
+ vector<Point<dim> > unit_support_points (fe.dofs_per_cell);
fe.get_unit_support_points(unit_support_points);
// The following works well
// support point by setting
// #true# in the boolean vector
// #is_representative_point#.
-// vector<bool> is_representative_point(fe.total_dofs, false);
+// vector<bool> is_representative_point(fe.dofs_per_cell, false);
// is_representative_point[0]=true;
// unsigned int n_rep_points=1;
-// for (unsigned int last_rep_point=0, i=1; i<fe.total_dofs; ++i)
+// for (unsigned int last_rep_point=0, i=1; i<fe.dofs_per_cell; ++i)
// {
// if (unit_support_points[i] != unit_support_points[last_rep_point])
// {
// }
// };
-// vector<int> dofs_on_cell (fe.total_dofs);
-// vector<Point<dim> > support_points (fe.total_dofs);
+// vector<int> dofs_on_cell (fe.dofs_per_cell);
+// vector<Point<dim> > support_points (fe.dofs_per_cell);
// vector<Point<dim> > rep_points (n_rep_points);
// vector<Vector<double> > function_values_at_rep_points (
-// n_rep_points, Vector<double>(fe.n_components));
+// n_rep_points, Vector<double>(fe.n_components()));
// for (; cell!=endc; ++cell)
// {
// // pick out the representative
// // support points
// unsigned int j=0;
-// for (unsigned int i=0; i<fe.total_dofs; ++i)
+// for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
// if (is_representative_point[i])
// rep_points[j++]=support_points[i];
// Assert(j == n_rep_points, ExcInternalError());
// // therefore the first #last_rep_point# is 0
// // and we need to start with
// // `last_rep_point = -1'
-// for (unsigned int i=0; i<fe.total_dofs; ++i)
+// for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
// {
// if (is_representative_point[i])
// ++last_rep_point;
// point by the #dof_to_rep_dof_table#.
// the following vector collects all dofs i,
- // 0<=i<fe.total_dofs, for that
+ // 0<=i<fe.dofs_per_cell, for that
// unit_support_points[i]
// is a representative one. i.e.
// the following vector collects all rep dofs.
// to the rep index.
vector<unsigned int> dof_to_rep_index_table;
unsigned int n_rep_points=0;
- for (unsigned int i=0; i<fe.total_dofs; ++i)
+ for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
{
bool representative=true;
// the following loop is looped
// the other way round to get
// the minimal effort of
- // O(fe.total_dofs) for multiple
+ // O(fe.dofs_per_cell) for multiple
// support points that are placed
// one after the other.
for (unsigned int j=dofs_of_rep_points.size(); j>0; --j)
}
}
Assert(dofs_of_rep_points.size()==n_rep_points, ExcInternalError());
- Assert(dof_to_rep_index_table.size()==fe.total_dofs, ExcInternalError());
+ Assert(dof_to_rep_index_table.size()==fe.dofs_per_cell, ExcInternalError());
- vector<int> dofs_on_cell (fe.total_dofs);
- vector<Point<dim> > support_points (fe.total_dofs);
+ vector<int> dofs_on_cell (fe.dofs_per_cell);
+ vector<Point<dim> > support_points (fe.dofs_per_cell);
vector<Point<dim> > rep_points (n_rep_points);
// more efficient one respectively
vector<double> function_values_scalar (n_rep_points);
vector<Vector<double> > function_values_system (n_rep_points,
- Vector<double>(fe.n_components));
+ Vector<double>(fe.n_components()));
for (; cell!=endc; ++cell)
{
// distribute the function
// values to the global
// vector
- for (unsigned int i=0; i<fe.total_dofs; ++i)
+ for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
{
const unsigned int component
= fe.system_to_component_index(i).first;
// distribute the function
// values to the global
// vector
- for (unsigned int i=0; i<fe.total_dofs; ++i)
+ for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
vec(dofs_on_cell[i])
= function_values_scalar[dof_to_rep_index_table[i]];
};
const Vector<double> &high,
Vector<double> &low)
{
- Vector<double> cell_high(high_dof.get_fe().total_dofs);
- Vector<double> cell_low(low_dof.get_fe().total_dofs);
+ Vector<double> cell_high(high_dof.get_fe().dofs_per_cell);
+ Vector<double> cell_low(low_dof.get_fe().dofs_per_cell);
DoFHandler<dim>::active_cell_iterator h = high_dof.begin_active();
DoFHandler<dim>::active_cell_iterator l = low_dof.begin_active();
const Quadrature<dim-1> &q_boundary,
const bool project_to_boundary_first)
{
- Assert (dof.get_fe().n_components == function.n_components,
+ Assert (dof.get_fe().n_components() == function.n_components,
ExcInvalidFE());
const FiniteElement<dim> &fe = dof.get_fe();
const Function<dim> &rhs,
Vector<double> &rhs_vector)
{
- Assert (dof.get_fe().n_components == rhs.n_components,
+ Assert (dof.get_fe().n_components() == rhs.n_components,
ExcComponentMismatch());
UpdateFlags update_flags = UpdateFlags(update_q_points |
ExcInvalidBoundaryIndicator());
const FiniteElement<1> &fe = dof.get_fe();
- Assert (fe.n_components == boundary_function.n_components,
+ Assert (fe.n_components() == boundary_function.n_components,
ExcComponentMismatch());
- Assert (fe.dofs_per_vertex == fe.n_components,
+ Assert (fe.dofs_per_vertex == fe.n_components(),
ExcComponentMismatch());
// set the component mask to either
// the original value or a vector
// of #true#s
const vector<bool> component_mask ((component_mask_.size() == 0) ?
- vector<bool> (fe.n_components, true) :
+ vector<bool> (fe.n_components(), true) :
component_mask_);
Assert (count(component_mask.begin(), component_mask.end(), true) > 0,
ExcComponentMismatch());
ExcInvalidBoundaryIndicator());
const FiniteElement<dim> &fe = dof.get_fe();
- const unsigned int n_components = fe.n_components;
+ const unsigned int n_components = fe.n_components();
const bool fe_is_system = (n_components != 1);
Assert (n_components == boundary_function.n_components,
// the original value or a vector
// of #true#s
const vector<bool> component_mask ((component_mask_.size() == 0) ?
- vector<bool> (fe.n_components, true) :
+ vector<bool> (fe.n_components(), true) :
component_mask_);
Assert (count(component_mask.begin(), component_mask.end(), true) > 0,
ExcComponentMismatch());
// respectively
vector<double> dof_values_scalar (fe.dofs_per_face);
vector<Vector<double> > dof_values_system (fe.dofs_per_face,
- Vector<double>(fe.n_components));
+ Vector<double>(fe.n_components()));
DoFHandler<dim>::active_face_iterator face = dof.begin_active_face(),
endf = dof.end_face();
const Quadrature<dim-1> &q,
map<int,double> &boundary_values)
{
- Assert (dof.get_fe().n_components == boundary_functions.begin()->second->n_components,
+ Assert (dof.get_fe().n_components() == boundary_functions.begin()->second->n_components,
ExcComponentMismatch());
vector<int> dof_to_boundary_mapping;
{
const unsigned int n_q_points = q.n_quadrature_points;
const FiniteElement<dim> &fe = dof.get_fe();
- const unsigned int n_components = fe.n_components;
+ const unsigned int n_components = fe.n_components();
const bool fe_is_system = (n_components != 1);
Assert( !((n_components == 1) && (norm == mean)),
%.target : %
@echo ============================ Executing Testcase: $<
@./$< > $(subst testcase,output,$<)
+ @diff $(subst testcase,output,$<) $(subst testcase,expect,$<)
# this is the main target
# make dependence so that it first wants to compile all files then
// DoFHandler<dim>::active_cell_iterator cell = dof.begin_active();
DoFHandler<dim>::active_face_iterator face = dof.begin_active_face();
- vector<Point<dim> > unit_points(fe.total_dofs);
- vector<Point<dim> > support_points(fe.total_dofs);
+ vector<Point<dim> > unit_points(fe.dofs_per_cell);
+ vector<Point<dim> > support_points(fe.dofs_per_cell);
vector<Point<dim> > face_support_points(fe.dofs_per_face);
// fe.get_unit_support_points(unit_points);
// fe.get_support_points(cell, boundary, support_points);
fe.get_face_support_points(face, face_support_points);
- deallog << "total_dofs" << " " << fe.total_dofs;
+ deallog << "dofs_per_cell" << " " << fe.dofs_per_cell;
deallog << ": vertex" << " " << fe.dofs_per_vertex;
deallog << " line" << " " << fe.dofs_per_line;
deallog << " quad" << " " <<fe.dofs_per_quad << endl;
- deallog << "n_transform_fct " << fe.n_transform_functions << endl;
- deallog << "n_components " << fe.n_components << endl;
+ deallog << "n_transform_fct " << fe.n_transform_functions() << endl;
+ deallog << "n_components " << fe.n_components() << endl;
deallog.push("components");
- for (unsigned i=0;i<fe.total_dofs;++i)
+ for (unsigned i=0;i<fe.dofs_per_cell;++i)
{
pair<unsigned,unsigned> p = fe.system_to_component_index(i);
deallog << "Index " << i << " ("
const Quadrature<dim>& quadrature,
const Function<dim>& rhs)
{
- const unsigned int fe_dofs = dof.get_fe().total_dofs;
+ const unsigned int fe_dofs = dof.get_fe().n_dofs_per_cell();
FEValues<dim> fe(dof.get_fe(), quadrature,
UpdateFlags(update_gradients | update_JxW_values |
update_q_points));
const MGDoFHandler<dim>& dof,
const Quadrature<dim>& quadrature)
{
- const unsigned int fe_dofs = dof.get_fe().total_dofs;
+ const unsigned int fe_dofs = dof.get_fe().n_dofs_per_cell();
FEValues<dim> fe(dof.get_fe(), quadrature,
UpdateFlags(update_gradients | update_JxW_values |
update_q_points));
MGDoFHandler<2>::cell_iterator cell;
MGDoFHandler<2>::cell_iterator endc = dofs.end(level);
- Vector<double> values(dofs.get_fe().total_dofs);
+ Vector<double> values(dofs.get_fe().dofs_per_cell);
unsigned int cell_index=0;
for (cell=dofs.begin(level); cell!=endc; ++cell, ++cell_index)
Vector<double> &final_v_bar) const {
const double y_offset = 300000000;
const double n_q_points = quadrature->n_quadrature_points;
- const unsigned int total_dofs = fe->total_dofs;
+ const unsigned int dofs_per_cell = fe->dofs_per_cell;
final_u_bar.reinit (dof->n_dofs());
final_v_bar.reinit (dof->n_dofs());
FEValues<dim> fe_values_primal (*primal_fe, *quadrature,
update_gradients);
- FullMatrix<double> cell_matrix (total_dofs, total_dofs);
+ FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
vector<Tensor<1,dim> > local_u_grad (n_q_points);
vector<double> local_v (n_q_points);
vector<double> density_values(quadrature->n_quadrature_points);
vector<double> stiffness_values(quadrature->n_quadrature_points);
- vector<int> cell_dof_indices (total_dofs);
+ vector<int> cell_dof_indices (dofs_per_cell);
for (; cell!=endc; ++cell, ++primal_cell)
{
const FullMatrix<double> &shape_values = fe_values.get_shape_values ();
const vector<double> &JxW_values (fe_values.get_JxW_values());
- vector<double> local_functional1 (total_dofs, 0);
- vector<double> local_functional2 (total_dofs, 0);
- for (unsigned int shape_func=0; shape_func<total_dofs; ++shape_func)
+ vector<double> local_functional1 (dofs_per_cell, 0);
+ 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] *
};
cell->get_dof_indices (cell_dof_indices);
- for (unsigned int shape_func=0; shape_func<total_dofs; ++shape_func)
+ for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
{
final_u_bar(cell_dof_indices[shape_func]) += local_functional1[shape_func];
final_v_bar(cell_dof_indices[shape_func]) += local_functional2[shape_func];
Vector<double> &j2) {
const double y_offset = 1.0;
const unsigned int n_q_points = quadrature_face->n_quadrature_points;
- const unsigned int total_dofs = fe->total_dofs;
+ const unsigned int dofs_per_cell = fe->dofs_per_cell;
j1.reinit (dof->n_dofs());
j2.reinit (dof->n_dofs());
cell = dof->begin_active();
endc = dof->end();
- vector<int> cell_dof_indices (total_dofs);
+ vector<int> cell_dof_indices (dofs_per_cell);
FEFaceValues<dim> fe_face_values (*fe, *quadrature_face,
UpdateFlags(update_JxW_values |
// \int w(x,t) phi_i(x,y,t) ds
// through this line for each
// of the basis functions
- vector<double> local_integral (total_dofs, 0);
- for (unsigned int shape_func=0; shape_func<total_dofs; ++shape_func)
+ 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) *
(EvaluateSeismicSignal<dim>
JxW_values[point];
cell->get_dof_indices (cell_dof_indices);
- for (unsigned int shape_func=0; shape_func<total_dofs; ++shape_func)
+ for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
j1(cell_dof_indices[shape_func]) += local_integral[shape_func];
};
};
template <int dim>
void SplitSignal<dim>::compute_functionals (Vector<double> &j1,
Vector<double> &j2) {
- const unsigned int total_dofs = fe->total_dofs;
+ const unsigned int dofs_per_cell = fe->dofs_per_cell;
const unsigned int n_q_points = quadrature_face->n_quadrature_points;
j1.reinit (dof->n_dofs());
cell = dof->begin_active();
endc = dof->end();
- vector<int> dof_indices (fe->total_dofs);
+ vector<int> dof_indices (fe->dofs_per_cell);
FEFaceValues<dim> fe_face_values (*fe, *quadrature_face, update_JxW_values);
for (; cell!=endc; ++cell)
const vector<double> &JxW_values = fe_face_values.get_JxW_values();
cell->get_dof_indices (dof_indices);
- for (unsigned int i=0; i<total_dofs; ++i)
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
{
double sum=0;
for (unsigned int j=0; j<n_q_points; ++j)
const unsigned int dim = 1;
const double n_q_points = quadrature->n_quadrature_points;
- const unsigned int total_dofs = fe->total_dofs;
+ const unsigned int dofs_per_cell = fe->dofs_per_cell;
final_u_bar.reinit (dof->n_dofs());
final_v_bar.reinit (dof->n_dofs());
endc = dof->end ();
FEValues<dim> fe_values (*fe, *quadrature, update_JxW_values);
- vector<int> cell_dof_indices (total_dofs);
+ vector<int> cell_dof_indices (dofs_per_cell);
for (; cell!=endc; ++cell)
{
const FullMatrix<double> &shape_values = fe_values.get_shape_values ();
const vector<double> &JxW_values (fe_values.get_JxW_values());
- vector<double> local_functional (total_dofs, 0);
- for (unsigned int shape_func=0; shape_func<total_dofs; ++shape_func)
+ 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];
cell->get_dof_indices (cell_dof_indices);
- for (unsigned int shape_func=0; shape_func<total_dofs; ++shape_func)
+ for (unsigned int shape_func=0; shape_func<dofs_per_cell; ++shape_func)
final_u_bar(cell_dof_indices[shape_func]) += local_functional[shape_func];
};
};
template <int dim>
void OneBranch1d<dim>::compute_functionals (Vector<double> &j1,
Vector<double> &j2) {
- const unsigned int total_dofs = fe->total_dofs;
+ const unsigned int dofs_per_cell = fe->dofs_per_cell;
const unsigned int n_q_points = quadrature->n_quadrature_points;
j1.reinit (dof->n_dofs());
cell = dof->begin_active();
endc = dof->end();
- vector<int> dof_indices (fe->total_dofs);
+ vector<int> dof_indices (fe->dofs_per_cell);
FEValues<dim> fe_values (*fe, *quadrature, update_JxW_values);
for (; cell!=endc; ++cell)
const vector<double> &JxW_values = fe_values.get_JxW_values();
cell->get_dof_indices (dof_indices);
- for (unsigned int i=0; i<total_dofs; ++i)
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
{
double sum=0;
for (unsigned int j=0; j<n_q_points; ++j)
template <int dim>
void SecondCrossing<dim>::compute_functionals (Vector<double> &j1,
Vector<double> &j2) {
- const unsigned int total_dofs = fe->total_dofs;
+ const unsigned int dofs_per_cell = fe->dofs_per_cell;
const unsigned int n_q_points = quadrature->n_quadrature_points;
j1.reinit (dof->n_dofs());
cell = dof->begin_active();
endc = dof->end();
- vector<int> dof_indices (fe->total_dofs);
+ vector<int> dof_indices (fe->dofs_per_cell);
FEValues<dim> fe_values (*fe, *quadrature, update_JxW_values);
for (; cell!=endc; ++cell)
const vector<double> &JxW_values = fe_values.get_JxW_values();
cell->get_dof_indices (dof_indices);
- for (unsigned int i=0; i<total_dofs; ++i)
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
{
double sum=0;
for (unsigned int j=0; j<n_q_points; ++j)
UpdateFlags(update_gradients |
update_JxW_values |
update_q_points));
- FullMatrix<double> cell_matrix (fe->total_dofs, fe->total_dofs);
- Vector<double> local_u (fe->total_dofs);
- Vector<double> local_v (fe->total_dofs);
+ FullMatrix<double> cell_matrix (fe->dofs_per_cell, fe->dofs_per_cell);
+ Vector<double> local_u (fe->dofs_per_cell);
+ Vector<double> local_v (fe->dofs_per_cell);
vector<double> density_values(quadrature->n_quadrature_points);
vector<double> stiffness_values(quadrature->n_quadrature_points);
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<fe->total_dofs; ++i)
- for (unsigned int j=0; j<fe->total_dofs; ++j)
+ 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] *
stiffness->value_list (fe_values.get_quadrature_points(),
stiffness_values);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
- for (unsigned int i=0; i<fe->total_dofs; ++i)
- for (unsigned int j=0; j<fe->total_dofs; ++j)
+ 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] *
endc = dof->end();
double u_integrated=0;
FEValues<1> fe_values (*fe, *quadrature, update_JxW_values);
- vector<double> cell_u (fe->total_dofs);
+ vector<double> cell_u (fe->dofs_per_cell);
for (; cell!=endc; ++cell)
if ((cell->center()(0) > -0.6) &&
endc = dof->end();
double u_integrated=0;
FEValues<1> fe_values (*fe, *quadrature, UpdateFlags(update_JxW_values | update_q_points));
- vector<double> cell_u (fe->total_dofs);
+ vector<double> cell_u (fe->dofs_per_cell);
for (; cell!=endc; ++cell)
if ((cell->center()(0) > -0.03) &&
mass_matrix.reinit (system_sparsity);
// now actually assemble the matrices
- const unsigned int total_dofs = fe.total_dofs,
+ const unsigned int dofs_per_cell = fe.dofs_per_cell,
n_q_points = quadrature.n_quadrature_points;
const bool density_constant = parameters.density_constant,
// indices of all the dofs on this
// cell
- vector<int> dof_indices_on_cell (total_dofs);
- FullMatrix<double> cell_mass_matrix (total_dofs, total_dofs);
- FullMatrix<double> cell_laplace_matrix (total_dofs, total_dofs);
+ vector<int> dof_indices_on_cell (dofs_per_cell);
+ FullMatrix<double> cell_mass_matrix (dofs_per_cell, dofs_per_cell);
+ FullMatrix<double> cell_laplace_matrix (dofs_per_cell, dofs_per_cell);
for (typename DoFHandler<dim>::active_cell_iterator cell=dof_handler->begin_active();
// now do the loop
for (unsigned int q_point=0; q_point<fe_values.n_quadrature_points; ++q_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_mass_matrix(i,j) += (shape_values(i, q_point) *
shape_values(j, q_point) *
};
// now transfer to global matrices
- 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)
{
mass_matrix.add(dof_indices_on_cell[i],
dof_indices_on_cell[j],
{
// get values from
// old cell and set on the new one
- Vector<double> cell_data (fe.total_dofs);
+ Vector<double> cell_data (fe.dofs_per_cell);
old_cell->get_interpolated_dof_values (old_grid_u, cell_data);
new_cell->set_dof_values_by_interpolation (cell_data, old_u);
const TimeStep_Dual<dim> &previous_time_level
= static_cast<const TimeStepBase_Wave<dim>*>(next_timestep)->get_timestep_dual();
- const unsigned int total_dofs = fe.total_dofs;
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
const double time_step = get_forward_timestep();
// both cells are on the same refinement
const vector<vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
const vector<double> &weights = fe_values.get_JxW_values ();
- FullMatrix<double> cell_matrix (total_dofs, total_dofs);
+ FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
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<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) += (values(i,point) *
values(j,point)) *
weights[point] *
density_values[point];
- Vector<double> tmp (total_dofs);
+ Vector<double> tmp (dofs_per_cell);
// this is the right hand side of the
// first equation
// for the theta scheme:
// rhs1 := Mv^1 + kMu^1
// -(1-theta)theta k^2 Av^1
- Vector<double> rhs1 (total_dofs);
+ Vector<double> rhs1 (dofs_per_cell);
// this is the part of the right hand side
// of the second equation which depends
// step.
// for the theta scheme:
// rhs2 := Mu^1-(1-theta)kAv^1
- Vector<double> rhs2 (total_dofs);
+ Vector<double> rhs2 (dofs_per_cell);
// vector of values of the function on the
// old grid restricted to one cell
- Vector<double> old_dof_values_v (total_dofs);
+ Vector<double> old_dof_values_v (dofs_per_cell);
// vector of old u and v times the local
// mass matrix
- Vector<double> local_M_u (total_dofs);
- Vector<double> local_M_v (total_dofs);
- Vector<double> local_A_v (total_dofs);
+ Vector<double> local_M_u (dofs_per_cell);
+ Vector<double> local_M_v (dofs_per_cell);
+ Vector<double> local_A_v (dofs_per_cell);
// transfer v+k*u. Note that we need
// old_dof_values_u again below
old_cell->get_dof_values (previous_time_level.v, old_dof_values_v);
parameters.stiffness->value_list (fe_values.get_quadrature_points(),
stiffness_values);
for (unsigned int point=0; point<fe_values.n_quadrature_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] *
// transfer into the global
// right hand side
- vector<int> new_dof_indices (total_dofs, -1);
+ vector<int> new_dof_indices (dofs_per_cell, -1);
new_cell->get_dof_indices (new_dof_indices);
- for (unsigned int i=0; i<total_dofs; ++i)
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
{
right_hand_side1(new_dof_indices[i]) += rhs1(i);
right_hand_side2(new_dof_indices[i]) += rhs2(i);
// for the theta scheme:
// rhs1 := Mv^0 + kMu^1
// -(1-theta)theta k^2 Av^1
- Vector<double> rhs1 (total_dofs);
+ Vector<double> rhs1 (dofs_per_cell);
// this is the part of the right hand side
// of the second equation which depends
// on the solutions of the previous time
// step.
// for the theta scheme:
// rhs2 := Mu^1-(1-theta)kAv^1
- Vector<double> rhs2 (total_dofs);
+ Vector<double> rhs2 (dofs_per_cell);
// collect the contributions of the
// child cells (and possibly their
// transfer into the global
// right hand side
- vector<int> new_dof_indices (total_dofs);
+ vector<int> new_dof_indices (dofs_per_cell);
new_cell->get_dof_indices (new_dof_indices);
- for (unsigned int i=0; i<total_dofs; ++i)
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
{
right_hand_side1(new_dof_indices[i]) += rhs1(i);
right_hand_side2(new_dof_indices[i]) += rhs2(i);
// vector of values of the function
// on the old grid restricted to
// the large (old) cell
- Vector<double> old_dof_values_u (total_dofs);
- Vector<double> old_dof_values_v (total_dofs);
+ Vector<double> old_dof_values_u (dofs_per_cell);
+ Vector<double> old_dof_values_v (dofs_per_cell);
old_cell->get_dof_values (previous_time_level.u, old_dof_values_u);
old_cell->get_dof_values (previous_time_level.v, old_dof_values_v);
const TimeStep_Dual<dim> &previous_time_level
= static_cast<const TimeStepBase_Wave<dim>*>(next_timestep)->get_timestep_dual();
- const unsigned int total_dofs = fe.total_dofs;
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
const double time_step = get_forward_timestep();
- FullMatrix<double> cell_matrix (total_dofs, total_dofs);
+ FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
// these will hold the values of the
// solution on the old grid, i.e. on
// the small cells
- Vector<double> local_old_dof_values_u (total_dofs);
- Vector<double> local_old_dof_values_v (total_dofs);
+ Vector<double> local_old_dof_values_u (dofs_per_cell);
+ Vector<double> local_old_dof_values_v (dofs_per_cell);
// same for the contributions to the
// right hand sides of the projection
- Vector<double> local_M_u (total_dofs);
- Vector<double> local_M_v (total_dofs);
- Vector<double> local_A_v (total_dofs);
+ Vector<double> local_M_u (dofs_per_cell);
+ Vector<double> local_M_v (dofs_per_cell);
+ Vector<double> local_A_v (dofs_per_cell);
// this is the right hand side of the
// first equation
// for the theta scheme:
// rhs1 := Mv^0 + kMu^1
// -(1-theta)theta k^2 Av^1
- Vector<double> child_rhs1 (total_dofs);
+ Vector<double> child_rhs1 (dofs_per_cell);
// this is the part of the right hand side
// of the second equation which depends
// on the solutions of the previous time
// step.
// for the theta scheme:
// rhs2 := Mu^1-(1-theta)kAv^1
- Vector<double> child_rhs2 (total_dofs);
+ Vector<double> child_rhs2 (dofs_per_cell);
for (unsigned int c=0; c<GeometryInfo<dim>::children_per_cell; ++c)
{
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<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) += (values(i,point) *
values(j,point)) *
weights[point] *
parameters.stiffness->value_list (fe_values.get_quadrature_points(),
stiffness_values);
for (unsigned int point=0; point<fe_values.n_quadrature_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] *
// increased with each level of recursion
unsigned int level_difference = 1;
- const unsigned int total_dofs = fe.total_dofs;
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
const double time_step = get_forward_timestep();
- FullMatrix<double> cell_matrix(total_dofs, total_dofs);
+ FullMatrix<double> cell_matrix(dofs_per_cell, dofs_per_cell);
// set up a vector which will hold the
// restriction of the old
// functions (u,v) to a childcell
- Vector<double> local_old_dof_values_u (total_dofs);
- Vector<double> local_old_dof_values_v (total_dofs);
+ Vector<double> local_old_dof_values_u (dofs_per_cell);
+ Vector<double> local_old_dof_values_v (dofs_per_cell);
// vector of old u and v times the local
// mass matrix (on the small cells
// respectively)
- Vector<double> local_M_u (total_dofs);
- Vector<double> local_M_v (total_dofs);
- Vector<double> local_A_v (total_dofs);
+ Vector<double> local_M_u (dofs_per_cell);
+ Vector<double> local_M_v (dofs_per_cell);
+ Vector<double> local_A_v (dofs_per_cell);
// this is the right hand side of the
// first equation
// for the theta scheme:
// rhs1 := Mv^1 + kMu^1
// -(1-theta)theta k^2 Av^1
- Vector<double> rhs1 (total_dofs);
+ Vector<double> rhs1 (dofs_per_cell);
// this is the part of the right hand side
// of the second equation which depends
// step.
// for the theta scheme:
// rhs2 := Mu^1-(1-theta)kAv^1
- Vector<double> rhs2 (total_dofs);
+ Vector<double> rhs2 (dofs_per_cell);
// indices of the dofs of a cell on
// the new grid
- vector<int> new_dof_indices (total_dofs, -1);
+ vector<int> new_dof_indices (dofs_per_cell, -1);
// loop over the child cells
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<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) += (values(i,point) *
values(j,point)) *
weights[point] *
parameters.stiffness->value_list (fe_values.get_quadrature_points(),
stiffness_values);
for (unsigned int point=0; point<fe_values.n_quadrature_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] *
// transfer into the global
// right hand side
new_child->get_dof_indices (new_dof_indices);
- for (unsigned int i=0; i<total_dofs; ++i)
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
{
right_hand_side1(new_dof_indices[i]) += rhs1(i);
right_hand_side2(new_dof_indices[i]) += rhs2(i);
const FiniteElement<dim> &primal_fe = get_timestep_primal().fe,
&dual_fe = get_timestep_dual().fe;
- const unsigned int total_dofs_primal = primal_fe.total_dofs,
- total_dofs_dual = dual_fe.total_dofs;
+ const unsigned int dofs_per_cell_primal = primal_fe.dofs_per_cell,
+ dofs_per_cell_dual = dual_fe.dofs_per_cell;
// none of the two cells has children
// hold the solution interpolated
// up to the ansatz degree of the
// dual problem.
- Vector<double> local_u(total_dofs_dual), local_v(total_dofs_dual);
- Vector<double> local_u_bar(total_dofs_dual), local_v_bar(total_dofs_dual);
+ Vector<double> local_u(dofs_per_cell_dual), local_v(dofs_per_cell_dual);
+ Vector<double> local_u_bar(dofs_per_cell_dual), local_v_bar(dofs_per_cell_dual);
// same thing for old solutions
- Vector<double> local_u_old(total_dofs_dual), local_v_old(total_dofs_dual);
- Vector<double> local_u_bar_old(total_dofs_dual), local_v_bar_old(total_dofs_dual);
+ Vector<double> local_u_old(dofs_per_cell_dual), local_v_old(dofs_per_cell_dual);
+ Vector<double> local_u_bar_old(dofs_per_cell_dual), local_v_bar_old(dofs_per_cell_dual);
// vectors to hold dof values on
// the primal/dual cell (temporary)
- Vector<double> primal_tmp(total_dofs_primal);
+ Vector<double> primal_tmp(dofs_per_cell_primal);
// fill local solution vectors
primal_cell->get_dof_values (primal_problem.u, primal_tmp);
// thereon
if (!primal_cell_old->has_children() && primal_cell->has_children())
{
- Vector<double> local_u_old(total_dofs_dual), local_v_old(total_dofs_dual);
- Vector<double> local_u_bar_old(total_dofs_dual), local_v_bar_old(total_dofs_dual);
+ Vector<double> local_u_old(dofs_per_cell_dual), local_v_old(dofs_per_cell_dual);
+ Vector<double> local_u_bar_old(dofs_per_cell_dual), local_v_bar_old(dofs_per_cell_dual);
// vectors to hold dof values on
// the primal/dual cell (temporary)
- Vector<double> primal_tmp(total_dofs_primal);
+ Vector<double> primal_tmp(dofs_per_cell_primal);
// fill local old solution vectors.
// no problems here, since the two
// hold the solution interpolated
// up to the ansatz degree of the
// dual problem.
- Vector<double> local_u(total_dofs_dual), local_v(total_dofs_dual);
- Vector<double> local_u_bar(total_dofs_dual), local_v_bar(total_dofs_dual);
- Vector<double> local_u_bar_old(total_dofs_dual), local_v_bar_old(total_dofs_dual);
- Vector<double> local_Ih_u_bar(total_dofs_dual), local_Ih_v_bar(total_dofs_dual);
- Vector<double> local_Ih_u_bar_old(total_dofs_dual), local_Ih_v_bar_old(total_dofs_dual);
+ Vector<double> local_u(dofs_per_cell_dual), local_v(dofs_per_cell_dual);
+ Vector<double> local_u_bar(dofs_per_cell_dual), local_v_bar(dofs_per_cell_dual);
+ Vector<double> local_u_bar_old(dofs_per_cell_dual), local_v_bar_old(dofs_per_cell_dual);
+ Vector<double> local_Ih_u_bar(dofs_per_cell_dual), local_Ih_v_bar(dofs_per_cell_dual);
+ Vector<double> local_Ih_u_bar_old(dofs_per_cell_dual), local_Ih_v_bar_old(dofs_per_cell_dual);
// vectors to hold dof values on
// the primal/dual cell (temporary)
const TimeStep_Dual<dim> &dual_problem = get_timestep_dual();
const FiniteElement<dim> &dual_fe = get_timestep_dual().fe;
- const unsigned int total_dofs_dual = dual_fe.total_dofs;
+ const unsigned int dofs_per_cell_dual = dual_fe.dofs_per_cell;
for (unsigned int child=0; child<GeometryInfo<dim>::children_per_cell; ++child)
// we have the solutions on the
// old (large) cell, we restrict it to
// each of the small cells
- Vector<double> child_u_old(total_dofs_dual), child_v_old(total_dofs_dual);
- Vector<double> child_u_bar_old(total_dofs_dual), child_v_bar_old(total_dofs_dual);
+ Vector<double> child_u_old(dofs_per_cell_dual), child_v_old(dofs_per_cell_dual);
+ Vector<double> child_u_bar_old(dofs_per_cell_dual), child_v_bar_old(dofs_per_cell_dual);
dual_fe.prolongate(child).vmult (child_u_old, local_u_old);
dual_fe.prolongate(child).vmult (child_v_old, local_v_old);
// hold the solution interpolated
// up to the ansatz degree of the
// dual problem.
- Vector<double> local_u(total_dofs_dual), local_v(total_dofs_dual);
- Vector<double> local_u_bar(total_dofs_dual), local_v_bar(total_dofs_dual);
+ Vector<double> local_u(dofs_per_cell_dual), local_v(dofs_per_cell_dual);
+ Vector<double> local_u_bar(dofs_per_cell_dual), local_v_bar(dofs_per_cell_dual);
// vectors to hold dof values on
// the primal/dual cell (temporary)
ErrorOnCell error_sum;
- const unsigned int total_dofs_dual = local_u_bar.size();
+ const unsigned int dofs_per_cell_dual = local_u_bar.size();
for (unsigned int child=0; child<GeometryInfo<dim>::children_per_cell; ++child)
{
// we have the solutions on the
// new (large) cell, we restrict it to
// each of the small cells
- Vector<double> child_u(total_dofs_dual), child_v(total_dofs_dual);
- Vector<double> child_u_bar(total_dofs_dual), child_v_bar(total_dofs_dual);
- Vector<double> child_Ih_u_bar(total_dofs_dual), child_Ih_v_bar(total_dofs_dual);
- Vector<double> child_Ih_u_bar_old(total_dofs_dual), child_Ih_v_bar_old(total_dofs_dual);
+ Vector<double> child_u(dofs_per_cell_dual), child_v(dofs_per_cell_dual);
+ Vector<double> child_u_bar(dofs_per_cell_dual), child_v_bar(dofs_per_cell_dual);
+ Vector<double> child_Ih_u_bar(dofs_per_cell_dual), child_Ih_v_bar(dofs_per_cell_dual);
+ Vector<double> child_Ih_u_bar_old(dofs_per_cell_dual), child_Ih_v_bar_old(dofs_per_cell_dual);
dual_fe.prolongate(child).vmult (child_u, local_u);
dual_fe.prolongate(child).vmult (child_v, local_v);
// the old cell was not further
// refined -> go on here directly
{
- Vector<double> local_u_old(total_dofs_dual), local_v_old(total_dofs_dual);
- Vector<double> local_u_bar_old(total_dofs_dual), local_v_bar_old(total_dofs_dual);
+ Vector<double> local_u_old(dofs_per_cell_dual), local_v_old(dofs_per_cell_dual);
+ Vector<double> local_u_bar_old(dofs_per_cell_dual), local_v_bar_old(dofs_per_cell_dual);
// vectors to hold dof values on
// the primal/dual cell (temporary)
old_primal_child->get_dof_values (primal_problem_old.v, primal_tmp);
embedding_matrix.vmult (local_v_old, primal_tmp);
- Vector<double> child_difference_u_bar (total_dofs_dual);
- Vector<double> child_difference_v_bar (total_dofs_dual);
- Vector<double> local_difference_u_bar_old (total_dofs_dual);
- Vector<double> local_difference_v_bar_old (total_dofs_dual);
+ Vector<double> child_difference_u_bar (dofs_per_cell_dual);
+ Vector<double> child_difference_v_bar (dofs_per_cell_dual);
+ Vector<double> local_difference_u_bar_old (dofs_per_cell_dual);
+ Vector<double> local_difference_v_bar_old (dofs_per_cell_dual);
child_difference_u_bar = child_u_bar;
child_difference_u_bar -= child_Ih_u_bar;
// identity on this cell
ErrorOnCell error_on_cell;
- const unsigned int total_dofs = get_timestep_dual().fe.total_dofs;
+ const unsigned int dofs_per_cell = get_timestep_dual().fe.dofs_per_cell;
// two temporaries needed for the
// calculation of the scalar products
- Vector<double> tmp1(total_dofs);
- Vector<double> tmp2(total_dofs);
+ Vector<double> tmp1(dofs_per_cell);
+ Vector<double> tmp2(dofs_per_cell);
vector<double> stiffness(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<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)
{
mass_matrix(i,j) += (values(i,point) *
values(j,point)) *
const FiniteElement<dim> &primal_fe = get_timestep_primal().fe,
&dual_fe = get_timestep_dual().fe;
- embedding_matrix.reinit (dual_fe.total_dofs,
- primal_fe.total_dofs);
+ embedding_matrix.reinit (dual_fe.dofs_per_cell,
+ primal_fe.dofs_per_cell);
- vector<Point<dim> > unit_support_points (dual_fe.total_dofs);
+ vector<Point<dim> > unit_support_points (dual_fe.dofs_per_cell);
dual_fe.get_unit_support_points (unit_support_points);
- for (unsigned int i=0; i<dual_fe.total_dofs; ++i)
- for (unsigned int j=0; j<primal_fe.total_dofs; ++j)
+ for (unsigned int i=0; i<dual_fe.dofs_per_cell; ++i)
+ for (unsigned int j=0; j<primal_fe.dofs_per_cell; ++j)
embedding_matrix(i,j) = primal_fe.shape_value (j, unit_support_points[i]);
// primal space and then back to the
// dual space (by injection, using
// the matrix constructed above)
- FullMatrix<double> inverse_interpolation (primal_fe.total_dofs,
- dual_fe.total_dofs);
- unit_support_points.resize (primal_fe.total_dofs);
+ FullMatrix<double> inverse_interpolation (primal_fe.dofs_per_cell,
+ dual_fe.dofs_per_cell);
+ unit_support_points.resize (primal_fe.dofs_per_cell);
primal_fe.get_unit_support_points (unit_support_points);
- for (unsigned int i=0; i<primal_fe.total_dofs; ++i)
- for (unsigned int j=0; j<dual_fe.total_dofs; ++j)
+ for (unsigned int i=0; i<primal_fe.dofs_per_cell; ++i)
+ for (unsigned int j=0; j<dual_fe.dofs_per_cell; ++j)
inverse_interpolation(i,j) = dual_fe.shape_value (j, unit_support_points[i]);
- interpolation_matrix.reinit (dual_fe.total_dofs, dual_fe.total_dofs);
+ interpolation_matrix.reinit (dual_fe.dofs_per_cell, dual_fe.dofs_per_cell);
embedding_matrix.mmult (interpolation_matrix, inverse_interpolation);
- difference_matrix.reinit (dual_fe.total_dofs, dual_fe.total_dofs);
+ difference_matrix.reinit (dual_fe.dofs_per_cell, dual_fe.dofs_per_cell);
// initialize with the unit matrix
- for (unsigned int i=0; i<dual_fe.total_dofs; ++i)
+ for (unsigned int i=0; i<dual_fe.dofs_per_cell; ++i)
difference_matrix(i,i) = 1.;
// compute difference
difference_matrix.add (-1, interpolation_matrix);
const TimeStep_Primal<dim> &previous_time_level
= static_cast<const TimeStepBase_Wave<dim>*>(previous_timestep)->get_timestep_primal();
- const unsigned int total_dofs = fe.total_dofs;
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
const double time_step = get_backward_timestep();
// both cells are on the same refinement
{
fe_values.reinit (old_cell);
- FullMatrix<double> cell_matrix (total_dofs, total_dofs);
+ FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
const FullMatrix<double> &values = fe_values.get_shape_values ();
const vector<vector<Tensor<1,dim> > >&gradients = fe_values.get_shape_grads ();
const vector<double> &weights = fe_values.get_JxW_values ();
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<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) += (values(i,point) *
values(j,point)) *
weights[point] *
density_values[point];
- Vector<double> tmp (total_dofs);
+ Vector<double> tmp (dofs_per_cell);
// this is the right hand side of the
// first equation
// for the theta scheme:
// rhs1 := Mu^0 + kMv^0
// -(1-theta)theta k^2 Au^0
- Vector<double> rhs1 (total_dofs);
+ Vector<double> rhs1 (dofs_per_cell);
// this is the part of the right hand side
// of the second equation which depends
// step.
// for the theta scheme:
// rhs2 := Mv^0-(1-theta)kA^0
- Vector<double> rhs2 (total_dofs);
+ Vector<double> rhs2 (dofs_per_cell);
// vector of values of the function on the
// old grid restricted to one cell
- Vector<double> old_dof_values_u (total_dofs);
+ Vector<double> old_dof_values_u (dofs_per_cell);
// vector of old u and v times the local
// mass matrix
- Vector<double> local_M_u (total_dofs);
- Vector<double> local_M_v (total_dofs);
- Vector<double> local_A_u (total_dofs);
+ Vector<double> local_M_u (dofs_per_cell);
+ Vector<double> local_M_v (dofs_per_cell);
+ Vector<double> local_A_u (dofs_per_cell);
// transfer u+k*v. Note that we need
// old_dof_values_u again below
old_cell->get_dof_values (previous_time_level.u, old_dof_values_u);
parameters.stiffness->value_list (fe_values.get_quadrature_points(),
stiffness_values);
for (unsigned int point=0; point<fe_values.n_quadrature_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] *
// transfer into the global
// right hand side
- vector<int> new_dof_indices (total_dofs, -1);
+ vector<int> new_dof_indices (dofs_per_cell, -1);
new_cell->get_dof_indices (new_dof_indices);
- for (unsigned int i=0; i<total_dofs; ++i)
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
{
right_hand_side1(new_dof_indices[i]) += rhs1(i);
right_hand_side2(new_dof_indices[i]) += rhs2(i);
// for the theta scheme:
// rhs1 := Mu^0 + kMv^0
// -(1-theta)theta k^2 Au^0
- Vector<double> rhs1 (total_dofs);
+ Vector<double> rhs1 (dofs_per_cell);
// this is the part of the right hand side
// of the second equation which depends
// step.
// for the theta scheme:
// rhs2 := Mv^0-(1-theta)kA^0
- Vector<double> rhs2 (total_dofs);
+ Vector<double> rhs2 (dofs_per_cell);
// collect the contributions of the
// child cells (and possibly their
// transfer into the global
// right hand side
- vector<int> new_dof_indices (total_dofs);
+ vector<int> new_dof_indices (dofs_per_cell);
new_cell->get_dof_indices (new_dof_indices);
- for (unsigned int i=0; i<total_dofs; ++i)
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
{
right_hand_side1(new_dof_indices[i]) += rhs1(i);
right_hand_side2(new_dof_indices[i]) += rhs2(i);
// vector of values of the function
// on the old grid restricted to
// the large (old) cell
- Vector<double> old_dof_values_u (total_dofs);
- Vector<double> old_dof_values_v (total_dofs);
+ Vector<double> old_dof_values_u (dofs_per_cell);
+ Vector<double> old_dof_values_v (dofs_per_cell);
old_cell->get_dof_values (previous_time_level.u, old_dof_values_u);
old_cell->get_dof_values (previous_time_level.v, old_dof_values_v);
const TimeStep_Primal<dim> &previous_time_level
= static_cast<const TimeStepBase_Wave<dim>*>(previous_timestep)->get_timestep_primal();
- const unsigned int total_dofs = fe.total_dofs;
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
const double time_step = get_backward_timestep();
- FullMatrix<double> cell_matrix (total_dofs, total_dofs);
+ FullMatrix<double> cell_matrix (dofs_per_cell, dofs_per_cell);
// these will hold the values of the
// solution on the old grid, i.e. on
// the small cells
- Vector<double> local_old_dof_values_u (total_dofs);
- Vector<double> local_old_dof_values_v (total_dofs);
+ Vector<double> local_old_dof_values_u (dofs_per_cell);
+ Vector<double> local_old_dof_values_v (dofs_per_cell);
// same for the contributions to the
// right hand sides of the projection
- Vector<double> local_M_u (total_dofs);
- Vector<double> local_M_v (total_dofs);
- Vector<double> local_A_u (total_dofs);
+ Vector<double> local_M_u (dofs_per_cell);
+ Vector<double> local_M_v (dofs_per_cell);
+ Vector<double> local_A_u (dofs_per_cell);
// this is the right hand side of the
// first equation
// for the theta scheme:
// rhs1 := Mu^0 + kMv^0
// -(1-theta)theta k^2 Au^0
- Vector<double> child_rhs1 (total_dofs);
+ Vector<double> child_rhs1 (dofs_per_cell);
// this is the part of the right hand side
// of the second equation which depends
// step.
// for the theta scheme:
// rhs2 := Mv^0-(1-theta)kA^0
- Vector<double> child_rhs2 (total_dofs);
+ Vector<double> child_rhs2 (dofs_per_cell);
for (unsigned int c=0; c<GeometryInfo<dim>::children_per_cell; ++c)
{
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<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) += (values(i,point) *
values(j,point)) *
weights[point] *
parameters.stiffness->value_list (fe_values.get_quadrature_points(),
stiffness_values);
for (unsigned int point=0; point<fe_values.n_quadrature_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] *
// increased with each level of recursion
unsigned int level_difference = 1;
- const unsigned int total_dofs = fe.total_dofs;
+ const unsigned int dofs_per_cell = fe.dofs_per_cell;
const double time_step = get_backward_timestep();
- FullMatrix<double> cell_matrix(total_dofs, total_dofs);
+ FullMatrix<double> cell_matrix(dofs_per_cell, dofs_per_cell);
// set up a vector which will hold the
// restriction of the old
// functions (u,v) to a childcell
- Vector<double> local_old_dof_values_u (total_dofs);
- Vector<double> local_old_dof_values_v (total_dofs);
+ Vector<double> local_old_dof_values_u (dofs_per_cell);
+ Vector<double> local_old_dof_values_v (dofs_per_cell);
// vector of old u and v times the local
// mass matrix (on the small cells
// respectively)
- Vector<double> local_M_u (total_dofs);
- Vector<double> local_M_v (total_dofs);
- Vector<double> local_A_u (total_dofs);
+ Vector<double> local_M_u (dofs_per_cell);
+ Vector<double> local_M_v (dofs_per_cell);
+ Vector<double> local_A_u (dofs_per_cell);
// this is the right hand side of the
// first equation
// for the theta scheme:
// rhs1 := Mu^0 + kMv^0
// -(1-theta)theta k^2 Au^0
- Vector<double> rhs1 (total_dofs);
+ Vector<double> rhs1 (dofs_per_cell);
// this is the part of the right hand side
// of the second equation which depends
// step.
// for the theta scheme:
// rhs2 := Mv^0-(1-theta)kA^0
- Vector<double> rhs2 (total_dofs);
+ Vector<double> rhs2 (dofs_per_cell);
// indices of the dofs of a cell on
// the new grid
- vector<int> new_dof_indices (total_dofs, -1);
+ vector<int> new_dof_indices (dofs_per_cell, -1);
// loop over the child cells
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<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) += (values(i,point) *
values(j,point)) *
weights[point] *
parameters.stiffness->value_list (fe_values.get_quadrature_points(),
stiffness_values);
for (unsigned int point=0; point<fe_values.n_quadrature_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] *
// transfer into the global
// right hand side
new_child->get_dof_indices (new_dof_indices);
- for (unsigned int i=0; i<total_dofs; ++i)
+ for (unsigned int i=0; i<dofs_per_cell; ++i)
{
right_hand_side1(new_dof_indices[i]) += rhs1(i);
right_hand_side2(new_dof_indices[i]) += rhs2(i);
{
gnuplot << q.quad_point(k);
- for (unsigned int i=0;i<finel.total_dofs;++i)
+ for (unsigned int i=0;i<finel.dofs_per_cell;++i)
{
gnuplot << " "<< fe.shape_value(i,k);
}