From 9d3883680f9cbe375bd097b19441a2a86f1dfe17 Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Thu, 5 Jul 2018 15:25:45 +0200 Subject: [PATCH] Fix comments in @code blocks in fe headers --- include/deal.II/fe/block_mask.h | 9 ++- include/deal.II/fe/component_mask.h | 5 +- include/deal.II/fe/fe.h | 24 +++--- include/deal.II/fe/fe_enriched.h | 18 ++--- include/deal.II/fe/fe_system.h | 98 +++++++++++++----------- include/deal.II/fe/fe_values.h | 26 ++++--- include/deal.II/fe/mapping_q1_eulerian.h | 2 +- 7 files changed, 100 insertions(+), 82 deletions(-) diff --git a/include/deal.II/fe/block_mask.h b/include/deal.II/fe/block_mask.h index ebc66bcc4d..71a170f6e1 100644 --- a/include/deal.II/fe/block_mask.h +++ b/include/deal.II/fe/block_mask.h @@ -48,10 +48,11 @@ DEAL_II_NAMESPACE_OPEN * block of a Stokes element (see * @ref vector_valued): * @code - * FESystem stokes_fe (FESystem(FE_Q(2), dim), 1, // Q2 - * element for the velocities FE_Q(1), 1); // Q1 - * element for the pressure FEValuesExtractors::Scalar pressure(dim); BlockMask - * pressure_mask = stokes_fe.block_mask (pressure); + * // Q2 element for the velocities, Q1 element for the pressure + * FESystem stokes_fe (FESystem(FE_Q(2), dim), 1, + * FE_Q(1), 1); + * FEValuesExtractors::Scalar pressure(dim); + * BlockMask pressure_mask = stokes_fe.block_mask (pressure); * @endcode * Note that by wrapping the velocity elements into a single FESystem object * we make sure that the overall element has only 2 blocks. The result is a diff --git a/include/deal.II/fe/component_mask.h b/include/deal.II/fe/component_mask.h index 802a400468..9d1a696da3 100644 --- a/include/deal.II/fe/component_mask.h +++ b/include/deal.II/fe/component_mask.h @@ -59,8 +59,9 @@ DEAL_II_NAMESPACE_OPEN * Stokes element (see * @ref vector_valued): * @code - * FESystem stokes_fe (FE_Q(2), dim, // Q2 element for the - * velocities FE_Q(1), 1); // Q1 element for the pressure + * // Q2 element for the velocities, Q1 element for the pressure + * FESystem stokes_fe (FE_Q(2), dim, + * FE_Q(1), 1); * FEValuesExtractors::Scalar pressure(dim); * ComponentMask pressure_mask = stokes_fe.component_mask (pressure); * @endcode diff --git a/include/deal.II/fe/fe.h b/include/deal.II/fe/fe.h index 96a9f21192..92b8eb3c03 100644 --- a/include/deal.II/fe/fe.h +++ b/include/deal.II/fe/fe.h @@ -174,12 +174,16 @@ class FESystem; * FiniteElement::system_to_base_index() one can get the * following information for each degree-of-freedom "i": * @code - * const unsigned int component = - * fe_basis.system_to_component_index(i).first; const unsigned int within_base - * = fe_basis.system_to_component_index(i).second; const unsigned int base = - * fe_basis.system_to_base_index(i).first.first; const unsigned int multiplicity - * = fe_basis.system_to_base_index(i).first.second; const unsigned int - * within_base_ = fe_basis.system_to_base_index(i).second; // same as above + * const unsigned int component = + * fe_basis.system_to_component_index(i).first; + * const unsigned int within_base = + * fe_basis.system_to_component_index(i).second; + * const unsigned int base = + * fe_basis.system_to_base_index(i).first.first; + * const unsigned int multiplicity = + * fe_basis.system_to_base_index(i).first.second; + * const unsigned int within_base_ = + * fe_basis.system_to_base_index(i).second; // same as above * @endcode * which will result in: * @@ -247,10 +251,10 @@ class FESystem; * Alternatively, the points can be transformed one-by-one: * @code * const vector > &unit_points = - * fe.get_unit_support_points(); + * fe.get_unit_support_points(); * * Point mapped_point = - * mapping.transform_unit_to_real_cell (cell, unit_points[i]); + * mapping.transform_unit_to_real_cell (cell, unit_points[i]); * @endcode * * @note Finite elements' implementation of the get_unit_support_points() @@ -822,8 +826,8 @@ public: * helpful in writing code that works with both ::DoFHandler and the hp * version hp::DoFHandler, since one can then write code like this: * @code - * dofs_per_cell - * = dof_handler->get_fe()[cell->active_fe_index()].dofs_per_cell; + * dofs_per_cell = + * dof_handler->get_fe()[cell->active_fe_index()].dofs_per_cell; * @endcode * * This code doesn't work in both situations without the present operator diff --git a/include/deal.II/fe/fe_enriched.h b/include/deal.II/fe/fe_enriched.h index b5a74e3ac9..428b6641c8 100644 --- a/include/deal.II/fe/fe_enriched.h +++ b/include/deal.II/fe/fe_enriched.h @@ -251,15 +251,15 @@ public: * define dummy functions. Below is an example which uses two functions with * the first element to be enriched and a single function with the second one. * @code - * FE_Enriched fe - * (&fe_base, - * {&fe_1, &fe_2}, - * {{[=] (const typename Triangulation::cell_iterator &) -> const - * Function * {return &fe_1_function1;}, - * [=] (const typename Triangulation::cell_iterator &) -> const - * Function * {return &fe_1_function2;}}, - * {[=] (const typename Triangulation::cell_iterator &) -> const - * Function * {return &fe_2_function;}}}); + * FE_Enriched fe( + * &fe_base, + * {&fe_1, &fe_2}, + * {{[=] (const typename Triangulation::cell_iterator &) + * -> const Function * {return &fe_1_function1;}, + * [=] (const typename Triangulation::cell_iterator &) + * -> const Function * {return &fe_1_function2;}}, + * {[=] (const typename Triangulation::cell_iterator &) + * -> const Function * {return &fe_2_function;}}}); * @endcode * * @note When using the same finite element for enrichment with N diff --git a/include/deal.II/fe/fe_system.h b/include/deal.II/fe/fe_system.h index 854f0c4c37..bc269b5bab 100644 --- a/include/deal.II/fe/fe_system.h +++ b/include/deal.II/fe/fe_system.h @@ -374,57 +374,65 @@ public: * though: the create_fe_list() function creates a vector of * pointers, but nothing destroys these. This is the solution: * @code - * template - * class MySimulator { - * public: - * MySimulator (const unsigned int polynomial_degree); - * - * private: - * FESystem fe; - * - * struct VectorElementDestroyer { - * const std::vector*> data; - * VectorElementDestroyer (const std::vector*> - * &pointers); ~VectorElementDestroyer (); // destructor to delete the - * pointers const std::vector*> & get_data () const; - * }; - * - * static std::vector*> - * create_fe_list (const unsigned int polynomial_degree); - * - * static std::vector - * create_fe_multiplicities (); - * }; + * template + * class MySimulator + * { + * public: + * MySimulator (const unsigned int polynomial_degree); * - * template - * MySimulator::VectorElementDestroyer:: - * VectorElementDestroyer (const std::vector*> - * &pointers) : data(pointers) - * {} + * private: + * FESystem fe; * - * template - * MySimulator::VectorElementDestroyer:: - * ~VectorElementDestroyer () + * struct VectorElementDestroyer * { - * for (unsigned int i=0; i*> data; * - * template - * const std::vector*> & - * MySimulator::VectorElementDestroyer:: - * get_data () const - * { - * return data; - * } + * VectorElementDestroyer( + * const std::vector*> &pointers); * + * // destructor to delete the pointers + * ~VectorElementDestroyer (); * - * template - * MySimulator::MySimulator (const unsigned int polynomial_degree) - * : - * fe (VectorElementDestroyer(create_fe_list - * (polynomial_degree)).get_data(), create_fe_multiplicities ()) - * {} + * const std::vector*> & get_data () const; + * }; + * + * static std::vector*> + * create_fe_list (const unsigned int polynomial_degree); + * + * static std::vector + * create_fe_multiplicities (); + * }; + * + * template + * MySimulator::VectorElementDestroyer:: + * VectorElementDestroyer( + * const std::vector*> &pointers) + * : + * data(pointers) + * {} + * + * template + * MySimulator::VectorElementDestroyer:: + * ~VectorElementDestroyer () + * { + * for (unsigned int i=0; i + * const std::vector*> & + * MySimulator::VectorElementDestroyer:: + * get_data () const + * { + * return data; + * } + * + * template + * MySimulator::MySimulator (const unsigned int polynomial_degree) + * : + * fe (VectorElementDestroyer(create_fe_list (polynomial_degree)).get_data(), + * create_fe_multiplicities ()) + * {} * @endcode * * In other words, the vector we receive from the diff --git a/include/deal.II/fe/fe_values.h b/include/deal.II/fe/fe_values.h index 37e2a52a3e..961acd66eb 100644 --- a/include/deal.II/fe/fe_values.h +++ b/include/deal.II/fe/fe_values.h @@ -367,8 +367,9 @@ namespace FEValuesViews * or, for a generic @p Number type, * @code * std::vector local_dof_values(cell->get_fe().dofs_per_cell); - * cell->get_dof_values(solution, local_dof_values.begin(), - * local_dof_values.end()); + * cell->get_dof_values(solution, + * local_dof_values.begin(), + * local_dof_values.end()); * @endcode */ template @@ -934,8 +935,9 @@ namespace FEValuesViews * or, for a generic @p Number type, * @code * std::vector local_dof_values(cell->get_fe().dofs_per_cell); - * cell->get_dof_values(solution, local_dof_values.begin(), - * local_dof_values.end()); + * cell->get_dof_values(solution, + * local_dof_values.begin(), + * local_dof_values.end()); * @endcode */ template @@ -1446,8 +1448,9 @@ namespace FEValuesViews * or, for a generic @p Number type, * @code * std::vector local_dof_values(cell->get_fe().dofs_per_cell); - * cell->get_dof_values(solution, local_dof_values.begin(), - * local_dof_values.end()); + * cell->get_dof_values(solution, + * local_dof_values.begin(), + * local_dof_values.end()); * @endcode */ template @@ -1757,8 +1760,9 @@ namespace FEValuesViews * or, for a generic @p Number type, * @code * std::vector local_dof_values(cell->get_fe().dofs_per_cell); - * cell->get_dof_values(solution, local_dof_values.begin(), - * local_dof_values.end()); + * cell->get_dof_values(solution, + * local_dof_values.begin(), + * local_dof_values.end()); * @endcode */ template @@ -1948,9 +1952,9 @@ namespace internal * for (unsigned int q=0; q displacement_field(flowfield_dof_handler.n_dofs()); * MappingQ1Eulerian mymapping(flowfield_dof_handler, - * displacement_field); + * displacement_field); * @endcode * * Note that since the vector of shift values and the dof handler are only -- 2.39.5