From: Matthias Maier Date: Thu, 20 Jun 2013 11:19:51 +0000 (+0000) Subject: Renindent comments in function.h X-Git-Tag: v8.0.0~279 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8be50b5532042304f313dc7f8ad16d2136159efc;p=dealii.git Renindent comments in function.h git-svn-id: https://svn.dealii.org/trunk@29839 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/base/function.h b/deal.II/include/deal.II/base/function.h index fafa9ded88..ef407d0d97 100644 --- a/deal.II/include/deal.II/base/function.h +++ b/deal.II/include/deal.II/base/function.h @@ -114,11 +114,8 @@ class Function : public FunctionTime, { public: /** - * Export the value of the - * template parameter as a static - * member constant. Sometimes - * useful for some expression - * template programming. + * Export the value of the template parameter as a static member + * constant. Sometimes useful for some expression template programming. */ static const unsigned int dimension = dim; @@ -128,20 +125,15 @@ public: const unsigned int n_components; /** - * Constructor. May take an - * initial value for the number - * of components (which defaults - * to one, i.e. a scalar - * function), and the time - * variable, which defaults to - * zero. + * Constructor. May take an initial value for the number of components + * (which defaults to one, i.e. a scalar function), and the time + * variable, which defaults to zero. */ Function (const unsigned int n_components = 1, const double initial_time = 0.0); /** - * Virtual destructor; absolutely - * necessary in this case. + * Virtual destructor; absolutely necessary in this case. * * This destructor is declared pure virtual, such that objects of this class * cannot be created. Since all the other virtual functions have a @@ -158,220 +150,160 @@ public: * the abstractness of any derived class even if they do not have an * explicitly declared destructor. * - * Nonetheless, since derived - * classes want to call the - * destructor of a base class, - * this destructor is implemented - * (despite it being pure + * Nonetheless, since derived classes want to call the destructor of a + * base class, this destructor is implemented (despite it being pure * virtual). */ virtual ~Function () = 0; /** - * Assignment operator. This is - * here only so that you can have - * objects of derived classes in - * containers, or assign them - * otherwise. It will raise an - * exception if the object from - * which you assign has a - * different number of components - * than the one being assigned - * to. + * Assignment operator. This is here only so that you can have objects of + * derived classes in containers, or assign them otherwise. It will raise + * an exception if the object from which you assign has a different + * number of components than the one being assigned to. */ Function &operator= (const Function &f); /** - * Return the value of the - * function at the given - * point. Unless there is only - * one component (i.e. the - * function is scalar), you - * should state the component you - * want to have evaluated; it - * defaults to zero, i.e. the + * Return the value of the function at the given point. Unless there is + * only one component (i.e. the function is scalar), you should state the + * component you want to have evaluated; it defaults to zero, i.e. the * first component. */ virtual double value (const Point &p, const unsigned int component = 0) const; /** - * Return all components of a - * vector-valued function at a - * given point. + * Return all components of a vector-valued function at a given point. * - * values shall have the right - * size beforehand, - * i.e. #n_components. + * values shall have the right size beforehand, i.e. + * #n_components. */ virtual void vector_value (const Point &p, Vector &values) const; /** - * Set values to the point - * values of the specified - * component of the function at - * the points. It is assumed - * that values already has the - * right size, i.e. the same - * size as the points array. + * Set values to the point values of the specified component of + * the function at the points. It is assumed that + * values already has the right size, i.e. the same size as the + * points array. * - * Be default, this function - * repeatedly calls value() for - * each point separately, to - * fill the output array. + * Be default, this function repeatedly calls value() for each point + * separately, to fill the output array. */ virtual void value_list (const std::vector > &points, std::vector &values, const unsigned int component = 0) const; /** - * Set values to the point - * values of the function at the - * points. It is assumed that - * values already has the right - * size, i.e. the same size as - * the points array, and that - * all elements be vectors with - * the same number of components - * as this function has. + * Set values to the point values of the function at the + * points. It is assumed that values already has the + * right size, i.e. the same size as the points array, and that + * all elements be vectors with the same number of components as this + * function has. * - * Be default, this function - * repeatedly calls vector_value() for - * each point separately, to - * fill the output array. + * Be default, this function repeatedly calls vector_value() for each + * point separately, to fill the output array. */ virtual void vector_value_list (const std::vector > &points, std::vector > &values) const; /** - * For each component of the - * function, fill a vector of - * values, one for each point. + * For each component of the function, fill a vector of values, one for + * each point. * - * The default implementation of - * this function in Function calls - * value_list() for each - * component. In order to improve - * performance, this can be - * reimplemented in derived - * classes to speed up performance. + * The default implementation of this function in Function calls + * value_list() for each component. In order to improve performance, this + * can be reimplemented in derived classes to speed up performance. */ virtual void vector_values (const std::vector > &points, std::vector > &values) const; /** - * Return the gradient of the - * specified component of the - * function at the given point. + * Return the gradient of the specified component of the function at the + * given point. */ virtual Tensor<1,dim> gradient (const Point &p, const unsigned int component = 0) const; /** - * Return the gradient of all - * components of the - * function at the given point. + * Return the gradient of all components of the function at the given + * point. */ virtual void vector_gradient (const Point &p, std::vector > &gradients) const; /** - * Set gradients to the - * gradients of the specified - * component of the function at - * the points. It is assumed - * that gradients already has the - * right size, i.e. the same - * size as the points array. + * Set gradients to the gradients of the specified component of + * the function at the points. It is assumed that + * gradients already has the right size, i.e. the same size as + * the points array. */ virtual void gradient_list (const std::vector > &points, std::vector > &gradients, const unsigned int component = 0) const; /** - * For each component of the - * function, fill a vector of - * gradient values, one for each point. + * For each component of the function, fill a vector of gradient values, + * one for each point. * - * The default implementation of - * this function in Function calls - * value_list() for each - * component. In order to improve - * performance, this can be - * reimplemented in derived - * classes to speed up performance. + * The default implementation of this function in Function calls + * value_list() for each component. In order to improve performance, this + * can be reimplemented in derived classes to speed up performance. */ virtual void vector_gradients (const std::vector > &points, std::vector > > &gradients) const; /** - * Set gradients to the gradients of - * the function at the points, - * for all components. - * It is assumed that gradients - * already has the right size, i.e. - * the same size as the points array. + * Set gradients to the gradients of the function at the + * points, for all components. It is assumed that + * gradients already has the right size, i.e. the same size as + * the points array. * - * The outer loop over - * gradients is over the points - * in the list, the inner loop - * over the different components - * of the function. + * The outer loop over gradients is over the points in the list, + * the inner loop over the different components of the function. */ virtual void vector_gradient_list (const std::vector > &points, std::vector > > &gradients) const; /** - * Compute the Laplacian of a - * given component at point p. + * Compute the Laplacian of a given component at point p. */ virtual double laplacian (const Point &p, const unsigned int component = 0) const; /** - * Compute the Laplacian of all - * components at point p and - * store them in values. + * Compute the Laplacian of all components at point p and store + * them in values. */ virtual void vector_laplacian (const Point &p, Vector &values) const; /** - * Compute the Laplacian of one - * component at a set of points. + * Compute the Laplacian of one component at a set of points. */ virtual void laplacian_list (const std::vector > &points, std::vector &values, const unsigned int component = 0) const; /** - * Compute the Laplacians of all - * components at a set of points. + * Compute the Laplacians of all components at a set of points. */ virtual void vector_laplacian_list (const std::vector > &points, std::vector > &values) const; /** - * Determine an estimate for - * the memory consumption (in - * bytes) of this - * object. Since sometimes - * the size of objects can - * not be determined exactly - * (for example: what is the - * memory consumption of an - * STL std::map type with a - * certain number of - * elements?), this is only - * an estimate. however often - * quite close to the true - * value. + * Determine an estimate for the memory consumption (in bytes) of this + * object. Since sometimes the size of objects can not be determined + * exactly (for example: what is the memory consumption of an STL + * std::map type with a certain number of elements?), this is + * only an estimate. however often quite close to the true value. */ std::size_t memory_consumption () const; }; + /** * Provide a function which always returns zero. Obviously, also the * derivates of this function are zero. Also, it returns zero on all @@ -390,126 +322,105 @@ class ZeroFunction : public Function { public: /** - * Constructor. The number of - * components is preset to one. + * Constructor. The number of components is preset to one. */ ZeroFunction (const unsigned int n_components = 1); /** - * Virtual destructor; absolutely - * necessary in this case. + * Virtual destructor; absolutely necessary in this case. */ virtual ~ZeroFunction (); /** - * Return the value of the function - * at the given point for one - * component. + * Return the value of the function at the given point for one component. */ virtual double value (const Point &p, const unsigned int component) const; /** - * Return the value of the function - * at the given point for all + * Return the value of the function at the given point for all * components. */ virtual void vector_value (const Point &p, Vector &return_value) const; /** - * Set values to the point values - * of the function at the points, - * for the given component. - * It is assumed that values - * already has the right size, i.e. - * the same size as the points - * array. + * Set values to the point values of the function at the + * points, for the given component. It is assumed that + * values already has the right size, i.e. the same size as the + * points array. */ virtual void value_list (const std::vector > &points, std::vector &values, const unsigned int component = 0) const; /** - * Set values to the point values - * of the function at the points, - * for all components. - * It is assumed that values - * already has the right size, i.e. - * the same size as the points - * array. + * Set values to the point values of the function at the + * points, for all components. It is assumed that + * values already has the right size, i.e. the same size as the + * points array. */ virtual void vector_value_list (const std::vector > &points, std::vector > &values) const; /** - * Return the gradient of the function - * at the given point, for the - * given component. + * Return the gradient of the function at the given point, for the given + * component. */ virtual Tensor<1,dim> gradient (const Point &p, const unsigned int component = 0) const; /** - * Return the gradient of the - * specified component of the - * function at the given point, - * for all components. + * Return the gradient of the specified component of the function at the + * given point, for all components. */ virtual void vector_gradient (const Point &p, std::vector > &gradients) const; /** - * Set gradients to the gradients of - * the function at the points, - * for the given component. - * It is assumed that values - * already has the right size, i.e. - * the same size as the points array. + * Set gradients to the gradients of the function at the + * points, for the given component. It is assumed that + * values already has the right size, i.e. the same size as the + * points array. */ virtual void gradient_list (const std::vector > &points, std::vector > &gradients, const unsigned int component = 0) const; /** - * Set gradients to the gradients of - * the function at the points, - * for all components. - * It is assumed that gradients - * already has the right size, i.e. - * the same size as the points array. + * Set gradients to the gradients of the function at the + * points, for all components. It is assumed that + * gradients already has the right size, i.e. the same size as + * the points array. * - * The outer loop over - * gradients is over the points - * in the list, the inner loop - * over the different components - * of the function. + * The outer loop over gradients is over the points in the list, + * the inner loop over the different components of the function. */ virtual void vector_gradient_list (const std::vector > &points, std::vector > > &gradients) const; }; + /** * Provide a function which always returns the constant value * handed to the constructor. * - * Obviously, the derivates of this - * function are zero, which is why we derive this class from - * ZeroFunction: we then only have to overload the value functions, - * not all the derivatives. In some way, it would be more obvious to - * do the derivation in the opposite direction, i.e. let - * ZeroFunction be a more specialized version of ConstantFunction; - * however, this would be less efficient, since we could not make - * use of the fact that the function value of the ZeroFunction is - * known at compile time and need not be looked up somewhere in - * memory. + * Obviously, the derivates of this function are zero, which is why we + * derive this class from ZeroFunction: we then only have to + * overload the value functions, not all the derivatives. In some way, it + * would be more obvious to do the derivation in the opposite direction, + * i.e. let ZeroFunction be a more specialized version of + * ConstantFunction; however, this would be less efficient, since + * we could not make use of the fact that the function value of the + * ZeroFunction is known at compile time and need not be looked up + * somewhere in memory. * * You can pass to the constructor an integer denoting the number of * components this function shall have. It defaults to one. If it is - * greater than one, then the function will return the constant value - * in all its components, which might not be overly useful a feature - * in most cases, however. + * greater than one, then the function will return the constant value in + * all its components, which might not be overly useful a feature in most + * cases, however. * * @ingroup functions * @author Wolfgang Bangerth, 1998, 1999 @@ -519,75 +430,55 @@ class ConstantFunction : public ZeroFunction { public: /** - * Constructor; takes the constant function - * value as an argument. The number of - * components is preset to one. + * Constructor; takes the constant function value as an argument. The + * number of components is preset to one. */ ConstantFunction (const double value, const unsigned int n_components = 1); /** - * Virtual destructor; absolutely - * necessary in this case. + * Virtual destructor; absolutely necessary in this case. */ virtual ~ConstantFunction (); /** - * Return the value of the function - * at the given point for one - * component. + * Return the value of the function at the given point for one component. */ virtual double value (const Point &p, const unsigned int component) const; /** - * Return the value of the function - * at the given point for all + * Return the value of the function at the given point for all * components. */ virtual void vector_value (const Point &p, Vector &return_value) const; /** - * Set values to the point values - * of the function at the points, - * for the given component. - * It is assumed that values - * already has the right size, i.e. - * the same size as the points - * array. + * Set values to the point values of the function at the + * points, for the given component. It is assumed that + * values already has the right size, i.e. the same size as the + * points array. */ virtual void value_list (const std::vector > &points, std::vector &values, const unsigned int component = 0) const; /** - * Set values to the point values - * of the function at the points, - * for all components. - * It is assumed that values - * already has the right size, i.e. - * the same size as the points - * array. + * Set values to the point values of the function at the + * points, for all components. It is assumed that + * values already has the right size, i.e. the same size as the + * points array. */ virtual void vector_value_list (const std::vector > &points, std::vector > &values) const; /** - * Determine an estimate for - * the memory consumption (in - * bytes) of this - * object. Since sometimes - * the size of objects can - * not be determined exactly - * (for example: what is the - * memory consumption of an - * STL std::map type with a - * certain number of - * elements?), this is only - * an estimate. however often - * quite close to the true - * value. + * Determine an estimate for the memory consumption (in bytes) of this + * object. Since sometimes the size of objects can not be determined + * exactly (for example: what is the memory consumption of an STL + * std::map type with a certain number of elements?), this is + * only an estimate. however often quite close to the true value. */ std::size_t memory_consumption () const; @@ -602,15 +493,14 @@ protected: /** * This is a constant vector-valued function, in which one or more - * components of the vector have a constant value and all other - * components are zero. It is especially useful as a weight function - * for VectorTools::integrate_difference, where it allows to - * integrate only one or a few vector components, rather than the - * entire vector-valued solution. In other words, it acts as a - * component mask with a single component selected (see the - * @ref GlossComponentMask "the glossary entry on component masks"). - * See the step-20 - * tutorial program for a detailed explanation and a use case. + * components of the vector have a constant value and all other components + * are zero. It is especially useful as a weight function for + * VectorTools::integrate_difference, where it allows to integrate only one + * or a few vector components, rather than the entire vector-valued + * solution. In other words, it acts as a component mask with a single + * component selected (see the @ref GlossComponentMask "the glossary entry + * on component masks"). See the step-20 tutorial program for a detailed + * explanation and a use case. * * @ingroup functions * @author Guido Kanschat, 2000, Wolfgang Bangerth 2006 @@ -620,120 +510,92 @@ class ComponentSelectFunction : public ConstantFunction { public: /** - * Constructor if only a single - * component shall be - * non-zero. Arguments denote the - * component selected, the value - * for that component and the - * total number of vector - * components. + * Constructor if only a single component shall be non-zero. Arguments + * denote the component selected, the value for that component and the + * total number of vector components. */ ComponentSelectFunction (const unsigned int selected, const double value, const unsigned int n_components); /** - * Constructor. As before, but - * the value for the selected - * component is assumed to be - * one. In essence, this function - * then works as a mask. + * Constructor. As before, but the value for the selected component is + * assumed to be one. In essence, this function then works as a mask. */ ComponentSelectFunction (const unsigned int selected, const unsigned int n_components); /** - * Constructor if multiple - * components shall have - * non-zero, unit values - * (i.e. this should be a mask - * for multiple components). The - * first argument denotes a - * half-open interval of - * components (for example - * std::pair(0,dim) for the first - * dim components), and the - * second argument is the total - * number of vector components. + * Constructor if multiple components shall have non-zero, unit values + * (i.e. this should be a mask for multiple components). The first + * argument denotes a half-open interval of components (for example + * std::pair(0,dim) for the first dim components), and the second + * argument is the total number of vector components. */ ComponentSelectFunction (const std::pair &selected, const unsigned int n_components); /** - * Return the value of the function - * at the given point for all + * Return the value of the function at the given point for all * components. */ virtual void vector_value (const Point &p, Vector &return_value) const; /** - * Set values to the point values - * of the function at the points, - * for all components. - * It is assumed that values - * already has the right size, i.e. - * the same size as the points - * array. + * Set values to the point values of the function at the + * points, for all components. It is assumed that + * values already has the right size, i.e. the same size as the + * points array. */ virtual void vector_value_list (const std::vector > &points, std::vector > &values) const; /** - * Determine an estimate for - * the memory consumption (in - * bytes) of this - * object. Since sometimes - * the size of objects can - * not be determined exactly - * (for example: what is the - * memory consumption of an - * STL std::map type with a - * certain number of - * elements?), this is only - * an estimate. however often - * quite close to the true - * value. + * Determine an estimate for the memory consumption (in bytes) of this + * object. Since sometimes the size of objects can not be determined + * exactly (for example: what is the memory consumption of an STL + * std::map type with a certain number of elements?), this is + * only an estimate. however often quite close to the true value. */ std::size_t memory_consumption () const; protected: /** - * Half-open interval of the - * indices of selected - * components. + * Half-open interval of the indices of selected components. */ const std::pair selected_components; }; + /** * This class provides a way to convert a scalar function of the kind * @code * double foo (const Point &); * @endcode - * into an object of type Function@. - * Since the argument returns a scalar, the result is clearly a - * Function object for which function.n_components==1. - * The class works by storing a pointer to the given function and - * every time function.value(p,component) is called, - * calls foo(p) and returns the corresponding value. It - * also makes sure that component is in fact zero, as needs - * be for scalar functions. + * into an object of type Function@. Since the argument returns a + * scalar, the result is clearly a Function object for which + * function.n_components==1. The class works by storing a + * pointer to the given function and every time + * function.value(p,component) is called, calls + * foo(p) and returns the corresponding value. It also makes + * sure that component is in fact zero, as needs be for scalar + * functions. * * The class provides an easy way to turn a simple global function into * something that has the required Function@ interface for operations - * like VectorTools::interpolate_boundary_values() etc., and thereby - * allows for simpler experimenting without having to write all the - * boiler plate code of declaring a class that is derived from Function - * and implementing the Function::value() function. + * like VectorTools::interpolate_boundary_values() etc., and thereby allows + * for simpler experimenting without having to write all the boiler plate + * code of declaring a class that is derived from Function and implementing + * the Function::value() function. * * The class gains additional expressvive power because the argument it * takes does not have to be a pointer to an actual function. Rather, it is - * a function object, i.e., it can also be the result of call to - * std::bind (or boost::bind) or some other object that can be called with - * a single argument. For example, if you need a Function object that - * returns the norm of a point, you could write it like so: + * a function object, i.e., it can also be the result of call to std::bind + * (or boost::bind) or some other object that can be called with a single + * argument. For example, if you need a Function object that returns the + * norm of a point, you could write it like so: * @code * template * class Norm : public Function { @@ -747,8 +609,8 @@ protected: * * Norm<2> my_norm_object; * @endcode - * and then pass the my_norm_object around, or you could write it - * like so: + * and then pass the my_norm_object around, or you could write + * it like so: * @code * ScalarFunctionFromFunctionObject my_norm_object (&Point::norm); * @endcode @@ -788,18 +650,14 @@ class ScalarFunctionFromFunctionObject : public Function { public: /** - * Given a function object that takes a Point and returns a double - * value, convert this into an object that matches the Function - * interface. + * Given a function object that takes a Point and returns a double value, + * convert this into an object that matches the Function interface. */ ScalarFunctionFromFunctionObject (const std_cxx1x::function &)> &function_object); /** - * Return the value of the - * function at the given - * point. Returns the value the - * function given to the constructor - * produces for this point. + * Return the value of the function at the given point. Returns the value + * the function given to the constructor produces for this point. */ virtual double value (const Point &p, const unsigned int component = 0) const; @@ -813,24 +671,25 @@ private: }; + /** - * This class is similar to the ScalarFunctionFromFunctionObject class in that it - * allows for the easy conversion of a function object to something that - * satisfies the interface of the Function base class. The difference is - * that here, the given function object is still a scalar function - * (i.e. it has a single value at each space point) but that the Function - * object generated is vector valued. The number of vector components - * is specified in the constructor, where one also selectes a single - * one of these vector components that should be filled by the passed - * object. The result is a vector Function object that returns zero in - * each component except the single selected one where it returns the - * value returned by the given as the first argument to the constructor. + * This class is similar to the ScalarFunctionFromFunctionObject class in + * that it allows for the easy conversion of a function object to something + * that satisfies the interface of the Function base class. The difference + * is that here, the given function object is still a scalar function (i.e. + * it has a single value at each space point) but that the Function object + * generated is vector valued. The number of vector components is specified + * in the constructor, where one also selectes a single one of these vector + * components that should be filled by the passed object. The result is a + * vector Function object that returns zero in each component except the + * single selected one where it returns the value returned by the given as + * the first argument to the constructor. * - * @note In the above discussion, note the difference between the - * (scalar) "function object" (i.e., a C++ object x that can - * be called as in x(p)) and the capitalized (vector valued) - * "Function object" (i.e., an object of a class that is derived from - * the Function base class). + * @note In the above discussion, note the difference between the (scalar) + * "function object" (i.e., a C++ object x that can be called + * as in x(p)) and the capitalized (vector valued) "Function + * object" (i.e., an object of a class that is derived from the Function + * base class). * * To be more concrete, let us consider the following example: * @code @@ -838,12 +697,12 @@ private: * VectorFunctionFromScalarFunctionObject<2> * component_mask (&one, 1, 3); * @endcode - * Here, component_mask then represents a Function object - * that for every point returns the vector $(0, 1, 0)^T$, i.e. a mask - * function that could, for example, be passed to VectorTools::integrate_difference(). - * This effect can also be achieved using the ComponentSelectFunction - * class but is obviously easily extended to functions that are - * non-constant in their one component. + * Here, component_mask then represents a Function object that + * for every point returns the vector $(0, 1, 0)^T$, i.e. a mask function + * that could, for example, be passed to + * VectorTools::integrate_difference(). This effect can also be achieved + * using the ComponentSelectFunction class but is obviously easily extended + * to functions that are non-constant in their one component. * * @author Wolfgang Bangerth, 2011 */ @@ -868,23 +727,17 @@ public: const unsigned int n_components); /** - * Return the value of the - * function at the given - * point. Returns the value the - * function given to the constructor - * produces for this point. + * Return the value of the function at the given point. Returns the value + * the function given to the constructor produces for this point. */ virtual double value (const Point &p, const unsigned int component = 0) const; /** - * Return all components of a - * vector-valued function at a - * given point. + * Return all components of a vector-valued function at a given point. * - * values shall have the right - * size beforehand, - * i.e. #n_components. + * values shall have the right size beforehand, i.e. + * #n_components. */ virtual void vector_value (const Point &p, Vector &values) const; @@ -897,22 +750,22 @@ private: const std_cxx1x::function &)> function_object; /** - * The vector component whose value is to be filled by the - * given scalar function. + * The vector component whose value is to be filled by the given scalar + * function. */ const unsigned int selected_component; }; /** - * This class is built as a means of translating - * the Tensor<1,dim> values produced by objects of type - * TensorFunction and returning them as a multiple - * component version of the same thing as a Vector for use in, for example, - * the VectorTools::interpolate or the many other functions taking Function objects. - * It allows the user to place the desired components into an n_components - * long vector starting at the selected_component location in that vector and have all other - * components be 0. + * This class is built as a means of translating the Tensor<1,dim> + * values produced by objects of type TensorFunction and returning + * them as a multiple component version of the same thing as a Vector for + * use in, for example, the VectorTools::interpolate or the many other + * functions taking Function objects. It allows the user to place the + * desired components into an n_components long vector starting at + * the selected_component location in that vector and have all + * other components be 0. * * For example: Say you created a class called * @code @@ -923,11 +776,12 @@ private: * RightHandSide<1,dim> rhs; * @endcode * of that class which you want to interpolate onto your mesh using the - * VectorTools::interpolate function, but the finite element you use for the DoFHandler - * object has 3 copies of a finite element with dim components, for a total of 3*dim - * components. To interpolate onto that DoFHandler, you need an object of type Function - * that has 3*dim vector components. Creating such an object from the existing rhs - * object is done using this piece of code: + * VectorTools::interpolate function, but the finite element you use for + * the DoFHandler object has 3 copies of a finite element with + * dim components, for a total of 3*dim components. To + * interpolate onto that DoFHandler, you need an object of type Function + * that has 3*dim vector components. Creating such an object from the + * existing rhs object is done using this piece of code: * @code * RighHandSide<1,dim> rhs; * VectorFunctionFromTensorFunction rhs_vector_function (rhs, 0, 3*dim); @@ -942,77 +796,70 @@ class VectorFunctionFromTensorFunction : public Function { public: /** - * Given a TensorFunction object that takes a Point and returns a Tensor<1,dim> - * value, convert this into an object that matches the Function@ - * interface. + * Given a TensorFunction object that takes a Point and returns + * a Tensor<1,dim> value, convert this into an object that + * matches the Function@ interface. * - * By default, create a Vector object of the same size as tensor_function - * returns, i.e., with dim components. + * By default, create a Vector object of the same size as + * tensor_function returns, i.e., with dim components. * * @param tensor_function The TensorFunction that will form one component * of the resulting Vector Function object. * @param n_components The total number of vector components of the * resulting TensorFunction object. * @param selected_component The first component that should be - * filled by the first argument. This should be such that the entire tensor_function - * fits inside the n_component length return vector. + * filled by the first argument. This should be such that the entire + * tensor_function fits inside the n_component length return + * vector. */ VectorFunctionFromTensorFunction (const TensorFunction<1,dim> &tensor_function, const unsigned int selected_component=0, const unsigned int n_components=dim); /** - * This destructor is defined as - * virtual so as to coincide with all - * other aspects of class. + * This destructor is defined as virtual so as to coincide with all other + * aspects of class. */ virtual ~VectorFunctionFromTensorFunction(); /** - * Return a single component of a - * vector-valued function at a - * given point. + * Return a single component of a vector-valued function at a given + * point. */ virtual double value (const Point &p, const unsigned int component = 0) const; /** - * Return all components of a - * vector-valued function at a - * given point. + * Return all components of a vector-valued function at a given point. * - * values shall have the right - * size beforehand, - * i.e. #n_components. + * values shall have the right size beforehand, i.e. + * #n_components. */ virtual void vector_value (const Point &p, Vector &values) const; /** - * Return all components of a - * vector-valued function at a - * list of points. + * Return all components of a vector-valued function at a list of points. * - * value_list shall be the same - * size as points and each element - * of the vector will be passed to - * vector_value() to evaluate - * the function + * value_list shall be the same size as points and each + * element of the vector will be passed to vector_value() to evaluate the + * function */ virtual void vector_value_list (const std::vector > &points, std::vector > &value_list) const; private: /** - * The TensorFunction object which we call when this class's vector_value() - * or vector_value_list() functions are called. + * The TensorFunction object which we call when this class's + * vector_value() or vector_value_list() functions are called. **/ const TensorFunction<1,dim> & tensor_function; /** - * The first vector component whose value is to be filled by the - * given TensorFunction. The values will be placed in components - * selected_component to selected_component+dim-1 for a TensorFunction<1,dim> object. + * The first vector component whose value is to be filled by the given + * TensorFunction. The values will be placed in components + * selected_component to selected_component+dim-1 for a + * TensorFunction<1,dim> object. */ const unsigned int selected_component; };