From: Wolfgang Bangerth Date: Tue, 2 Apr 2013 21:27:33 +0000 (+0000) Subject: Reindent. X-Git-Tag: v8.0.0~811 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=565d6bce10a416c8a3881763abf2c90f858d5544;p=dealii.git Reindent. git-svn-id: https://svn.dealii.org/trunk@29152 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 9698e24419..40d3555911 100644 --- a/deal.II/include/deal.II/base/function.h +++ b/deal.II/include/deal.II/base/function.h @@ -933,79 +933,80 @@ template 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. - * - * 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. - */ - 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. - */ - virtual ~VectorFunctionFromTensorFunction(); - - /** - * 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. - * - * 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. - * - * 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; + /** + * 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. + * + * @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. + */ + 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. + */ + virtual ~VectorFunctionFromTensorFunction(); + + /** + * 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. + * + * 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. + * + * 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. - **/ - 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. - */ - const unsigned int selected_component; + /** + * 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. + */ + const unsigned int selected_component; }; diff --git a/deal.II/source/base/function.cc b/deal.II/source/base/function.cc index 27436923ee..02b1e29fca 100644 --- a/deal.II/source/base/function.cc +++ b/deal.II/source/base/function.cc @@ -592,20 +592,20 @@ vector_value (const Point &p, */ template VectorFunctionFromTensorFunction::VectorFunctionFromTensorFunction (const TensorFunction<1,dim>& tensor_function, - const unsigned int selected_component, - const unsigned int n_components) -: -Function (n_components), -tensor_function (tensor_function), -selected_component (selected_component) + const unsigned int selected_component, + const unsigned int n_components) + : + Function (n_components), + tensor_function (tensor_function), + selected_component (selected_component) { - // Verify that the Tensor<1,dim> will fit in the given length selected_components - // and not hang over the end of the vector. - Assert (0 <= selected_component, - ExcIndexRange (selected_component,0,0)); - Assert (selected_component + dim - 1 < this->n_components, - ExcIndexRange (selected_component, 0, this->n_components)); + // Verify that the Tensor<1,dim> will fit in the given length selected_components + // and not hang over the end of the vector. + Assert (0 <= selected_component, + ExcIndexRange (selected_component,0,0)); + Assert (selected_component + dim - 1 < this->n_components, + ExcIndexRange (selected_component, 0, this->n_components)); } @@ -617,10 +617,10 @@ VectorFunctionFromTensorFunction::~VectorFunctionFromTensorFunction () template inline double VectorFunctionFromTensorFunction::value (const Point &p, - const unsigned int component) const + const unsigned int component) const { Assert (componentn_components, - ExcIndexRange(component, 0, this->n_components)); + ExcIndexRange(component, 0, this->n_components)); // if the requested component is out of the range selected, then we // can return early @@ -630,11 +630,11 @@ double VectorFunctionFromTensorFunction::value (const Point &p, return 0; // otherwise retrieve the values from the tensor_function to be - // placed at the selected_component to selected_component + dim - 1 - // elements of the Vector values and pick the correct one - const Tensor<1,dim> tensor_value = tensor_function.value (p); + // placed at the selected_component to selected_component + dim - 1 + // elements of the Vector values and pick the correct one + const Tensor<1,dim> tensor_value = tensor_function.value (p); - return tensor_value[component-selected_component]; + return tensor_value[component-selected_component]; } @@ -643,20 +643,20 @@ inline void VectorFunctionFromTensorFunction::vector_value (const Point &p, Vector &values) const { - Assert(values.size() == this->n_components, - ExcDimensionMismatch(values.size(),this->n_components)); + Assert(values.size() == this->n_components, + ExcDimensionMismatch(values.size(),this->n_components)); - // Retrieve the values from the tensor_function to be - // placed at the selected_component to selected_component + dim - 1 - // elements of the Vector values. - const Tensor<1,dim> tensor_value = tensor_function.value (p); + // Retrieve the values from the tensor_function to be + // placed at the selected_component to selected_component + dim - 1 + // elements of the Vector values. + const Tensor<1,dim> tensor_value = tensor_function.value (p); - // First we make all elements of values = 0 - values = 0; + // First we make all elements of values = 0 + values = 0; - // Second we adjust the desired components to take on the values in tensor_value. - for (unsigned int i=0; itensor_value. + for (unsigned int i=0; i::vector_value (const Point &p, */ template void VectorFunctionFromTensorFunction::vector_value_list (const std::vector > &points, - std::vector > &value_list) const + std::vector > &value_list) const { - Assert (value_list.size() == points.size(), - ExcDimensionMismatch (value_list.size(), points.size())); + Assert (value_list.size() == points.size(), + ExcDimensionMismatch (value_list.size(), points.size())); - const unsigned int n_points = points.size(); + const unsigned int n_points = points.size(); - for (unsigned int p=0; p::vector_value (points[p], value_list[p]); + for (unsigned int p=0; p::vector_value (points[p], value_list[p]); }