From 1f579eb0437de0f3f22fedd92dc0e8f27b13d7c8 Mon Sep 17 00:00:00 2001 From: Denis Davydov Date: Fri, 13 Apr 2018 04:07:59 +0200 Subject: [PATCH] more fixes of whitespaces and incode comments --- include/deal.II/fe/fe_values.h | 24 ++- source/fe/fe_values.cc | 324 +++++++++++++-------------------- 2 files changed, 146 insertions(+), 202 deletions(-) diff --git a/include/deal.II/fe/fe_values.h b/include/deal.II/fe/fe_values.h index 406404588f..f77c2f3f5c 100644 --- a/include/deal.II/fe/fe_values.h +++ b/include/deal.II/fe/fe_values.h @@ -3595,7 +3595,6 @@ namespace FEValuesViews - template inline typename Scalar::gradient_type @@ -3901,6 +3900,8 @@ namespace FEValuesViews return curl_type(); } + + template inline typename Vector::hessian_type @@ -3936,6 +3937,8 @@ namespace FEValuesViews } } + + template inline typename Vector::third_derivative_type @@ -3972,6 +3975,7 @@ namespace FEValuesViews } + namespace { /** @@ -3991,6 +3995,7 @@ namespace FEValuesViews } + inline dealii::SymmetricTensor<2,2> symmetrize_single_row (const unsigned int n, @@ -4017,6 +4022,7 @@ namespace FEValuesViews } + inline dealii::SymmetricTensor<2,3> symmetrize_single_row (const unsigned int n, @@ -4049,6 +4055,7 @@ namespace FEValuesViews } + template inline typename Vector::symmetric_gradient_type @@ -4124,6 +4131,7 @@ namespace FEValuesViews } + template inline typename SymmetricTensor<2, dim, spacedim>::divergence_type @@ -4198,6 +4206,8 @@ namespace FEValuesViews } } + + template inline typename Tensor<2, dim, spacedim>::value_type @@ -4243,6 +4253,7 @@ namespace FEValuesViews } + template inline typename Tensor<2, dim, spacedim>::divergence_type @@ -4295,6 +4306,8 @@ namespace FEValuesViews } } + + template inline typename Tensor<2, dim, spacedim>::gradient_type @@ -4383,6 +4396,8 @@ operator[] (const FEValuesExtractors::Vector &vector) const return fe_values_views_cache.vectors[vector.first_vector_component]; } + + template inline const FEValuesViews::SymmetricTensor<2,dim,spacedim> & @@ -4397,6 +4412,8 @@ operator[] (const FEValuesExtractors::SymmetricTensor<2> &tensor) const return fe_values_views_cache.symmetric_second_order_tensors[tensor.first_tensor_component]; } + + template inline const FEValuesViews::Tensor<2,dim,spacedim> & @@ -4413,7 +4430,6 @@ operator[] (const FEValuesExtractors::Tensor<2> &tensor) const - template inline const double & @@ -4692,6 +4708,7 @@ FEValuesBase::get_fe () const } + template inline const Mapping & @@ -4907,6 +4924,7 @@ FEValuesBase::get_jacobian_pushed_forward_3rd_derivatives () const } + template inline const std::vector > & @@ -4938,7 +4956,6 @@ FEValuesBase::quadrature_point (const unsigned int i) const - template inline double @@ -5006,6 +5023,7 @@ FEValuesBase::inverse_jacobian (const unsigned int i) const } + template inline const Tensor<1,spacedim> & diff --git a/source/fe/fe_values.cc b/source/fe/fe_values.cc index ddbfb4888c..295363ce22 100644 --- a/source/fe/fe_values.cc +++ b/source/fe/fe_values.cc @@ -152,6 +152,7 @@ namespace FEValuesViews {} + template Scalar & Scalar::operator= (const Scalar &) @@ -238,6 +239,7 @@ namespace FEValuesViews } + template Vector::Vector () : @@ -257,6 +259,7 @@ namespace FEValuesViews } + template SymmetricTensor<2, dim, spacedim>:: SymmetricTensor(const FEValuesBase &fe_values, @@ -356,6 +359,7 @@ namespace FEValuesViews } + template Tensor<2, dim, spacedim>:: Tensor(const FEValuesBase &fe_values, @@ -455,6 +459,7 @@ namespace FEValuesViews } + namespace internal { // Given values of degrees of freedom, evaluate the @@ -1323,6 +1328,8 @@ namespace FEValuesViews } } + + template void do_function_gradients (const ArrayView &dof_values, @@ -1411,6 +1418,8 @@ namespace FEValuesViews fe_values->finite_element_output.shape_values, shape_function_data, values); } + + template template void @@ -1901,7 +1910,6 @@ namespace FEValuesViews - template template void @@ -1923,6 +1931,7 @@ namespace FEValuesViews } + template template void @@ -2216,13 +2225,9 @@ namespace internal component); } - // compute number of vectors - // that we can fit into - // this finite element. note - // that this is based on the - // dimensionality 'dim' of the - // manifold, not 'spacedim' of - // the output vector + // compute number of vectors that we can fit into this finite element. note + // that this is based on the dimensionality 'dim' of the + // manifold, not 'spacedim' of the output vector const unsigned int n_vectors = (fe.n_components() >= spacedim ? fe.n_components()-spacedim+1 : 0); @@ -2238,8 +2243,7 @@ namespace internal component); } - // compute number of symmetric - // tensors in the same way as above + // compute number of symmetric tensors in the same way as above const unsigned int n_symmetric_second_order_tensors = (fe.n_components() >= (dim*dim + dim)/2 ? fe.n_components() - (dim*dim + dim)/2 + 1 : @@ -2257,8 +2261,7 @@ namespace internal } - // compute number of symmetric - // tensors in the same way as above + // compute number of symmetric tensors in the same way as above const unsigned int n_second_order_tensors = (fe.n_components() >= dim*dim ? fe.n_components() - dim*dim + 1 : @@ -2286,35 +2289,23 @@ class FEValuesBase::CellIteratorBase { public: /** - * Destructor. Made virtual - * since we store only - * pointers to the base - * class. + * Destructor. Made virtual since we store only + * pointers to the base class. */ virtual ~CellIteratorBase () = default; /** - * Conversion operator to an - * iterator for - * triangulations. This - * conversion is implicit for - * the original iterators, - * since they are derived - * classes. However, since - * here we have kind of a - * parallel class hierarchy, - * we have to have a - * conversion operator. + * Conversion operator to an iterator for triangulations. This + * conversion is implicit for the original iterators, since they are derived + * classes. However, since here we have kind of a parallel class hierarchy, + * we have to have a conversion operator. */ virtual operator typename Triangulation::cell_iterator () const = 0; /** - * Return the number of - * degrees of freedom the DoF - * handler object has to - * which the iterator belongs - * to. + * Return the number of degrees of freedom the DoF + * handler object has to which the iterator belongs to. */ virtual types::global_dof_index @@ -2322,10 +2313,10 @@ public: #include "fe_values.decl.1.inst" - /// Call - /// @p get_interpolated_dof_values - /// of the iterator with the - /// given arguments. + /** + * Call @p get_interpolated_dof_values of the iterator with the + * given arguments. + */ virtual void get_interpolated_dof_values (const IndexSet &in, @@ -2336,12 +2327,8 @@ public: /** - * Implementation of derived - * classes of the - * CellIteratorBase - * interface. See there for a - * description of the use of - * these classes. + * Implementation of derived classes of the CellIteratorBase + * interface. See there for a description of the use of these classes. * * @author Wolfgang Bangerth, 2003 */ @@ -2351,34 +2338,22 @@ class FEValuesBase::CellIterator : public FEValuesBase::cell_iterator () const; /** - * Return the number of - * degrees of freedom the DoF - * handler object has to - * which the iterator belongs - * to. + * Return the number of degrees of freedom the DoF handler object has to + * which the iterator belongs to. */ virtual types::global_dof_index @@ -2386,10 +2361,10 @@ public: #include "fe_values.decl.2.inst" - /// Call - /// @p get_interpolated_dof_values - /// of the iterator with the - /// given arguments. + /** + * Call @p get_interpolated_dof_values + * of the iterator with the given arguments. + */ virtual void get_interpolated_dof_values (const IndexSet &in, @@ -2397,53 +2372,28 @@ public: private: /** - * Copy of the iterator which - * we use in this object. + * Copy of the iterator which we use in this object. */ const CI cell; }; /** - * Implementation of a derived - * class of the - * CellIteratorBase - * interface. See there for a - * description of the use of + * Implementation of a derived class of the CellIteratorBase + * interface. See there for a description of the use of * these classes. * - * This class is basically a - * specialization of the general - * template for iterators into - * Triangulation objects (but - * since C++ does not allow - * something like this for nested - * classes, it runs under a - * separate name). Since these do - * not implement the interface - * that we would like to call, - * the functions of this class - * cannot be implemented - * meaningfully. However, most - * functions of the FEValues - * class do not make any use of - * degrees of freedom at all, so - * it should be possible to call - * FEValues::reinit() with a tria - * iterator only; this class - * makes this possible, but - * whenever one of the functions - * of FEValues tries to call - * any of the functions of this - * class, an exception will be - * raised reminding the user that - * if she wants to use these - * features, then the - * FEValues object has to be - * reinitialized with a cell - * iterator that allows to - * extract degree of freedom - * information. + * This class is basically a specialization of the general template for iterators into + * Triangulation objects (but since C++ does not allow something like this for nested + * classes, it runs under a separate name). Since these do not implement the interface + * that we would like to call, the functions of this class cannot be implemented + * meaningfully. However, most functions of the FEValues class do not make any use of + * degrees of freedom at all, so it should be possible to call FEValues::reinit() with a tria + * iterator only; this class makes this possible, but whenever one of the functions + * of FEValues tries to call any of the functions of this class, an exception will be + * raised reminding the user that if she wants to use these features, then the + * FEValues object has to be reinitialized with a cell iterator that allows to + * extract degree of freedom information. * * @author Wolfgang Bangerth, 2003 */ @@ -2452,36 +2402,23 @@ class FEValuesBase::TriaCellIterator : public FEValuesBase::cell_iterator &cell); /** - * Conversion operator to an - * iterator for - * triangulations. This - * conversion is implicit for - * the original iterators, - * since they are derived - * classes. However, since - * here we have kind of a - * parallel class hierarchy, - * we have to have a - * conversion operator. Here, - * the conversion is trivial, + * Conversion operator to an iterator for triangulations. This + * conversion is implicit for the original iterators, since they are derived + * classes. However, since here we have kind of a parallel class hierarchy, + * we have to have a conversion operator. Here, the conversion is trivial, * from and to the same time. */ virtual operator typename Triangulation::cell_iterator () const; /** - * Implement the respective - * function of the base - * class. Since this is not - * possible, we just raise an - * error. + * Implement the respective function of the base class. Since this is not + * possible, we just raise an error. */ virtual types::global_dof_index @@ -2489,10 +2426,10 @@ public: #include "fe_values.decl.2.inst" - /// Call - /// @p get_interpolated_dof_values - /// of the iterator with the - /// given arguments. + /** + * Call @p get_interpolated_dof_values of the iterator with the + * given arguments. + */ virtual void get_interpolated_dof_values (const IndexSet &in, @@ -2500,18 +2437,13 @@ public: private: /** - * Copy of the iterator which - * we use in this object. + * Copy of the iterator which we use in this object. */ const typename Triangulation::cell_iterator cell; /** - * String to be displayed - * whenever one of the - * functions of this class is - * called. Make it a static - * member variable, since we - * show the same message for + * String to be displayed whenever one of the functions of this class is + * called. Make it a static member variable, since we show the same message for * all member functions. */ static const char *const message_string; @@ -2555,6 +2487,7 @@ FEValuesBase::CellIterator::n_dofs_for_dof_handler () const #include "fe_values.impl.1.inst" + template template void @@ -2586,6 +2519,7 @@ FEValuesBase::TriaCellIterator::message_string "degrees of freedom, such as DoFHandler::cell_iterator."); + template FEValuesBase::TriaCellIterator:: TriaCellIterator (const typename Triangulation::cell_iterator &cell) @@ -2613,9 +2547,11 @@ FEValuesBase::TriaCellIterator::n_dofs_for_dof_handler () const } + #include "fe_values.impl.2.inst" + template void FEValuesBase::TriaCellIterator:: @@ -2706,7 +2642,6 @@ namespace internal - template void FiniteElementRelatedData::initialize (const unsigned int n_quadrature_points, @@ -2727,10 +2662,8 @@ namespace internal Assert (n_nonzero_shape_components >= fe.dofs_per_cell, ExcInternalError()); - // with the number of rows now - // known, initialize those fields - // that we will need to their - // correct size + // with the number of rows now known, initialize those fields + // that we will need to their correct size if (flags & update_values) { this->shape_values.reinit(n_nonzero_shape_components, @@ -2861,6 +2794,8 @@ namespace internal } } + + template void do_function_values (const typename VectorType::value_type *dof_values_ptr, @@ -2962,6 +2897,8 @@ namespace internal } } + + // use the same implementation for gradients and Hessians, distinguish them // by the rank of the tensors template @@ -3002,6 +2939,8 @@ namespace internal } } + + template void do_function_derivatives (const Number *dof_values_ptr, @@ -3098,6 +3037,8 @@ namespace internal } } + + template void do_function_laplacians (const Number2 *dof_values_ptr, @@ -3133,6 +3074,8 @@ namespace internal } } + + template void do_function_laplacians (const Number *dof_values_ptr, @@ -3415,7 +3358,6 @@ void FEValuesBase::get_function_gradients ( - template template void @@ -3518,7 +3460,6 @@ void FEValuesBase::get_function_hessians ( - template template void @@ -3740,7 +3681,6 @@ void FEValuesBase::get_function_third_derivatives ( - template template void @@ -3867,6 +3807,7 @@ FEValuesBase::compute_update_flags (const UpdateFlags update_flags } + template void FEValuesBase< dim, spacedim >::invalidate_present_cell () @@ -3884,6 +3825,7 @@ FEValuesBase< dim, spacedim >::invalidate_present_cell () } + template void FEValuesBase< dim, spacedim >:: @@ -3928,6 +3870,7 @@ maybe_invalidate_previous_present_cell (const typename Triangulation inline void @@ -3992,10 +3935,12 @@ FEValuesBase::get_cell_similarity () const } + template const unsigned int FEValuesBase::dimension; + template const unsigned int FEValuesBase::space_dimension; @@ -4006,7 +3951,6 @@ const unsigned int FEValues::integral_dimension; - template FEValues::FEValues (const Mapping &mapping, const FiniteElement &fe, @@ -4046,8 +3990,7 @@ template void FEValues::initialize (const UpdateFlags update_flags) { - // You can compute normal vectors - // to the cells only in the + // You can compute normal vectors to the cells only in the // codimension one case. if (dim != spacedim-1) Assert ((update_flags & update_normal_vectors) == false, @@ -4092,6 +4035,7 @@ FEValues::initialize (const UpdateFlags update_flags) } + namespace { // Reset a unique_ptr. If we can, do not de-allocate the previously @@ -4124,6 +4068,7 @@ namespace } + template void FEValues::reinit (const typename Triangulation::cell_iterator &cell) { @@ -4135,10 +4080,8 @@ void FEValues::reinit (const typename Triangulation: reset_pointer_in_place_if_possible::TriaCellIterator> (this->present_cell, cell); - // this was the part of the work - // that is dependent on the actual - // data type of the iterator. now - // pass on to the function doing + // this was the part of the work that is dependent on the actual + // data type of the iterator. now pass on to the function doing // the real work. do_reinit (); } @@ -4151,10 +4094,8 @@ void FEValues::reinit (const TriaIterator, lda> > &cell) { - // assert that the finite elements - // passed to the constructor and - // used by the DoFHandler used by - // this cell, are the same + // assert that the finite elements passed to the constructor and + // used by the DoFHandler used by this cell, are the same Assert (static_cast&>(*this->fe) == static_cast&>(cell->get_fe()), (typename FEValuesBase::ExcFEDontMatch())); @@ -4167,10 +4108,8 @@ FEValues::reinit lda> > > > (this->present_cell, cell); - // this was the part of the work - // that is dependent on the actual - // data type of the iterator. now - // pass on to the function doing + // this was the part of the work that is dependent on the actual + // data type of the iterator. now pass on to the function doing // the real work. do_reinit (); } @@ -4266,10 +4205,13 @@ FEFaceValuesBase::memory_consumption () const template const unsigned int FEFaceValues::dimension; + + template const unsigned int FEFaceValues::integral_dimension; + template FEFaceValues::FEFaceValues (const Mapping &mapping, const FiniteElement &fe, @@ -4350,10 +4292,8 @@ FEFaceValues::reinit (const TriaIterator, lda> > &cell, const unsigned int face_no) { - // assert that the finite elements - // passed to the constructor and - // used by the DoFHandler used by - // this cell, are the same + // assert that the finite elements passed to the constructor and + // used by the DoFHandler used by this cell, are the same Assert (static_cast&>(*this->fe) == static_cast&>( cell->get_dof_handler().get_fe(cell->active_fe_index ())), @@ -4368,10 +4308,8 @@ FEFaceValues::reinit lda> > > > (this->present_cell, cell); - // this was the part of the work - // that is dependent on the actual - // data type of the iterator. now - // pass on to the function doing + // this was the part of the work that is dependent on the actual + // data type of the iterator. now pass on to the function doing // the real work. do_reinit (face_no); } @@ -4389,10 +4327,8 @@ void FEFaceValues::reinit (const typename Triangulation::TriaCellIterator> (this->present_cell, cell); - // this was the part of the work - // that is dependent on the actual - // data type of the iterator. now - // pass on to the function doing + // this was the part of the work that is dependent on the actual + // data type of the iterator. now pass on to the function doing // the real work. do_reinit (face_no); } @@ -4432,6 +4368,8 @@ void FEFaceValues::do_reinit (const unsigned int face_no) template const unsigned int FESubfaceValues::dimension; + + template const unsigned int FESubfaceValues::integral_dimension; @@ -4510,6 +4448,7 @@ FESubfaceValues::initialize (const UpdateFlags update_flags) } + template template