From e2d0def738d6cef133f20751941be30ee4c5b080 Mon Sep 17 00:00:00 2001 From: wolf Date: Thu, 25 Nov 1999 14:19:40 +0000 Subject: [PATCH] Change total_dofs to dofs_per_cell, add a bunch of n_* functionf for the dofs_per_* variables, and change n_transform_functions and n_components in finite elements likewise. git-svn-id: https://svn.dealii.org/trunk@1949 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/fe/fe.h | 169 +++++++- deal.II/deal.II/include/fe/fe_system.h | 6 +- deal.II/deal.II/include/fe/fe_values.h | 8 +- .../include/multigrid/multigrid.templates.h | 4 +- .../include/numerics/multigrid.templates.h | 4 +- deal.II/deal.II/source/dofs/dof_accessor.cc | 28 +- deal.II/deal.II/source/dofs/dof_handler.cc | 20 +- .../deal.II/source/dofs/dof_renumbering.cc | 16 +- deal.II/deal.II/source/dofs/dof_tools.cc | 16 +- .../deal.II/source/dofs/mg_dof_accessor.cc | 4 +- deal.II/deal.II/source/dofs/mg_dof_handler.cc | 8 +- deal.II/deal.II/source/fe/fe.cc | 64 +-- .../deal.II/source/fe/fe_lib.criss_cross.cc | 28 +- deal.II/deal.II/source/fe/fe_lib.cubic.cc | 58 +-- .../deal.II/source/fe/fe_lib.dg.constant.cc | 22 +- deal.II/deal.II/source/fe/fe_lib.linear.cc | 54 +-- deal.II/deal.II/source/fe/fe_lib.quadratic.cc | 58 +-- deal.II/deal.II/source/fe/fe_lib.quartic.cc | 36 +- deal.II/deal.II/source/fe/fe_system.cc | 146 +++---- deal.II/deal.II/source/fe/fe_values.cc | 88 ++-- deal.II/deal.II/source/fe/q1_mapping.cc | 4 +- .../source/multigrid/mg_dof_accessor.cc | 4 +- .../source/multigrid/mg_dof_handler.cc | 8 +- deal.II/deal.II/source/multigrid/multigrid.cc | 2 +- deal.II/deal.II/source/numerics/assembler.cc | 6 +- deal.II/deal.II/source/numerics/data_io.cc | 8 +- deal.II/deal.II/source/numerics/data_out.cc | 6 +- .../deal.II/source/numerics/data_out_stack.cc | 6 +- .../source/numerics/error_estimator.cc | 4 +- deal.II/deal.II/source/numerics/matrices.cc | 62 +-- deal.II/deal.II/source/numerics/multigrid.cc | 2 +- .../source/numerics/solution_transfer.cc | 8 +- deal.II/deal.II/source/numerics/vectors.cc | 62 +-- tests/deal.II/Makefile | 1 + tests/deal.II/fe_tables.cc | 12 +- tests/deal.II/helmholtz1.th | 2 +- tests/deal.II/helmholtz1mg.th | 2 +- tests/deal.II/mglocal.cc | 2 +- tests/deal.II/wave-test-3.cc | 382 +++++++++--------- tests/fe/show_shapes.cc | 2 +- 40 files changed, 774 insertions(+), 648 deletions(-) diff --git a/deal.II/deal.II/include/fe/fe.h b/deal.II/deal.II/include/fe/fe.h index 3540cb97ad..a5a9e20896 100644 --- a/deal.II/deal.II/include/fe/fe.h +++ b/deal.II/deal.II/include/fe/fe.h @@ -45,16 +45,6 @@ class FiniteElementData */ 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. */ @@ -80,6 +70,16 @@ class FiniteElementData */ 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 @@ -88,7 +88,7 @@ class FiniteElementData * writing dimension independant * programs easier. */ - const unsigned int total_dofs; + const unsigned int dofs_per_cell; /** * Number of basis functions used for the @@ -96,20 +96,20 @@ class FiniteElementData * 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 (); @@ -150,10 +150,51 @@ class 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 &) const; @@ -1572,14 +1613,94 @@ class FiniteElement : public FiniteElementBase /* ------------------------------- Inline functions ----------------------- */ +template +inline +unsigned int +FiniteElementData::n_dofs_per_vertex () const +{ + return dofs_per_vertex; +}; + + + +template +inline +unsigned int +FiniteElementData::n_dofs_per_line () const +{ + return dofs_per_line; +}; + + + +template +inline +unsigned int +FiniteElementData::n_dofs_per_quad () const +{ + return dofs_per_quad; +}; + + + +template +inline +unsigned int +FiniteElementData::n_dofs_per_hex () const +{ + return dofs_per_hex; +}; + + + +template +inline +unsigned int +FiniteElementData::n_dofs_per_face () const +{ + return dofs_per_face; +}; + + + +template +inline +unsigned int +FiniteElementData::n_dofs_per_cell () const +{ + return dofs_per_cell; +}; + + + +template +inline +unsigned int +FiniteElementData::n_components () const +{ + return components; +}; + + + +template +inline +unsigned int +FiniteElementData::n_transform_functions () const +{ + return transform_functions; +}; + + + template inline unsigned int FiniteElementBase::component_to_system_index (unsigned int component, unsigned int component_index) const { - Assert(component::face_component_to_system_index (unsigned int component, unsigned int component_index) const { - Assert(component::face_system_to_component_index (unsigned int index) cons return face_system_to_component_table[index]; } + + template inline unsigned int FiniteElementBase::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 inline bool FiniteElementBase::restriction_is_additive (const unsigned int component) const { - Assert(component::FESystem (const FE1 &fe1, const unsigned int n1, 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); @@ -578,9 +578,9 @@ FESystem::FESystem (const FE1 &fe1, const unsigned int 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); diff --git a/deal.II/deal.II/include/fe/fe_values.h b/deal.II/deal.II/include/fe/fe_values.h index 65f596a317..6803c8cd11 100644 --- a/deal.II/deal.II/include/fe/fe_values.h +++ b/deal.II/deal.II/include/fe/fe_values.h @@ -77,7 +77,7 @@ * 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. @@ -220,7 +220,7 @@ class FEValuesBase * 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 @@ -246,7 +246,7 @@ class FEValuesBase */ 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, @@ -908,7 +908,7 @@ class FEFaceValuesBase : public FEValuesBase */ 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, diff --git a/deal.II/deal.II/include/multigrid/multigrid.templates.h b/deal.II/deal.II/include/multigrid/multigrid.templates.h index 7428725849..9f908631be 100644 --- a/deal.II/deal.II/include/multigrid/multigrid.templates.h +++ b/deal.II/deal.II/include/multigrid/multigrid.templates.h @@ -18,7 +18,7 @@ template void MG::copy_to_mg(const Vector& 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 @@ -95,7 +95,7 @@ template void MG::copy_from_mg(Vector &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 global_dof_indices (dofs_per_cell); vector level_dof_indices (dofs_per_cell); diff --git a/deal.II/deal.II/include/numerics/multigrid.templates.h b/deal.II/deal.II/include/numerics/multigrid.templates.h index 7428725849..9f908631be 100644 --- a/deal.II/deal.II/include/numerics/multigrid.templates.h +++ b/deal.II/deal.II/include/numerics/multigrid.templates.h @@ -18,7 +18,7 @@ template void MG::copy_to_mg(const Vector& 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 @@ -95,7 +95,7 @@ template void MG::copy_from_mg(Vector &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 global_dof_indices (dofs_per_cell); vector level_dof_indices (dofs_per_cell); diff --git a/deal.II/deal.II/source/dofs/dof_accessor.cc b/deal.II/deal.II/source/dofs/dof_accessor.cc index 15b8b05318..374e5de195 100644 --- a/deal.II/deal.II/source/dofs/dof_accessor.cc +++ b/deal.II/deal.II/source/dofs/dof_accessor.cc @@ -349,7 +349,7 @@ DoFCellAccessor::get_dof_values (const Vector &values, 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()); @@ -394,7 +394,7 @@ DoFCellAccessor::set_dof_values (const Vector &local_values, 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()); @@ -455,7 +455,7 @@ DoFCellAccessor::get_dof_values (const Vector &values, Assert (dof_handler != 0, DoFAccessor::ExcInvalidObject()); Assert (&dof_handler->get_fe() != 0, DoFAccessor::ExcInvalidObject()); - Assert (local_values.size() == dof_handler->get_fe().total_dofs, + Assert (local_values.size() == dof_handler->get_fe().dofs_per_cell, DoFAccessor::ExcVectorDoesNotMatch()); Assert (values.size() == dof_handler->n_dofs(), DoFAccessor::ExcVectorDoesNotMatch()); @@ -504,7 +504,7 @@ DoFCellAccessor::set_dof_values (const Vector &local_values, Assert (dof_handler != 0, DoFAccessor::ExcInvalidObject()); Assert (&dof_handler->get_fe() != 0, DoFAccessor::ExcInvalidObject()); - Assert (local_values.size() == dof_handler->get_fe().total_dofs, + Assert (local_values.size() == dof_handler->get_fe().dofs_per_cell, DoFAccessor::ExcVectorDoesNotMatch()); Assert (values.size() == dof_handler->n_dofs(), DoFAccessor::ExcVectorDoesNotMatch()); @@ -567,7 +567,7 @@ DoFCellAccessor::get_dof_values (const Vector &values, 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()); @@ -620,7 +620,7 @@ DoFCellAccessor::set_dof_values (const Vector &local_values, 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()); @@ -659,11 +659,11 @@ template void DoFCellAccessor::get_interpolated_dof_values (const Vector &values, Vector &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::ExcInvalidObject()); Assert (&dof_handler->get_fe() != 0, DoFAccessor::ExcInvalidObject()); - Assert (interpolated_values.size() == total_dofs, + Assert (interpolated_values.size() == dofs_per_cell, DoFAccessor::ExcVectorDoesNotMatch()); Assert (values.size() == dof_handler->n_dofs(), DoFAccessor::ExcVectorDoesNotMatch()); @@ -675,8 +675,8 @@ DoFCellAccessor::get_interpolated_dof_values (const Vector &values, else // otherwise clobber them from the children { - Vector tmp1(total_dofs); - Vector tmp2(total_dofs); + Vector tmp1(dofs_per_cell); + Vector tmp2(dofs_per_cell); interpolated_values.clear (); @@ -699,7 +699,7 @@ DoFCellAccessor::get_interpolated_dof_values (const Vector &values, // end in adding up the contribution // from nodes on boundaries of // children more than once. - for (unsigned int i=0; iget_fe().system_to_component_index(i).first; @@ -721,11 +721,11 @@ template void DoFCellAccessor::set_dof_values_by_interpolation (const Vector &local_values, Vector &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::ExcInvalidObject()); Assert (&dof_handler->get_fe() != 0, DoFAccessor::ExcInvalidObject()); - Assert (local_values.size() == total_dofs, + Assert (local_values.size() == dofs_per_cell, DoFAccessor::ExcVectorDoesNotMatch()); Assert (values.size() == dof_handler->n_dofs(), DoFAccessor::ExcVectorDoesNotMatch()); @@ -737,7 +737,7 @@ DoFCellAccessor::set_dof_values_by_interpolation (const Vector &loc else // otherwise distribute them to the children { - Vector tmp(total_dofs); + Vector tmp(dofs_per_cell); for (unsigned int child=0; child::children_per_cell; ++child) diff --git a/deal.II/deal.II/source/dofs/dof_handler.cc b/deal.II/deal.II/source/dofs/dof_handler.cc index 72131e8598..7b480a0e4b 100644 --- a/deal.II/deal.II/source/dofs/dof_handler.cc +++ b/deal.II/deal.II/source/dofs/dof_handler.cc @@ -1981,7 +1981,7 @@ void DoFHandler::make_sparsity_pattern (SparseMatrixStruct &sparsity) const 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 dofs_on_this_cell(dofs_per_cell); active_cell_iterator cell = begin_active(), endc = end(); @@ -2003,18 +2003,18 @@ void DoFHandler::make_sparsity_pattern (const vector > &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; in_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 @@ -2302,15 +2302,15 @@ void DoFHandler::distribute_cell_to_dof_vector (const Vector &cell_ 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 @@ -2319,7 +2319,7 @@ void DoFHandler::distribute_cell_to_dof_vector (const Vector &cell_ 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 dof_indices (dofs_per_cell); for (; cell!=endc; ++cell, ++present_cell) diff --git a/deal.II/deal.II/source/dofs/dof_renumbering.cc b/deal.II/deal.II/source/dofs/dof_renumbering.cc index f7ffda9a55..d2606a949b 100644 --- a/deal.II/deal.II/source/dofs/dof_renumbering.cc +++ b/deal.II/deal.II/source/dofs/dof_renumbering.cc @@ -370,24 +370,24 @@ template void DoFRenumbering::component_wise (DoFHandler &dof_handler, const vector &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 component_order (component_order_arg); if (component_order.size() == 0) - for (unsigned int i=0; i &dof_handler, // sorted by dof index. note also that some // dof indices are entered multiply, so we // will have to take care of that - vector > component_to_dof_map (dof_handler.get_fe().n_components); + vector > component_to_dof_map (dof_handler.get_fe().n_components()); for (typename DoFHandler::active_cell_iterator cell=dof_handler.begin_active(); cell!=dof_handler.end(); ++cell) { @@ -432,7 +432,7 @@ void DoFRenumbering::component_wise (DoFHandler &dof_handler, // preserve the order within each component // and during this also remove duplicate // entries - for (unsigned int component=0; component &dof_handler, int next_free_index = 0; vector new_indices (dof_handler.n_dofs(), -1); - for (unsigned int component=0; component::const_iterator begin_of_component = component_to_dof_map[component].begin(), diff --git a/deal.II/deal.II/source/dofs/dof_tools.cc b/deal.II/deal.II/source/dofs/dof_tools.cc index dac0e080eb..7847191faa 100644 --- a/deal.II/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/deal.II/source/dofs/dof_tools.cc @@ -19,21 +19,21 @@ DoFTools::extract_dofs(const DoFHandler &dof, vector &selected_dofs) { const FiniteElement &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 indices(fe.total_dofs); + vector indices(fe.dofs_per_cell); DoFHandler::active_cell_iterator c; for (c = dof.begin_active() ; c != dof.end() ; ++ c) { c->get_dof_indices(indices); - for (unsigned int i=0;i &selected_dofs) { const FiniteElement& 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 indices(fe.total_dofs); + vector indices(fe.dofs_per_cell); MGDoFHandler::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::get_mg_dof_values (const Vector &values, 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()); @@ -565,7 +565,7 @@ MGDoFCellAccessor<2>::get_mg_dof_values (const Vector &values, 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()); diff --git a/deal.II/deal.II/source/dofs/mg_dof_handler.cc b/deal.II/deal.II/source/dofs/mg_dof_handler.cc index 9d2763f25f..0b4e5c4b48 100644 --- a/deal.II/deal.II/source/dofs/mg_dof_handler.cc +++ b/deal.II/deal.II/source/dofs/mg_dof_handler.cc @@ -1548,16 +1548,16 @@ void MGDoFHandler::make_sparsity_pattern (const unsigned int level, Assert (sparsity.n_cols() == n_dofs(level), ExcDifferentDimensions (sparsity.n_cols(), n_dofs(level))); - const unsigned int total_dofs = selected_fe->total_dofs; - vector dofs_on_this_cell(total_dofs); + const unsigned int dofs_per_cell = selected_fe->dofs_per_cell; + vector 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::FiniteElementData (const unsigned int dofs_per_vertex, dofs_per_line(dofs_per_line), dofs_per_quad(dofs_per_quad), dofs_per_hex(dofs_per_hex), - dofs_per_face(GeometryInfo::vertices_per_face * dofs_per_vertex+ - GeometryInfo::lines_per_face * dofs_per_line + - dofs_per_quad), first_line_index(GeometryInfo::vertices_per_cell * dofs_per_vertex), first_quad_index(first_line_index+ @@ -49,9 +46,12 @@ FiniteElementData::FiniteElementData (const unsigned int dofs_per_vertex, first_face_quad_index(first_face_line_index+ GeometryInfo::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::vertices_per_face * dofs_per_vertex+ + GeometryInfo::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)); }; @@ -68,8 +68,6 @@ FiniteElementData::FiniteElementData (const unsigned int dofs_per_vertex, dofs_per_line(dofs_per_line), dofs_per_quad(dofs_per_quad), dofs_per_hex(0), - dofs_per_face(GeometryInfo::vertices_per_face * dofs_per_vertex+ - dofs_per_line), first_line_index(GeometryInfo::vertices_per_cell * dofs_per_vertex), first_quad_index(first_line_index+ GeometryInfo::lines_per_cell * dofs_per_line), @@ -80,9 +78,11 @@ FiniteElementData::FiniteElementData (const unsigned int dofs_per_vertex, first_face_quad_index(first_line_index+ GeometryInfo::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::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)); }; @@ -98,7 +98,6 @@ FiniteElementData::FiniteElementData (const unsigned int dofs_per_vertex, dofs_per_line(dofs_per_line), dofs_per_quad(0), dofs_per_hex(0), - dofs_per_face(dofs_per_vertex), first_line_index(GeometryInfo::vertices_per_cell * dofs_per_vertex), first_quad_index(first_line_index+ GeometryInfo::lines_per_cell * dofs_per_line), @@ -109,9 +108,10 @@ FiniteElementData::FiniteElementData (const unsigned int dofs_per_vertex, first_face_quad_index(first_line_index+ GeometryInfo::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)); }; @@ -132,8 +132,8 @@ bool FiniteElementData::operator== (const FiniteElementData &f) const (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)); }; @@ -146,20 +146,20 @@ template FiniteElementBase::FiniteElementBase (const FiniteElementData &fe_data, const vector &restriction_is_additive_flags) : FiniteElementData (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(total_dofs)), - face_component_to_system_table(n_components, vector(dofs_per_face)), - component_to_base_table(n_components), + component_to_system_table(components, vector(dofs_per_cell)), + face_component_to_system_table(components, vector(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::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) @@ -189,7 +189,7 @@ FiniteElementBase::FiniteElementBase (const FiniteElementData &fe_data // one component; if there are several, then // the constructor of the derived class needs // to fill these arrays - for (unsigned int j=0 ; j(0,j); component_to_system_table[0][j] = j; @@ -283,8 +283,8 @@ void FiniteElement<1>::fill_fe_values (const DoFHandler<1>::cell_iterator &cell, 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 @@ -364,8 +364,8 @@ void FiniteElement<1>::fill_fe_subface_values (const DoFHandler<1>::cell_iterato template <> void FiniteElement<1>::get_unit_support_points (vector > &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 @@ -387,8 +387,8 @@ void FiniteElement<1>::get_unit_support_points (vector > &support_point template <> void FiniteElement<1>::get_support_points (const DoFHandler<1>::cell_iterator &cell, vector > &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 diff --git a/deal.II/deal.II/source/fe/fe_lib.criss_cross.cc b/deal.II/deal.II/source/fe/fe_lib.criss_cross.cc index 53238f0763..3c0adf2f3b 100644 --- a/deal.II/deal.II/source/fe/fe_lib.criss_cross.cc +++ b/deal.II/deal.II/source/fe/fe_lib.criss_cross.cc @@ -516,7 +516,7 @@ inline double FECrissCross<2>::shape_value (const unsigned int i, const Point<2> &p) const { - Assert((i inline Tensor<1,2> FECrissCross<2>::shape_grad (const unsigned int i, const Point<2> &p) const { - Assert((i FECrissCross<2>::shape_grad_grad (const unsigned int i, const Point<2> &) const { - Assert((i::shape_grad_grad (const unsigned int i, template <> void FECrissCross<2>::get_unit_support_points (vector > &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); @@ -602,8 +602,8 @@ void FECrissCross<2>::get_support_points (const DoFHandler<2>::cell_iterator &ce vector > &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::vertices_per_cell; ++vertex) @@ -653,10 +653,10 @@ void FECrissCross<2>::get_face_support_points (const DoFHandler<2>::face_iterato template <> void FECrissCross<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, FullMatrix &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), @@ -941,8 +941,8 @@ void FECrissCross::fill_fe_values (const DoFHandler::cell_iterator &ce 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(); @@ -966,7 +966,7 @@ void FECrissCross::fill_fe_values (const DoFHandler::cell_iterator &ce // 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::shape_value (const unsigned int i, const Point<1> &p) const { - Assert((i FEQ3<1>::shape_grad (const unsigned int i, const Point<1> &p) const { - Assert((i, so we @@ -158,7 +158,7 @@ Tensor<2,1> FEQ3<1>::shape_grad_grad (const unsigned int i, const Point<1> &p) const { - Assert (i return_value; @@ -201,10 +201,10 @@ void FEQ3<1>::get_face_support_points (const DoFHandler<1>::face_iterator &, template <> void FEQ3<1>::get_local_mass_matrix (const DoFHandler<1>::cell_iterator &cell, FullMatrix &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()); @@ -703,7 +703,7 @@ double FEQ3<2>::shape_value (const unsigned int i, const Point<2> &p) const { - Assert (i FEQ3<2>::shape_grad (const unsigned int i, const Point<2> &p) const { - Assert (i FEQ3<2>::shape_grad_grad (const unsigned int i, const Point<2> &p) const { - Assert (i::shape_grad_grad (const unsigned int i, template <> void FEQ3<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, FullMatrix &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), @@ -1485,8 +1485,8 @@ void FEQ3<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, template <> void FEQ3<2>::get_unit_support_points (vector > &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); @@ -1511,8 +1511,8 @@ void FEQ3<2>::get_unit_support_points (vector > &unit_points) const { template <> void FEQ3<2>::get_support_points (const DoFHandler<2>::cell_iterator &cell, vector > &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), @@ -9955,7 +9955,7 @@ double FEQ3<3>::shape_value (const unsigned int i, const Point<3> &p) const { - Assert (i FEQ3<3>::shape_grad (const unsigned int i, const Point<3> &p) const { - Assert (i FEQ3<3>::shape_grad_grad (const unsigned int i, const Point<3> &p) const { - Assert (i::get_local_mass_matrix (const DoFHandler<3>::cell_iterator &, FullMatrix &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)); }; @@ -11411,8 +11411,8 @@ FEQ3<3>::get_local_mass_matrix (const DoFHandler<3>::cell_iterator &, template <> void FEQ3<3>::get_unit_support_points (vector > &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); @@ -11484,8 +11484,8 @@ void FEQ3<3>::get_unit_support_points (vector > &unit_points) const { template <> void FEQ3<3>::get_support_points (const typename DoFHandler<3>::cell_iterator &cell, vector > &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), diff --git a/deal.II/deal.II/source/fe/fe_lib.dg.constant.cc b/deal.II/deal.II/source/fe/fe_lib.dg.constant.cc index a9d8810202..0c98e7ccbb 100644 --- a/deal.II/deal.II/source/fe/fe_lib.dg.constant.cc +++ b/deal.II/deal.II/source/fe/fe_lib.dg.constant.cc @@ -48,7 +48,7 @@ double FEDG_Q0::shape_value (const unsigned int i, const Point&) const { - Assert((i FEDG_Q0::shape_grad (const unsigned int i, const Point&) const { - Assert((i (); }; @@ -72,7 +72,7 @@ Tensor<2,dim> FEDG_Q0::shape_grad_grad (const unsigned int i, const Point &) const { - Assert((i(); }; @@ -82,10 +82,10 @@ FEDG_Q0::shape_grad_grad (const unsigned int i, template void FEDG_Q0::get_local_mass_matrix (const DoFHandler::cell_iterator &cell, FullMatrix &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(); }; @@ -95,8 +95,8 @@ void FEDG_Q0::get_local_mass_matrix (const DoFHandler::cell_iterator & template void FEDG_Q0::get_unit_support_points (vector > &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 void FEDG_Q0::get_support_points (const typename DoFHandler::cell_iterator &cell, vector > &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(); }; diff --git a/deal.II/deal.II/source/fe/fe_lib.linear.cc b/deal.II/deal.II/source/fe/fe_lib.linear.cc index 4778488d2e..1bea588b69 100644 --- a/deal.II/deal.II/source/fe/fe_lib.linear.cc +++ b/deal.II/deal.II/source/fe/fe_lib.linear.cc @@ -73,7 +73,7 @@ double FEQ1<1>::shape_value(const unsigned int i, const Point<1> &p) const { - Assert((i FEQ1<1>::shape_grad(const unsigned int i, const Point<1>&) const { - Assert((i, so we // still construct it as that. it should @@ -112,7 +112,7 @@ Tensor<2,1> FEQ1<1>::shape_grad_grad (const unsigned int i, const Point<1> &) const { - Assert((i(); @@ -146,10 +146,10 @@ void FEQ1<1>::get_face_support_points (const DoFHandler<1>::face_iterator &, template <> void FEQ1<1>::get_local_mass_matrix (const DoFHandler<1>::cell_iterator &cell, FullMatrix &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()); @@ -245,7 +245,7 @@ double FEQ1<2>::shape_value (const unsigned int i, const Point<2>& p) const { - Assert((i FEQ1<2>::shape_grad (const unsigned int i, const Point<2>& p) const { - Assert((i, so we // still construct it as that. it should @@ -288,7 +288,7 @@ Tensor<2,2> FEQ1<2>::shape_grad_grad (const unsigned int i, const Point<2> &) const { - Assert((i::shape_grad_grad (const unsigned int i, template <> void FEQ1<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, FullMatrix &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: @@ -420,8 +420,8 @@ void FEQ1<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, template <> void FEQ1<2>::get_unit_support_points (vector > &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); @@ -706,7 +706,7 @@ double FEQ1<3>::shape_value (const unsigned int i, const Point<3>& p) const { - Assert((i FEQ1<3>::shape_grad (const unsigned int i, const Point<3>& p) const { - Assert((i, so we // still construct it as that. it should @@ -773,7 +773,7 @@ Tensor<2,3> FEQ1<3>::shape_grad_grad (const unsigned int i, const Point<3> &p) const { - Assert((i return_value; @@ -852,10 +852,10 @@ FEQ1<3>::shape_grad_grad (const unsigned int i, template <> void FEQ1<3>::get_local_mass_matrix (const DoFHandler<3>::cell_iterator &, FullMatrix &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)); }; @@ -864,8 +864,8 @@ void FEQ1<3>::get_local_mass_matrix (const DoFHandler<3>::cell_iterator &, template <> void FEQ1<3>::get_unit_support_points (vector > &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); @@ -886,8 +886,8 @@ template void FEQ1::get_support_points (const typename DoFHandler::cell_iterator &cell, vector > &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::vertices_per_cell; ++vertex) support_points[vertex] = cell->vertex(vertex); diff --git a/deal.II/deal.II/source/fe/fe_lib.quadratic.cc b/deal.II/deal.II/source/fe/fe_lib.quadratic.cc index 0dd21c0f68..afcda64e03 100644 --- a/deal.II/deal.II/source/fe/fe_lib.quadratic.cc +++ b/deal.II/deal.II/source/fe/fe_lib.quadratic.cc @@ -125,7 +125,7 @@ double FEQ2<1>::shape_value(const unsigned int i, const Point<1> &p) const { - Assert((i FEQ2<1>::shape_grad(const unsigned int i, const Point<1> &p) const { - Assert((i, so we @@ -166,7 +166,7 @@ Tensor<2,1> FEQ2<1>::shape_grad_grad (const unsigned int i, const Point<1> &) const { - Assert((i return_value; switch (i) @@ -212,10 +212,10 @@ void FEQ2<1>::get_face_support_points (const DoFHandler<1>::face_iterator &, template <> void FEQ2<1>::get_local_mass_matrix (const DoFHandler<1>::cell_iterator &cell, FullMatrix &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()); @@ -651,7 +651,7 @@ double FEQ2<2>::shape_value (const unsigned int i, const Point<2> &p) const { - Assert (i FEQ2<2>::shape_grad (const unsigned int i, const Point<2> &p) const { - Assert (i FEQ2<2>::shape_grad_grad (const unsigned int i, const Point<2> &p) const { - Assert (i::shape_grad_grad (const unsigned int i, template <> void FEQ2<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, FullMatrix &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 @@ -1062,8 +1062,8 @@ void FEQ2<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, template <> void FEQ2<2>::get_unit_support_points (vector > &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); @@ -1081,8 +1081,8 @@ void FEQ2<2>::get_unit_support_points (vector > &unit_points) const { template <> void FEQ2<2>::get_support_points (const DoFHandler<2>::cell_iterator &cell, vector > &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); @@ -2297,7 +2297,7 @@ double FEQ2<3>::shape_value (const unsigned int i, const Point<3> &p) const { - Assert (i FEQ2<3>::shape_grad (const unsigned int i, const Point<3> &p) const { - Assert (i FEQ2<3>::shape_grad_grad (const unsigned int i, const Point<3> &p) const { - Assert (i void FEQ2<3>::get_local_mass_matrix (const DoFHandler<3>::cell_iterator &, FullMatrix &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)); }; @@ -2789,8 +2789,8 @@ void FEQ2<3>::get_local_mass_matrix (const DoFHandler<3>::cell_iterator &, template <> void FEQ2<3>::get_unit_support_points (vector > &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); @@ -2826,8 +2826,8 @@ void FEQ2<3>::get_unit_support_points (vector > &unit_points) const { template <> void FEQ2<3>::get_support_points (const DoFHandler<3>::cell_iterator &cell, vector > &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), diff --git a/deal.II/deal.II/source/fe/fe_lib.quartic.cc b/deal.II/deal.II/source/fe/fe_lib.quartic.cc index 9ee9594842..0ea1ef55dc 100644 --- a/deal.II/deal.II/source/fe/fe_lib.quartic.cc +++ b/deal.II/deal.II/source/fe/fe_lib.quartic.cc @@ -79,7 +79,7 @@ double FEQ4<1>::shape_value(const unsigned int i, const Point<1> &p) const { - Assert((i FEQ4<1>::shape_grad(const unsigned int i, const Point<1> &p) const { - Assert((i, so we @@ -124,7 +124,7 @@ Tensor<2,1> FEQ4<1>::shape_grad_grad (const unsigned int i, const Point<1> &p) const { - Assert (i return_value; @@ -168,10 +168,10 @@ void FEQ4<1>::get_face_support_points (const DoFHandler<1>::face_iterator &, template <> void FEQ4<1>::get_local_mass_matrix (const DoFHandler<1>::cell_iterator &cell, FullMatrix &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()); @@ -985,7 +985,7 @@ double FEQ4<2>::shape_value (const unsigned int i, const Point<2> &p) const { - Assert (i FEQ4<2>::shape_grad (const unsigned int i, const Point<2> &p) const { - Assert (i FEQ4<2>::shape_grad_grad (const unsigned int i, const Point<2> &p) const { - Assert (i::shape_grad_grad (const unsigned int i, template <> void FEQ4<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, FullMatrix &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), @@ -2607,8 +2607,8 @@ void FEQ4<2>::get_local_mass_matrix (const DoFHandler<2>::cell_iterator &cell, template <> void FEQ4<2>::get_unit_support_points (vector > &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); @@ -2642,8 +2642,8 @@ void FEQ4<2>::get_unit_support_points (vector > &unit_points) const { template <> void FEQ4<2>::get_support_points (const DoFHandler<2>::cell_iterator &cell, vector > &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), diff --git a/deal.II/deal.II/source/fe/fe_system.cc b/deal.II/deal.II/source/fe/fe_system.cc index bc0afdb8dd..eb1f27b455 100644 --- a/deal.II/deal.II/source/fe/fe_system.cc +++ b/deal.II/deal.II/source/fe/fe_system.cc @@ -141,11 +141,11 @@ FESystem::build_cell_table() // Initialize mapping from components to // linear index. Fortunately, this is // the inverse of what we just did. - for (unsigned int comp=0 ; comp::build_face_table() // Initialize mapping from components to // linear index. Fortunately, this is // the inverse of what we just did. - for (unsigned comp=0 ; comp::initialize () // distribute the matrices of the base // finite elements to the matrices of // this object - for (unsigned int component=0; component::children_per_cell; ++child) @@ -504,8 +504,8 @@ FESystem<1>::multiply_dof_numbers (const FiniteElementData<1> &fe_data, { 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); }; @@ -518,8 +518,8 @@ FESystem<1>::multiply_dof_numbers (const FiniteElementData<1> &fe1, { 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 ); }; @@ -538,10 +538,10 @@ FESystem<1>::multiply_dof_numbers (const FiniteElementData<1> &fe1, 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 @@ -557,8 +557,8 @@ FESystem<2>::multiply_dof_numbers (const FiniteElementData<2> &fe_data, 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 <> @@ -571,8 +571,8 @@ FESystem<2>::multiply_dof_numbers (const FiniteElementData<2> &fe1, 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 ); }; @@ -594,10 +594,10 @@ FESystem<2>::multiply_dof_numbers (const FiniteElementData<2> &fe1, 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 @@ -614,8 +614,8 @@ FESystem<3>::multiply_dof_numbers (const FiniteElementData<3> &fe_data, 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 <> @@ -629,8 +629,8 @@ FESystem<3>::multiply_dof_numbers (const FiniteElementData<3> &fe1, 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 ); }; @@ -655,10 +655,10 @@ FESystem<3>::multiply_dof_numbers (const FiniteElementData<3> &fe1, 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 @@ -671,7 +671,7 @@ FESystem::compute_restriction_is_additive_flags (const FiniteElement & { vector tmp; for (unsigned int i=0; i::compute_restriction_is_additive_flags (const FiniteElement & { vector tmp; for (unsigned int i=0; i::compute_restriction_is_additive_flags (const FiniteElement & { vector tmp; for (unsigned int i=0; i::shape_value (const unsigned int i, const Point &p) const { - Assert((i comp = system_to_component_index(i); @@ -740,7 +740,7 @@ Tensor<1,dim> FESystem::shape_grad (const unsigned int i, const Point &p) const { - Assert((i comp = system_to_component_index(i); @@ -755,7 +755,7 @@ Tensor<2,dim> FESystem::shape_grad_grad (const unsigned int i, const Point &p) const { - Assert((i comp = system_to_component_index(i); @@ -770,21 +770,21 @@ template void FESystem::get_unit_support_points ( vector > &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 > base_unit_support_points (base_element(0).total_dofs); + vector > base_unit_support_points (base_element(0).dofs_per_cell); unsigned int component = 0; for (unsigned int base_el=0 ; base_el::get_unit_support_points ( // vector > > base_us_points(n_base_elements()); // for (unsigned int base_el=0 ; base_el void FESystem::get_support_points (const DoFHandler::cell_iterator &cell, vector > &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 > base_support_points (base_element(0).total_dofs); + vector > base_support_points (base_element(0).dofs_per_cell); unsigned int component = 0; for (unsigned int base_el=0 ; base_el void FESystem::get_local_mass_matrix (const DoFHandler::cell_iterator &cell, FullMatrix &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 @@ -895,9 +895,9 @@ void FESystem::get_local_mass_matrix (const DoFHandler::cell_iterator { // first get the local mass matrix for // the base object - const unsigned int base_element_total_dofs=base_element(base_el).total_dofs; - FullMatrix 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 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 @@ -905,8 +905,8 @@ void FESystem::get_local_mass_matrix (const DoFHandler::cell_iterator const unsigned int el_multiplicity=element_multiplicity(base_el); for (unsigned int n=0; n::get_local_mass_matrix (const DoFHandler::cell_iterator ++component; }; }; - Assert (component == n_components, ExcInternalError()); + Assert (component == n_components(), ExcInternalError()); }; @@ -999,7 +999,7 @@ FESystem::fill_fe_values (const DoFHandler::cell_iterator &cell, const FullMatrix &shape_values_transform, const vector > > &shape_grad_transform) const { - vector > supp(base_elements[0].first->total_dofs); + vector > 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, @@ -1013,13 +1013,13 @@ FESystem::fill_fe_values (const DoFHandler::cell_iterator &cell, 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, @@ -1028,7 +1028,7 @@ FESystem::fill_fe_values (const DoFHandler::cell_iterator &cell, 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; } diff --git a/deal.II/deal.II/source/fe/fe_values.cc b/deal.II/deal.II/source/fe/fe_values.cc index 29cc85dec0..d3adb919c4 100644 --- a/deal.II/deal.II/source/fe/fe_values.cc +++ b/deal.II/deal.II/source/fe/fe_values.cc @@ -18,18 +18,18 @@ template FEValuesBase::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 &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(total_dofs, n_q_points)), - shape_gradients (total_dofs, vector >(n_q_points)), - shape_2nd_derivatives (total_dofs, vector >(n_q_points)), + shape_values (n_values_arrays, FullMatrix(dofs_per_cell, n_q_points)), + shape_gradients (dofs_per_cell, vector >(n_q_points)), + shape_2nd_derivatives (dofs_per_cell, vector >(n_q_points)), weights (n_q_points, 0), JxW_values (n_q_points, 0), quadrature_points (n_q_points, Point()), @@ -66,7 +66,7 @@ template void FEValuesBase::get_function_values (const Vector &fe_function, vector &values) const { - Assert (fe->n_components == 1, + Assert (fe->n_components() == 1, ExcWrongNoOfComponents()); Assert (selected_dataset::get_function_values (const Vector &fe_function, // get function values of dofs // on this cell - Vector dof_values (total_dofs); + Vector dof_values (dofs_per_cell); if (present_cell->active()) present_cell->get_dof_values (fe_function, dof_values); else @@ -87,7 +87,7 @@ void FEValuesBase::get_function_values (const Vector &fe_function, // add up contributions of trial // functions for (unsigned int point=0; point::get_function_values (const Vector &fe_functi Assert (selected_datasetn_components, + Assert (values[i].size() == fe->n_components(), ExcWrongNoOfComponents()); // get function values of dofs // on this cell - Vector dof_values (total_dofs); + Vector dof_values (dofs_per_cell); if (present_cell->active()) present_cell->get_dof_values (fe_function, dof_values); else @@ -120,7 +120,7 @@ void FEValuesBase::get_function_values (const Vector &fe_functi // add up contributions of trial // functions for (unsigned int point=0; pointsystem_to_component_index(shape_func).first) += (dof_values(shape_func) * shape_values[selected_dataset](shape_func, point)); }; @@ -147,14 +147,14 @@ template void FEValuesBase::get_function_grads (const Vector &fe_function, vector > &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 dof_values (total_dofs); + Vector dof_values (dofs_per_cell); if (present_cell->active()) present_cell->get_dof_values (fe_function, dof_values); else @@ -166,7 +166,7 @@ void FEValuesBase::get_function_grads (const Vector &fe_function, // add up contributions of trial // functions for (unsigned int point=0; point tmp(shape_gradients[shape_func][point]); tmp *= dof_values(shape_func); @@ -183,12 +183,12 @@ void FEValuesBase::get_function_grads (const Vector &fe_ Assert (selected_datasetn_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 dof_values (total_dofs); + Vector dof_values (dofs_per_cell); if (present_cell->active()) present_cell->get_dof_values (fe_function, dof_values); else @@ -201,7 +201,7 @@ void FEValuesBase::get_function_grads (const Vector &fe_ // add up contributions of trial // functions for (unsigned int point=0; point tmp(shape_gradients[shape_func][point]); tmp *= dof_values(shape_func); @@ -230,14 +230,14 @@ template void FEValuesBase::get_function_2nd_derivatives (const Vector &fe_function, vector > &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 dof_values (total_dofs); + Vector dof_values (dofs_per_cell); if (present_cell->active()) present_cell->get_dof_values (fe_function, dof_values); else @@ -249,7 +249,7 @@ void FEValuesBase::get_function_2nd_derivatives (const Vector &fe // add up contributions of trial // functions for (unsigned int point=0; point tmp(shape_2nd_derivatives[shape_func][point]); tmp *= dof_values(shape_func); @@ -303,24 +303,24 @@ FEValues::FEValues (const FiniteElement &fe, const UpdateFlags update_flags) : FEValuesBase (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 >(quadrature.n_quadrature_points)), - unit_shape_2nd_derivatives(fe.total_dofs, + unit_shape_2nd_derivatives(fe.dofs_per_cell, vector >(quadrature.n_quadrature_points)), - unit_shape_gradients_transform(fe.n_transform_functions, + unit_shape_gradients_transform(fe.n_transform_functions(), vector >(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::reinit (const typename DoFHandler::cell_iterator &cell) // compute gradients on real element if // requested if (update_flags & update_gradients) - for (unsigned int i=0; itotal_dofs; ++i) + for (unsigned int i=0; idofs_per_cell; ++i) for (unsigned int j=0; j::reinit (const typename DoFHandler::cell_iterator &cell) Tensor<2,dim> tmp1, tmp2; if (update_flags & update_second_derivatives) - for (unsigned int i=0; itotal_dofs; ++i) + for (unsigned int i=0; idofs_per_cell; ++i) for (unsigned int j=0; j::reinit (const typename DoFHandler::cell_iterator &cell) template FEFaceValuesBase::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, @@ -444,16 +444,16 @@ FEFaceValuesBase::FEFaceValuesBase (const unsigned int n_q_points, : FEValuesBase (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 > >(total_dofs, + vector > >(dofs_per_cell, vector >(n_q_points))), unit_shape_2nd_derivatives(n_faces_or_subfaces, - vector > >(total_dofs, + vector > >(dofs_per_cell, vector >(n_q_points))), unit_shape_gradients_transform (n_faces_or_subfaces, vector > >(n_transform_functions, @@ -492,8 +492,8 @@ FEFaceValues::FEFaceValues (const FiniteElement &fe, : FEFaceValuesBase (quadrature.n_quadrature_points, fe.dofs_per_face, - fe.total_dofs, - fe.n_transform_functions, + fe.dofs_per_cell, + fe.n_transform_functions(), GeometryInfo::faces_per_cell, update_flags, fe) @@ -509,7 +509,7 @@ FEFaceValues::FEFaceValues (const FiniteElement &fe, for (unsigned int face=0; face::faces_per_cell; ++face) QProjector::project_to_face (quadrature, face, unit_quadrature_points[face]); - for (unsigned int i=0; i::faces_per_cell; ++face) { @@ -574,7 +574,7 @@ void FEFaceValues::reinit (const typename DoFHandler::cell_iterator &c // compute gradients on real element if // requested if (update_flags & update_gradients) - for (unsigned int i=0; itotal_dofs; ++i) + for (unsigned int i=0; idofs_per_cell; ++i) { fill_n (shape_gradients[i].begin(), n_quadrature_points, @@ -593,7 +593,7 @@ void FEFaceValues::reinit (const typename DoFHandler::cell_iterator &c Tensor<2,dim> tmp1, tmp2; if (update_flags & update_second_derivatives) - for (unsigned int i=0; itotal_dofs; ++i) + for (unsigned int i=0; idofs_per_cell; ++i) for (unsigned int j=0; j::FESubfaceValues (const FiniteElement &fe, : FEFaceValuesBase (quadrature.n_quadrature_points, 0, - fe.total_dofs, - fe.n_transform_functions, + fe.dofs_per_cell, + fe.n_transform_functions(), GeometryInfo::faces_per_cell * GeometryInfo::subfaces_per_face, update_flags, fe) @@ -665,7 +665,7 @@ FESubfaceValues::FESubfaceValues (const FiniteElement &fe, face, subface, unit_quadrature_points[face*(1<<(dim-1))+subface]); - for (unsigned int i=0; i::faces_per_cell; ++face) for (unsigned int subface=0; subface::subfaces_per_face; ++subface) @@ -748,7 +748,7 @@ void FESubfaceValues::reinit (const typename DoFHandler::cell_iterator // compute gradients on real element if // requested if (update_flags & update_gradients) - for (unsigned int i=0; itotal_dofs; ++i) + for (unsigned int i=0; idofs_per_cell; ++i) { fill_n (shape_gradients[i].begin(), n_quadrature_points, @@ -766,7 +766,7 @@ void FESubfaceValues::reinit (const typename DoFHandler::cell_iterator Tensor<2,dim> tmp1, tmp2; if (update_flags & update_second_derivatives) - for (unsigned int i=0; itotal_dofs; ++i) + for (unsigned int i=0; idofs_per_cell; ++i) for (unsigned int j=0; j::fill_fe_values (const DoFHandler::cell_iterator &cel 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(); diff --git a/deal.II/deal.II/source/multigrid/mg_dof_accessor.cc b/deal.II/deal.II/source/multigrid/mg_dof_accessor.cc index 3ff7d0a9f8..0e72ae0e8f 100644 --- a/deal.II/deal.II/source/multigrid/mg_dof_accessor.cc +++ b/deal.II/deal.II/source/multigrid/mg_dof_accessor.cc @@ -528,7 +528,7 @@ MGDoFCellAccessor<1>::get_mg_dof_values (const Vector &values, 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()); @@ -565,7 +565,7 @@ MGDoFCellAccessor<2>::get_mg_dof_values (const Vector &values, 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()); diff --git a/deal.II/deal.II/source/multigrid/mg_dof_handler.cc b/deal.II/deal.II/source/multigrid/mg_dof_handler.cc index 9d2763f25f..0b4e5c4b48 100644 --- a/deal.II/deal.II/source/multigrid/mg_dof_handler.cc +++ b/deal.II/deal.II/source/multigrid/mg_dof_handler.cc @@ -1548,16 +1548,16 @@ void MGDoFHandler::make_sparsity_pattern (const unsigned int level, Assert (sparsity.n_cols() == n_dofs(level), ExcDifferentDimensions (sparsity.n_cols(), n_dofs(level))); - const unsigned int total_dofs = selected_fe->total_dofs; - vector dofs_on_this_cell(total_dofs); + const unsigned int dofs_per_cell = selected_fe->dofs_per_cell; + vector 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 void MGTransferPrebuilt::build_matrices (const MGDoFHandler &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 diff --git a/deal.II/deal.II/source/numerics/assembler.cc b/deal.II/deal.II/source/numerics/assembler.cc index d404302043..41f44c8102 100644 --- a/deal.II/deal.II/source/numerics/assembler.cc +++ b/deal.II/deal.II/source/numerics/assembler.cc @@ -37,8 +37,8 @@ Assembler::Assembler (Triangulation *tria, const int index, const AssemblerData *local_data) : DoFCellAccessor (tria,level,index, &local_data->dof), - cell_matrix (dof_handler->get_fe().total_dofs), - cell_vector (Vector(dof_handler->get_fe().total_dofs)), + cell_matrix (dof_handler->get_fe().dofs_per_cell), + cell_vector (Vector(dof_handler->get_fe().dofs_per_cell)), assemble_matrix (local_data->assemble_matrix), assemble_rhs (local_data->assemble_rhs), matrix(local_data->matrix), @@ -61,7 +61,7 @@ template void Assembler::assemble (const Equation &equation) { // re-init fe values for this cell fe_values.reinit (DoFHandler::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 (); diff --git a/deal.II/deal.II/source/numerics/data_io.cc b/deal.II/deal.II/source/numerics/data_io.cc index c45d4cb103..5deb30cdd3 100644 --- a/deal.II/deal.II/source/numerics/data_io.cc +++ b/deal.II/deal.II/source/numerics/data_io.cc @@ -597,7 +597,7 @@ void DataOut_Old::write_gnuplot (ostream &out, unsigned int accuracy) const vector< vector > > values (dof_data.size(), vector< Vector >(points.n_quadrature_points, - Vector(dofs->get_fe().n_components + Vector(dofs->get_fe().n_components() ))); unsigned int cell_index=0; @@ -621,7 +621,7 @@ void DataOut_Old::write_gnuplot (ostream &out, unsigned int accuracy) const Point 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::write_gnuplot (ostream &out, unsigned int accuracy) const 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::write_gnuplot (ostream &out, unsigned int accuracy) const 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::add_data_vector (const Vector &vec, (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::build_patches (const unsigned int n_subdivisions) { 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(); diff --git a/deal.II/deal.II/source/numerics/data_out_stack.cc b/deal.II/deal.II/source/numerics/data_out_stack.cc index 521969ad5b..4ede3bd649 100644 --- a/deal.II/deal.II/source/numerics/data_out_stack.cc +++ b/deal.II/deal.II/source/numerics/data_out_stack.cc @@ -122,8 +122,8 @@ void DataOutStack::add_data_vector (const Vector &vec, (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::build_patches (const unsigned int n_subdivisions) 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(); diff --git a/deal.II/deal.II/source/numerics/error_estimator.cc b/deal.II/deal.II/source/numerics/error_estimator.cc index 36010e7b46..e3605c7cb8 100644 --- a/deal.II/deal.II/source/numerics/error_estimator.cc +++ b/deal.II/deal.II/source/numerics/error_estimator.cc @@ -36,7 +36,7 @@ void KellyErrorEstimator<1>::estimate (const DoFHandler<1> &dof, const vector &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 component_mask ((component_mask_.size() == 0) ? @@ -187,7 +187,7 @@ void KellyErrorEstimator::estimate (const DoFHandler &dof, const vector &component_mask_, const Function *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 component_mask ((component_mask_.size() == 0) ? diff --git a/deal.II/deal.II/source/numerics/matrices.cc b/deal.II/deal.II/source/numerics/matrices.cc index 69f52cd803..0e07954451 100644 --- a/deal.II/deal.II/source/numerics/matrices.cc +++ b/deal.II/deal.II/source/numerics/matrices.cc @@ -81,7 +81,7 @@ void MatrixCreator::create_mass_matrix (const DoFHandler &dof, SparseMatrix &matrix) { const FiniteElement &fe = dof.get_fe(); - const unsigned int dofs_per_cell = fe.total_dofs; + const unsigned int dofs_per_cell = fe.dofs_per_cell; FullMatrix local_mass_matrix (dofs_per_cell, dofs_per_cell); vector dofs_on_this_cell (dofs_per_cell); @@ -128,7 +128,7 @@ void MatrixCreator::create_boundary_mass_matrix (const DoFHandler & vector &dof_to_boundary_mapping, const Function *a) { const FiniteElement &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()); @@ -143,7 +143,7 @@ void MatrixCreator::create_boundary_mass_matrix (const DoFHandler & 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 cell_matrix(dofs_per_cell, dofs_per_cell); @@ -196,9 +196,9 @@ void MatrixCreator::create_boundary_mass_matrix (const DoFHandler & a->vector_value_list (fe_values.get_quadrature_points(), coefficient_values_system); for (unsigned int point=0; point::create_boundary_mass_matrix (const DoFHandler & } else for (unsigned int point=0; point::create_boundary_mass_matrix (const DoFHandler & a->value_list (fe_values.get_quadrature_points(), coefficient_values_scalar); for (unsigned int point=0; point::create_boundary_mass_matrix (const DoFHandler & } else for (unsigned int point=0; point::create_laplace_matrix (const DoFHandler &dof, const Quadrature &q, SparseMatrix &matrix, const Function * 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 dummy; // no entries, should give an error if accessed @@ -459,7 +459,7 @@ void MatrixCreator::create_laplace_matrix (const DoFHandler &dof, Vector &rhs_vector, const Function * 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 | @@ -645,10 +645,10 @@ template void MassMatrix::assemble (FullMatrix &cell_matrix, const FEValues &fe_values, const typename DoFHandler::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 &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::ExcWrongSize(cell_matrix.n(), dofs_per_cell)); @@ -733,10 +733,10 @@ void MassMatrix::assemble (FullMatrix &cell_matrix, const DoFHandler::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 &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 @@ -798,10 +798,10 @@ void MassMatrix::assemble (Vector &rhs, const DoFHandler::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 &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 @@ -843,10 +843,10 @@ void LaplaceMatrix::assemble (FullMatrix &cell_matrix, const DoFHandler::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 &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 @@ -909,11 +909,11 @@ template void LaplaceMatrix::assemble (FullMatrix &cell_matrix, const FEValues &fe_values, const DoFHandler::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 &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 @@ -966,10 +966,10 @@ void LaplaceMatrix::assemble (Vector &rhs, const DoFHandler::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 &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 @@ -1001,23 +1001,23 @@ MatrixCreator::create_interpolation_matrix(const FiniteElement &high, const FiniteElement &low, FullMatrix& 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 phantom_weights(low.total_dofs,1.); - vector > support_points(low.total_dofs); + vector phantom_weights(low.dofs_per_cell,1.); + vector > support_points(low.dofs_per_cell); low.get_unit_support_points(support_points); Quadrature low_points(support_points, phantom_weights); FEValues fe(high, low_points, UpdateFlags(0)); - for (unsigned int i=0; i void MGTransferPrebuilt::build_matrices (const MGDoFHandler &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 diff --git a/deal.II/deal.II/source/numerics/solution_transfer.cc b/deal.II/deal.II/source/numerics/solution_transfer.cc index 1a1f79ee75..01c369c37c 100644 --- a/deal.II/deal.II/source/numerics/solution_transfer.cc +++ b/deal.II/deal.II/source/numerics/solution_transfer.cc @@ -55,7 +55,7 @@ void SolutionTransfer::prepare_for_pure_refinement() 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 > (n_active_cells, @@ -98,7 +98,7 @@ SolutionTransfer::refine_interpolate(const Vector &in, 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 local_values(dofs_per_cell); DoFHandler::cell_iterator cell = dof_handler->begin(), @@ -154,7 +154,7 @@ prepare_for_coarsening_and_refinement(const vector > &all_in) 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 > &all_in, }; - 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 local_values(dofs_per_cell); vector *indexptr; diff --git a/deal.II/deal.II/source/numerics/vectors.cc b/deal.II/deal.II/source/numerics/vectors.cc index 041ab2d634..b28c76cf17 100644 --- a/deal.II/deal.II/source/numerics/vectors.cc +++ b/deal.II/deal.II/source/numerics/vectors.cc @@ -46,11 +46,11 @@ void VectorTools::interpolate (const DoFHandler &dof, const Function &function, Vector &vec) { - Assert (dof.get_fe().n_components == function.n_components, + Assert (dof.get_fe().n_components() == function.n_components, ExcComponentMismatch()); const FiniteElement &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::active_cell_iterator cell = dof.begin_active(), @@ -67,7 +67,7 @@ void VectorTools::interpolate (const DoFHandler &dof, // avoided to evaluate // the vectorfunction multiply at // the same point on a cell. - vector > unit_support_points (fe.total_dofs); + vector > unit_support_points (fe.dofs_per_cell); fe.get_unit_support_points(unit_support_points); // The following works well @@ -85,10 +85,10 @@ void VectorTools::interpolate (const DoFHandler &dof, // support point by setting // #true# in the boolean vector // #is_representative_point#. -// vector is_representative_point(fe.total_dofs, false); +// vector 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::interpolate (const DoFHandler &dof, // } // }; -// vector dofs_on_cell (fe.total_dofs); -// vector > support_points (fe.total_dofs); +// vector dofs_on_cell (fe.dofs_per_cell); +// vector > support_points (fe.dofs_per_cell); // vector > rep_points (n_rep_points); // vector > function_values_at_rep_points ( -// n_rep_points, Vector(fe.n_components)); +// n_rep_points, Vector(fe.n_components())); // for (; cell!=endc; ++cell) // { @@ -115,7 +115,7 @@ void VectorTools::interpolate (const DoFHandler &dof, // // pick out the representative // // support points // unsigned int j=0; -// for (unsigned int i=0; i::interpolate (const DoFHandler &dof, // // therefore the first #last_rep_point# is 0 // // and we need to start with // // `last_rep_point = -1' -// for (unsigned int i=0; i::interpolate (const DoFHandler &dof, // point by the #dof_to_rep_dof_table#. // the following vector collects all dofs i, - // 0<=i::interpolate (const DoFHandler &dof, // to the rep index. vector dof_to_rep_index_table; unsigned int n_rep_points=0; - for (unsigned int i=0; i0; --j) @@ -203,10 +203,10 @@ void VectorTools::interpolate (const DoFHandler &dof, } } 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 dofs_on_cell (fe.total_dofs); - vector > support_points (fe.total_dofs); + vector dofs_on_cell (fe.dofs_per_cell); + vector > support_points (fe.dofs_per_cell); vector > rep_points (n_rep_points); @@ -218,7 +218,7 @@ void VectorTools::interpolate (const DoFHandler &dof, // more efficient one respectively vector function_values_scalar (n_rep_points); vector > function_values_system (n_rep_points, - Vector(fe.n_components)); + Vector(fe.n_components())); for (; cell!=endc; ++cell) { @@ -246,7 +246,7 @@ void VectorTools::interpolate (const DoFHandler &dof, // distribute the function // values to the global // vector - for (unsigned int i=0; i::interpolate (const DoFHandler &dof, // distribute the function // values to the global // vector - for (unsigned int i=0; i::interpolate(const DoFHandler &high_dof, const Vector &high, Vector &low) { - Vector cell_high(high_dof.get_fe().total_dofs); - Vector cell_low(low_dof.get_fe().total_dofs); + Vector cell_high(high_dof.get_fe().dofs_per_cell); + Vector cell_low(low_dof.get_fe().dofs_per_cell); DoFHandler::active_cell_iterator h = high_dof.begin_active(); DoFHandler::active_cell_iterator l = low_dof.begin_active(); @@ -333,7 +333,7 @@ void VectorTools::project (const DoFHandler &dof, const Quadrature &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 &fe = dof.get_fe(); @@ -435,7 +435,7 @@ void VectorTools::create_right_hand_side (const DoFHandler &dof, const Function &rhs, Vector &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 | @@ -475,16 +475,16 @@ VectorTools<1>::interpolate_boundary_values (const DoFHandler<1> &dof, 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 component_mask ((component_mask_.size() == 0) ? - vector (fe.n_components, true) : + vector (fe.n_components(), true) : component_mask_); Assert (count(component_mask.begin(), component_mask.end(), true) > 0, ExcComponentMismatch()); @@ -558,7 +558,7 @@ VectorTools::interpolate_boundary_values (const DoFHandler &dof, ExcInvalidBoundaryIndicator()); const FiniteElement &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, @@ -568,7 +568,7 @@ VectorTools::interpolate_boundary_values (const DoFHandler &dof, // the original value or a vector // of #true#s const vector component_mask ((component_mask_.size() == 0) ? - vector (fe.n_components, true) : + vector (fe.n_components(), true) : component_mask_); Assert (count(component_mask.begin(), component_mask.end(), true) > 0, ExcComponentMismatch()); @@ -584,7 +584,7 @@ VectorTools::interpolate_boundary_values (const DoFHandler &dof, // respectively vector dof_values_scalar (fe.dofs_per_face); vector > dof_values_system (fe.dofs_per_face, - Vector(fe.n_components)); + Vector(fe.n_components())); DoFHandler::active_face_iterator face = dof.begin_active_face(), endf = dof.end_face(); @@ -636,7 +636,7 @@ VectorTools::project_boundary_values (const DoFHandler &dof, const Quadrature &q, map &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 dof_to_boundary_mapping; @@ -722,7 +722,7 @@ VectorTools::integrate_difference (const DoFHandler &dof, { const unsigned int n_q_points = q.n_quadrature_points; const FiniteElement &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)), diff --git a/tests/deal.II/Makefile b/tests/deal.II/Makefile index e29c38c804..0ba860a6e3 100644 --- a/tests/deal.II/Makefile +++ b/tests/deal.II/Makefile @@ -67,6 +67,7 @@ targets = $(addsuffix .target, $(executables)) %.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 diff --git a/tests/deal.II/fe_tables.cc b/tests/deal.II/fe_tables.cc index 2a3abdc20f..bb0c25868b 100644 --- a/tests/deal.II/fe_tables.cc +++ b/tests/deal.II/fe_tables.cc @@ -40,22 +40,22 @@ print_fe_statistics(const FiniteElement& fe) // DoFHandler::active_cell_iterator cell = dof.begin_active(); DoFHandler::active_face_iterator face = dof.begin_active_face(); - vector > unit_points(fe.total_dofs); - vector > support_points(fe.total_dofs); + vector > unit_points(fe.dofs_per_cell); + vector > support_points(fe.dofs_per_cell); vector > 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" << " " < p = fe.system_to_component_index(i); deallog << "Index " << i << " (" diff --git a/tests/deal.II/helmholtz1.th b/tests/deal.II/helmholtz1.th index 7510fab761..85373d700f 100644 --- a/tests/deal.II/helmholtz1.th +++ b/tests/deal.II/helmholtz1.th @@ -8,7 +8,7 @@ Helmholtz::build_all(MATRIX& A, const Quadrature& quadrature, const Function& rhs) { - const unsigned int fe_dofs = dof.get_fe().total_dofs; + const unsigned int fe_dofs = dof.get_fe().n_dofs_per_cell(); FEValues fe(dof.get_fe(), quadrature, UpdateFlags(update_gradients | update_JxW_values | update_q_points)); diff --git a/tests/deal.II/helmholtz1mg.th b/tests/deal.II/helmholtz1mg.th index 11d952711e..b4d358e180 100644 --- a/tests/deal.II/helmholtz1mg.th +++ b/tests/deal.II/helmholtz1mg.th @@ -6,7 +6,7 @@ Helmholtz::build_mgmatrix(MGMatrix& A, const MGDoFHandler& dof, const Quadrature& quadrature) { - const unsigned int fe_dofs = dof.get_fe().total_dofs; + const unsigned int fe_dofs = dof.get_fe().n_dofs_per_cell(); FEValues fe(dof.get_fe(), quadrature, UpdateFlags(update_gradients | update_JxW_values | update_q_points)); diff --git a/tests/deal.II/mglocal.cc b/tests/deal.II/mglocal.cc index 7664abf5cd..db69323f4e 100644 --- a/tests/deal.II/mglocal.cc +++ b/tests/deal.II/mglocal.cc @@ -181,7 +181,7 @@ void write_gnuplot (const MGDoFHandler<2>& dofs, const Vector& v, unsign MGDoFHandler<2>::cell_iterator cell; MGDoFHandler<2>::cell_iterator endc = dofs.end(level); - Vector values(dofs.get_fe().total_dofs); + Vector values(dofs.get_fe().dofs_per_cell); unsigned int cell_index=0; for (cell=dofs.begin(level); cell!=endc; ++cell, ++cell_index) diff --git a/tests/deal.II/wave-test-3.cc b/tests/deal.II/wave-test-3.cc index b9f69f2525..0d226d9d27 100644 --- a/tests/deal.II/wave-test-3.cc +++ b/tests/deal.II/wave-test-3.cc @@ -2108,7 +2108,7 @@ void EndEnergy::compute_vectors (const PartOfDomain pod, Vector &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()); @@ -2125,7 +2125,7 @@ void EndEnergy::compute_vectors (const PartOfDomain pod, FEValues fe_values_primal (*primal_fe, *quadrature, update_gradients); - FullMatrix cell_matrix (total_dofs, total_dofs); + FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); vector > local_u_grad (n_q_points); vector local_v (n_q_points); @@ -2133,7 +2133,7 @@ void EndEnergy::compute_vectors (const PartOfDomain pod, vector density_values(quadrature->n_quadrature_points); vector stiffness_values(quadrature->n_quadrature_points); - vector cell_dof_indices (total_dofs); + vector cell_dof_indices (dofs_per_cell); for (; cell!=endc; ++cell, ++primal_cell) { @@ -2172,9 +2172,9 @@ void EndEnergy::compute_vectors (const PartOfDomain pod, const FullMatrix &shape_values = fe_values.get_shape_values (); const vector &JxW_values (fe_values.get_JxW_values()); - vector local_functional1 (total_dofs, 0); - vector local_functional2 (total_dofs, 0); - for (unsigned int shape_func=0; shape_func local_functional1 (dofs_per_cell, 0); + vector local_functional2 (dofs_per_cell, 0); + for (unsigned int shape_func=0; shape_func::compute_vectors (const PartOfDomain pod, }; cell->get_dof_indices (cell_dof_indices); - for (unsigned int shape_func=0; shape_func::compute_functionals (Vector &j1, Vector &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()); @@ -2260,7 +2260,7 @@ void SeismicSignal::compute_functionals (Vector &j1, cell = dof->begin_active(); endc = dof->end(); - vector cell_dof_indices (total_dofs); + vector cell_dof_indices (dofs_per_cell); FEFaceValues fe_face_values (*fe, *quadrature_face, UpdateFlags(update_JxW_values | @@ -2287,8 +2287,8 @@ void SeismicSignal::compute_functionals (Vector &j1, // \int w(x,t) phi_i(x,y,t) ds // through this line for each // of the basis functions - vector local_integral (total_dofs, 0); - for (unsigned int shape_func=0; shape_func local_integral (dofs_per_cell, 0); + for (unsigned int shape_func=0; shape_func @@ -2296,7 +2296,7 @@ void SeismicSignal::compute_functionals (Vector &j1, JxW_values[point]; cell->get_dof_indices (cell_dof_indices); - for (unsigned int shape_func=0; shape_func::compute_functionals (Vector &, template void SplitSignal::compute_functionals (Vector &j1, Vector &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()); @@ -2393,7 +2393,7 @@ void SplitSignal::compute_functionals (Vector &j1, cell = dof->begin_active(); endc = dof->end(); - vector dof_indices (fe->total_dofs); + vector dof_indices (fe->dofs_per_cell); FEFaceValues fe_face_values (*fe, *quadrature_face, update_JxW_values); for (; cell!=endc; ++cell) @@ -2421,7 +2421,7 @@ void SplitSignal::compute_functionals (Vector &j1, const vector &JxW_values = fe_face_values.get_JxW_values(); cell->get_dof_indices (dof_indices); - for (unsigned int i=0; i::compute_endtime_vectors (Vector &final_u_bar, 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()); @@ -2463,7 +2463,7 @@ void SplitLine<1>::compute_endtime_vectors (Vector &final_u_bar, endc = dof->end (); FEValues fe_values (*fe, *quadrature, update_JxW_values); - vector cell_dof_indices (total_dofs); + vector cell_dof_indices (dofs_per_cell); for (; cell!=endc; ++cell) { @@ -2476,14 +2476,14 @@ void SplitLine<1>::compute_endtime_vectors (Vector &final_u_bar, const FullMatrix &shape_values = fe_values.get_shape_values (); const vector &JxW_values (fe_values.get_JxW_values()); - vector local_functional (total_dofs, 0); - for (unsigned int shape_func=0; shape_func local_functional (dofs_per_cell, 0); + for (unsigned int shape_func=0; shape_funcget_dof_indices (cell_dof_indices); - for (unsigned int shape_func=0; shape_func::compute_endtime_vectors (Vector &final_u_bar, template void OneBranch1d::compute_functionals (Vector &j1, Vector &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()); @@ -2513,7 +2513,7 @@ void OneBranch1d::compute_functionals (Vector &j1, cell = dof->begin_active(); endc = dof->end(); - vector dof_indices (fe->total_dofs); + vector dof_indices (fe->dofs_per_cell); FEValues fe_values (*fe, *quadrature, update_JxW_values); for (; cell!=endc; ++cell) @@ -2525,7 +2525,7 @@ void OneBranch1d::compute_functionals (Vector &j1, const vector &JxW_values = fe_values.get_JxW_values(); cell->get_dof_indices (dof_indices); - for (unsigned int i=0; i::compute_functionals (Vector &j1, template void SecondCrossing::compute_functionals (Vector &j1, Vector &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()); @@ -2562,7 +2562,7 @@ void SecondCrossing::compute_functionals (Vector &j1, cell = dof->begin_active(); endc = dof->end(); - vector dof_indices (fe->total_dofs); + vector dof_indices (fe->dofs_per_cell); FEValues fe_values (*fe, *quadrature, update_JxW_values); for (; cell!=endc; ++cell) @@ -2574,7 +2574,7 @@ void SecondCrossing::compute_functionals (Vector &j1, const vector &JxW_values = fe_values.get_JxW_values(); cell->get_dof_indices (dof_indices); - for (unsigned int i=0; i::compute_energy (const PartOfDomain pod) const UpdateFlags(update_gradients | update_JxW_values | update_q_points)); - FullMatrix cell_matrix (fe->total_dofs, fe->total_dofs); - Vector local_u (fe->total_dofs); - Vector local_v (fe->total_dofs); + FullMatrix cell_matrix (fe->dofs_per_cell, fe->dofs_per_cell); + Vector local_u (fe->dofs_per_cell); + Vector local_v (fe->dofs_per_cell); vector density_values(quadrature->n_quadrature_points); vector stiffness_values(quadrature->n_quadrature_points); @@ -2794,8 +2794,8 @@ double EvaluateEnergyContent::compute_energy (const PartOfDomain pod) const density->value_list (fe_values.get_quadrature_points(), density_values); for (unsigned int point=0; pointtotal_dofs; ++i) - for (unsigned int j=0; jtotal_dofs; ++j) + for (unsigned int i=0; idofs_per_cell; ++i) + for (unsigned int j=0; jdofs_per_cell; ++j) cell_matrix(i,j) += (values(i,point) * values(j,point)) * weights[point] * @@ -2809,8 +2809,8 @@ double EvaluateEnergyContent::compute_energy (const PartOfDomain pod) const stiffness->value_list (fe_values.get_quadrature_points(), stiffness_values); for (unsigned int point=0; pointtotal_dofs; ++i) - for (unsigned int j=0; jtotal_dofs; ++j) + for (unsigned int i=0; idofs_per_cell; ++i) + for (unsigned int j=0; jdofs_per_cell; ++j) cell_matrix(i,j) += (gradients[i][point] * gradients[j][point]) * weights[point] * @@ -3130,7 +3130,7 @@ double EvaluateOneBranch1d<1>::evaluate () { endc = dof->end(); double u_integrated=0; FEValues<1> fe_values (*fe, *quadrature, update_JxW_values); - vector cell_u (fe->total_dofs); + vector cell_u (fe->dofs_per_cell); for (; cell!=endc; ++cell) if ((cell->center()(0) > -0.6) && @@ -3207,7 +3207,7 @@ double EvaluateSecondCrossing1d<1>::evaluate () { endc = dof->end(); double u_integrated=0; FEValues<1> fe_values (*fe, *quadrature, UpdateFlags(update_JxW_values | update_q_points)); - vector cell_u (fe->total_dofs); + vector cell_u (fe->dofs_per_cell); for (; cell!=endc; ++cell) if ((cell->center()(0) > -0.03) && @@ -5512,7 +5512,7 @@ void TimeStep_Wave::create_matrices () 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, @@ -5540,9 +5540,9 @@ void TimeStep_Wave::create_matrices () // indices of all the dofs on this // cell - vector dof_indices_on_cell (total_dofs); - FullMatrix cell_mass_matrix (total_dofs, total_dofs); - FullMatrix cell_laplace_matrix (total_dofs, total_dofs); + vector dof_indices_on_cell (dofs_per_cell); + FullMatrix cell_mass_matrix (dofs_per_cell, dofs_per_cell); + FullMatrix cell_laplace_matrix (dofs_per_cell, dofs_per_cell); for (typename DoFHandler::active_cell_iterator cell=dof_handler->begin_active(); @@ -5573,8 +5573,8 @@ void TimeStep_Wave::create_matrices () // now do the loop for (unsigned int q_point=0; q_point::create_matrices () }; // now transfer to global matrices - for (unsigned int i=0; i::transfer_old_solutions (const typename DoFHandler::cell { // get values from // old cell and set on the new one - Vector cell_data (fe.total_dofs); + Vector 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); @@ -6131,7 +6131,7 @@ TimeStep_Dual::build_rhs (const DoFHandler::cell_iterator &old_cell, const TimeStep_Dual &previous_time_level = static_cast*>(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 @@ -6143,26 +6143,26 @@ TimeStep_Dual::build_rhs (const DoFHandler::cell_iterator &old_cell, const vector > >&gradients = fe_values.get_shape_grads (); const vector &weights = fe_values.get_JxW_values (); - FullMatrix cell_matrix (total_dofs, total_dofs); + FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); vector density_values(fe_values.n_quadrature_points); parameters.density->value_list (fe_values.get_quadrature_points(), density_values); for (unsigned int point=0; point tmp (total_dofs); + Vector 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 rhs1 (total_dofs); + Vector rhs1 (dofs_per_cell); // this is the part of the right hand side // of the second equation which depends @@ -6170,16 +6170,16 @@ TimeStep_Dual::build_rhs (const DoFHandler::cell_iterator &old_cell, // step. // for the theta scheme: // rhs2 := Mu^1-(1-theta)kAv^1 - Vector rhs2 (total_dofs); + Vector rhs2 (dofs_per_cell); // vector of values of the function on the // old grid restricted to one cell - Vector old_dof_values_v (total_dofs); + Vector old_dof_values_v (dofs_per_cell); // vector of old u and v times the local // mass matrix - Vector local_M_u (total_dofs); - Vector local_M_v (total_dofs); - Vector local_A_v (total_dofs); + Vector local_M_u (dofs_per_cell); + Vector local_M_v (dofs_per_cell); + Vector 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); @@ -6195,8 +6195,8 @@ TimeStep_Dual::build_rhs (const DoFHandler::cell_iterator &old_cell, parameters.stiffness->value_list (fe_values.get_quadrature_points(), stiffness_values); for (unsigned int point=0; point::build_rhs (const DoFHandler::cell_iterator &old_cell, // transfer into the global // right hand side - vector new_dof_indices (total_dofs, -1); + vector new_dof_indices (dofs_per_cell, -1); new_cell->get_dof_indices (new_dof_indices); - for (unsigned int i=0; i::build_rhs (const DoFHandler::cell_iterator &old_cell, // for the theta scheme: // rhs1 := Mv^0 + kMu^1 // -(1-theta)theta k^2 Av^1 - Vector rhs1 (total_dofs); + Vector 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 rhs2 (total_dofs); + Vector rhs2 (dofs_per_cell); // collect the contributions of the // child cells (and possibly their @@ -6251,9 +6251,9 @@ TimeStep_Dual::build_rhs (const DoFHandler::cell_iterator &old_cell, // transfer into the global // right hand side - vector new_dof_indices (total_dofs); + vector new_dof_indices (dofs_per_cell); new_cell->get_dof_indices (new_dof_indices); - for (unsigned int i=0; i::build_rhs (const DoFHandler::cell_iterator &old_cell, // vector of values of the function // on the old grid restricted to // the large (old) cell - Vector old_dof_values_u (total_dofs); - Vector old_dof_values_v (total_dofs); + Vector old_dof_values_u (dofs_per_cell); + Vector 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); @@ -6305,36 +6305,36 @@ TimeStep_Dual::collect_from_children (const DoFHandler::cell_iterator const TimeStep_Dual &previous_time_level = static_cast*>(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 cell_matrix (total_dofs, total_dofs); + FullMatrix 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 local_old_dof_values_u (total_dofs); - Vector local_old_dof_values_v (total_dofs); + Vector local_old_dof_values_u (dofs_per_cell); + Vector local_old_dof_values_v (dofs_per_cell); // same for the contributions to the // right hand sides of the projection - Vector local_M_u (total_dofs); - Vector local_M_v (total_dofs); - Vector local_A_v (total_dofs); + Vector local_M_u (dofs_per_cell); + Vector local_M_v (dofs_per_cell); + Vector 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 child_rhs1 (total_dofs); + Vector 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 child_rhs2 (total_dofs); + Vector child_rhs2 (dofs_per_cell); for (unsigned int c=0; c::children_per_cell; ++c) { @@ -6370,8 +6370,8 @@ TimeStep_Dual::collect_from_children (const DoFHandler::cell_iterator parameters.density->value_list (fe_values.get_quadrature_points(), density_values); for (unsigned int point=0; point::collect_from_children (const DoFHandler::cell_iterator parameters.stiffness->value_list (fe_values.get_quadrature_points(), stiffness_values); for (unsigned int point=0; point::distribute_to_children (const DoFHandler::cell_iterator // 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 cell_matrix(total_dofs, total_dofs); + FullMatrix 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 local_old_dof_values_u (total_dofs); - Vector local_old_dof_values_v (total_dofs); + Vector local_old_dof_values_u (dofs_per_cell); + Vector 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 local_M_u (total_dofs); - Vector local_M_v (total_dofs); - Vector local_A_v (total_dofs); + Vector local_M_u (dofs_per_cell); + Vector local_M_v (dofs_per_cell); + Vector 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 rhs1 (total_dofs); + Vector rhs1 (dofs_per_cell); // this is the part of the right hand side // of the second equation which depends @@ -6463,11 +6463,11 @@ TimeStep_Dual::distribute_to_children (const DoFHandler::cell_iterator // step. // for the theta scheme: // rhs2 := Mu^1-(1-theta)kAv^1 - Vector rhs2 (total_dofs); + Vector rhs2 (dofs_per_cell); // indices of the dofs of a cell on // the new grid - vector new_dof_indices (total_dofs, -1); + vector new_dof_indices (dofs_per_cell, -1); // loop over the child cells @@ -6508,8 +6508,8 @@ TimeStep_Dual::distribute_to_children (const DoFHandler::cell_iterator parameters.density->value_list (fe_values.get_quadrature_points(), density_values); for (unsigned int point=0; point::distribute_to_children (const DoFHandler::cell_iterator parameters.stiffness->value_list (fe_values.get_quadrature_points(), stiffness_values); for (unsigned int point=0; point::distribute_to_children (const DoFHandler::cell_iterator // transfer into the global // right hand side new_child->get_dof_indices (new_dof_indices); - for (unsigned int i=0; i::estimate_error_dual (const DoFHandler::cell_ const FiniteElement &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 @@ -6871,16 +6871,16 @@ TimeStep_ErrorEstimation::estimate_error_dual (const DoFHandler::cell_ // hold the solution interpolated // up to the ansatz degree of the // dual problem. - Vector local_u(total_dofs_dual), local_v(total_dofs_dual); - Vector local_u_bar(total_dofs_dual), local_v_bar(total_dofs_dual); + Vector local_u(dofs_per_cell_dual), local_v(dofs_per_cell_dual); + Vector local_u_bar(dofs_per_cell_dual), local_v_bar(dofs_per_cell_dual); // same thing for old solutions - Vector local_u_old(total_dofs_dual), local_v_old(total_dofs_dual); - Vector local_u_bar_old(total_dofs_dual), local_v_bar_old(total_dofs_dual); + Vector local_u_old(dofs_per_cell_dual), local_v_old(dofs_per_cell_dual); + Vector 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 primal_tmp(total_dofs_primal); + Vector primal_tmp(dofs_per_cell_primal); // fill local solution vectors primal_cell->get_dof_values (primal_problem.u, primal_tmp); @@ -6926,12 +6926,12 @@ TimeStep_ErrorEstimation::estimate_error_dual (const DoFHandler::cell_ // thereon if (!primal_cell_old->has_children() && primal_cell->has_children()) { - Vector local_u_old(total_dofs_dual), local_v_old(total_dofs_dual); - Vector local_u_bar_old(total_dofs_dual), local_v_bar_old(total_dofs_dual); + Vector local_u_old(dofs_per_cell_dual), local_v_old(dofs_per_cell_dual); + Vector 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 primal_tmp(total_dofs_primal); + Vector primal_tmp(dofs_per_cell_primal); // fill local old solution vectors. // no problems here, since the two @@ -6976,11 +6976,11 @@ TimeStep_ErrorEstimation::estimate_error_dual (const DoFHandler::cell_ // hold the solution interpolated // up to the ansatz degree of the // dual problem. - Vector local_u(total_dofs_dual), local_v(total_dofs_dual); - Vector local_u_bar(total_dofs_dual), local_v_bar(total_dofs_dual); - Vector local_u_bar_old(total_dofs_dual), local_v_bar_old(total_dofs_dual); - Vector local_Ih_u_bar(total_dofs_dual), local_Ih_v_bar(total_dofs_dual); - Vector local_Ih_u_bar_old(total_dofs_dual), local_Ih_v_bar_old(total_dofs_dual); + Vector local_u(dofs_per_cell_dual), local_v(dofs_per_cell_dual); + Vector local_u_bar(dofs_per_cell_dual), local_v_bar(dofs_per_cell_dual); + Vector local_u_bar_old(dofs_per_cell_dual), local_v_bar_old(dofs_per_cell_dual); + Vector local_Ih_u_bar(dofs_per_cell_dual), local_Ih_v_bar(dofs_per_cell_dual); + Vector 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) @@ -7065,7 +7065,7 @@ compute_error_on_new_children (const DoFHandler::cell_iterator &primal_cell const TimeStep_Dual &dual_problem = get_timestep_dual(); const FiniteElement &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::children_per_cell; ++child) @@ -7073,8 +7073,8 @@ compute_error_on_new_children (const DoFHandler::cell_iterator &primal_cell // we have the solutions on the // old (large) cell, we restrict it to // each of the small cells - Vector child_u_old(total_dofs_dual), child_v_old(total_dofs_dual); - Vector child_u_bar_old(total_dofs_dual), child_v_bar_old(total_dofs_dual); + Vector child_u_old(dofs_per_cell_dual), child_v_old(dofs_per_cell_dual); + Vector 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); @@ -7107,8 +7107,8 @@ compute_error_on_new_children (const DoFHandler::cell_iterator &primal_cell // hold the solution interpolated // up to the ansatz degree of the // dual problem. - Vector local_u(total_dofs_dual), local_v(total_dofs_dual); - Vector local_u_bar(total_dofs_dual), local_v_bar(total_dofs_dual); + Vector local_u(dofs_per_cell_dual), local_v(dofs_per_cell_dual); + Vector 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) @@ -7160,17 +7160,17 @@ TimeStep_ErrorEstimation::collect_error_from_children (const DoFHandler::children_per_cell; ++child) { // we have the solutions on the // new (large) cell, we restrict it to // each of the small cells - Vector child_u(total_dofs_dual), child_v(total_dofs_dual); - Vector child_u_bar(total_dofs_dual), child_v_bar(total_dofs_dual); - Vector child_Ih_u_bar(total_dofs_dual), child_Ih_v_bar(total_dofs_dual); - Vector child_Ih_u_bar_old(total_dofs_dual), child_Ih_v_bar_old(total_dofs_dual); + Vector child_u(dofs_per_cell_dual), child_v(dofs_per_cell_dual); + Vector child_u_bar(dofs_per_cell_dual), child_v_bar(dofs_per_cell_dual); + Vector child_Ih_u_bar(dofs_per_cell_dual), child_Ih_v_bar(dofs_per_cell_dual); + Vector 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); @@ -7199,8 +7199,8 @@ TimeStep_ErrorEstimation::collect_error_from_children (const DoFHandler go on here directly { - Vector local_u_old(total_dofs_dual), local_v_old(total_dofs_dual); - Vector local_u_bar_old(total_dofs_dual), local_v_bar_old(total_dofs_dual); + Vector local_u_old(dofs_per_cell_dual), local_v_old(dofs_per_cell_dual); + Vector 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) @@ -7215,10 +7215,10 @@ TimeStep_ErrorEstimation::collect_error_from_children (const DoFHandlerget_dof_values (primal_problem_old.v, primal_tmp); embedding_matrix.vmult (local_v_old, primal_tmp); - Vector child_difference_u_bar (total_dofs_dual); - Vector child_difference_v_bar (total_dofs_dual); - Vector local_difference_u_bar_old (total_dofs_dual); - Vector local_difference_v_bar_old (total_dofs_dual); + Vector child_difference_u_bar (dofs_per_cell_dual); + Vector child_difference_v_bar (dofs_per_cell_dual); + Vector local_difference_u_bar_old (dofs_per_cell_dual); + Vector local_difference_v_bar_old (dofs_per_cell_dual); child_difference_u_bar = child_u_bar; child_difference_u_bar -= child_Ih_u_bar; @@ -7303,12 +7303,12 @@ TimeStep_ErrorEstimation::error_formula (const DoFHandler::active_cell // 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 tmp1(total_dofs); - Vector tmp2(total_dofs); + Vector tmp1(dofs_per_cell); + Vector tmp2(dofs_per_cell); vector stiffness(fe_values.n_quadrature_points); @@ -7338,8 +7338,8 @@ TimeStep_ErrorEstimation::error_formula (const DoFHandler::active_cell parameters.density->value_list (fe_values.get_quadrature_points(), density_values); for (unsigned int point=0; point::make_interpolation_matrices () { const FiniteElement &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 > unit_support_points (dual_fe.total_dofs); + vector > unit_support_points (dual_fe.dofs_per_cell); dual_fe.get_unit_support_points (unit_support_points); - for (unsigned int i=0; i::make_interpolation_matrices () { // primal space and then back to the // dual space (by injection, using // the matrix constructed above) - FullMatrix inverse_interpolation (primal_fe.total_dofs, - dual_fe.total_dofs); - unit_support_points.resize (primal_fe.total_dofs); + FullMatrix 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::build_rhs (const DoFHandler::cell_iterator &old_cell, const TimeStep_Primal &previous_time_level = static_cast*>(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 @@ -8462,7 +8462,7 @@ TimeStep_Primal::build_rhs (const DoFHandler::cell_iterator &old_cell, { fe_values.reinit (old_cell); - FullMatrix cell_matrix (total_dofs, total_dofs); + FullMatrix cell_matrix (dofs_per_cell, dofs_per_cell); const FullMatrix &values = fe_values.get_shape_values (); const vector > >&gradients = fe_values.get_shape_grads (); const vector &weights = fe_values.get_JxW_values (); @@ -8472,20 +8472,20 @@ TimeStep_Primal::build_rhs (const DoFHandler::cell_iterator &old_cell, parameters.density->value_list (fe_values.get_quadrature_points(), density_values); for (unsigned int point=0; point tmp (total_dofs); + Vector 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 rhs1 (total_dofs); + Vector rhs1 (dofs_per_cell); // this is the part of the right hand side // of the second equation which depends @@ -8493,16 +8493,16 @@ TimeStep_Primal::build_rhs (const DoFHandler::cell_iterator &old_cell, // step. // for the theta scheme: // rhs2 := Mv^0-(1-theta)kA^0 - Vector rhs2 (total_dofs); + Vector rhs2 (dofs_per_cell); // vector of values of the function on the // old grid restricted to one cell - Vector old_dof_values_u (total_dofs); + Vector old_dof_values_u (dofs_per_cell); // vector of old u and v times the local // mass matrix - Vector local_M_u (total_dofs); - Vector local_M_v (total_dofs); - Vector local_A_u (total_dofs); + Vector local_M_u (dofs_per_cell); + Vector local_M_v (dofs_per_cell); + Vector 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); @@ -8518,8 +8518,8 @@ TimeStep_Primal::build_rhs (const DoFHandler::cell_iterator &old_cell, parameters.stiffness->value_list (fe_values.get_quadrature_points(), stiffness_values); for (unsigned int point=0; point::build_rhs (const DoFHandler::cell_iterator &old_cell, // transfer into the global // right hand side - vector new_dof_indices (total_dofs, -1); + vector new_dof_indices (dofs_per_cell, -1); new_cell->get_dof_indices (new_dof_indices); - for (unsigned int i=0; i::build_rhs (const DoFHandler::cell_iterator &old_cell, // for the theta scheme: // rhs1 := Mu^0 + kMv^0 // -(1-theta)theta k^2 Au^0 - Vector rhs1 (total_dofs); + Vector rhs1 (dofs_per_cell); // this is the part of the right hand side // of the second equation which depends @@ -8567,7 +8567,7 @@ TimeStep_Primal::build_rhs (const DoFHandler::cell_iterator &old_cell, // step. // for the theta scheme: // rhs2 := Mv^0-(1-theta)kA^0 - Vector rhs2 (total_dofs); + Vector rhs2 (dofs_per_cell); // collect the contributions of the // child cells (and possibly their @@ -8576,9 +8576,9 @@ TimeStep_Primal::build_rhs (const DoFHandler::cell_iterator &old_cell, // transfer into the global // right hand side - vector new_dof_indices (total_dofs); + vector new_dof_indices (dofs_per_cell); new_cell->get_dof_indices (new_dof_indices); - for (unsigned int i=0; i::build_rhs (const DoFHandler::cell_iterator &old_cell, // vector of values of the function // on the old grid restricted to // the large (old) cell - Vector old_dof_values_u (total_dofs); - Vector old_dof_values_v (total_dofs); + Vector old_dof_values_u (dofs_per_cell); + Vector 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); @@ -8631,29 +8631,29 @@ TimeStep_Primal::collect_from_children (const DoFHandler::cell_iterato const TimeStep_Primal &previous_time_level = static_cast*>(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 cell_matrix (total_dofs, total_dofs); + FullMatrix 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 local_old_dof_values_u (total_dofs); - Vector local_old_dof_values_v (total_dofs); + Vector local_old_dof_values_u (dofs_per_cell); + Vector local_old_dof_values_v (dofs_per_cell); // same for the contributions to the // right hand sides of the projection - Vector local_M_u (total_dofs); - Vector local_M_v (total_dofs); - Vector local_A_u (total_dofs); + Vector local_M_u (dofs_per_cell); + Vector local_M_v (dofs_per_cell); + Vector 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 child_rhs1 (total_dofs); + Vector child_rhs1 (dofs_per_cell); // this is the part of the right hand side // of the second equation which depends @@ -8661,7 +8661,7 @@ TimeStep_Primal::collect_from_children (const DoFHandler::cell_iterato // step. // for the theta scheme: // rhs2 := Mv^0-(1-theta)kA^0 - Vector child_rhs2 (total_dofs); + Vector child_rhs2 (dofs_per_cell); for (unsigned int c=0; c::children_per_cell; ++c) { @@ -8697,8 +8697,8 @@ TimeStep_Primal::collect_from_children (const DoFHandler::cell_iterato parameters.density->value_list (fe_values.get_quadrature_points(), density_values); for (unsigned int point=0; point::collect_from_children (const DoFHandler::cell_iterato parameters.stiffness->value_list (fe_values.get_quadrature_points(), stiffness_values); for (unsigned int point=0; point::distribute_to_children (const DoFHandler::cell_iterat // 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 cell_matrix(total_dofs, total_dofs); + FullMatrix 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 local_old_dof_values_u (total_dofs); - Vector local_old_dof_values_v (total_dofs); + Vector local_old_dof_values_u (dofs_per_cell); + Vector 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 local_M_u (total_dofs); - Vector local_M_v (total_dofs); - Vector local_A_u (total_dofs); + Vector local_M_u (dofs_per_cell); + Vector local_M_v (dofs_per_cell); + Vector 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 rhs1 (total_dofs); + Vector rhs1 (dofs_per_cell); // this is the part of the right hand side // of the second equation which depends @@ -8792,11 +8792,11 @@ TimeStep_Primal::distribute_to_children (const DoFHandler::cell_iterat // step. // for the theta scheme: // rhs2 := Mv^0-(1-theta)kA^0 - Vector rhs2 (total_dofs); + Vector rhs2 (dofs_per_cell); // indices of the dofs of a cell on // the new grid - vector new_dof_indices (total_dofs, -1); + vector new_dof_indices (dofs_per_cell, -1); // loop over the child cells @@ -8837,8 +8837,8 @@ TimeStep_Primal::distribute_to_children (const DoFHandler::cell_iterat parameters.density->value_list (fe_values.get_quadrature_points(), density_values); for (unsigned int point=0; point::distribute_to_children (const DoFHandler::cell_iterat parameters.stiffness->value_list (fe_values.get_quadrature_points(), stiffness_values); for (unsigned int point=0; point::distribute_to_children (const DoFHandler::cell_iterat // transfer into the global // right hand side new_child->get_dof_indices (new_dof_indices); - for (unsigned int i=0; i& finel, const char* name) { gnuplot << q.quad_point(k); - for (unsigned int i=0;i