* block of a Stokes element (see
* @ref vector_valued):
* @code
- * FESystem<dim> stokes_fe (FESystem<dim>(FE_Q<dim>(2), dim), 1, // Q2
- * element for the velocities FE_Q<dim>(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<dim> stokes_fe (FESystem<dim>(FE_Q<dim>(2), dim), 1,
+ * FE_Q<dim>(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
* Stokes element (see
* @ref vector_valued):
* @code
- * FESystem<dim> stokes_fe (FE_Q<dim>(2), dim, // Q2 element for the
- * velocities FE_Q<dim>(1), 1); // Q1 element for the pressure
+ * // Q2 element for the velocities, Q1 element for the pressure
+ * FESystem<dim> stokes_fe (FE_Q<dim>(2), dim,
+ * FE_Q<dim>(1), 1);
* FEValuesExtractors::Scalar pressure(dim);
* ComponentMask pressure_mask = stokes_fe.component_mask (pressure);
* @endcode
* 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:
*
* Alternatively, the points can be transformed one-by-one:
* @code
* const vector<Point<dim> > &unit_points =
- * fe.get_unit_support_points();
+ * fe.get_unit_support_points();
*
* Point<dim> 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()
* 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
* 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<dim> fe
- * (&fe_base,
- * {&fe_1, &fe_2},
- * {{[=] (const typename Triangulation<dim>::cell_iterator &) -> const
- * Function<dim> * {return &fe_1_function1;},
- * [=] (const typename Triangulation<dim>::cell_iterator &) -> const
- * Function<dim> * {return &fe_1_function2;}},
- * {[=] (const typename Triangulation<dim>::cell_iterator &) -> const
- * Function<dim> * {return &fe_2_function;}}});
+ * FE_Enriched<dim> fe(
+ * &fe_base,
+ * {&fe_1, &fe_2},
+ * {{[=] (const typename Triangulation<dim>::cell_iterator &)
+ * -> const Function<dim> * {return &fe_1_function1;},
+ * [=] (const typename Triangulation<dim>::cell_iterator &)
+ * -> const Function<dim> * {return &fe_1_function2;}},
+ * {[=] (const typename Triangulation<dim>::cell_iterator &)
+ * -> const Function<dim> * {return &fe_2_function;}}});
* @endcode
*
* @note When using the same finite element for enrichment with N
* though: the <code>create_fe_list()</code> function creates a vector of
* pointers, but nothing destroys these. This is the solution:
* @code
- * template <int dim>
- * class MySimulator {
- * public:
- * MySimulator (const unsigned int polynomial_degree);
- *
- * private:
- * FESystem<dim> fe;
- *
- * struct VectorElementDestroyer {
- * const std::vector<const FiniteElement<dim>*> data;
- * VectorElementDestroyer (const std::vector<const FiniteElement<dim>*>
- * &pointers); ~VectorElementDestroyer (); // destructor to delete the
- * pointers const std::vector<const FiniteElement<dim>*> & get_data () const;
- * };
- *
- * static std::vector<const FiniteElement<dim>*>
- * create_fe_list (const unsigned int polynomial_degree);
- *
- * static std::vector<unsigned int>
- * create_fe_multiplicities ();
- * };
+ * template <int dim>
+ * class MySimulator
+ * {
+ * public:
+ * MySimulator (const unsigned int polynomial_degree);
*
- * template <int dim>
- * MySimulator<dim>::VectorElementDestroyer::
- * VectorElementDestroyer (const std::vector<const FiniteElement<dim>*>
- * &pointers) : data(pointers)
- * {}
+ * private:
+ * FESystem<dim> fe;
*
- * template <int dim>
- * MySimulator<dim>::VectorElementDestroyer::
- * ~VectorElementDestroyer ()
+ * struct VectorElementDestroyer
* {
- * for (unsigned int i=0; i<data.size(); ++i)
- * delete data[i];
- * }
+ * const std::vector<const FiniteElement<dim>*> data;
*
- * template <int dim>
- * const std::vector<const FiniteElement<dim>*> &
- * MySimulator<dim>::VectorElementDestroyer::
- * get_data () const
- * {
- * return data;
- * }
+ * VectorElementDestroyer(
+ * const std::vector<const FiniteElement<dim>*> &pointers);
*
+ * // destructor to delete the pointers
+ * ~VectorElementDestroyer ();
*
- * template <int dim>
- * MySimulator<dim>::MySimulator (const unsigned int polynomial_degree)
- * :
- * fe (VectorElementDestroyer(create_fe_list
- * (polynomial_degree)).get_data(), create_fe_multiplicities ())
- * {}
+ * const std::vector<const FiniteElement<dim>*> & get_data () const;
+ * };
+ *
+ * static std::vector<const FiniteElement<dim>*>
+ * create_fe_list (const unsigned int polynomial_degree);
+ *
+ * static std::vector<unsigned int>
+ * create_fe_multiplicities ();
+ * };
+ *
+ * template <int dim>
+ * MySimulator<dim>::VectorElementDestroyer::
+ * VectorElementDestroyer(
+ * const std::vector<const FiniteElement<dim>*> &pointers)
+ * :
+ * data(pointers)
+ * {}
+ *
+ * template <int dim>
+ * MySimulator<dim>::VectorElementDestroyer::
+ * ~VectorElementDestroyer ()
+ * {
+ * for (unsigned int i=0; i<data.size(); ++i)
+ * delete data[i];
+ * }
+ *
+ * template <int dim>
+ * const std::vector<const FiniteElement<dim>*> &
+ * MySimulator<dim>::VectorElementDestroyer::
+ * get_data () const
+ * {
+ * return data;
+ * }
+ *
+ * template <int dim>
+ * MySimulator<dim>::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
* or, for a generic @p Number type,
* @code
* std::vector<Number> 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 <class InputVector>
* or, for a generic @p Number type,
* @code
* std::vector<Number> 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 <class InputVector>
* or, for a generic @p Number type,
* @code
* std::vector<Number> 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 <class InputVector>
* or, for a generic @p Number type,
* @code
* std::vector<Number> 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 <class InputVector>
* for (unsigned int q=0; q<quadrature.size(); ++q)
* for (unsigned int i=0; i<finite_element.dofs_per_cell; ++i)
* for (unsigned int j=0; j<finite_element.dofs_per_cell; ++j)
- * A(i,j) += fe_values.shape_value(i,q) *
- * fe_values.shape_value(j,q) *
- * fe_values.JxW(q);
+ * A(i,j) += fe_values.shape_value(i,q) *
+ * fe_values.shape_value(j,q) *
+ * fe_values.JxW(q);
* ...
* }
* @endcode
* flowfield_dof_handler.distribute_dofs(fe);
* Vector<double> displacement_field(flowfield_dof_handler.n_dofs());
* MappingQ1Eulerian<dim> mymapping(flowfield_dof_handler,
- * displacement_field);
+ * displacement_field);
* @endcode
*
* Note that since the vector of shift values and the dof handler are only