From 8e8d868ae582fa0d6bcbef6a557bf15e75461f2e Mon Sep 17 00:00:00 2001 From: heister Date: Sun, 8 Dec 2013 02:15:54 +0000 Subject: [PATCH] reindent using astyle git-svn-id: https://svn.dealii.org/trunk@31932 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/include/deal.II/base/data_out_base.h | 17 +- deal.II/include/deal.II/base/exceptions.h | 58 +-- deal.II/include/deal.II/base/geometry_info.h | 26 +- deal.II/include/deal.II/base/graph_coloring.h | 18 +- deal.II/include/deal.II/base/logstream.h | 4 +- deal.II/include/deal.II/base/parallel.h | 22 +- .../deal.II/base/synchronous_iterator.h | 4 +- .../include/deal.II/base/thread_management.h | 372 ++++++++-------- deal.II/include/deal.II/base/work_stream.h | 42 +- deal.II/include/deal.II/distributed/tria.h | 19 +- .../deal.II/dofs/dof_accessor.templates.h | 58 +-- deal.II/include/deal.II/dofs/dof_handler.h | 14 +- deal.II/include/deal.II/dofs/dof_levels.h | 4 +- deal.II/include/deal.II/dofs/dof_tools.h | 9 +- deal.II/include/deal.II/fe/fe_tools.h | 16 +- deal.II/include/deal.II/fe/fe_values.h | 34 +- deal.II/include/deal.II/grid/grid_generator.h | 12 +- deal.II/include/deal.II/grid/tria_objects.h | 2 +- deal.II/include/deal.II/hp/dof_faces.h | 8 +- deal.II/include/deal.II/hp/dof_handler.h | 2 +- deal.II/include/deal.II/hp/dof_level.h | 12 +- .../include/deal.II/integrators/divergence.h | 24 +- deal.II/include/deal.II/integrators/laplace.h | 68 +-- deal.II/include/deal.II/lac/arpack_solver.h | 4 +- deal.II/include/deal.II/lac/block_list.h | 4 +- .../include/deal.II/lac/block_matrix_base.h | 18 +- .../include/deal.II/lac/block_sparse_matrix.h | 16 +- .../include/deal.II/lac/block_vector_base.h | 12 +- .../lac/chunk_sparse_matrix.templates.h | 22 +- .../include/deal.II/lac/constraint_matrix.h | 12 +- .../deal.II/lac/constraint_matrix.templates.h | 38 +- .../include/deal.II/lac/lapack_templates.h | 4 +- deal.II/include/deal.II/lac/matrix_out.h | 16 +- .../deal.II/lac/parallel_block_vector.h | 8 +- deal.II/include/deal.II/lac/parallel_vector.h | 3 +- .../include/deal.II/lac/petsc_matrix_base.h | 8 +- .../deal.II/lac/petsc_parallel_block_vector.h | 2 +- .../include/deal.II/lac/petsc_vector_base.h | 158 +++---- .../deal.II/lac/precondition_selector.h | 2 +- deal.II/include/deal.II/lac/slepc_solver.h | 2 +- deal.II/include/deal.II/lac/sparse_direct.h | 2 +- deal.II/include/deal.II/lac/sparse_matrix.h | 8 +- .../deal.II/lac/sparse_matrix.templates.h | 12 +- deal.II/include/deal.II/lac/sparsity_tools.h | 2 +- .../lac/trilinos_parallel_block_vector.h | 8 +- .../deal.II/lac/trilinos_precondition.h | 12 +- .../deal.II/lac/trilinos_vector_base.h | 12 +- deal.II/include/deal.II/lac/vector.h | 10 +- .../include/deal.II/lac/vector.templates.h | 8 +- .../deal.II/matrix_free/dof_info.templates.h | 6 +- .../deal.II/matrix_free/fe_evaluation.h | 152 +++---- .../matrix_free/matrix_free.templates.h | 2 +- deal.II/include/deal.II/meshworker/loop.h | 4 +- deal.II/include/deal.II/meshworker/simple.h | 108 ++--- .../multigrid/sparse_matrix_collection.h | 84 ++-- .../numerics/derivative_approximation.h | 8 +- .../deal.II/numerics/fe_field_function.h | 4 +- .../include/deal.II/numerics/vector_tools.h | 20 +- .../deal.II/numerics/vector_tools.templates.h | 352 ++++++++-------- .../source/base/auto_derivative_function.cc | 2 +- deal.II/source/base/data_out_base.cc | 10 +- deal.II/source/base/exceptions.cc | 2 +- deal.II/source/base/function_parser.cc | 4 +- deal.II/source/base/geometry_info.cc | 8 +- deal.II/source/base/logstream.cc | 46 +- deal.II/source/base/mpi.cc | 4 +- deal.II/source/base/multithread_info.cc | 2 +- deal.II/source/base/path_search.cc | 30 +- deal.II/source/base/polynomial.cc | 6 +- deal.II/source/base/quadrature.cc | 8 +- deal.II/source/base/table_handler.cc | 10 +- deal.II/source/distributed/tria.cc | 398 ++++++++++-------- deal.II/source/dofs/dof_handler.cc | 21 +- deal.II/source/dofs/dof_handler_policy.cc | 2 +- deal.II/source/dofs/dof_tools.cc | 20 +- deal.II/source/dofs/dof_tools_constraints.cc | 272 ++++++------ deal.II/source/fe/fe.cc | 8 +- deal.II/source/fe/fe_dgq.cc | 16 +- deal.II/source/fe/fe_face.cc | 18 +- deal.II/source/fe/fe_q_base.cc | 64 +-- deal.II/source/fe/fe_system.cc | 12 +- deal.II/source/fe/fe_tools.cc | 2 +- deal.II/source/fe/fe_tools_interpolate.cc | 16 +- deal.II/source/fe/fe_values.cc | 2 +- deal.II/source/fe/mapping_q.cc | 36 +- deal.II/source/fe/mapping_q1.cc | 36 +- deal.II/source/grid/grid_generator.cc | 10 +- deal.II/source/grid/grid_in.cc | 60 +-- deal.II/source/grid/grid_out.cc | 2 +- deal.II/source/grid/grid_tools.cc | 120 +++--- deal.II/source/grid/tria_boundary.cc | 2 +- deal.II/source/grid/tria_boundary_lib.cc | 8 +- deal.II/source/grid/tria_objects.cc | 14 +- deal.II/source/hp/dof_handler.cc | 10 +- deal.II/source/hp/dof_level.cc | 20 +- deal.II/source/lac/constraint_matrix.cc | 2 +- deal.II/source/lac/slepc_solver.cc | 22 +- deal.II/source/lac/solver_control.cc | 2 +- deal.II/source/lac/sparse_direct.cc | 2 +- deal.II/source/lac/sparsity_tools.cc | 198 ++++----- deal.II/source/lac/trilinos_block_vector.cc | 2 +- deal.II/source/lac/trilinos_precondition.cc | 4 +- deal.II/source/lac/trilinos_solver.cc | 12 +- deal.II/source/multigrid/mg_tools.cc | 20 +- deal.II/source/numerics/data_out.cc | 34 +- deal.II/source/numerics/data_out_dof_data.cc | 40 +- deal.II/source/numerics/data_out_rotation.cc | 2 +- .../numerics/derivative_approximation.cc | 42 +- deal.II/source/numerics/matrix_tools.cc | 374 ++++++++-------- deal.II/source/numerics/solution_transfer.cc | 92 ++-- 110 files changed, 2096 insertions(+), 2041 deletions(-) diff --git a/deal.II/include/deal.II/base/data_out_base.h b/deal.II/include/deal.II/base/data_out_base.h index 5ea4eb017b..db413f05fd 100644 --- a/deal.II/include/deal.II/base/data_out_base.h +++ b/deal.II/include/deal.II/base/data_out_base.h @@ -3179,15 +3179,16 @@ public: * Read or write the data of this object for serialization */ template - void serialize(Archive &ar, const unsigned int version) { + void serialize(Archive &ar, const unsigned int version) + { ar &valid - &h5_sol_filename - &h5_mesh_filename - &entry_time - &num_nodes - &num_cells - &dimension - &attribute_dims; + &h5_sol_filename + &h5_mesh_filename + &entry_time + &num_nodes + &num_cells + &dimension + &attribute_dims; } /// Get the XDMF content associated with this entry. diff --git a/deal.II/include/deal.II/base/exceptions.h b/deal.II/include/deal.II/base/exceptions.h index 73506c7b0e..635c50d048 100644 --- a/deal.II/include/deal.II/base/exceptions.h +++ b/deal.II/include/deal.II/base/exceptions.h @@ -76,7 +76,7 @@ public: /** * Override the standard function that returns the description of the error. */ - virtual const char* what() const throw(); + virtual const char *what() const throw(); /** * Get exception name. @@ -266,7 +266,7 @@ namespace deal_II_exceptions // Fill the fields of the exception object e.set_fields (file, line, function, cond, exc_name); - switch(handling) + switch (handling) { case abort_on_exception: dealii::deal_II_exceptions::internals::abort(e); @@ -297,15 +297,15 @@ namespace deal_II_exceptions */ #ifdef DEBUG #define Assert(cond, exc) \ -{ \ - if (!(cond)) \ - ::dealii::deal_II_exceptions::internals:: \ - issue_error(::dealii::deal_II_exceptions::internals::abort_on_exception,\ - __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \ -} + { \ + if (!(cond)) \ + ::dealii::deal_II_exceptions::internals:: \ + issue_error(::dealii::deal_II_exceptions::internals::abort_on_exception,\ + __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \ + } #else #define Assert(cond, exc) \ -{} + {} #endif @@ -325,16 +325,16 @@ namespace deal_II_exceptions */ #ifdef DEBUG #define AssertNothrow(cond, exc) \ -{ \ - if (!(cond)) \ - ::dealii::deal_II_exceptions::internals:: \ - issue_error( \ - ::dealii::deal_II_exceptions::internals::abort_nothrow_on_exception, \ - __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \ -} + { \ + if (!(cond)) \ + ::dealii::deal_II_exceptions::internals:: \ + issue_error( \ + ::dealii::deal_II_exceptions::internals::abort_nothrow_on_exception, \ + __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \ + } #else #define AssertNothrow(cond, exc) \ -{} + {} #endif @@ -352,20 +352,20 @@ namespace deal_II_exceptions */ #ifdef HAVE_BUILTIN_EXPECT #define AssertThrow(cond, exc) \ -{ \ - if (__builtin_expect(!(cond), false)) \ - ::dealii::deal_II_exceptions::internals:: \ - issue_error(::dealii::deal_II_exceptions::internals::throw_on_exception,\ - __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \ -} + { \ + if (__builtin_expect(!(cond), false)) \ + ::dealii::deal_II_exceptions::internals:: \ + issue_error(::dealii::deal_II_exceptions::internals::throw_on_exception,\ + __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \ + } #else /*ifdef HAVE_BUILTIN_EXPECT*/ #define AssertThrow(cond, exc) \ -{ \ - if (!(cond)) \ - ::dealii::deal_II_exceptions::internals:: \ - issue_error(::dealii::deal_II_exceptions::internals::throw_on_exception,\ - __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \ -} + { \ + if (!(cond)) \ + ::dealii::deal_II_exceptions::internals:: \ + issue_error(::dealii::deal_II_exceptions::internals::throw_on_exception,\ + __FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #exc, exc); \ + } #endif /*ifdef HAVE_BUILTIN_EXPECT*/ diff --git a/deal.II/include/deal.II/base/geometry_info.h b/deal.II/include/deal.II/base/geometry_info.h index 2b8b62331f..9859d77473 100644 --- a/deal.II/include/deal.II/base/geometry_info.h +++ b/deal.II/include/deal.II/base/geometry_info.h @@ -2172,11 +2172,11 @@ struct GeometryInfo static void alternating_form_at_vertices #ifndef DEAL_II_CONSTEXPR_BUG - (const Point (&vertices)[vertices_per_cell], - Tensor (&forms)[vertices_per_cell]); + (const Point (&vertices)[vertices_per_cell], + Tensor (&forms)[vertices_per_cell]); #else - (const Point *vertices, - Tensor *forms); + (const Point *vertices, + Tensor *forms); #endif /** @@ -2372,7 +2372,8 @@ RefinementCase<2>::cut_axis (const unsigned int i) Assert (i < dim, ExcIndexRange(i, 0, dim)); static const RefinementCase options[dim] = { RefinementPossibilities<2>::cut_x, - RefinementPossibilities<2>::cut_y }; + RefinementPossibilities<2>::cut_y + }; return options[i]; } @@ -2387,8 +2388,9 @@ RefinementCase<3>::cut_axis (const unsigned int i) Assert (i < dim, ExcIndexRange(i, 0, dim)); static const RefinementCase options[dim] = { RefinementPossibilities<3>::cut_x, - RefinementPossibilities<3>::cut_y, - RefinementPossibilities<3>::cut_z }; + RefinementPossibilities<3>::cut_y, + RefinementPossibilities<3>::cut_z + }; return options[i]; } @@ -2577,7 +2579,7 @@ GeometryInfo<2>::child_cell_from_point (const Point<2> &p) return (p[0] <= 0.5 ? (p[1] <= 0.5 ? 0 : 2) : - (p[1] <= 0.5 ? 1 : 3)); + (p[1] <= 0.5 ? 1 : 3)); } @@ -2594,10 +2596,10 @@ GeometryInfo<3>::child_cell_from_point (const Point<3> &p) return (p[0] <= 0.5 ? (p[1] <= 0.5 ? (p[2] <= 0.5 ? 0 : 4) : - (p[2] <= 0.5 ? 2 : 6)) : - (p[1] <= 0.5 ? - (p[2] <= 0.5 ? 1 : 5) : - (p[2] <= 0.5 ? 3 : 7))); + (p[2] <= 0.5 ? 2 : 6)) : + (p[1] <= 0.5 ? + (p[2] <= 0.5 ? 1 : 5) : + (p[2] <= 0.5 ? 3 : 7))); } diff --git a/deal.II/include/deal.II/base/graph_coloring.h b/deal.II/include/deal.II/base/graph_coloring.h index d8cc56d27a..f3c58a24b3 100644 --- a/deal.II/include/deal.II/base/graph_coloring.h +++ b/deal.II/include/deal.II/base/graph_coloring.h @@ -236,15 +236,15 @@ namespace GraphColoring // intersection of the conflict indices. for (unsigned int i=0; i::iterator degrees_it; diff --git a/deal.II/include/deal.II/base/logstream.h b/deal.II/include/deal.II/base/logstream.h index fe03109f66..2c9519b6d2 100644 --- a/deal.II/include/deal.II/base/logstream.h +++ b/deal.II/include/deal.II/base/logstream.h @@ -551,7 +551,7 @@ private: */ Threads::ThreadLocalStorage > outstreams; - template friend LogStream &operator << (LogStream & log, const T &t); + template friend LogStream &operator << (LogStream &log, const T &t); }; @@ -567,7 +567,7 @@ private: */ template inline -LogStream & operator<< (LogStream &log, const T &t) +LogStream &operator<< (LogStream &log, const T &t) { // print to the internal stringstream log.get_stream() << t; diff --git a/deal.II/include/deal.II/base/parallel.h b/deal.II/include/deal.II/base/parallel.h index 819d60f296..51c762f1c3 100644 --- a/deal.II/include/deal.II/base/parallel.h +++ b/deal.II/include/deal.II/base/parallel.h @@ -110,7 +110,7 @@ namespace parallel * three elements. */ template + typename I3, typename I4> static void apply (const F &f, @@ -173,8 +173,8 @@ namespace parallel * module. */ template + typename OutputIterator, + typename Predicate> void transform (const InputIterator &begin_in, const InputIterator &end_in, OutputIterator out, @@ -239,9 +239,9 @@ namespace parallel * module. */ template + typename InputIterator2, + typename OutputIterator, + typename Predicate> void transform (const InputIterator1 &begin_in1, const InputIterator1 &end_in1, InputIterator2 in2, @@ -307,10 +307,10 @@ namespace parallel * module. */ template + typename InputIterator2, + typename InputIterator3, + typename OutputIterator, + typename Predicate> void transform (const InputIterator1 &begin_in1, const InputIterator1 &end_in1, InputIterator2 in2, @@ -563,7 +563,7 @@ namespace parallel * for each subrange. */ template + typename Function> struct ReductionOnSubranges { /** diff --git a/deal.II/include/deal.II/base/synchronous_iterator.h b/deal.II/include/deal.II/base/synchronous_iterator.h index 4bc42d379e..14b40192ba 100644 --- a/deal.II/include/deal.II/base/synchronous_iterator.h +++ b/deal.II/include/deal.II/base/synchronous_iterator.h @@ -166,7 +166,7 @@ void advance (std_cxx1x::tuple &t, * Advance a tuple of iterators by $n$. */ template + typename I3, typename I4> inline void advance (std_cxx1x::tuple &t, const unsigned int n) @@ -206,7 +206,7 @@ void advance_by_one (std_cxx1x::tuple &t) * Advance a tuple of iterators by 1. */ template + typename I3, typename I4> inline void advance_by_one (std_cxx1x::tuple &t) { diff --git a/deal.II/include/deal.II/base/thread_management.h b/deal.II/include/deal.II/base/thread_management.h index ab3cde9387..337e0933f9 100644 --- a/deal.II/include/deal.II/base/thread_management.h +++ b/deal.II/include/deal.II/base/thread_management.h @@ -1034,7 +1034,7 @@ namespace Threads * for each number of arguments. */ template ::value> + int length = std_cxx1x::tuple_size::value> struct fun_ptr_helper; @@ -1477,7 +1477,7 @@ namespace Threads * returned by the function called on * the thread. */ - std_cxx1x::shared_ptr > ret_val; + std_cxx1x::shared_ptr > ret_val; /** * Start the thread and @@ -1570,8 +1570,8 @@ namespace Threads * Copy constructor. */ Thread (const Thread &t) - : - thread_descriptor (t.thread_descriptor) + : + thread_descriptor (t.thread_descriptor) {} /** @@ -2330,14 +2330,14 @@ namespace Threads * @deprecated Use new_thread() instead. */ template + typename Arg1, typename Arg2, typename Arg3> inline internal::fun_encapsulator,3> spawn (RT (*fun_ptr)(Arg1,Arg2,Arg3)) DEAL_II_DEPRECATED; template + typename Arg1, typename Arg2, typename Arg3> inline internal::fun_encapsulator,3> spawn (RT (*fun_ptr)(Arg1,Arg2,Arg3)) @@ -2355,14 +2355,14 @@ namespace Threads * @deprecated Use new_thread() instead. */ template + typename Arg1, typename Arg2, typename Arg3> inline internal::fun_encapsulator,3> spawn (C &c, RT (C::*fun_ptr)(Arg1,Arg2,Arg3)) DEAL_II_DEPRECATED; template + typename Arg1, typename Arg2, typename Arg3> inline internal::fun_encapsulator,3> spawn (C &c, RT (C::*fun_ptr)(Arg1,Arg2,Arg3)) @@ -2380,14 +2380,14 @@ namespace Threads * @deprecated Use new_thread() instead. */ template + typename Arg1, typename Arg2, typename Arg3> inline internal::fun_encapsulator,3> spawn (const C &c, RT (C::*fun_ptr)(Arg1,Arg2,Arg3) const) DEAL_II_DEPRECATED; template + typename Arg1, typename Arg2, typename Arg3> inline internal::fun_encapsulator,3> spawn (const C &c, RT (C::*fun_ptr)(Arg1,Arg2,Arg3) const) @@ -2409,14 +2409,14 @@ namespace Threads * @deprecated Use new_thread() instead. */ template + typename Arg1, typename Arg2, typename Arg3, typename Arg4> inline internal::fun_encapsulator,4> spawn (RT (*fun_ptr)(Arg1,Arg2,Arg3,Arg4)) DEAL_II_DEPRECATED; template + typename Arg1, typename Arg2, typename Arg3, typename Arg4> inline internal::fun_encapsulator,4> spawn (RT (*fun_ptr)(Arg1,Arg2,Arg3,Arg4)) @@ -2434,14 +2434,14 @@ namespace Threads * @deprecated Use new_thread() instead. */ template + typename Arg1, typename Arg2, typename Arg3, typename Arg4> inline internal::fun_encapsulator,4> spawn (C &c, RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4)) DEAL_II_DEPRECATED; template + typename Arg1, typename Arg2, typename Arg3, typename Arg4> inline internal::fun_encapsulator,4> spawn (C &c, RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4)) @@ -2459,14 +2459,14 @@ namespace Threads * @deprecated Use new_thread() instead. */ template + typename Arg1, typename Arg2, typename Arg3, typename Arg4> inline internal::fun_encapsulator,4> spawn (const C &c, RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4) const) DEAL_II_DEPRECATED; template + typename Arg1, typename Arg2, typename Arg3, typename Arg4> inline internal::fun_encapsulator,4> spawn (const C &c, RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4) const) @@ -2487,16 +2487,16 @@ namespace Threads * @deprecated Use new_thread() instead. */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5> inline internal::fun_encapsulator,5> spawn (RT (*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5)) DEAL_II_DEPRECATED; template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5> inline internal::fun_encapsulator,5> spawn (RT (*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5)) @@ -2514,16 +2514,16 @@ namespace Threads * @deprecated Use new_thread() instead. */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5> inline internal::fun_encapsulator,5> spawn (C &c, RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5)) DEAL_II_DEPRECATED; template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5> inline internal::fun_encapsulator,5> spawn (C &c, RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5)) @@ -2541,16 +2541,16 @@ namespace Threads * @deprecated Use new_thread() instead. */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5> inline internal::fun_encapsulator,5> spawn (const C &c, RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5) const) DEAL_II_DEPRECATED; template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5> inline internal::fun_encapsulator,5> spawn (const C &c, RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5) const) @@ -2571,16 +2571,16 @@ namespace Threads * @deprecated Use new_thread() instead. */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6> inline internal::fun_encapsulator,6> spawn (RT (*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6)) DEAL_II_DEPRECATED; template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6> inline internal::fun_encapsulator,6> spawn (RT (*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6)) @@ -2598,16 +2598,16 @@ namespace Threads * @deprecated Use new_thread() instead. */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6> inline internal::fun_encapsulator,6> spawn (C &c, RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6)) DEAL_II_DEPRECATED; template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6> inline internal::fun_encapsulator,6> spawn (C &c, RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6)) @@ -2625,8 +2625,8 @@ namespace Threads * @deprecated Use new_thread() instead. */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6> inline internal::fun_encapsulator,6> @@ -2634,8 +2634,8 @@ namespace Threads template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6> inline internal::fun_encapsulator,6> @@ -2657,9 +2657,9 @@ namespace Threads * @deprecated Use new_thread() instead. */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7> inline internal::fun_encapsulator,7> @@ -2667,9 +2667,9 @@ namespace Threads template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7> inline internal::fun_encapsulator,7> @@ -2688,9 +2688,9 @@ namespace Threads * @deprecated Use new_thread() instead. */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7> inline internal::fun_encapsulator,7> @@ -2698,9 +2698,9 @@ namespace Threads template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7> inline internal::fun_encapsulator,7> @@ -2719,9 +2719,9 @@ namespace Threads * @deprecated Use new_thread() instead. */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7> inline internal::fun_encapsulator + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7> inline internal::fun_encapsulator + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7, typename Arg8> inline internal::fun_encapsulator + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7, typename Arg8> inline internal::fun_encapsulator + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7, typename Arg8> inline internal::fun_encapsulator + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7, typename Arg8> inline internal::fun_encapsulator + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7, typename Arg8> inline internal::fun_encapsulator + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7, typename Arg8> inline internal::fun_encapsulator + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7, typename Arg8, typename Arg9> inline internal::fun_encapsulator + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7, typename Arg8, typename Arg9> inline internal::fun_encapsulator + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7, typename Arg8, typename Arg9> inline internal::fun_encapsulator + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7, typename Arg8, typename Arg9> inline internal::fun_encapsulator + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7, typename Arg8, typename Arg9> inline internal::fun_encapsulator + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7, typename Arg8, typename Arg9> inline internal::fun_encapsulator + typename Arg1, typename Arg2, typename Arg3> inline Thread new_thread (RT (*fun_ptr)(Arg1,Arg2,Arg3), @@ -3215,7 +3215,7 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3> inline Thread new_thread (RT (C::*fun_ptr)(Arg1,Arg2,Arg3), @@ -3241,7 +3241,7 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3> inline Thread new_thread (RT (C::*fun_ptr)(Arg1,Arg2,Arg3) const, @@ -3270,7 +3270,7 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, typename Arg4> inline Thread new_thread (RT (*fun_ptr)(Arg1,Arg2,Arg3,Arg4), @@ -3298,7 +3298,7 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, typename Arg4> inline Thread new_thread (RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4), @@ -3326,7 +3326,7 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, typename Arg4> inline Thread new_thread (RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4) const, @@ -3356,8 +3356,8 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5> inline Thread new_thread (RT (*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5), @@ -3387,8 +3387,8 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5> inline Thread new_thread (RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5), @@ -3418,8 +3418,8 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5> inline Thread new_thread (RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5) const, @@ -3451,8 +3451,8 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6> inline Thread new_thread (RT (*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6), @@ -3484,8 +3484,8 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6> inline Thread new_thread (RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6), @@ -3517,8 +3517,8 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6> inline Thread new_thread (RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6) const, @@ -3552,9 +3552,9 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7> inline Thread new_thread (RT (*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7), @@ -3588,9 +3588,9 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7> inline Thread new_thread (RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7), @@ -3624,9 +3624,9 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7> inline Thread new_thread (RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7) const, @@ -3662,9 +3662,9 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7, typename Arg8> inline Thread new_thread (RT (*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5, @@ -3701,9 +3701,9 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7, typename Arg8> inline Thread new_thread (RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5, @@ -3740,9 +3740,9 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7, typename Arg8> inline Thread new_thread (RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5, @@ -3781,9 +3781,9 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7, typename Arg8, typename Arg9> inline Thread new_thread (RT (*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5, @@ -3822,9 +3822,9 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7, typename Arg8, typename Arg9> inline Thread new_thread (RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5, @@ -3863,9 +3863,9 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7, typename Arg8, typename Arg9> inline Thread new_thread (RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5, @@ -4341,8 +4341,8 @@ namespace Threads * Copy constructor. */ Task (const Task &t) - : - task_descriptor (t.task_descriptor) + : + task_descriptor (t.task_descriptor) {} @@ -4649,7 +4649,7 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3> inline Task new_task (RT (*fun_ptr)(Arg1,Arg2,Arg3), @@ -4675,7 +4675,7 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3> inline Task new_task (RT (C::*fun_ptr)(Arg1,Arg2,Arg3), @@ -4701,7 +4701,7 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3> inline Task new_task (RT (C::*fun_ptr)(Arg1,Arg2,Arg3) const, @@ -4730,7 +4730,7 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, typename Arg4> inline Task new_task (RT (*fun_ptr)(Arg1,Arg2,Arg3,Arg4), @@ -4758,7 +4758,7 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, typename Arg4> inline Task new_task (RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4), @@ -4786,7 +4786,7 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, typename Arg4> inline Task new_task (RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4) const, @@ -4816,8 +4816,8 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5> inline Task new_task (RT (*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5), @@ -4847,8 +4847,8 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5> inline Task new_task (RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5), @@ -4878,8 +4878,8 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5> inline Task new_task (RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5) const, @@ -4911,8 +4911,8 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6> inline Task new_task (RT (*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6), @@ -4944,8 +4944,8 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6> inline Task new_task (RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6), @@ -4977,8 +4977,8 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6> inline Task new_task (RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6) const, @@ -5012,9 +5012,9 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7> inline Task new_task (RT (*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7), @@ -5048,9 +5048,9 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7> inline Task new_task (RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7), @@ -5084,9 +5084,9 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7> inline Task new_task (RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5,Arg6,Arg7) const, @@ -5122,9 +5122,9 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7, typename Arg8> inline Task new_task (RT (*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5, @@ -5161,9 +5161,9 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7, typename Arg8> inline Task new_task (RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5, @@ -5200,9 +5200,9 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7, typename Arg8> inline Task new_task (RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5, @@ -5241,9 +5241,9 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7, typename Arg8, typename Arg9> inline Task new_task (RT (*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5, @@ -5282,9 +5282,9 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7, typename Arg8, typename Arg9> inline Task new_task (RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5, @@ -5323,9 +5323,9 @@ namespace Threads * @ingroup threads */ template + typename Arg1, typename Arg2, typename Arg3, + typename Arg4, typename Arg5, typename Arg6, + typename Arg7, typename Arg8, typename Arg9> inline Task new_task (RT (C::*fun_ptr)(Arg1,Arg2,Arg3,Arg4,Arg5, diff --git a/deal.II/include/deal.II/base/work_stream.h b/deal.II/include/deal.II/base/work_stream.h index 4236b80911..363c28bbc7 100644 --- a/deal.II/include/deal.II/base/work_stream.h +++ b/deal.II/include/deal.II/base/work_stream.h @@ -162,8 +162,8 @@ namespace WorkStream * A class that creates a sequence of items from a range of iterators. */ template + typename ScratchData, + typename CopyData> class IteratorRangeToItemStream : public tbb::filter { public: @@ -481,8 +481,8 @@ namespace WorkStream * run in parallel. */ template + typename ScratchData, + typename CopyData> class Worker : public tbb::filter { public: @@ -635,8 +635,8 @@ namespace WorkStream * they are created. */ template + typename ScratchData, + typename CopyData> class Copier : public tbb::filter { public: @@ -722,8 +722,8 @@ namespace WorkStream * A class that creates a sequence of items from a range of iterators. */ template + typename ScratchData, + typename CopyData> class IteratorRangeToItemStream : public tbb::filter { public: @@ -1009,8 +1009,8 @@ namespace WorkStream * run in parallel. */ template + typename ScratchData, + typename CopyData> class WorkerAndCopier : public tbb::filter { public: @@ -1198,10 +1198,10 @@ namespace WorkStream * are generated. */ template + typename Copier, + typename Iterator, + typename ScratchData, + typename CopyData> void run (const Iterator &begin, const typename identity::type &end, @@ -1331,10 +1331,10 @@ namespace WorkStream * are generated. */ template + typename Copier, + typename Iterator, + typename ScratchData, + typename CopyData> void run (const std::vector > &colored_iterators, Worker worker, @@ -1443,9 +1443,9 @@ namespace WorkStream * are generated. */ template + typename Iterator, + typename ScratchData, + typename CopyData> void run (const Iterator &begin, const typename identity::type &end, diff --git a/deal.II/include/deal.II/distributed/tria.h b/deal.II/include/deal.II/distributed/tria.h index 1bfe32cd5a..f3285eb009 100644 --- a/deal.II/include/deal.II/distributed/tria.h +++ b/deal.II/include/deal.II/distributed/tria.h @@ -159,7 +159,10 @@ namespace internal } //forward declaration of the data type for periodic face pairs -namespace GridTools {template struct PeriodicFacePair;} +namespace GridTools +{ + template struct PeriodicFacePair; +} namespace parallel { @@ -679,7 +682,7 @@ namespace parallel register_data_attach (const std::size_t size, const std_cxx1x::function & pack_callback); + void *)> &pack_callback); /** * The given function is called for @@ -691,7 +694,7 @@ namespace parallel notify_ready_to_unpack (const unsigned int offset, const std_cxx1x::function & unpack_callback); + const void *)> &unpack_callback); /** * Returns a permutation vector for the order the coarse @@ -723,7 +726,7 @@ namespace parallel */ void add_periodicity - (const std::vector >&); + (const std::vector > &); @@ -934,8 +937,8 @@ namespace parallel */ void fill_vertices_with_ghost_neighbors - (std::map > - &vertices_with_ghost_neighbors); + (std::map > + &vertices_with_ghost_neighbors); template friend class dealii::internal::DoFHandler::Policy::ParallelDistributed; }; @@ -1040,8 +1043,8 @@ namespace parallel */ void fill_vertices_with_ghost_neighbors - (std::map > - &vertices_with_ghost_neighbors); + (std::map > + &vertices_with_ghost_neighbors); }; } diff --git a/deal.II/include/deal.II/dofs/dof_accessor.templates.h b/deal.II/include/deal.II/dofs/dof_accessor.templates.h index 6ccc484d85..e3dc97f94b 100644 --- a/deal.II/include/deal.II/dofs/dof_accessor.templates.h +++ b/deal.II/include/deal.II/dofs/dof_accessor.templates.h @@ -514,7 +514,7 @@ namespace internal { return dof_handler.faces->lines. get_dof_index (dof_handler, - obj_index, + obj_index, fe_index, local_index, obj_level); @@ -814,7 +814,7 @@ namespace internal const dealii::internal::int2type<1> &) { return dof_handler.levels[obj_level]->fe_index_is_active(obj_index, - fe_index); + fe_index); } @@ -826,7 +826,7 @@ namespace internal const unsigned int obj_index, const dealii::internal::int2type<1> &) { - // on a cell, the number of active elements is one + // on a cell, the number of active elements is one return 1; } @@ -841,7 +841,7 @@ namespace internal const unsigned int n, const dealii::internal::int2type<1> &) { - Assert (n==0, ExcMessage("On cells, there can only be one active FE index")); + Assert (n==0, ExcMessage("On cells, there can only be one active FE index")); return dof_handler.levels[obj_level]->active_fe_index (obj_index); } @@ -902,7 +902,7 @@ namespace internal const dealii::internal::int2type<2> &) { return dof_handler.levels[obj_level]->fe_index_is_active(obj_index, - fe_index); + fe_index); } @@ -914,7 +914,7 @@ namespace internal const unsigned int obj_index, const dealii::internal::int2type<2> &) { - // on a cell, the number of active elements is one + // on a cell, the number of active elements is one return 1; } @@ -929,7 +929,7 @@ namespace internal const unsigned int n, const dealii::internal::int2type<2> &) { - Assert (n==0, ExcMessage("On cells, there can only be one active FE index")); + Assert (n==0, ExcMessage("On cells, there can only be one active FE index")); return dof_handler.levels[obj_level]->active_fe_index (obj_index); } @@ -1007,7 +1007,7 @@ namespace internal const dealii::internal::int2type<3> &) { return dof_handler.levels[obj_level]->fe_index_is_active(obj_index, - fe_index); + fe_index); } @@ -1050,7 +1050,7 @@ namespace internal const unsigned int obj_index, const dealii::internal::int2type<3> &) { - // on a cell, the number of active elements is one + // on a cell, the number of active elements is one return 1; } @@ -1065,7 +1065,7 @@ namespace internal const unsigned int n, const dealii::internal::int2type<3> &) { - Assert (n==0, ExcMessage("On cells, there can only be one active FE index")); + Assert (n==0, ExcMessage("On cells, there can only be one active FE index")); return dof_handler.levels[obj_level]->active_fe_index (obj_index); } @@ -2571,7 +2571,7 @@ namespace internal Assert (static_cast(accessor.present_index) < accessor.dof_handler->levels[accessor.present_level] - ->cell_cache_offsets.size(), + ->cell_cache_offsets.size(), ExcInternalError()); Assert (accessor.dof_handler->levels[accessor.present_level] ->cell_cache_offsets[accessor.present_index] @@ -2582,12 +2582,12 @@ namespace internal std::vector dof_indices (dofs_per_cell); static_cast,lda> &> - (accessor).get_dof_indices (dof_indices, accessor.active_fe_index()); + (accessor).get_dof_indices (dof_indices, accessor.active_fe_index()); types::global_dof_index *next_dof_index - = &accessor.dof_handler->levels[accessor.present_level] - ->cell_dof_indices_cache[accessor.dof_handler->levels[accessor.present_level] - ->cell_cache_offsets[accessor.present_index]]; + = &accessor.dof_handler->levels[accessor.present_level] + ->cell_dof_indices_cache[accessor.dof_handler->levels[accessor.present_level] + ->cell_cache_offsets[accessor.present_index]]; for (unsigned int i=0; ilevels[accessor.level()] - ->active_fe_index(accessor.present_index); + ->active_fe_index(accessor.present_index); } @@ -2821,7 +2821,7 @@ namespace internal ExcMessage ("DoFHandler not initialized")); accessor.dof_handler->levels[accessor.level()] - ->set_active_fe_index (accessor.present_index, i); + ->set_active_fe_index (accessor.present_index, i); } @@ -3033,7 +3033,7 @@ namespace internal template + class OutputMatrix, typename OutputVector> static void distribute_local_to_global (const DoFCellAccessor, lda> &accessor, @@ -3078,7 +3078,7 @@ namespace internal template + class OutputMatrix, typename OutputVector> static void distribute_local_to_global (const DoFCellAccessor, lda> &accessor, @@ -3287,8 +3287,8 @@ DoFCellAccessor::get_dof_indices (std::vector & AssertDimension (dof_indices.size(), this->get_fe().dofs_per_cell); const types::global_dof_index *cache - = this->dof_handler->levels[this->present_level] - ->get_cell_cache_start (this->present_index, this->get_fe().dofs_per_cell); + = this->dof_handler->levels[this->present_level] + ->get_cell_cache_start (this->present_index, this->get_fe().dofs_per_cell); for (unsigned int i=0; iget_fe().dofs_per_cell; ++i, ++cache) dof_indices[i] = *cache; } @@ -3357,8 +3357,8 @@ DoFCellAccessor::get_dof_values (const InputVector &values, typename DoFCellAccessor::ExcVectorDoesNotMatch()); const types::global_dof_index *cache - = this->dof_handler->levels[this->present_level] - ->get_cell_cache_start (this->present_index, this->get_fe().dofs_per_cell); + = this->dof_handler->levels[this->present_level] + ->get_cell_cache_start (this->present_index, this->get_fe().dofs_per_cell); values.extract_subvector_to (cache, cache + this->get_fe().dofs_per_cell, @@ -3385,12 +3385,12 @@ DoFCellAccessor::get_dof_values (const ConstraintMatrix &constraints, == this->get_fe().dofs_per_cell, typename DoFCellAccessor::ExcVectorDoesNotMatch()); Assert (values.size() == this->get_dof_handler().n_dofs(), - typename DoFCellAccessor::ExcVectorDoesNotMatch()); + typename DoFCellAccessor::ExcVectorDoesNotMatch()); const types::global_dof_index *cache - = this->dof_handler->levels[this->present_level] - ->get_cell_cache_start (this->present_index, this->get_fe().dofs_per_cell); + = this->dof_handler->levels[this->present_level] + ->get_cell_cache_start (this->present_index, this->get_fe().dofs_per_cell); constraints.get_dof_values(values, *cache, local_values_begin, local_values_end); @@ -3414,12 +3414,12 @@ DoFCellAccessor::set_dof_values (const Vector &local_values, == this->get_fe().dofs_per_cell, typename DoFCellAccessor::ExcVectorDoesNotMatch()); Assert (values.size() == this->get_dof_handler().n_dofs(), - typename DoFCellAccessor::ExcVectorDoesNotMatch()); + typename DoFCellAccessor::ExcVectorDoesNotMatch()); const types::global_dof_index *cache - = this->dof_handler->levels[this->present_level] - ->get_cell_cache_start (this->present_index, this->get_fe().dofs_per_cell); + = this->dof_handler->levels[this->present_level] + ->get_cell_cache_start (this->present_index, this->get_fe().dofs_per_cell); for (unsigned int i=0; iget_fe().dofs_per_cell; ++i, ++cache) values(*cache) = local_values(i); diff --git a/deal.II/include/deal.II/dofs/dof_handler.h b/deal.II/include/deal.II/dofs/dof_handler.h index c56d20ed5e..5feae64959 100644 --- a/deal.II/include/deal.II/dofs/dof_handler.h +++ b/deal.II/include/deal.II/dofs/dof_handler.h @@ -1262,8 +1262,8 @@ namespace internal * * Defined in dof_handler.cc. */ - template - std::string policy_to_string(const dealii::internal::DoFHandler::Policy::PolicyBase & policy); + template + std::string policy_to_string(const dealii::internal::DoFHandler::Policy::PolicyBase &policy); } @@ -1327,11 +1327,11 @@ void DoFHandler::load (Archive &ar, "the one that was associated with the DoFHandler previously stored.")); AssertThrow (policy_name == internal::policy_to_string(*policy), ExcMessage (std::string ("The policy currently associated with this DoFHandler (") - + internal::policy_to_string(*policy) - +std::string(") does not match the one that was associated with the " - "DoFHandler previously stored (") - + policy_name - + ").")); + + internal::policy_to_string(*policy) + +std::string(") does not match the one that was associated with the " + "DoFHandler previously stored (") + + policy_name + + ").")); } diff --git a/deal.II/include/deal.II/dofs/dof_levels.h b/deal.II/include/deal.II/dofs/dof_levels.h index c657388fe9..6982bc7f7b 100644 --- a/deal.II/include/deal.II/dofs/dof_levels.h +++ b/deal.II/include/deal.II/dofs/dof_levels.h @@ -101,7 +101,7 @@ namespace internal */ const types::global_dof_index * get_cell_cache_start (const unsigned int obj_index, - const unsigned int dofs_per_cell) const; + const unsigned int dofs_per_cell) const; /** * Determine an estimate for the @@ -125,7 +125,7 @@ namespace internal inline const types::global_dof_index * DoFLevel::get_cell_cache_start (const unsigned int obj_index, - const unsigned int dofs_per_cell) const + const unsigned int dofs_per_cell) const { Assert (obj_index*dofs_per_cell+dofs_per_cell <= diff --git a/deal.II/include/deal.II/dofs/dof_tools.h b/deal.II/include/deal.II/dofs/dof_tools.h index f1a02d0fe9..d00ab54b23 100644 --- a/deal.II/include/deal.II/dofs/dof_tools.h +++ b/deal.II/include/deal.II/dofs/dof_tools.h @@ -53,7 +53,10 @@ class ConstraintMatrix; template class InterGridMap; template class Mapping; -namespace GridTools {template struct PeriodicFacePair;} +namespace GridTools +{ + template struct PeriodicFacePair; +} //TODO: map_support_points_to_dofs should generate a multimap, rather than just a map, since several dofs may be located at the same support point @@ -1024,8 +1027,8 @@ namespace DoFTools template void make_periodicity_constraints - (const std::vector > - &periodic_faces, + (const std::vector > + &periodic_faces, dealii::ConstraintMatrix &constraint_matrix, const ComponentMask &component_mask = ComponentMask()); diff --git a/deal.II/include/deal.II/fe/fe_tools.h b/deal.II/include/deal.II/fe/fe_tools.h index 1cc390f751..362edb59d4 100644 --- a/deal.II/include/deal.II/fe/fe_tools.h +++ b/deal.II/include/deal.II/fe/fe_tools.h @@ -552,9 +552,9 @@ namespace FETools * @p distribute function of your hanging node constraints object. */ template class DH1, - template class DH2, - class InVector, class OutVector> + template class DH1, + template class DH2, + class InVector, class OutVector> void interpolate (const DH1 &dof1, const InVector &u1, @@ -578,9 +578,9 @@ namespace FETools * DoF values at the discontinuities. */ template class DH1, - template class DH2, - class InVector, class OutVector> + template class DH1, + template class DH2, + class InVector, class OutVector> void interpolate (const DH1 &dof1, const InVector &u1, const DH2 &dof2, @@ -611,8 +611,8 @@ namespace FETools * type @p hp::DoFHandler. */ template class DH, - class InVector, class OutVector, int spacedim> + template class DH, + class InVector, class OutVector, int spacedim> void back_interpolate (const DH &dof1, const InVector &u1, const FiniteElement &fe2, diff --git a/deal.II/include/deal.II/fe/fe_values.h b/deal.II/include/deal.II/fe/fe_values.h index 153c1b5721..0802018b05 100644 --- a/deal.II/include/deal.II/fe/fe_values.h +++ b/deal.II/include/deal.II/fe/fe_values.h @@ -2220,13 +2220,13 @@ public: */ DeclException1 (ExcAccessToUninitializedField, char *, - << ("You are requesting information from an FEValues/FEFaceValues/FESubfaceValues " - "object for which this kind of information has not been computed. What " - "information these objects compute is determined by the update_* flags you " - "pass to the constructor. Here, the operation you are attempting requires " - "the <") - << arg1 - << "> flag to be set, but it was apparently not specified upon construction."); + << ("You are requesting information from an FEValues/FEFaceValues/FESubfaceValues " + "object for which this kind of information has not been computed. What " + "information these objects compute is determined by the update_* flags you " + "pass to the constructor. Here, the operation you are attempting requires " + "the <") + << arg1 + << "> flag to be set, but it was apparently not specified upon construction."); /** * @todo Document this * @@ -3896,7 +3896,7 @@ const std::vector > & FEValuesBase::get_quadrature_points () const { Assert (this->update_flags & update_quadrature_points, - ExcAccessToUninitializedField("update_quadrature_points")); + ExcAccessToUninitializedField("update_quadrature_points")); return this->quadrature_points; } @@ -3908,7 +3908,7 @@ const std::vector & FEValuesBase::get_JxW_values () const { Assert (this->update_flags & update_JxW_values, - ExcAccessToUninitializedField("update_JxW_values")); + ExcAccessToUninitializedField("update_JxW_values")); return this->JxW_values; } @@ -3920,7 +3920,7 @@ const std::vector > & FEValuesBase::get_jacobians () const { Assert (this->update_flags & update_jacobians, - ExcAccessToUninitializedField("update_jacobians")); + ExcAccessToUninitializedField("update_jacobians")); return this->jacobians; } @@ -3932,7 +3932,7 @@ const std::vector > & FEValuesBase::get_jacobian_grads () const { Assert (this->update_flags & update_jacobian_grads, - ExcAccessToUninitializedField("update_jacobians_grads")); + ExcAccessToUninitializedField("update_jacobians_grads")); return this->jacobian_grads; } @@ -3944,7 +3944,7 @@ const std::vector > & FEValuesBase::get_inverse_jacobians () const { Assert (this->update_flags & update_inverse_jacobians, - ExcAccessToUninitializedField("update_inverse_jacobians")); + ExcAccessToUninitializedField("update_inverse_jacobians")); return this->inverse_jacobians; } @@ -3956,7 +3956,7 @@ const Point & FEValuesBase::quadrature_point (const unsigned int i) const { Assert (this->update_flags & update_quadrature_points, - ExcAccessToUninitializedField("update_quadrature_points")); + ExcAccessToUninitializedField("update_quadrature_points")); Assert (iquadrature_points.size(), ExcIndexRange(i, 0, this->quadrature_points.size())); return this->quadrature_points[i]; @@ -3971,7 +3971,7 @@ double FEValuesBase::JxW (const unsigned int i) const { Assert (this->update_flags & update_JxW_values, - ExcAccessToUninitializedField("update_JxW_values")); + ExcAccessToUninitializedField("update_JxW_values")); Assert (iJxW_values.size(), ExcIndexRange(i, 0, this->JxW_values.size())); return this->JxW_values[i]; @@ -3985,7 +3985,7 @@ const DerivativeForm<1,dim,spacedim> & FEValuesBase::jacobian (const unsigned int i) const { Assert (this->update_flags & update_jacobians, - ExcAccessToUninitializedField("update_jacobians")); + ExcAccessToUninitializedField("update_jacobians")); Assert (ijacobians.size(), ExcIndexRange(i, 0, this->jacobians.size())); return this->jacobians[i]; @@ -3999,7 +3999,7 @@ const DerivativeForm<2,dim,spacedim> & FEValuesBase::jacobian_grad (const unsigned int i) const { Assert (this->update_flags & update_jacobian_grads, - ExcAccessToUninitializedField("update_jacobians_grads")); + ExcAccessToUninitializedField("update_jacobians_grads")); Assert (ijacobian_grads.size(), ExcIndexRange(i, 0, this->jacobian_grads.size())); return this->jacobian_grads[i]; @@ -4013,7 +4013,7 @@ const DerivativeForm<1,spacedim,dim> & FEValuesBase::inverse_jacobian (const unsigned int i) const { Assert (this->update_flags & update_inverse_jacobians, - ExcAccessToUninitializedField("update_inverse_jacobians")); + ExcAccessToUninitializedField("update_inverse_jacobians")); Assert (iinverse_jacobians.size(), ExcIndexRange(i, 0, this->inverse_jacobians.size())); return this->inverse_jacobians[i]; diff --git a/deal.II/include/deal.II/grid/grid_generator.h b/deal.II/include/deal.II/grid/grid_generator.h index 7307374abe..0ad8634481 100644 --- a/deal.II/include/deal.II/grid/grid_generator.h +++ b/deal.II/include/deal.II/grid/grid_generator.h @@ -606,12 +606,12 @@ namespace GridGenerator */ template void hyper_cube_with_cylindrical_hole ( - Triangulation &triangulation, - const double inner_radius = .25, - const double outer_radius = .5, - const double L = .5, - const unsigned int repetition = 1, - const bool colorize = false); + Triangulation &triangulation, + const double inner_radius = .25, + const double outer_radius = .5, + const double L = .5, + const unsigned int repetition = 1, + const bool colorize = false); /** * Produce a ring of cells in 3D that is cut open, twisted and glued diff --git a/deal.II/include/deal.II/grid/tria_objects.h b/deal.II/include/deal.II/grid/tria_objects.h index a04968e0a9..8e9e4ad481 100644 --- a/deal.II/include/deal.II/grid/tria_objects.h +++ b/deal.II/include/deal.II/grid/tria_objects.h @@ -175,7 +175,7 @@ namespace internal void serialize(Archive &ar, const unsigned int version); }; - + /** * Store boundary and material data. For * example, in one dimension, this field diff --git a/deal.II/include/deal.II/hp/dof_faces.h b/deal.II/include/deal.II/hp/dof_faces.h index 3aa6f9c4d5..7812e9c530 100644 --- a/deal.II/include/deal.II/hp/dof_faces.h +++ b/deal.II/include/deal.II/hp/dof_faces.h @@ -405,8 +405,8 @@ namespace internal return *(pointer + 1 + local_index); else pointer += static_cast( - dof_handler.get_fe()[*pointer] - .template n_dofs_per_object() + 1); + dof_handler.get_fe()[*pointer] + .template n_dofs_per_object() + 1); } } @@ -634,8 +634,8 @@ namespace internal return true; else pointer += static_cast( - dof_handler.get_fe()[*pointer] - .template n_dofs_per_object()+1); + dof_handler.get_fe()[*pointer] + .template n_dofs_per_object()+1); } } diff --git a/deal.II/include/deal.II/hp/dof_handler.h b/deal.II/include/deal.II/hp/dof_handler.h index 4ee8bab130..8b0c2b1ace 100644 --- a/deal.II/include/deal.II/hp/dof_handler.h +++ b/deal.II/include/deal.II/hp/dof_handler.h @@ -790,7 +790,7 @@ namespace hp * levels[] tree of * the Triangulation objects. */ - std::vector levels; + std::vector levels; /** * Space to store the DoF diff --git a/deal.II/include/deal.II/hp/dof_level.h b/deal.II/include/deal.II/hp/dof_level.h index 0f9e43fd85..a582379c97 100644 --- a/deal.II/include/deal.II/hp/dof_level.h +++ b/deal.II/include/deal.II/hp/dof_level.h @@ -250,7 +250,7 @@ namespace internal */ void set_active_fe_index (const unsigned int obj_index, - const unsigned int fe_index); + const unsigned int fe_index); /** * Return a pointer to the beginning of the DoF indices cache @@ -265,7 +265,7 @@ namespace internal */ const types::global_dof_index * get_cell_cache_start (const unsigned int obj_index, - const unsigned int dofs_per_cell) const; + const unsigned int dofs_per_cell) const; /** * Determine an estimate for the @@ -330,7 +330,7 @@ namespace internal "information is available")); Assert (fe_index == active_fe_indices[obj_index], - ExcMessage ("FE index does not match that of the present cell")); + ExcMessage ("FE index does not match that of the present cell")); // see if the dof_indices array has been compressed for this // particular cell @@ -363,7 +363,7 @@ namespace internal Assert ((signed_active_fe_index_type)active_fe_indices[obj_index]>=0, ExcMessage ("This function can no longer be called after compressing the dof_indices array")); Assert (fe_index == active_fe_indices[obj_index], - ExcMessage ("FE index does not match that of the present cell")); + ExcMessage ("FE index does not match that of the present cell")); dof_indices[dof_offsets[obj_index]+local_index] = global_index; } @@ -399,7 +399,7 @@ namespace internal void DoFLevel:: set_active_fe_index (const unsigned int obj_index, - const unsigned int fe_index) + const unsigned int fe_index) { Assert (obj_index < active_fe_indices.size(), ExcIndexRange (obj_index, 0, active_fe_indices.size())); @@ -412,7 +412,7 @@ namespace internal inline const types::global_dof_index * DoFLevel::get_cell_cache_start (const unsigned int obj_index, - const unsigned int dofs_per_cell) const + const unsigned int dofs_per_cell) const { Assert (obj_index < cell_cache_offsets.size(), ExcInternalError()); diff --git a/deal.II/include/deal.II/integrators/divergence.h b/deal.II/include/deal.II/integrators/divergence.h index 836936425b..79438a8fba 100644 --- a/deal.II/include/deal.II/integrators/divergence.h +++ b/deal.II/include/deal.II/integrators/divergence.h @@ -187,18 +187,18 @@ namespace LocalIntegrators } -/** - * Cell matrix for gradient. The derivative is on the trial function. - * \f[ - * \int_Z \nabla u \cdot \mathbf v\,dx - * \f] - * - * This is the strong gradient and the trial space should be at least - * in H1. The test functions can be discontinuous. - * - * @author Guido Kanschat - * @date 2011 - */ + /** + * Cell matrix for gradient. The derivative is on the trial function. + * \f[ + * \int_Z \nabla u \cdot \mathbf v\,dx + * \f] + * + * This is the strong gradient and the trial space should be at least + * in H1. The test functions can be discontinuous. + * + * @author Guido Kanschat + * @date 2011 + */ template void gradient_matrix( FullMatrix &M, diff --git a/deal.II/include/deal.II/integrators/laplace.h b/deal.II/include/deal.II/integrators/laplace.h index 0148bbcaa5..156c274ef0 100644 --- a/deal.II/include/deal.II/integrators/laplace.h +++ b/deal.II/include/deal.II/integrators/laplace.h @@ -397,48 +397,48 @@ namespace LocalIntegrators { const double dx = fe1.JxW(k); const Point &n = fe1.normal_vector(k); - for (unsigned int i=0; i + typename MATRIX2, typename INVERSE> void solve( const MATRIX1 &A, const MATRIX2 &B, @@ -228,7 +228,7 @@ ArpackSolver::ArpackSolver (SolverControl &control, template + typename MATRIX2, typename INVERSE> inline void ArpackSolver::solve ( const MATRIX1 &system_matrix, diff --git a/deal.II/include/deal.II/lac/block_list.h b/deal.II/include/deal.II/lac/block_list.h index 97bfc00e20..782ccb4742 100644 --- a/deal.II/include/deal.II/lac/block_list.h +++ b/deal.II/include/deal.II/lac/block_list.h @@ -465,7 +465,7 @@ BlockList::cell_generates_vertex_patch( if (same_level_only && cell->neighbor(4)->neighbor(2)->level() != cell->level()) break; if (cell->neighbor(4)->neighbor(0)->at_boundary(2)) break; if (same_level_only && cell->neighbor(4)->neighbor(0)->neighbor(2)->level() != cell->level()) break; - // No break here + // No break here case 2: if (cell->at_boundary(2)) break; if (same_level_only && cell->neighbor(2)->level() != cell->level()) break; @@ -578,7 +578,7 @@ BlockList::initialize_vertex_patches_mg( indices[fe.face_to_cell_index(i,5)] = numbers::invalid_dof_index; } add(k, indices); - // no break here + // no break here case 1: cell->get_mg_dof_indices(indices); for (unsigned int i=0; i + class VectorType> void vmult_block_nonblock (BlockVectorType &dst, const VectorType &src) const; @@ -1106,7 +1106,7 @@ protected: * compiler. */ template + class VectorType> void vmult_nonblock_block (VectorType &dst, const BlockVectorType &src) const; @@ -1174,7 +1174,7 @@ protected: * compiler. */ template + class VectorType> void Tvmult_block_nonblock (BlockVectorType &dst, const VectorType &src) const; @@ -1197,7 +1197,7 @@ protected: * compiler. */ template + class VectorType> void Tvmult_nonblock_block (VectorType &dst, const BlockVectorType &src) const; @@ -1301,7 +1301,7 @@ private: * beginning of their use, so there is no point actually copying * anything. */ - TemporaryData & operator = (const TemporaryData &) + TemporaryData &operator = (const TemporaryData &) { return *this; } @@ -2537,7 +2537,7 @@ vmult_block_block (BlockVectorType &dst, template template + class VectorType> void BlockMatrixBase:: vmult_nonblock_block (VectorType &dst, @@ -2557,7 +2557,7 @@ vmult_nonblock_block (VectorType &dst, template template + class VectorType> void BlockMatrixBase:: vmult_block_nonblock (BlockVectorType &dst, @@ -2638,7 +2638,7 @@ Tvmult_block_block (BlockVectorType &dst, template template + class VectorType> void BlockMatrixBase:: Tvmult_block_nonblock (BlockVectorType &dst, @@ -2659,7 +2659,7 @@ Tvmult_block_nonblock (BlockVectorType &dst, template template + class VectorType> void BlockMatrixBase:: Tvmult_nonblock_block (VectorType &dst, diff --git a/deal.II/include/deal.II/lac/block_sparse_matrix.h b/deal.II/include/deal.II/lac/block_sparse_matrix.h index 75d3c5811e..35932009e9 100644 --- a/deal.II/include/deal.II/lac/block_sparse_matrix.h +++ b/deal.II/include/deal.II/lac/block_sparse_matrix.h @@ -278,7 +278,7 @@ public: * only one block column. */ template + typename nonblock_number> void vmult (BlockVector &dst, const Vector &src) const; @@ -290,7 +290,7 @@ public: * only one block row. */ template + typename nonblock_number> void vmult (Vector &dst, const BlockVector &src) const; @@ -325,7 +325,7 @@ public: * only one block row. */ template + typename nonblock_number> void Tvmult (BlockVector &dst, const Vector &src) const; @@ -337,7 +337,7 @@ public: * only one block column. */ template + typename nonblock_number> void Tvmult (Vector &dst, const BlockVector &src) const; @@ -501,7 +501,7 @@ BlockSparseMatrix::vmult (BlockVector &dst, template template + typename nonblock_number> inline void BlockSparseMatrix::vmult (BlockVector &dst, @@ -514,7 +514,7 @@ BlockSparseMatrix::vmult (BlockVector &dst, template template + typename nonblock_number> inline void BlockSparseMatrix::vmult (Vector &dst, @@ -551,7 +551,7 @@ BlockSparseMatrix::Tvmult (BlockVector &dst, template template + typename nonblock_number> inline void BlockSparseMatrix::Tvmult (BlockVector &dst, @@ -564,7 +564,7 @@ BlockSparseMatrix::Tvmult (BlockVector &dst, template template + typename nonblock_number> inline void BlockSparseMatrix::Tvmult (Vector &dst, diff --git a/deal.II/include/deal.II/lac/block_vector_base.h b/deal.II/include/deal.II/lac/block_vector_base.h index 8991123408..a924af5d66 100644 --- a/deal.II/include/deal.II/lac/block_vector_base.h +++ b/deal.II/include/deal.II/lac/block_vector_base.h @@ -2553,7 +2553,7 @@ template template inline void BlockVectorBase::extract_subvector_to (const std::vector &indices, - std::vector &values) const + std::vector &values) const { for (size_type i = 0; i < indices.size(); ++i) values[i] = operator()(indices[i]); @@ -2568,10 +2568,12 @@ void BlockVectorBase::extract_subvector_to (ForwardIterator const ForwardIterator indices_end, OutputIterator values_begin) const { - while (indices_begin != indices_end) { - *values_begin = operator()(*indices_begin); - indices_begin++; values_begin++; - } + while (indices_begin != indices_end) + { + *values_begin = operator()(*indices_begin); + indices_begin++; + values_begin++; + } } #endif // DOXYGEN diff --git a/deal.II/include/deal.II/lac/chunk_sparse_matrix.templates.h b/deal.II/include/deal.II/lac/chunk_sparse_matrix.templates.h index f9d396419d..62f8409c8f 100644 --- a/deal.II/include/deal.II/lac/chunk_sparse_matrix.templates.h +++ b/deal.II/include/deal.II/lac/chunk_sparse_matrix.templates.h @@ -61,8 +61,8 @@ namespace internal * fragment. */ template + typename SrcIterator, + typename DstIterator> inline void chunk_vmult_add (const size_type chunk_size, @@ -92,8 +92,8 @@ namespace internal * the residual. */ template + typename SrcIterator, + typename DstIterator> inline void chunk_vmult_subtract (const size_type chunk_size, @@ -123,8 +123,8 @@ namespace internal * chunk_size to the destination vector fragment. */ template + typename SrcIterator, + typename DstIterator> inline void chunk_Tvmult_add (const size_type chunk_size, @@ -150,9 +150,9 @@ namespace internal * individual chunk. */ template + typename MatrixIterator, + typename SrcIterator1, + typename SrcIterator2> inline result_type chunk_matrix_scalar_product (const size_type chunk_size, @@ -190,8 +190,8 @@ namespace internal * task scheduler. */ template + typename InVector, + typename OutVector> void vmult_add_on_subrange (const ChunkSparsityPattern &cols, const unsigned int begin_row, const unsigned int end_row, diff --git a/deal.II/include/deal.II/lac/constraint_matrix.h b/deal.II/include/deal.II/lac/constraint_matrix.h index 5377861801..33bf9bf3bb 100644 --- a/deal.II/include/deal.II/lac/constraint_matrix.h +++ b/deal.II/include/deal.II/lac/constraint_matrix.h @@ -215,7 +215,7 @@ public: * IndexSet, whereas otherwise it contains the global problem size and the * local range. */ - const IndexSet & get_local_lines() const; + const IndexSet &get_local_lines() const; /** * This function copies the content of @p constraints_in with DoFs that are @@ -436,7 +436,7 @@ public: * index2=index1. */ bool are_identity_constrained (const size_type index1, - const size_type index2) const; + const size_type index2) const; /** * Return the maximum number of other dofs that one dof is constrained @@ -857,7 +857,7 @@ public: * prevent data races. */ template + class VectorType> void distribute_local_to_global (ForwardIteratorVec local_vector_begin, ForwardIteratorVec local_vector_end, @@ -1035,7 +1035,7 @@ public: * set (i.e., distribute to be called). */ template + class VectorType> void get_dof_values (const VectorType &global_vector, ForwardIteratorInd local_indices_begin, @@ -1633,7 +1633,7 @@ void ConstraintMatrix::distribute_local_to_global ( template + class VectorType> inline void ConstraintMatrix::distribute_local_to_global ( ForwardIteratorVec local_vector_begin, @@ -1676,7 +1676,7 @@ ConstraintMatrix::distribute_local_to_global ( template + class VectorType> inline void ConstraintMatrix::get_dof_values (const VectorType &global_vector, ForwardIteratorInd local_indices_begin, diff --git a/deal.II/include/deal.II/lac/constraint_matrix.templates.h b/deal.II/include/deal.II/lac/constraint_matrix.templates.h index a047165fde..36c3304668 100644 --- a/deal.II/include/deal.II/lac/constraint_matrix.templates.h +++ b/deal.II/include/deal.II/lac/constraint_matrix.templates.h @@ -1742,7 +1742,7 @@ namespace internals /** * Dereferencing operator. */ - ScratchData & operator* () + ScratchData &operator* () { return *my_scratch_data; } @@ -1750,13 +1750,13 @@ namespace internals /** * Dereferencing operator. */ - ScratchData * operator-> () + ScratchData *operator-> () { return my_scratch_data; } private: - ScratchData* my_scratch_data; + ScratchData *my_scratch_data; }; private: @@ -1766,7 +1766,7 @@ namespace internals static Threads::ThreadLocalStorage scratch_data; }; - + // function for block matrices: Find out where in the list of local dofs // (sorted according to global ids) the individual blocks start. Transform @@ -2509,7 +2509,7 @@ ConstraintMatrix::distribute_local_to_global ( const size_type n_local_dofs = local_dof_indices.size(); typename internals::ConstraintMatrixData::ScratchDataAccessor - scratch_data; + scratch_data; internals::GlobalRowsFromLocal &global_rows = scratch_data->global_rows; global_rows.reinit(n_local_dofs); @@ -2523,8 +2523,8 @@ ConstraintMatrix::distribute_local_to_global ( // an array in any case since we cannot know about the actual data type in // the ConstraintMatrix class (unless we do cast). This involves a little // bit of logic to determine the type of the matrix value. - std::vector & cols = scratch_data->columns; - std::vector & vals = scratch_data->values; + std::vector &cols = scratch_data->columns; + std::vector &vals = scratch_data->values; SparseMatrix *sparse_matrix = dynamic_cast *>(&global_matrix); if (use_dealii_matrix == false) @@ -2602,7 +2602,7 @@ ConstraintMatrix::distribute_local_to_global ( const size_type n_local_col_dofs = col_indices.size(); typename internals::ConstraintMatrixData::ScratchDataAccessor - scratch_data; + scratch_data; internals::GlobalRowsFromLocal &global_rows = scratch_data->global_rows; global_rows.reinit(n_local_row_dofs); internals::GlobalRowsFromLocal &global_cols = scratch_data->global_columns; @@ -2615,8 +2615,8 @@ ConstraintMatrix::distribute_local_to_global ( // create arrays for the column data (indices and values) that will then be // written into the matrix. Shortcut for deal.II sparse matrix - std::vector & cols = scratch_data->columns; - std::vector & vals = scratch_data->values; + std::vector &cols = scratch_data->columns; + std::vector &vals = scratch_data->values; cols.resize(n_actual_col_dofs); vals.resize(n_actual_col_dofs); @@ -2670,7 +2670,7 @@ distribute_local_to_global (const FullMatrix &local_matrix, Assert (sorted == true, ExcMatrixNotClosed()); typename internals::ConstraintMatrixData::ScratchDataAccessor - scratch_data; + scratch_data; const size_type n_local_dofs = local_dof_indices.size(); internals::GlobalRowsFromLocal &global_rows = scratch_data->global_rows; @@ -2693,8 +2693,8 @@ distribute_local_to_global (const FullMatrix &local_matrix, block_starts.resize(num_blocks+1); internals::make_block_starts (global_matrix, global_rows, block_starts); - std::vector & cols = scratch_data->columns; - std::vector & vals = scratch_data->values; + std::vector &cols = scratch_data->columns; + std::vector &vals = scratch_data->values; if (use_dealii_matrix == false) { cols.resize (n_actual_dofs); @@ -2787,7 +2787,7 @@ add_entries_local_to_global (const std::vector &local_dof_indices, // plus some indices that come from constraints. if (dof_mask_is_active == false) { - std::vector & actual_dof_indices = scratch_data->columns; + std::vector &actual_dof_indices = scratch_data->columns; actual_dof_indices.resize(n_local_dofs); make_sorted_row_list (local_dof_indices, actual_dof_indices); const size_type n_actual_dofs = actual_dof_indices.size(); @@ -2815,8 +2815,8 @@ add_entries_local_to_global (const std::vector &local_dof_indices, else sparsity_pattern.add (local_dof_indices[i], local_dof_indices[i]); } - - return; + + return; } @@ -2830,7 +2830,7 @@ add_entries_local_to_global (const std::vector &local_dof_indices, // create arrays for the column indices that will then be written into the // sparsity pattern. - std::vector & cols = scratch_data->columns; + std::vector &cols = scratch_data->columns; cols.resize(n_actual_dofs); for (size_type i=0; i &local_dof_indices, if (dof_mask_is_active == false) { - std::vector & actual_dof_indices = scratch_data->columns; + std::vector &actual_dof_indices = scratch_data->columns; actual_dof_indices.resize(n_local_dofs); make_sorted_row_list (local_dof_indices, actual_dof_indices); const size_type n_actual_dofs = actual_dof_indices.size(); @@ -3000,7 +3000,7 @@ add_entries_local_to_global (const std::vector &local_dof_indices, const size_type n_actual_dofs = global_rows.size(); // additional construct that also takes care of block indices. - std::vector & block_starts = scratch_data->block_starts; + std::vector &block_starts = scratch_data->block_starts; block_starts.resize(num_blocks+1); internals::make_block_starts(sparsity_pattern, global_rows, block_starts); diff --git a/deal.II/include/deal.II/lac/lapack_templates.h b/deal.II/include/deal.II/lac/lapack_templates.h index ddebfbdf03..676fa71406 100644 --- a/deal.II/include/deal.II/lac/lapack_templates.h +++ b/deal.II/include/deal.II/lac/lapack_templates.h @@ -720,7 +720,7 @@ syev (const char *, const char *, const int *, number1 *, const int *, number2 * inline void syev (const char *jobz, const char *uplo, const int *n, double *A, const int *lda, double *w, double *work, const int *lwork, int *info) { - dsyev_ (char*jobz,char*uplo,int*n,double*A,int*lda,double*w,double*work,int*lwork,int*info); + dsyev_ (char *jobz,char *uplo,int *n,double*A,int *lda,double*w,double*work,int *lwork,int *info); } #else inline void @@ -735,7 +735,7 @@ syev (const char *, const char *, const int *, double *, const int *, double *, inline void syev (const char *jobz, const char *uplo, const int *n, float *A, const int *lda, float *w, float *work, const int *lwork, int *info) { - ssyev_ (char*jobz,char*uplo,int*n,double*A,int*lda,double*w,double*work,int*lwork,int*info); + ssyev_ (char *jobz,char *uplo,int *n,double*A,int *lda,double*w,double*work,int *lwork,int *info); } #else inline void diff --git a/deal.II/include/deal.II/lac/matrix_out.h b/deal.II/include/deal.II/lac/matrix_out.h index 2f30fdc684..dbb94464f7 100644 --- a/deal.II/include/deal.II/lac/matrix_out.h +++ b/deal.II/include/deal.II/lac/matrix_out.h @@ -373,10 +373,10 @@ MatrixOut::get_gridpoint_value (const Matrix &matrix, size_type n_elements = 0; for (size_type row=i*options.block_size; row < std::min(size_type(matrix.m()), - size_type((i+1)*options.block_size)); ++row) + size_type((i+1)*options.block_size)); ++row) for (size_type col=j*options.block_size; col < std::min(size_type(matrix.m()), - size_type((j+1)*options.block_size)); ++col, ++n_elements) + size_type((j+1)*options.block_size)); ++col, ++n_elements) if (options.show_absolute_values == true) average += std::fabs(get_element (matrix, row, col)); else @@ -394,12 +394,12 @@ MatrixOut::build_patches (const Matrix &matrix, const Options options) { size_type - gridpoints_x = (matrix.n() / options.block_size - + - (matrix.n() % options.block_size != 0 ? 1 : 0)), - gridpoints_y = (matrix.m() / options.block_size - + - (matrix.m() % options.block_size != 0 ? 1 : 0)); + gridpoints_x = (matrix.n() / options.block_size + + + (matrix.n() % options.block_size != 0 ? 1 : 0)), + gridpoints_y = (matrix.m() / options.block_size + + + (matrix.m() % options.block_size != 0 ? 1 : 0)); // If continuous, the number of // plotted patches is matrix size-1 diff --git a/deal.II/include/deal.II/lac/parallel_block_vector.h b/deal.II/include/deal.II/lac/parallel_block_vector.h index 7e3f1bb190..7ffd04094b 100644 --- a/deal.II/include/deal.II/lac/parallel_block_vector.h +++ b/deal.II/include/deal.II/lac/parallel_block_vector.h @@ -423,8 +423,8 @@ namespace parallel template inline BlockVector::BlockVector (const std::vector &local_ranges, - const std::vector &ghost_indices, - const MPI_Comm communicator) + const std::vector &ghost_indices, + const MPI_Comm communicator) { std::vector sizes(local_ranges.size()); for (unsigned int i=0; i inline BlockVector::BlockVector (const std::vector &local_ranges, - const MPI_Comm communicator) + const MPI_Comm communicator) { std::vector sizes(local_ranges.size()); for (unsigned int i=0; in_blocks() == 0 || this->n_blocks() == v.n_blocks(), - ExcDimensionMismatch(this->n_blocks(), v.n_blocks())); + ExcDimensionMismatch(this->n_blocks(), v.n_blocks())); if (this->n_blocks() != v.n_blocks()) reinit(v.n_blocks(), true); diff --git a/deal.II/include/deal.II/lac/parallel_vector.h b/deal.II/include/deal.II/lac/parallel_vector.h index fbc865798f..db837d4983 100644 --- a/deal.II/include/deal.II/lac/parallel_vector.h +++ b/deal.II/include/deal.II/lac/parallel_vector.h @@ -1750,7 +1750,8 @@ namespace parallel while (indices_begin != indices_end) { *values_begin = operator()(*indices_begin); - indices_begin++; values_begin++; + indices_begin++; + values_begin++; } } diff --git a/deal.II/include/deal.II/lac/petsc_matrix_base.h b/deal.II/include/deal.II/lac/petsc_matrix_base.h index 8d0ed3179e..870647f24c 100644 --- a/deal.II/include/deal.II/lac/petsc_matrix_base.h +++ b/deal.II/include/deal.II/lac/petsc_matrix_base.h @@ -84,10 +84,10 @@ namespace PETScWrappers const size_type row, const size_type index); - /** - * Copy constructor. - */ - Accessor (const Accessor &a); + /** + * Copy constructor. + */ + Accessor (const Accessor &a); /** * Row number of the element diff --git a/deal.II/include/deal.II/lac/petsc_parallel_block_vector.h b/deal.II/include/deal.II/lac/petsc_parallel_block_vector.h index f55e61d5cc..1928d507df 100644 --- a/deal.II/include/deal.II/lac/petsc_parallel_block_vector.h +++ b/deal.II/include/deal.II/lac/petsc_parallel_block_vector.h @@ -448,7 +448,7 @@ namespace PETScWrappers // we only allow assignment to vectors with the same number of blocks // or to an empty BlockVector Assert (n_blocks() == 0 || n_blocks() == v.n_blocks(), - ExcDimensionMismatch(n_blocks(), v.n_blocks())); + ExcDimensionMismatch(n_blocks(), v.n_blocks())); if (this->n_blocks() != v.n_blocks()) reinit(v.n_blocks()); diff --git a/deal.II/include/deal.II/lac/petsc_vector_base.h b/deal.II/include/deal.II/lac/petsc_vector_base.h index 709e1e6185..6de405f3b5 100644 --- a/deal.II/include/deal.II/lac/petsc_vector_base.h +++ b/deal.II/include/deal.II/lac/petsc_vector_base.h @@ -1264,97 +1264,99 @@ namespace PETScWrappers // if we are dealing // with a parallel vector if (ghosted ) - { - - int ierr; - - // there is the possibility - // that the vector has - // ghost elements. in that - // case, we first need to - // figure out which - // elements we own locally, - // then get a pointer to - // the elements that are - // stored here (both the - // ones we own as well as - // the ghost elements). in - // this array, the locally - // owned elements come - // first followed by the - // ghost elements whose - // position we can get from - // an index set - PetscInt begin, end, i; - ierr = VecGetOwnershipRange (vector, &begin, &end); - AssertThrow (ierr == 0, ExcPETScError(ierr)); + { + + int ierr; + + // there is the possibility + // that the vector has + // ghost elements. in that + // case, we first need to + // figure out which + // elements we own locally, + // then get a pointer to + // the elements that are + // stored here (both the + // ones we own as well as + // the ghost elements). in + // this array, the locally + // owned elements come + // first followed by the + // ghost elements whose + // position we can get from + // an index set + PetscInt begin, end, i; + ierr = VecGetOwnershipRange (vector, &begin, &end); + AssertThrow (ierr == 0, ExcPETScError(ierr)); + + Vec locally_stored_elements = PETSC_NULL; + ierr = VecGhostGetLocalForm(vector, &locally_stored_elements); + AssertThrow (ierr == 0, ExcPETScError(ierr)); + + PetscInt lsize; + ierr = VecGetSize(locally_stored_elements, &lsize); + AssertThrow (ierr == 0, ExcPETScError(ierr)); + + PetscScalar *ptr; + ierr = VecGetArray(locally_stored_elements, &ptr); + AssertThrow (ierr == 0, ExcPETScError(ierr)); + + for (i = 0; i < n_idx; i++) + { + const unsigned int index = *(indices_begin+i); + if ( index>=static_cast(begin) + && index(end) ) + { + //local entry + *(values_begin+i) = *(ptr+index-begin); + } + else + { + //ghost entry + const unsigned int ghostidx + = ghost_indices.index_within_set(index); + + Assert(ghostidx+end-begin<(unsigned int)lsize, ExcInternalError()); + *(values_begin+i) = *(ptr+ghostidx+end-begin); + } + } + + ierr = VecRestoreArray(locally_stored_elements, &ptr); + AssertThrow (ierr == 0, ExcPETScError(ierr)); + + ierr = VecGhostRestoreLocalForm(vector, &locally_stored_elements); + AssertThrow (ierr == 0, ExcPETScError(ierr)); - Vec locally_stored_elements = PETSC_NULL; - ierr = VecGhostGetLocalForm(vector, &locally_stored_elements); - AssertThrow (ierr == 0, ExcPETScError(ierr)); - - PetscInt lsize; - ierr = VecGetSize(locally_stored_elements, &lsize); - AssertThrow (ierr == 0, ExcPETScError(ierr)); - - PetscScalar *ptr; - ierr = VecGetArray(locally_stored_elements, &ptr); - AssertThrow (ierr == 0, ExcPETScError(ierr)); - - for (i = 0; i < n_idx; i++) { - const unsigned int index = *(indices_begin+i); - if ( index>=static_cast(begin) - && index(end) ) - { - //local entry - *(values_begin+i) = *(ptr+index-begin); - } - else - { - //ghost entry - const unsigned int ghostidx - = ghost_indices.index_within_set(index); - - Assert(ghostidx+end-begin<(unsigned int)lsize, ExcInternalError()); - *(values_begin+i) = *(ptr+ghostidx+end-begin); - } } - - ierr = VecRestoreArray(locally_stored_elements, &ptr); - AssertThrow (ierr == 0, ExcPETScError(ierr)); - - ierr = VecGhostRestoreLocalForm(vector, &locally_stored_elements); - AssertThrow (ierr == 0, ExcPETScError(ierr)); - - } // if the vector is local or the // caller, then simply access the // element we are interested in else - { - int ierr; + { + int ierr; - PetscInt begin, end; - ierr = VecGetOwnershipRange (vector, &begin, &end); - AssertThrow (ierr == 0, ExcPETScError(ierr)); + PetscInt begin, end; + ierr = VecGetOwnershipRange (vector, &begin, &end); + AssertThrow (ierr == 0, ExcPETScError(ierr)); - PetscScalar *ptr; - ierr = VecGetArray(vector, &ptr); - AssertThrow (ierr == 0, ExcPETScError(ierr)); + PetscScalar *ptr; + ierr = VecGetArray(vector, &ptr); + AssertThrow (ierr == 0, ExcPETScError(ierr)); - for (PetscInt i = 0; i < n_idx; i++) { - const unsigned int index = *(indices_begin+i); + for (PetscInt i = 0; i < n_idx; i++) + { + const unsigned int index = *(indices_begin+i); - Assert(index>=static_cast(begin) - && index(end), ExcInternalError()); + Assert(index>=static_cast(begin) + && index(end), ExcInternalError()); - *(values_begin+i) = *(ptr+index-begin); - } + *(values_begin+i) = *(ptr+index-begin); + } - ierr = VecRestoreArray(vector, &ptr); - AssertThrow (ierr == 0, ExcPETScError(ierr)); + ierr = VecRestoreArray(vector, &ptr); + AssertThrow (ierr == 0, ExcPETScError(ierr)); - } + } } #endif // DOXYGEN diff --git a/deal.II/include/deal.II/lac/precondition_selector.h b/deal.II/include/deal.II/lac/precondition_selector.h index 21fe9100bc..5ff4284df7 100644 --- a/deal.II/include/deal.II/lac/precondition_selector.h +++ b/deal.II/include/deal.II/lac/precondition_selector.h @@ -94,7 +94,7 @@ template class SparseMatrix; * @author Ralf Hartmann, 1999 */ template , - class VECTOR = dealii::Vector > + class VECTOR = dealii::Vector > class PreconditionSelector : public Subscriptor { public: diff --git a/deal.II/include/deal.II/lac/slepc_solver.h b/deal.II/include/deal.II/lac/slepc_solver.h index eefb46b6a9..ad8f01b418 100644 --- a/deal.II/include/deal.II/lac/slepc_solver.h +++ b/deal.II/include/deal.II/lac/slepc_solver.h @@ -300,7 +300,7 @@ namespace SLEPcWrappers */ void solve (const unsigned int n_eigenpairs, - unsigned int *n_converged); + unsigned int *n_converged); /** * Access the real parts of solutions for a solved eigenvector diff --git a/deal.II/include/deal.II/lac/sparse_direct.h b/deal.II/include/deal.II/lac/sparse_direct.h index c9df62991f..4075ba85dd 100644 --- a/deal.II/include/deal.II/lac/sparse_direct.h +++ b/deal.II/include/deal.II/lac/sparse_direct.h @@ -93,7 +93,7 @@ public: * preconditioners. */ class AdditionalData -{}; + {}; /** diff --git a/deal.II/include/deal.II/lac/sparse_matrix.h b/deal.II/include/deal.II/lac/sparse_matrix.h index 6f9519ae27..4efc719c17 100644 --- a/deal.II/include/deal.II/lac/sparse_matrix.h +++ b/deal.II/include/deal.II/lac/sparse_matrix.h @@ -1497,8 +1497,8 @@ public: */ template void print (STREAM &out, - const bool across = false, - const bool diagonal_first = true) const; + const bool across = false, + const bool diagonal_first = true) const; /** * Print the matrix in the usual format, i.e. as a matrix and not as a list @@ -2477,8 +2477,8 @@ template template inline void SparseMatrix::print (STREAM &out, - const bool across, - const bool diagonal_first) const + const bool across, + const bool diagonal_first) const { Assert (cols != 0, ExcNotInitialized()); Assert (val != 0, ExcNotInitialized()); diff --git a/deal.II/include/deal.II/lac/sparse_matrix.templates.h b/deal.II/include/deal.II/lac/sparse_matrix.templates.h index e007579833..01caf34c11 100644 --- a/deal.II/include/deal.II/lac/sparse_matrix.templates.h +++ b/deal.II/include/deal.II/lac/sparse_matrix.templates.h @@ -437,8 +437,8 @@ namespace internal * task scheduler. */ template + typename InVector, + typename OutVector> void vmult_on_subrange (const size_type begin_row, const size_type end_row, const number *values, @@ -823,7 +823,7 @@ namespace internal * scheduler. */ template + typename InVector> number matrix_norm_sqr_on_subrange (const size_type begin_row, const size_type end_row, const number *values, @@ -886,7 +886,7 @@ namespace internal * scheduler. */ template + typename InVector> number matrix_scalar_product_on_subrange (const size_type begin_row, const size_type end_row, const number *values, @@ -1269,8 +1269,8 @@ namespace internal * scheduler. */ template + typename InVector, + typename OutVector> number residual_sqr_on_subrange (const size_type begin_row, const size_type end_row, const number *values, diff --git a/deal.II/include/deal.II/lac/sparsity_tools.h b/deal.II/include/deal.II/lac/sparsity_tools.h index 860eedfae7..89b4a2b21c 100644 --- a/deal.II/include/deal.II/lac/sparsity_tools.h +++ b/deal.II/include/deal.II/lac/sparsity_tools.h @@ -256,7 +256,7 @@ namespace SparsityTools /** * similar to the function above, but includes support for * BlockCompressedSimpleSparsityPattern. - * @p owned_set_per_cpu is typically DoFHandler::locally_owned_dofs_per_processor + * @p owned_set_per_cpu is typically DoFHandler::locally_owned_dofs_per_processor * and @p myrange are locally_relevant_dofs. */ template diff --git a/deal.II/include/deal.II/lac/trilinos_parallel_block_vector.h b/deal.II/include/deal.II/lac/trilinos_parallel_block_vector.h index d684216bdc..7ec7a0e217 100644 --- a/deal.II/include/deal.II/lac/trilinos_parallel_block_vector.h +++ b/deal.II/include/deal.II/lac/trilinos_parallel_block_vector.h @@ -133,8 +133,8 @@ namespace TrilinosWrappers * be ignored. */ BlockVector (const std::vector ¶llel_partitioning, - const std::vector &ghost_values, - const MPI_Comm &communicator); + const std::vector &ghost_values, + const MPI_Comm &communicator); /** @@ -448,8 +448,8 @@ namespace TrilinosWrappers inline BlockVector::BlockVector (const std::vector ¶llel_partitioning, - const std::vector &ghost_values, - const MPI_Comm &communicator) + const std::vector &ghost_values, + const MPI_Comm &communicator) { reinit(parallel_partitioning, ghost_values, communicator); } diff --git a/deal.II/include/deal.II/lac/trilinos_precondition.h b/deal.II/include/deal.II/lac/trilinos_precondition.h index 3936118d50..0f295a99e1 100644 --- a/deal.II/include/deal.II/lac/trilinos_precondition.h +++ b/deal.II/include/deal.II/lac/trilinos_precondition.h @@ -128,7 +128,7 @@ namespace TrilinosWrappers * Apply the transpose preconditioner. */ virtual void Tvmult (VectorBase &dst, - const VectorBase &src) const; + const VectorBase &src) const; /** * Apply the preconditioner on @@ -1532,15 +1532,15 @@ namespace TrilinosWrappers const VectorBase &src) const; /** - * Apply the preconditioner on deal.II data structures - * instead of the ones provided in the Trilinos wrapper class, + * Apply the preconditioner on deal.II data structures + * instead of the ones provided in the Trilinos wrapper class, * i.e., dst = src. */ void vmult (dealii::Vector &dst, const dealii::Vector &src) const; /** - * Apply the transpose preconditioner on deal.II data structures + * Apply the transpose preconditioner on deal.II data structures * instead of the ones provided in the Trilinos wrapper class, * i.e. dst = src. */ @@ -1548,7 +1548,7 @@ namespace TrilinosWrappers const dealii::Vector &src) const; /** - * Apply the preconditioner on deal.II parallel data structures + * Apply the preconditioner on deal.II parallel data structures * instead of the ones provided in the Trilinos wrapper class, * i.e., dst = src. */ @@ -1556,7 +1556,7 @@ namespace TrilinosWrappers const dealii::parallel::distributed::Vector &src) const; /** - * Apply the transpose preconditioner on deal.II parallel data structures + * Apply the transpose preconditioner on deal.II parallel data structures * instead of the ones provided in the Trilinos wrapper class, * i.e., dst = src. */ diff --git a/deal.II/include/deal.II/lac/trilinos_vector_base.h b/deal.II/include/deal.II/lac/trilinos_vector_base.h index d5e2217ad9..848a8ad556 100644 --- a/deal.II/include/deal.II/lac/trilinos_vector_base.h +++ b/deal.II/include/deal.II/lac/trilinos_vector_base.h @@ -1361,10 +1361,12 @@ namespace TrilinosWrappers const ForwardIterator indices_end, OutputIterator values_begin) const { - while (indices_begin != indices_end) { - *values_begin = operator()(*indices_begin); - indices_begin++; values_begin++; - } + while (indices_begin != indices_end) + { + *values_begin = operator()(*indices_begin); + indices_begin++; + values_begin++; + } } @@ -2215,7 +2217,7 @@ namespace TrilinosWrappers } - + #endif // DOXYGEN } diff --git a/deal.II/include/deal.II/lac/vector.h b/deal.II/include/deal.II/lac/vector.h index fb67e97c1c..8dae825247 100644 --- a/deal.II/include/deal.II/lac/vector.h +++ b/deal.II/include/deal.II/lac/vector.h @@ -1366,10 +1366,12 @@ void Vector::extract_subvector_to (ForwardIterator indices_begi const ForwardIterator indices_end, OutputIterator values_begin) const { - while (indices_begin != indices_end) { - *values_begin = operator()(*indices_begin); - indices_begin++; values_begin++; - } + while (indices_begin != indices_end) + { + *values_begin = operator()(*indices_begin); + indices_begin++; + values_begin++; + } } diff --git a/deal.II/include/deal.II/lac/vector.templates.h b/deal.II/include/deal.II/lac/vector.templates.h index 2d729e578e..91529fd539 100644 --- a/deal.II/include/deal.II/lac/vector.templates.h +++ b/deal.II/include/deal.II/lac/vector.templates.h @@ -580,7 +580,7 @@ namespace internal // The code returns the result as the last argument in order to make // spawning tasks simpler and use automatic template deduction. template + typename ResultType, typename size_type> void accumulate (const Operation &op, const Number *X, const Number2 *Y, @@ -635,18 +635,18 @@ namespace internal r2 = op(X, Y, power); for (size_type j=1; j<8; ++j) r2 += op(X, Y, power); - // no break + // no break case 2: r1 = op(X, Y, power); for (size_type j=1; j<8; ++j) r1 += op(X, Y, power); r1 += r2; - // no break + // no break case 1: r2 = op(X, Y, power); for (size_type j=1; j<8; ++j) r2 += op(X, Y, power); - // no break + // no break default: for (size_type j=0; jlocal_range().second- vector_partitioner->local_range().first) - + vector_partitioner->ghost_indices().n_elements(); + + vector_partitioner->ghost_indices().n_elements(); for (std::size_t i=0; i 0) { @@ -1970,7 +1970,7 @@ not_connect: { out << "Entries row " << row << ": "; const unsigned int *glob_indices = begin_indices(row), - *end_row = end_indices(row); + *end_row = end_indices(row); unsigned int index = 0; const std::pair *con_it = begin_indicators(row), diff --git a/deal.II/include/deal.II/matrix_free/fe_evaluation.h b/deal.II/include/deal.II/matrix_free/fe_evaluation.h index 6e75bc5331..425175f5af 100644 --- a/deal.II/include/deal.II/matrix_free/fe_evaluation.h +++ b/deal.II/include/deal.II/matrix_free/fe_evaluation.h @@ -83,7 +83,7 @@ namespace internal * @author Katharina Kormann and Martin Kronbichler, 2010, 2011 */ template + int n_components_, typename Number> class FEEvaluationBase { public: @@ -745,7 +745,7 @@ protected: * @author Katharina Kormann and Martin Kronbichler, 2010, 2011 */ template + int n_components_, typename Number> class FEEvaluationAccess : public FEEvaluationBase { @@ -1070,7 +1070,7 @@ protected: * @author Katharina Kormann and Martin Kronbichler, 2010, 2011 */ template + int n_components_ = 1, typename Number = double > class FEEvaluationGeneral : public FEEvaluationAccess::value, @@ -1219,7 +1219,7 @@ protected: * @author Katharina Kormann and Martin Kronbichler, 2010, 2011 */ template + int n_components_ = 1, typename Number = double > class FEEvaluation : public FEEvaluationGeneral { @@ -1427,7 +1427,7 @@ protected: /*----------------------- FEEvaluationBase ----------------------------------*/ template + int n_components_, typename Number> inline FEEvaluationBase ::FEEvaluationBase (const MatrixFree &data_in, @@ -1478,7 +1478,7 @@ FEEvaluationBase template + int n_components_, typename Number> inline void FEEvaluationBase @@ -1553,7 +1553,7 @@ FEEvaluationBase template + int n_components_, typename Number> inline unsigned int FEEvaluationBase @@ -1566,7 +1566,7 @@ FEEvaluationBase template + int n_components_, typename Number> inline internal::MatrixFreeFunctions::CellType FEEvaluationBase @@ -1664,7 +1664,7 @@ namespace internal VectorType &vec, Number &res) const { - res = vector_access (const_cast(vec), index); + res = vector_access (const_cast(vec), index); } void pre_constraints (const Number &, @@ -1679,7 +1679,7 @@ namespace internal VectorType &vec, Number &res) const { - res += weight * vector_access (const_cast(vec), index); + res += weight * vector_access (const_cast(vec), index); } void post_constraints (const Number &sum, @@ -1803,7 +1803,7 @@ namespace internal template + int n_components_, typename Number> template inline void @@ -2124,7 +2124,7 @@ FEEvaluationBase template + int n_components_, typename Number> template inline void @@ -2149,7 +2149,7 @@ FEEvaluationBase template + int n_components_, typename Number> template inline void @@ -2178,7 +2178,7 @@ FEEvaluationBase template + int n_components_, typename Number> template inline void @@ -2207,7 +2207,7 @@ FEEvaluationBase template + int n_components_, typename Number> template inline void @@ -2227,7 +2227,7 @@ FEEvaluationBase template + int n_components_, typename Number> template inline void @@ -2249,7 +2249,7 @@ FEEvaluationBase template + int n_components_, typename Number> template inline void @@ -2271,7 +2271,7 @@ FEEvaluationBase template + int n_components_, typename Number> template inline void @@ -2295,7 +2295,7 @@ FEEvaluationBase template + int n_components_, typename Number> template inline void @@ -2322,7 +2322,7 @@ FEEvaluationBase template + int n_components_, typename Number> template inline void @@ -2349,7 +2349,7 @@ FEEvaluationBase template + int n_components_, typename Number> template inline void @@ -2373,7 +2373,7 @@ FEEvaluationBase template + int n_components_, typename Number> template inline void @@ -2401,7 +2401,7 @@ FEEvaluationBase template + int n_components_, typename Number> template inline void @@ -2429,7 +2429,7 @@ FEEvaluationBase template + int n_components_, typename Number> template inline void @@ -2549,7 +2549,7 @@ FEEvaluationBase template + int n_components, typename Number> inline const VectorizedArray * FEEvaluationBase:: @@ -2561,7 +2561,7 @@ begin_dof_values () const template + int n_components, typename Number> inline VectorizedArray * FEEvaluationBase:: @@ -2576,7 +2576,7 @@ begin_dof_values () template + int n_components, typename Number> inline const VectorizedArray * FEEvaluationBase:: @@ -2590,7 +2590,7 @@ begin_values () const template + int n_components, typename Number> inline VectorizedArray * FEEvaluationBase:: @@ -2605,7 +2605,7 @@ begin_values () template + int n_components, typename Number> inline const VectorizedArray * FEEvaluationBase:: @@ -2619,7 +2619,7 @@ begin_gradients () const template + int n_components, typename Number> inline VectorizedArray * FEEvaluationBase:: @@ -2634,7 +2634,7 @@ begin_gradients () template + int n_components, typename Number> inline const VectorizedArray * FEEvaluationBase:: @@ -2647,7 +2647,7 @@ begin_hessians () const template + int n_components, typename Number> inline VectorizedArray * FEEvaluationBase:: @@ -2659,7 +2659,7 @@ begin_hessians () template + int n_components_, typename Number> inline Tensor<1,n_components_,VectorizedArray > FEEvaluationBase @@ -2675,7 +2675,7 @@ FEEvaluationBase template + int n_components_, typename Number> inline Tensor<1,n_components_,VectorizedArray > FEEvaluationBase @@ -2693,7 +2693,7 @@ FEEvaluationBase template + int n_components_, typename Number> inline Tensor<1,n_components_,Tensor<1,dim,VectorizedArray > > FEEvaluationBase @@ -2782,7 +2782,7 @@ namespace internal template + int n_components_, typename Number> inline Tensor<1,n_components_,Tensor<2,dim,VectorizedArray > > FEEvaluationBase @@ -2908,7 +2908,7 @@ FEEvaluationBase template + int n_components_, typename Number> inline Tensor<1,n_components_,Tensor<1,dim,VectorizedArray > > FEEvaluationBase @@ -2987,7 +2987,7 @@ FEEvaluationBase template + int n_components_, typename Number> inline Tensor<1,n_components_,VectorizedArray > FEEvaluationBase @@ -3011,7 +3011,7 @@ FEEvaluationBase template + int n_components_, typename Number> inline void FEEvaluationBase @@ -3029,7 +3029,7 @@ FEEvaluationBase template + int n_components_, typename Number> inline void FEEvaluationBase @@ -3058,7 +3058,7 @@ FEEvaluationBase template + int n_components_, typename Number> inline void FEEvaluationBase @@ -3101,7 +3101,7 @@ FEEvaluationBase template + int n_components_, typename Number> inline Tensor<1,n_components_,VectorizedArray > FEEvaluationBase @@ -3127,7 +3127,7 @@ FEEvaluationBase template + int n_components_, typename Number> inline FEEvaluationAccess ::FEEvaluationAccess (const MatrixFree &data_in, @@ -3537,7 +3537,7 @@ FEEvaluationAccess } template + typename Number> inline void FEEvaluationAccess @@ -3685,7 +3685,7 @@ FEEvaluationAccess /*----------------------- FEEvaluationGeneral -------------------------------*/ template + typename Number> inline FEEvaluationGeneral ::FEEvaluationGeneral (const MatrixFree &data_in, @@ -3735,7 +3735,7 @@ FEEvaluationGeneral { proposed_quad_comp = no; break; - } + } if (proposed_dof_comp != numbers::invalid_unsigned_int && proposed_quad_comp != numbers::invalid_unsigned_int) { @@ -3805,7 +3805,7 @@ namespace internal // like the functions below and corresponds to a usual matrix-matrix // product template + int direction, bool dof_to_quad, bool add> inline void apply_tensor_product (const Number *shape_data, @@ -3880,7 +3880,7 @@ namespace internal // fe_degree+1 degrees of freedom per direction and not n_q_points_1d for // those directions lower than the one currently applied template + bool dof_to_quad, bool add> inline void apply_tensor_product_face (const Number *shape_data, @@ -3969,7 +3969,7 @@ namespace internal // ones and in addition use the symmetry in entries to reduce the number of // read operations. template + int direction, bool dof_to_quad, bool add> inline void apply_tensor_product_values (const Number *shape_values, @@ -4172,7 +4172,7 @@ namespace internal // zeros and ones and in addition use the symmetry in entries to // reduce the number of read operations. template + int direction, bool dof_to_quad, bool add> inline void apply_tensor_product_gradients (const Number *shape_gradients, @@ -4316,7 +4316,7 @@ namespace internal // form assuming the symmetries of unit cell shape hessians for // finite elements in FEEvaluation template + int direction, bool dof_to_quad, bool add> inline void apply_tensor_product_hessians (const Number *shape_hessians, @@ -4688,7 +4688,7 @@ namespace internal // [ 2.82 -1.528 2.673 0 -13.51 ] // [-1 0.518 -0.75 2.482 10 ] template + int direction, bool dof_to_quad, bool add> inline void apply_tensor_product_gradients_gl (const Number *shape_gradients, @@ -5185,7 +5185,7 @@ namespace internal template + typename Number> inline void FEEvaluationGeneral @@ -5199,7 +5199,7 @@ FEEvaluationGeneral template + typename Number> inline void FEEvaluationGeneral @@ -5212,7 +5212,7 @@ FEEvaluationGeneral template + typename Number> inline Point > FEEvaluationGeneral @@ -5254,7 +5254,7 @@ FEEvaluationGeneral template + typename Number> template inline void @@ -5270,7 +5270,7 @@ FEEvaluationGeneral template + typename Number> template inline void @@ -5286,7 +5286,7 @@ FEEvaluationGeneral template + typename Number> template inline void @@ -5304,7 +5304,7 @@ FEEvaluationGeneral template + typename Number> inline FEEvaluation ::FEEvaluation (const MatrixFree &data_in, @@ -5408,7 +5408,7 @@ FEEvaluation template + typename Number> inline void FEEvaluation @@ -5422,7 +5422,7 @@ FEEvaluation template + typename Number> inline void FEEvaluation @@ -5434,7 +5434,7 @@ FEEvaluation template + typename Number> template inline void @@ -5447,18 +5447,18 @@ FEEvaluation // for all other orders, we choose even-odd if (fe_degree > 1 || n_q_points_1d > 3) internal::apply_tensor_product_evenodd, direction, dof_to_quad, add, 0> - (shape_val_evenodd, in, out); + VectorizedArray, direction, dof_to_quad, add, 0> + (shape_val_evenodd, in, out); else internal::apply_tensor_product_values, direction, dof_to_quad, add> - (this->data.shape_values.begin(), in, out); + VectorizedArray, direction, dof_to_quad, add> + (this->data.shape_values.begin(), in, out); } template + typename Number> template inline void @@ -5468,12 +5468,12 @@ FEEvaluation { if (fe_degree > 1 || n_q_points_1d > 3) internal::apply_tensor_product_evenodd, direction, dof_to_quad, add, 1> - (shape_gra_evenodd, in, out); + VectorizedArray, direction, dof_to_quad, add, 1> + (shape_gra_evenodd, in, out); else internal::apply_tensor_product_gradients, direction, dof_to_quad, add> - (this->data.shape_gradients.begin(), in, out); + VectorizedArray, direction, dof_to_quad, add> + (this->data.shape_gradients.begin(), in, out); } @@ -5482,7 +5482,7 @@ FEEvaluation // the same symmetry relations hold. However, it is not possible to omit some // values that are zero for the values template + typename Number> template inline void @@ -5492,12 +5492,12 @@ FEEvaluation { if (fe_degree > 1 || n_q_points_1d > 3) internal::apply_tensor_product_evenodd, direction, dof_to_quad, add, 2> - (shape_hes_evenodd, in, out); + VectorizedArray, direction, dof_to_quad, add, 2> + (shape_hes_evenodd, in, out); else internal::apply_tensor_product_hessians, direction, dof_to_quad, add> - (this->data.shape_hessians.begin(), in, out); + VectorizedArray, direction, dof_to_quad, add> + (this->data.shape_hessians.begin(), in, out); } diff --git a/deal.II/include/deal.II/matrix_free/matrix_free.templates.h b/deal.II/include/deal.II/matrix_free/matrix_free.templates.h index 193df65ef7..359deb1d8f 100644 --- a/deal.II/include/deal.II/matrix_free/matrix_free.templates.h +++ b/deal.II/include/deal.II/matrix_free/matrix_free.templates.h @@ -595,7 +595,7 @@ void MatrixFree::initialize_indices for (types::global_dof_index i=start_index; iis_constrained(i)==true) dof_info[no].constrained_dofs. - push_back(static_cast(i-start_index)); + push_back(static_cast(i-start_index)); } } diff --git a/deal.II/include/deal.II/meshworker/loop.h b/deal.II/include/deal.II/meshworker/loop.h index 73ed8f5bd7..ecbf0c53d5 100644 --- a/deal.II/include/deal.II/meshworker/loop.h +++ b/deal.II/include/deal.II/meshworker/loop.h @@ -114,7 +114,7 @@ namespace MeshWorker const std_cxx1x::function &boundary_worker, const std_cxx1x::function& face_worker, + typename INFOBOX::CellInfo &)> &face_worker, const bool cells_first, const bool unique_faces_only) { @@ -260,7 +260,7 @@ namespace MeshWorker const std_cxx1x::function &boundary_worker, const std_cxx1x::function& face_worker, + typename INFOBOX::CellInfo &)> &face_worker, ASSEMBLER &assembler, bool cells_first = true, bool unique_faces_only = true) diff --git a/deal.II/include/deal.II/meshworker/simple.h b/deal.II/include/deal.II/meshworker/simple.h index e43257df15..9f279b3c8b 100644 --- a/deal.II/include/deal.II/meshworker/simple.h +++ b/deal.II/include/deal.II/meshworker/simple.h @@ -915,7 +915,7 @@ namespace MeshWorker for (unsigned int j=0; j= threshold) - if (!mg_constrained_dofs->at_refinement_edge(level, i2[k])) + if (!mg_constrained_dofs->at_refinement_edge(level, i2[k])) G.add(i1[j], i2[k], M(k,j)); } } @@ -961,40 +961,40 @@ namespace MeshWorker AssertDimension(M.m(), i1.size()); AssertDimension(M.n(), i2.size()); Assert(mg_constrained_dofs != 0, ExcInternalError()); - + for (unsigned int j=0; j= threshold) - // Enter values into matrix only if j corresponds to a - // degree of freedom on the refinemenent edge, k does - // not, and both are not on the boundary. This is part - // the difference between the complete matrix with no - // boundary condition at the refinement edge and and - // the matrix assembled above by assemble(). - - // Thus the logic is: enter the row if it is - // constrained by hanging node constraints (actually, - // the whole refinement edge), but not if it is - // constrained by a boundary constraint. - if (mg_constrained_dofs->at_refinement_edge(level, i1[j]) && - !mg_constrained_dofs->at_refinement_edge(level, i2[k])) - { - if (mg_constrained_dofs->set_boundary_values()) - { - if ((!mg_constrained_dofs->at_refinement_edge_boundary(level, i1[j]) && - !mg_constrained_dofs->at_refinement_edge_boundary(level, i2[k])) - || - (mg_constrained_dofs->at_refinement_edge_boundary(level, i1[j]) && - mg_constrained_dofs->at_refinement_edge_boundary(level, i2[k]) && - i1[j] == i2[k])) - G.add(i1[j], i2[k], M(j,k)); - } - else - G.add(i1[j], i2[k], M(j,k)); - } + for (unsigned int k=0; k= threshold) + // Enter values into matrix only if j corresponds to a + // degree of freedom on the refinemenent edge, k does + // not, and both are not on the boundary. This is part + // the difference between the complete matrix with no + // boundary condition at the refinement edge and and + // the matrix assembled above by assemble(). + + // Thus the logic is: enter the row if it is + // constrained by hanging node constraints (actually, + // the whole refinement edge), but not if it is + // constrained by a boundary constraint. + if (mg_constrained_dofs->at_refinement_edge(level, i1[j]) && + !mg_constrained_dofs->at_refinement_edge(level, i2[k])) + { + if (mg_constrained_dofs->set_boundary_values()) + { + if ((!mg_constrained_dofs->at_refinement_edge_boundary(level, i1[j]) && + !mg_constrained_dofs->at_refinement_edge_boundary(level, i2[k])) + || + (mg_constrained_dofs->at_refinement_edge_boundary(level, i1[j]) && + mg_constrained_dofs->at_refinement_edge_boundary(level, i2[k]) && + i1[j] == i2[k])) + G.add(i1[j], i2[k], M(j,k)); + } + else + G.add(i1[j], i2[k], M(j,k)); + } } - - + + template inline void MGMatrixSimple::assemble_out( @@ -1007,28 +1007,28 @@ namespace MeshWorker AssertDimension(M.n(), i1.size()); AssertDimension(M.m(), i2.size()); Assert(mg_constrained_dofs != 0, ExcInternalError()); - + for (unsigned int j=0; j= threshold) - if (mg_constrained_dofs->at_refinement_edge(level, i1[j]) && - !mg_constrained_dofs->at_refinement_edge(level, i2[k])) - { - if (mg_constrained_dofs->set_boundary_values()) - { - if ((!mg_constrained_dofs->at_refinement_edge_boundary(level, i1[j]) && - !mg_constrained_dofs->at_refinement_edge_boundary(level, i2[k])) - || - (mg_constrained_dofs->at_refinement_edge_boundary(level, i1[j]) && - mg_constrained_dofs->at_refinement_edge_boundary(level, i2[k]) && - i1[j] == i2[k])) - G.add(i1[j], i2[k], M(k,j)); - } - else - G.add(i1[j], i2[k], M(k,j)); - } + for (unsigned int k=0; k= threshold) + if (mg_constrained_dofs->at_refinement_edge(level, i1[j]) && + !mg_constrained_dofs->at_refinement_edge(level, i2[k])) + { + if (mg_constrained_dofs->set_boundary_values()) + { + if ((!mg_constrained_dofs->at_refinement_edge_boundary(level, i1[j]) && + !mg_constrained_dofs->at_refinement_edge_boundary(level, i2[k])) + || + (mg_constrained_dofs->at_refinement_edge_boundary(level, i1[j]) && + mg_constrained_dofs->at_refinement_edge_boundary(level, i2[k]) && + i1[j] == i2[k])) + G.add(i1[j], i2[k], M(k,j)); + } + else + G.add(i1[j], i2[k], M(k,j)); + } } - + template template @@ -1182,7 +1182,7 @@ namespace MeshWorker ResidualSimple::initialize(c); } - + template template inline void diff --git a/deal.II/include/deal.II/multigrid/sparse_matrix_collection.h b/deal.II/include/deal.II/multigrid/sparse_matrix_collection.h index 4859e1ef7f..5e128a2f39 100644 --- a/deal.II/include/deal.II/multigrid/sparse_matrix_collection.h +++ b/deal.II/include/deal.II/multigrid/sparse_matrix_collection.h @@ -30,32 +30,32 @@ DEAL_II_NAMESPACE_OPEN namespace mg { -/** - * Handler and storage for all five SparseMatrix object involved in - * using multigrid with local refinement. - * - * @author Baerbel Janssen, Guido Kanschat - * @date 2013 - */ + /** + * Handler and storage for all five SparseMatrix object involved in + * using multigrid with local refinement. + * + * @author Baerbel Janssen, Guido Kanschat + * @date 2013 + */ template class SparseMatrixCollection : public Subscriptor { - public: - void resize(const unsigned int minlevel, const unsigned int maxlevel); - - template - void reinit(const DH& dof_handler); - - void set_zero(); - - MGLevelObject sparsity; - MGLevelObject sparsity_edge; - - MGLevelObject > matrix; - MGLevelObject > matrix_down; - MGLevelObject > matrix_up; - MGLevelObject > matrix_in; - MGLevelObject > matrix_out; + public: + void resize(const unsigned int minlevel, const unsigned int maxlevel); + + template + void reinit(const DH &dof_handler); + + void set_zero(); + + MGLevelObject sparsity; + MGLevelObject sparsity_edge; + + MGLevelObject > matrix; + MGLevelObject > matrix_down; + MGLevelObject > matrix_up; + MGLevelObject > matrix_in; + MGLevelObject > matrix_out; }; @@ -81,28 +81,28 @@ namespace mg template template void - SparseMatrixCollection::reinit(const DH& dof_handler) + SparseMatrixCollection::reinit(const DH &dof_handler) { AssertIndexRange(sparsity.max_level(), dof_handler.get_tria().n_levels()); - + for (unsigned int level=sparsity.min_level(); - level<=sparsity.max_level();++level) + level<=sparsity.max_level(); ++level) { - CompressedSparsityPattern c_sparsity(dof_handler.n_dofs(level)); - MGTools::make_flux_sparsity_pattern(dof_handler, c_sparsity, level); - sparsity[level].copy_from(c_sparsity); - matrix[level].reinit(sparsity[level]); - matrix_in[level].reinit(sparsity[level]); - matrix_out[level].reinit(sparsity[level]); - if (level>0) - { - CompressedSparsityPattern ci_sparsity; - ci_sparsity.reinit(dof_handler.n_dofs(level-1), dof_handler.n_dofs(level)); - MGTools::make_flux_sparsity_pattern_edge(dof_handler, ci_sparsity, level); - sparsity_edge[level].copy_from(ci_sparsity); - matrix_up[level].reinit(sparsity_edge[level]); - matrix_down[level].reinit(sparsity_edge[level]); - } + CompressedSparsityPattern c_sparsity(dof_handler.n_dofs(level)); + MGTools::make_flux_sparsity_pattern(dof_handler, c_sparsity, level); + sparsity[level].copy_from(c_sparsity); + matrix[level].reinit(sparsity[level]); + matrix_in[level].reinit(sparsity[level]); + matrix_out[level].reinit(sparsity[level]); + if (level>0) + { + CompressedSparsityPattern ci_sparsity; + ci_sparsity.reinit(dof_handler.n_dofs(level-1), dof_handler.n_dofs(level)); + MGTools::make_flux_sparsity_pattern_edge(dof_handler, ci_sparsity, level); + sparsity_edge[level].copy_from(ci_sparsity); + matrix_up[level].reinit(sparsity_edge[level]); + matrix_down[level].reinit(sparsity_edge[level]); + } } } @@ -116,7 +116,7 @@ namespace mg matrix_up = 0.; matrix_down = 0.; } - + } DEAL_II_NAMESPACE_CLOSE diff --git a/deal.II/include/deal.II/numerics/derivative_approximation.h b/deal.II/include/deal.II/numerics/derivative_approximation.h index 97e7cfc4b7..fb7062f195 100644 --- a/deal.II/include/deal.II/numerics/derivative_approximation.h +++ b/deal.II/include/deal.II/numerics/derivative_approximation.h @@ -552,7 +552,7 @@ private: * we are to work on. */ template class DH, class InputVector, int spacedim> + template class DH, class InputVector, int spacedim> static void approximate_derivative (const Mapping &mapping, const DH &dof, @@ -566,10 +566,10 @@ private: * on the cell. */ template class DH, class InputVector, int spacedim> + template class DH, class InputVector, int spacedim> static void approximate (SynchronousIterators::active_cell_iterator>, - Vector::iterator> > const &cell, + Vector::iterator> > const &cell, const Mapping &mapping, const DH &dof, const InputVector &solution, @@ -580,7 +580,7 @@ private: * derivative tensor. */ template class DH, class InputVector, int spacedim> + template class DH, class InputVector, int spacedim> static void approximate_cell (const Mapping &mapping, const DH &dof, diff --git a/deal.II/include/deal.II/numerics/fe_field_function.h b/deal.II/include/deal.II/numerics/fe_field_function.h index b4df6928f1..af75bf5e74 100644 --- a/deal.II/include/deal.II/numerics/fe_field_function.h +++ b/deal.II/include/deal.II/numerics/fe_field_function.h @@ -168,8 +168,8 @@ namespace Functions * @author Luca Heltai, 2006, Markus Buerg, 2012, Wolfgang Bangerth, 2013 */ template , - typename VECTOR=Vector > + typename DH=DoFHandler, + typename VECTOR=Vector > class FEFieldFunction : public Function { public: diff --git a/deal.II/include/deal.II/numerics/vector_tools.h b/deal.II/include/deal.II/numerics/vector_tools.h index 28c5fa3f10..9d14cdcc10 100644 --- a/deal.II/include/deal.II/numerics/vector_tools.h +++ b/deal.II/include/deal.II/numerics/vector_tools.h @@ -539,8 +539,8 @@ namespace VectorTools * constraints object. */ template class DH, - class VECTOR> + template class DH, + class VECTOR> void interpolate_to_different_mesh (const DH &dof1, const VECTOR &u1, @@ -573,8 +573,8 @@ namespace VectorTools * at hanging nodes. */ template class DH, - class VECTOR> + template class DH, + class VECTOR> void interpolate_to_different_mesh (const DH &dof1, const VECTOR &u1, @@ -597,8 +597,8 @@ namespace VectorTools * destination DoFHandler. */ template class DH, - class VECTOR> + template class DH, + class VECTOR> void interpolate_to_different_mesh (const InterGridMap > &intergridmap, const VECTOR &u1, @@ -686,8 +686,8 @@ namespace VectorTools VECTOR &vec, const bool enforce_zero_boundary = false, const hp::QCollection &q_boundary = hp::QCollection(dim > 1 ? - QGauss(2) : - Quadrature(0)), + QGauss(2) : + Quadrature(0)), const bool project_to_boundary_first = false); /** @@ -703,8 +703,8 @@ namespace VectorTools VECTOR &vec, const bool enforce_zero_boundary = false, const hp::QCollection &q_boundary = hp::QCollection(dim > 1 ? - QGauss(2) : - Quadrature(0)), + QGauss(2) : + Quadrature(0)), const bool project_to_boundary_first = false); /** diff --git a/deal.II/include/deal.II/numerics/vector_tools.templates.h b/deal.II/include/deal.II/numerics/vector_tools.templates.h index 7e79d0011d..b4cdccc015 100644 --- a/deal.II/include/deal.II/numerics/vector_tools.templates.h +++ b/deal.II/include/deal.II/numerics/vector_tools.templates.h @@ -89,7 +89,7 @@ namespace VectorTools const bool fe_is_system = (n_components != 1); typename DH::active_cell_iterator cell = dof.begin_active(), - endc = dof.end(); + endc = dof.end(); // For FESystems many of the // unit_support_points will appear @@ -200,7 +200,7 @@ namespace VectorTools hp::MappingCollection mapping_collection (mapping); hp::FEValues fe_values (mapping_collection, - fe, support_quadrature, update_quadrature_points); + fe, support_quadrature, update_quadrature_points); for (; cell!=endc; ++cell) if (cell->is_locally_owned()) @@ -392,8 +392,8 @@ namespace VectorTools template class DH, - class Vector> + template class DH, + class Vector> void interpolate_to_different_mesh (const DH &dof1, const Vector &u1, @@ -416,8 +416,8 @@ namespace VectorTools template class DH, - class Vector> + template class DH, + class Vector> void interpolate_to_different_mesh (const DH &dof1, const Vector &u1, @@ -438,8 +438,8 @@ namespace VectorTools template class DH, - class Vector> + template class DH, + class Vector> void interpolate_to_different_mesh (const InterGridMap > &intergridmap, const Vector &u1, @@ -507,12 +507,12 @@ namespace VectorTools template class M_or_MC, template class Q_or_QC> void project_compute_b_v (const M_or_MC &mapping, - const DH &dof, - const Function &function, - const bool enforce_zero_boundary, - const Q_or_QC &q_boundary, - const bool project_to_boundary_first, - std::map &boundary_values) + const DH &dof, + const Function &function, + const bool enforce_zero_boundary, + const Q_or_QC &q_boundary, + const bool project_to_boundary_first, + std::map &boundary_values) { if (enforce_zero_boundary == true) // no need to project boundary @@ -574,14 +574,14 @@ namespace VectorTools template class M_or_MC, template class Q_or_QC> void do_project (const M_or_MC &mapping, - const DH &dof, - const ConstraintMatrix &constraints, - const Q_or_QC &quadrature, - const Function &function, - Vector &vec_result, - const bool enforce_zero_boundary, - const Q_or_QC &q_boundary, - const bool project_to_boundary_first) + const DH &dof, + const ConstraintMatrix &constraints, + const Q_or_QC &quadrature, + const Function &function, + Vector &vec_result, + const bool enforce_zero_boundary, + const Q_or_QC &q_boundary, + const bool project_to_boundary_first) { Assert (dof.get_fe().n_components() == function.n_components, ExcDimensionMismatch(dof.get_fe().n_components(), @@ -673,9 +673,9 @@ namespace VectorTools const bool project_to_boundary_first) { do_project (mapping, dof, constraints, quadrature, - function, vec_result, - enforce_zero_boundary, q_boundary, - project_to_boundary_first); + function, vec_result, + enforce_zero_boundary, q_boundary, + project_to_boundary_first); } @@ -707,9 +707,9 @@ namespace VectorTools const bool project_to_boundary_first) { do_project (mapping, dof, constraints, quadrature, - function, vec_result, - enforce_zero_boundary, q_boundary, - project_to_boundary_first); + function, vec_result, + enforce_zero_boundary, q_boundary, + project_to_boundary_first); } @@ -1484,11 +1484,11 @@ namespace VectorTools template class M_or_MC> static inline void do_interpolate_boundary_values (const M_or_MC &, - const DH &dof, - const typename FunctionMap::type &function_map, - std::map &boundary_values, - const ComponentMask &component_mask, - const dealii::internal::int2type<1>) + const DH &dof, + const typename FunctionMap::type &function_map, + std::map &boundary_values, + const ComponentMask &component_mask, + const dealii::internal::int2type<1>) { const unsigned int dim = DH::dimension; const unsigned int spacedim=DH::space_dimension; @@ -1564,11 +1564,11 @@ namespace VectorTools static inline void do_interpolate_boundary_values (const M_or_MC &mapping, - const DH &dof, - const typename FunctionMap::type &function_map, - std::map &boundary_values, - const ComponentMask &component_mask, - const dealii::internal::int2type) + const DH &dof, + const typename FunctionMap::type &function_map, + std::map &boundary_values, + const ComponentMask &component_mask, + const dealii::internal::int2type) { const unsigned int dim = DH::dimension; const unsigned int spacedim=DH::space_dimension; @@ -1747,17 +1747,17 @@ namespace VectorTools : (dim == 2 ? (i<2*fe.dofs_per_vertex ? i : i+2*fe.dofs_per_vertex) + : + (dim == 3 ? + (i<4*fe.dofs_per_vertex ? + i : - (dim == 3 ? - (i<4*fe.dofs_per_vertex ? - i - : - (i<4*fe.dofs_per_vertex+4*fe.dofs_per_line ? - i+4*fe.dofs_per_vertex - : - i+4*fe.dofs_per_vertex+8*fe.dofs_per_line)) + (i<4*fe.dofs_per_vertex+4*fe.dofs_per_line ? + i+4*fe.dofs_per_vertex : - numbers::invalid_unsigned_int))); + i+4*fe.dofs_per_vertex+8*fe.dofs_per_line)) + : + numbers::invalid_unsigned_int))); Assert (cell_i < fe.dofs_per_cell, ExcInternalError()); // make sure that if this is not a primitive @@ -1783,7 +1783,7 @@ namespace VectorTools } else // fe has only one component, so save some computations - { + { // get only the one component that this function has dof_values_scalar.resize (fe.dofs_per_face); function_map.find(boundary_component)->second @@ -1811,8 +1811,8 @@ namespace VectorTools const ComponentMask &component_mask_) { do_interpolate_boundary_values (mapping, dof, function_map, boundary_values, - component_mask_, - dealii::internal::int2type()); + component_mask_, + dealii::internal::int2type()); } @@ -1842,8 +1842,8 @@ namespace VectorTools const ComponentMask &component_mask_) { do_interpolate_boundary_values (mapping, dof, function_map, boundary_values, - component_mask_, - dealii::internal::int2type()); + component_mask_, + dealii::internal::int2type()); } @@ -1972,11 +1972,11 @@ namespace VectorTools template class Q_or_QC> void do_project_boundary_values (const M_or_MC &mapping, - const DH &dof, - const typename FunctionMap::type &boundary_functions, - const Q_or_QC &q, - std::map &boundary_values, - std::vector component_mapping) + const DH &dof, + const typename FunctionMap::type &boundary_functions, + const Q_or_QC &q, + std::map &boundary_values, + std::vector component_mapping) { // in 1d, projection onto the 0d end points == interpolation if (dim == 1) @@ -1987,11 +1987,11 @@ namespace VectorTools return; } - //TODO:[?] In project_boundary_values, no condensation of sparsity - // structures, matrices and right hand sides or distribution of - // solution vectors is performed. This is ok for dim<3 because then - // there are no constrained nodes on the boundary, but is not - // acceptable for higher dimensions. Fix this. + //TODO:[?] In project_boundary_values, no condensation of sparsity + // structures, matrices and right hand sides or distribution of + // solution vectors is performed. This is ok for dim<3 because then + // there are no constrained nodes on the boundary, but is not + // acceptable for higher dimensions. Fix this. if (component_mapping.size() == 0) { @@ -2047,8 +2047,8 @@ namespace VectorTools // but it needs to be implemented if (dim>=3) { - #ifdef DEBUG - // Assert that there are no hanging nodes at the boundary +#ifdef DEBUG + // Assert that there are no hanging nodes at the boundary int level = -1; for (typename DH::active_cell_iterator cell = dof.begin_active(); cell != dof.end(); ++cell) @@ -2064,7 +2064,7 @@ namespace VectorTools } } } - #endif +#endif } sparsity.compress(); @@ -2185,9 +2185,9 @@ namespace VectorTools std::vector component_mapping) { do_project_boundary_values (mapping, dof, - boundary_functions, - q, boundary_values, - component_mapping); + boundary_functions, + q, boundary_values, + component_mapping); } @@ -2200,9 +2200,9 @@ namespace VectorTools std::vector component_mapping) { project_boundary_values (hp::StaticMappingQ1::mapping_collection, dof, - boundary_function, - q, boundary_values, - component_mapping); + boundary_function, + q, boundary_values, + component_mapping); } @@ -2299,11 +2299,11 @@ namespace VectorTools template - std::ostream & operator << (std::ostream &out, - const VectorDoFTuple &vdt) + std::ostream &operator << (std::ostream &out, + const VectorDoFTuple &vdt) { for (unsigned int d=0; d normal_vector = (cell->face(face_no)->get_boundary() .normal_vector (cell->face(face_no), fe_values.quadrature_point(i))); - if (normal_vector * fe_values.normal_vector(i) < 0) - normal_vector *= -1; + if (normal_vector * fe_values.normal_vector(i) < 0) + normal_vector *= -1; Assert (std::fabs(normal_vector.norm() - 1) < 1e-14, ExcInternalError()); for (unsigned int d=0; dcenter() << std::endl - << " normal=" << normal_vector << std::endl; + std::cout << "Adding normal vector:" << std::endl + << " dofs=" << vector_dofs << std::endl + << " cell=" << cell << " at " << cell->center() << std::endl + << " normal=" << normal_vector << std::endl; #endif } } @@ -4320,14 +4320,14 @@ namespace VectorTools same_dof_range[1] = dof_to_normals_map.end(); #ifdef DEBUG_NO_NORMAL_FLUX - std::cout << "For dof indices <" << p->first << ">, found the following normals" - << std::endl; + std::cout << "For dof indices <" << p->first << ">, found the following normals" + << std::endl; for (typename DoFToNormalsMap::const_iterator q = same_dof_range[0]; q != same_dof_range[1]; ++q) - std::cout << " " << q->second.first - << " from cell " << q->second.second - << std::endl; + std::cout << " " << q->second.first + << " from cell " << q->second.second + << std::endl; #endif @@ -4367,13 +4367,13 @@ namespace VectorTools Assert (cell_to_normals_map.size() >= 1, ExcInternalError()); #ifdef DEBUG_NO_NORMAL_FLUX - std::cout << " cell_to_normals_map:" << std::endl; + std::cout << " cell_to_normals_map:" << std::endl; for (typename CellToNormalsMap::const_iterator x = cell_to_normals_map.begin(); x != cell_to_normals_map.end(); ++x) - std::cout << " " << x->first << " -> (" - << x->second.first << ',' << x->second.second << ')' - << std::endl; + std::cout << " " << x->first << " -> (" + << x->second.first << ',' << x->second.second << ')' + << std::endl; #endif // count the maximum number of contributions from each cell @@ -4392,17 +4392,17 @@ namespace VectorTools switch (max_n_contributions_per_cell) { - // first deal with the case that a number of cells all have - // registered that they have a normal vector defined at the - // location of a given vector dof, and that each of them have - // encountered this vector dof exactly once while looping over all - // their faces. as stated in the documentation, this is the case - // where we want to simply average over all normal vectors - // - // the typical case is in 2d where multiple cells meet at one - // vertex sitting on the boundary. same in 3d for a vertex that - // is associated with only one of the boundary indicators passed - // to this function + // first deal with the case that a number of cells all have + // registered that they have a normal vector defined at the + // location of a given vector dof, and that each of them have + // encountered this vector dof exactly once while looping over all + // their faces. as stated in the documentation, this is the case + // where we want to simply average over all normal vectors + // + // the typical case is in 2d where multiple cells meet at one + // vertex sitting on the boundary. same in 3d for a vertex that + // is associated with only one of the boundary indicators passed + // to this function case 1: { @@ -4513,21 +4513,21 @@ namespace VectorTools // if this is dim-1 for all cells (if a single cell has // contributed dim, or if all adjacent cells have contributed 1 // normal vector, this is already handled above). - // - // we only implement the case that all cells contribute - // dim-1 because we assume that we are following an edge - // of the domain (think: we are looking at a vertex - // located on one of the edges of a refined cube where the - // boundary indicators of the two adjacent faces of the - // cube are both listed in the set of boundary indicators - // passed to this function). in that case, all cells along - // that edge of the domain are assumed to have contributed - // dim-1 normal vectors. however, there are cases where - // this assumption is not justified (see the lengthy - // explanation in test no_flux_12.cc) and in those cases - // we simply ignore the cell that contributes only - // once. this is also discussed at length in the - // documentation of this function. + // + // we only implement the case that all cells contribute + // dim-1 because we assume that we are following an edge + // of the domain (think: we are looking at a vertex + // located on one of the edges of a refined cube where the + // boundary indicators of the two adjacent faces of the + // cube are both listed in the set of boundary indicators + // passed to this function). in that case, all cells along + // that edge of the domain are assumed to have contributed + // dim-1 normal vectors. however, there are cases where + // this assumption is not justified (see the lengthy + // explanation in test no_flux_12.cc) and in those cases + // we simply ignore the cell that contributes only + // once. this is also discussed at length in the + // documentation of this function. // // for each contributing cell compute the tangential vector that // remains unconstrained @@ -4538,21 +4538,21 @@ namespace VectorTools ++contribution) { #ifdef DEBUG_NO_NORMAL_FLUX - std::cout << " Treating edge case with dim-1 contributions." << std::endl - << " Looking at cell " << contribution->first - << " which has contributed these normal vectors:" - << std::endl; - for (typename std::list >::const_iterator - t = contribution->second.begin(); - t != contribution->second.end(); - ++t) - std::cout << " " << *t << std::endl; + std::cout << " Treating edge case with dim-1 contributions." << std::endl + << " Looking at cell " << contribution->first + << " which has contributed these normal vectors:" + << std::endl; + for (typename std::list >::const_iterator + t = contribution->second.begin(); + t != contribution->second.end(); + ++t) + std::cout << " " << *t << std::endl; #endif - // as mentioned above, simply ignore cells that only - // contribute once + // as mentioned above, simply ignore cells that only + // contribute once if (contribution->second.size() < dim-1) - continue; + continue; Tensor<1,dim> normals[dim-1]; { @@ -4654,7 +4654,7 @@ namespace VectorTools template class DH, int spacedim> void - compute_normal_flux_constraints (const DH&dof_handler, + compute_normal_flux_constraints (const DH &dof_handler, const unsigned int first_vector_component, const std::set &boundary_ids, ConstraintMatrix &constraints, @@ -4699,7 +4699,7 @@ namespace VectorTools std::max(n_scalar_indices, fe.face_system_to_component_index(i).second+1); cell_vector_dofs[fe.face_system_to_component_index(i).second] - [fe.face_system_to_component_index(i).first-first_vector_component] + [fe.face_system_to_component_index(i).first-first_vector_component] = face_dofs[i]; } @@ -4714,8 +4714,8 @@ namespace VectorTools // can find constrained ones unsigned int n_total_constraints_found = 0; for (typename std::set, - PointComparator >::const_iterator it=vector_dofs.begin(); - it!=vector_dofs.end(); ++it) + PointComparator >::const_iterator it=vector_dofs.begin(); + it!=vector_dofs.end(); ++it) { unsigned int n_constraints = 0; bool is_constrained[dim]; @@ -4754,7 +4754,7 @@ namespace VectorTools normal[d] = 1.; } AssertIndexRange(constrained_index, dim); - const std::vector >* constrained + const std::vector > *constrained = no_normal_flux_constraints.get_constraint_entries((*it)[constrained_index]); // find components to which this index is constrained to Assert(constrained != 0, ExcInternalError()); @@ -4998,7 +4998,7 @@ namespace VectorTools double sum = 0; for (unsigned int k=0; k &p, Point q1, q2, q3, q4; Vector v1(this->n_components), v2(this->n_components), - v3(this->n_components), v4(this->n_components); + v3(this->n_components), v4(this->n_components); const double h_inv_12=1./(12*h); for (unsigned int i=0; i > &patch template <> void DataOutBase::write_svg<1,1> (const std::vector > &patches, - const std::vector &data_names, - const std::vector > &vector_data_ranges, - const SvgFlags &flags, - std::ostream &out) + const std::vector &data_names, + const std::vector > &vector_data_ranges, + const SvgFlags &flags, + std::ostream &out) { AssertThrow (false, ExcNotImplemented()); } @@ -6533,7 +6533,7 @@ void DataOutInterface::write_vtu_in_parallel (const char *filename MPI_Info_create(&info); MPI_File fh; err = MPI_File_open(comm, const_cast(filename), - MPI_MODE_CREATE | MPI_MODE_WRONLY, info, &fh); + MPI_MODE_CREATE | MPI_MODE_WRONLY, info, &fh); AssertThrow(err==0, ExcMessage("Unable to open file with MPI_File_open!")); diff --git a/deal.II/source/base/exceptions.cc b/deal.II/source/base/exceptions.cc index e98a4d89b9..80e04826cc 100644 --- a/deal.II/source/base/exceptions.cc +++ b/deal.II/source/base/exceptions.cc @@ -118,7 +118,7 @@ void ExceptionBase::set_fields (const char *f, #endif } -const char* ExceptionBase::what() const throw() +const char *ExceptionBase::what() const throw() { // If no error c_string was generated so far, do it now: if (what_str == "") diff --git a/deal.II/source/base/function_parser.cc b/deal.II/source/base/function_parser.cc index c26b0594e5..285ff50a7a 100644 --- a/deal.II/source/base/function_parser.cc +++ b/deal.II/source/base/function_parser.cc @@ -24,14 +24,14 @@ namespace fparser { class FunctionParser: public ::FunctionParser -{}; + {}; } #else namespace fparser { class FunctionParser -{}; + {}; } #endif diff --git a/deal.II/source/base/geometry_info.cc b/deal.II/source/base/geometry_info.cc index 7bb041574e..4ca5e47b44 100644 --- a/deal.II/source/base/geometry_info.cc +++ b/deal.II/source/base/geometry_info.cc @@ -1843,11 +1843,11 @@ void GeometryInfo:: alternating_form_at_vertices #ifndef DEAL_II_CONSTEXPR_BUG - (const Point (&vertices)[vertices_per_cell], - Tensor (&forms)[vertices_per_cell]) +(const Point (&vertices)[vertices_per_cell], + Tensor (&forms)[vertices_per_cell]) #else - (const Point *vertices, - Tensor *forms) +(const Point *vertices, + Tensor *forms) #endif { // for each of the vertices, diff --git a/deal.II/source/base/logstream.cc b/deal.II/source/base/logstream.cc index 447ff34110..75b401e569 100644 --- a/deal.II/source/base/logstream.cc +++ b/deal.II/source/base/logstream.cc @@ -159,26 +159,32 @@ LogStream::operator<< (std::ostream& (*p) (std::ostream &)) { // Implement a minimalistic stream buffer that only stores the fact // whether overflow or sync was called - public: - QueryStreambuf() - : flushed_(false), newline_written_(false) - { - } - bool flushed() { return flushed_; } - bool newline_written() { return newline_written_; } - private: - int_type overflow(int_type ch) - { - newline_written_ = true; - return ch; - } - int sync() - { - flushed_ = true; - return 0; - } - bool flushed_; - bool newline_written_; + public: + QueryStreambuf() + : flushed_(false), newline_written_(false) + { + } + bool flushed() + { + return flushed_; + } + bool newline_written() + { + return newline_written_; + } + private: + int_type overflow(int_type ch) + { + newline_written_ = true; + return ch; + } + int sync() + { + flushed_ = true; + return 0; + } + bool flushed_; + bool newline_written_; } query_streambuf; { diff --git a/deal.II/source/base/mpi.cc b/deal.II/source/base/mpi.cc index 4b93f9be56..97a7c89b66 100644 --- a/deal.II/source/base/mpi.cc +++ b/deal.II/source/base/mpi.cc @@ -190,7 +190,7 @@ namespace Utilities void max_reduce ( const void *in_lhs_, void *inout_rhs_, int *len, - MPI_Datatype * ) + MPI_Datatype *) { const MinMaxAvg *in_lhs = static_cast(in_lhs_); MinMaxAvg *inout_rhs = static_cast(inout_rhs_); @@ -443,7 +443,7 @@ namespace Utilities // when running PETSc, because we initialize MPI ourselves before calling // PetscInitialize #ifdef DEAL_II_WITH_MPI - int mpi_err = 0; + int mpi_err = 0; int MPI_has_been_started = 0; MPI_Initialized(&MPI_has_been_started); diff --git a/deal.II/source/base/multithread_info.cc b/deal.II/source/base/multithread_info.cc index a3a92163de..815af8bd45 100644 --- a/deal.II/source/base/multithread_info.cc +++ b/deal.II/source/base/multithread_info.cc @@ -105,7 +105,7 @@ unsigned int MultithreadInfo::get_n_cpus() void MultithreadInfo::set_thread_limit(const unsigned int max_threads) { Assert(n_max_threads==numbers::invalid_unsigned_int, - ExcMessage("Calling set_thread_limit() more than once is not supported!")); + ExcMessage("Calling set_thread_limit() more than once is not supported!")); unsigned int max_threads_env = numbers::invalid_unsigned_int; char *penv; diff --git a/deal.II/source/base/path_search.cc b/deal.II/source/base/path_search.cc index eaa59d4ff0..9a1b0808b6 100644 --- a/deal.II/source/base/path_search.cc +++ b/deal.II/source/base/path_search.cc @@ -131,19 +131,19 @@ PathSearch::find (const std::string &filename, // the whole filename specified, including (possibly) // the suffix { - real_name = *path + filename; - if (debug > 1) - deallog << "PathSearch[" << cls << "] trying " - << real_name << std::endl; - FILE *fp = fopen(real_name.c_str(), open_mode); - if (fp != 0) - { - if (debug > 0) - deallog << "PathSearch[" << cls << "] opened " - << real_name << std::endl; - fclose(fp); - return real_name; - } + real_name = *path + filename; + if (debug > 1) + deallog << "PathSearch[" << cls << "] trying " + << real_name << std::endl; + FILE *fp = fopen(real_name.c_str(), open_mode); + if (fp != 0) + { + if (debug > 0) + deallog << "PathSearch[" << cls << "] opened " + << real_name << std::endl; + fclose(fp); + return real_name; + } } // try again with the suffix appended, unless there is @@ -153,13 +153,13 @@ PathSearch::find (const std::string &filename, real_name = *path + filename + suffix; if (debug > 1) deallog << "PathSearch[" << cls << "] trying " - << real_name << std::endl; + << real_name << std::endl; FILE *fp = fopen(real_name.c_str(), open_mode); if (fp != 0) { if (debug > 0) deallog << "PathSearch[" << cls << "] opened " - << real_name << std::endl; + << real_name << std::endl; fclose(fp); return real_name; } diff --git a/deal.II/source/base/polynomial.cc b/deal.II/source/base/polynomial.cc index cd0b61f7e9..19ecd4654f 100644 --- a/deal.II/source/base/polynomial.cc +++ b/deal.II/source/base/polynomial.cc @@ -149,9 +149,9 @@ namespace Polynomials } break; - // manually implement size 1 (values only), size 2 (value + first - // derivative), and size 3 (up to second derivative) since they - // might be called often. then, we can unroll the loop. + // manually implement size 1 (values only), size 2 (value + first + // derivative), and size 3 (up to second derivative) since they + // might be called often. then, we can unroll the loop. case 1: values[0] = 1; for (unsigned int i=0; i::Quadrature (const Quadrature<0> &) template Quadrature::Quadrature (const Quadrature &q) - : - Subscriptor(), - quadrature_points (Utilities::fixed_power(q.size())), - weights (Utilities::fixed_power(q.size())) +: +Subscriptor(), + quadrature_points (Utilities::fixed_power(q.size())), + weights (Utilities::fixed_power(q.size())) { Assert (dim <= 3, ExcNotImplemented()); diff --git a/deal.II/source/base/table_handler.cc b/deal.II/source/base/table_handler.cc index 831434c98d..78c9a8089f 100644 --- a/deal.II/source/base/table_handler.cc +++ b/deal.II/source/base/table_handler.cc @@ -391,7 +391,7 @@ void TableHandler::write_text(std::ostream &out, out << std::flush; return; } - + case simple_table_with_separate_column_description: { // write the captions @@ -417,7 +417,7 @@ void TableHandler::write_text(std::ostream &out, out << std::flush; return; } - + case table_with_separate_column_description: { // writing the captions for table_with_separate_column_description @@ -430,7 +430,7 @@ void TableHandler::write_text(std::ostream &out, } break; } - + case table_with_headers: { // This format output supercolumn headers and aligns them centered @@ -507,12 +507,12 @@ void TableHandler::write_text(std::ostream &out, out << '\n'; break; } - + default: Assert (false, ExcInternalError()); } - + // finally output the data itself for // table_with_headers or table_with_separate_column_description: for (unsigned int i=0; i::connectivity_destroy) (p4est_connectivity_t *connectivity) @@ -325,7 +325,7 @@ namespace internal = p4est_connectivity_save; int (&functions<2>::connectivity_is_valid) (types<2>::connectivity - *connectivity) + *connectivity) = p4est_connectivity_is_valid; types<2>::connectivity * @@ -624,7 +624,7 @@ namespace internal = p8est_connectivity_save; int (&functions<3>::connectivity_is_valid) (types<3>::connectivity - *connectivity) + *connectivity) = p8est_connectivity_is_valid; types<3>::connectivity * @@ -771,7 +771,7 @@ namespace std::vector &vertex_touch_count, std::vector::active_cell_iterator,unsigned int> > > - & vertex_to_cell) + &vertex_to_cell) { vertex_touch_count.resize (triangulation.n_vertices()); vertex_to_cell.resize (triangulation.n_vertices()); @@ -795,7 +795,7 @@ namespace std::vector &edge_touch_count, std::vector::active_cell_iterator,unsigned int> > > - & edge_to_cell) + &edge_to_cell) { Assert (triangulation.n_levels() == 1, ExcInternalError()); @@ -825,7 +825,7 @@ namespace const std::vector &vertex_touch_count, const std::vector::active_cell_iterator,unsigned int> > > - & vertex_to_cell, + &vertex_to_cell, const std::vector &coarse_cell_to_p4est_tree_permutation, const bool set_vertex_info, typename internal::p4est::types::connectivity *connectivity) @@ -2082,10 +2082,11 @@ namespace parallel Triangulation:: load(const char *filename) { - if (parallel_ghost != 0) { - dealii::internal::p4est::functions::ghost_destroy (parallel_ghost); - parallel_ghost = 0; - } + if (parallel_ghost != 0) + { + dealii::internal::p4est::functions::ghost_destroy (parallel_ghost); + parallel_ghost = 0; + } dealii::internal::p4est::functions::destroy (parallel_forest); parallel_forest = 0; dealii::internal::p4est::functions::connectivity_destroy (connectivity); @@ -2116,9 +2117,9 @@ namespace parallel // this command changes the distribution for some reason, so we // will leave it in here. dealii::internal::p4est::functions:: - partition (parallel_forest, - /* prepare coarsening */ 1, - /* weight_callback */ NULL); + partition (parallel_forest, + /* prepare coarsening */ 1, + /* weight_callback */ NULL); } @@ -2347,7 +2348,7 @@ namespace parallel num_ett = std::accumulate (edge_touch_count.begin(), edge_touch_count.end(), 0); - + // now create a connectivity object with the right sizes for all arrays const bool set_vertex_info #ifdef DEBUG @@ -2470,7 +2471,7 @@ namespace parallel // function. Note that the smoothing flag is used in the normal // refinement process. typename Triangulation::MeshSmoothing - save_smooth = this->smooth_grid; + save_smooth = this->smooth_grid; // We will refine manually to match the p4est further down, which // obeys a level difference of 2 at each vertex (see the balance call @@ -2528,13 +2529,13 @@ namespace parallel parallel_ghost = 0; } parallel_ghost = dealii::internal::p4est::functions::ghost_new (parallel_forest, - (dim == 2 - ? - typename dealii::internal::p4est::types:: - balance_type(P4EST_CONNECT_CORNER) - : - typename dealii::internal::p4est::types:: - balance_type(P8EST_CONNECT_CORNER))); + (dim == 2 + ? + typename dealii::internal::p4est::types:: + balance_type(P4EST_CONNECT_CORNER) + : + typename dealii::internal::p4est::types:: + balance_type(P8EST_CONNECT_CORNER))); Assert (parallel_ghost, ExcInternalError()); @@ -2767,7 +2768,7 @@ namespace parallel Assert(cell->neighbor(f)->active(), ExcInternalError()); Assert(cell->neighbor(f)->subdomain_id() != numbers::artificial_subdomain_id, ExcInternalError()); Assert(cell->neighbor(f)->level_subdomain_id() == numbers::artificial_subdomain_id - || cell->neighbor(f)->level_subdomain_id() == cell->neighbor(f)->subdomain_id(), ExcInternalError()); + || cell->neighbor(f)->level_subdomain_id() == cell->neighbor(f)->subdomain_id(), ExcInternalError()); cell->neighbor(f)->set_level_subdomain_id(cell->neighbor(f)->subdomain_id()); } } @@ -3049,7 +3050,7 @@ namespace parallel register_data_attach (const std::size_t size, const std_cxx1x::function & pack_callback) + void *)> &pack_callback) { Assert(size>0, ExcMessage("register_data_attach(), size==0")); Assert(attached_data_pack_callbacks.size()==n_attached_datas, @@ -3072,7 +3073,7 @@ namespace parallel notify_ready_to_unpack (const unsigned int offset, const std_cxx1x::function & unpack_callback) + const void *)> &unpack_callback) { Assert (offset < attached_data_size, ExcMessage ("invalid offset in notify_ready_to_unpack()")); Assert (n_attached_datas > 0, ExcMessage ("notify_ready_to_unpack() called too often")); @@ -3150,7 +3151,7 @@ namespace parallel struct find_ghosts { typename dealii::parallel::distributed::Triangulation *triangulation; - sc_array_t * subids; + sc_array_t *subids; std::map > *vertices_with_ghost_neighbors; }; @@ -3163,12 +3164,12 @@ namespace parallel template void find_ghosts_corner - (typename dealii::internal::p4est::iter::corner_info * info, + (typename dealii::internal::p4est::iter::corner_info *info, void *user_data) { int i, j; int nsides = info->sides.elem_count; - typename dealii::internal::p4est::iter::corner_side * sides = + typename dealii::internal::p4est::iter::corner_side *sides = (typename dealii::internal::p4est::iter::corner_side *) (info->sides.array); struct find_ghosts *fg = static_cast *>(user_data); @@ -3180,35 +3181,41 @@ namespace parallel *vertices_with_ghost_neighbors = fg->vertices_with_ghost_neighbors; subids->elem_count = 0; - for (i = 0; i < nsides; i++) { - if (sides[i].is_ghost) { - typename dealii::parallel::distributed::Triangulation::cell_iterator cell = cell_from_quad (triangulation, sides[i].treeid, *(sides[i].quad)); - Assert (cell->is_ghost(), ExcMessage ("ghost quad did not find ghost cell")); - dealii::types::subdomain_id *subid = - static_cast(sc_array_push (subids)); - *subid = cell->subdomain_id(); + for (i = 0; i < nsides; i++) + { + if (sides[i].is_ghost) + { + typename dealii::parallel::distributed::Triangulation::cell_iterator cell = cell_from_quad (triangulation, sides[i].treeid, *(sides[i].quad)); + Assert (cell->is_ghost(), ExcMessage ("ghost quad did not find ghost cell")); + dealii::types::subdomain_id *subid = + static_cast(sc_array_push (subids)); + *subid = cell->subdomain_id(); + } } - } - if (!subids->elem_count) { - return; - } + if (!subids->elem_count) + { + return; + } nsubs = (int) subids->elem_count; subdomain_ids = (dealii::types::subdomain_id *) (subids->array); - for (i = 0; i < nsides; i++) { - if (!sides[i].is_ghost) { - typename dealii::parallel::distributed::Triangulation::cell_iterator cell = cell_from_quad (triangulation, sides[i].treeid, *(sides[i].quad)); + for (i = 0; i < nsides; i++) + { + if (!sides[i].is_ghost) + { + typename dealii::parallel::distributed::Triangulation::cell_iterator cell = cell_from_quad (triangulation, sides[i].treeid, *(sides[i].quad)); - Assert (!cell->is_ghost(), ExcMessage ("local quad found ghost cell")); + Assert (!cell->is_ghost(), ExcMessage ("local quad found ghost cell")); - for (j = 0; j < nsubs; j++) { - (*vertices_with_ghost_neighbors)[cell->vertex_index(sides[i].corner)] - .insert (subdomain_ids[j]); - } + for (j = 0; j < nsubs; j++) + { + (*vertices_with_ghost_neighbors)[cell->vertex_index(sides[i].corner)] + .insert (subdomain_ids[j]); + } + } } - } subids->elem_count = 0; } @@ -3219,12 +3226,12 @@ namespace parallel template void find_ghosts_edge - (typename dealii::internal::p4est::iter::edge_info * info, + (typename dealii::internal::p4est::iter::edge_info *info, void *user_data) { int i, j, k; int nsides = info->sides.elem_count; - typename dealii::internal::p4est::iter::edge_side * sides = + typename dealii::internal::p4est::iter::edge_side *sides = (typename dealii::internal::p4est::iter::edge_side *) (info->sides.array); struct find_ghosts *fg = static_cast *>(user_data); @@ -3236,40 +3243,50 @@ namespace parallel *vertices_with_ghost_neighbors = fg->vertices_with_ghost_neighbors; subids->elem_count = 0; - for (i = 0; i < nsides; i++) { - if (sides[i].is_hanging) { - for (j = 0; j < 2; j++) { - if (sides[i].is.hanging.is_ghost[j]) { - typename dealii::parallel::distributed::Triangulation::cell_iterator cell = cell_from_quad (triangulation, sides[i].treeid, *(sides[i].is.hanging.quad[j])); - dealii::types::subdomain_id *subid = - static_cast(sc_array_push (subids)); - *subid = cell->subdomain_id(); + for (i = 0; i < nsides; i++) + { + if (sides[i].is_hanging) + { + for (j = 0; j < 2; j++) + { + if (sides[i].is.hanging.is_ghost[j]) + { + typename dealii::parallel::distributed::Triangulation::cell_iterator cell = cell_from_quad (triangulation, sides[i].treeid, *(sides[i].is.hanging.quad[j])); + dealii::types::subdomain_id *subid = + static_cast(sc_array_push (subids)); + *subid = cell->subdomain_id(); + } + } } - } } - } - if (!subids->elem_count) { - return; - } + if (!subids->elem_count) + { + return; + } nsubs = (int) subids->elem_count; subdomain_ids = (dealii::types::subdomain_id *) (subids->array); - for (i = 0; i < nsides; i++) { - if (sides[i].is_hanging) { - for (j = 0; j < 2; j++) { - if (!sides[i].is.hanging.is_ghost[j]) { - typename dealii::parallel::distributed::Triangulation::cell_iterator cell = cell_from_quad (triangulation, sides[i].treeid, *(sides[i].is.hanging.quad[j])); + for (i = 0; i < nsides; i++) + { + if (sides[i].is_hanging) + { + for (j = 0; j < 2; j++) + { + if (!sides[i].is.hanging.is_ghost[j]) + { + typename dealii::parallel::distributed::Triangulation::cell_iterator cell = cell_from_quad (triangulation, sides[i].treeid, *(sides[i].is.hanging.quad[j])); - for (k = 0; k < nsubs; k++) { - (*vertices_with_ghost_neighbors)[cell->vertex_index(p8est_edge_corners[sides[i].edge][1^j])] - .insert (subdomain_ids[k]); - } + for (k = 0; k < nsubs; k++) + { + (*vertices_with_ghost_neighbors)[cell->vertex_index(p8est_edge_corners[sides[i].edge][1^j])] + .insert (subdomain_ids[k]); + } + } + } } - } } - } subids->elem_count = 0; } @@ -3280,12 +3297,12 @@ namespace parallel template void find_ghosts_face - (typename dealii::internal::p4est::iter::face_info * info, + (typename dealii::internal::p4est::iter::face_info *info, void *user_data) { int i, j, k; int nsides = info->sides.elem_count; - typename dealii::internal::p4est::iter::face_side * sides = + typename dealii::internal::p4est::iter::face_side *sides = (typename dealii::internal::p4est::iter::face_side *) (info->sides.array); struct find_ghosts *fg = static_cast *>(user_data); @@ -3298,46 +3315,58 @@ namespace parallel int limit = (dim == 2) ? 2 : 4; subids->elem_count = 0; - for (i = 0; i < nsides; i++) { - if (sides[i].is_hanging) { - for (j = 0; j < limit; j++) { - if (sides[i].is.hanging.is_ghost[j]) { - typename dealii::parallel::distributed::Triangulation::cell_iterator cell = cell_from_quad (triangulation, sides[i].treeid, *(sides[i].is.hanging.quad[j])); - dealii::types::subdomain_id *subid = - static_cast(sc_array_push (subids)); - *subid = cell->subdomain_id(); + for (i = 0; i < nsides; i++) + { + if (sides[i].is_hanging) + { + for (j = 0; j < limit; j++) + { + if (sides[i].is.hanging.is_ghost[j]) + { + typename dealii::parallel::distributed::Triangulation::cell_iterator cell = cell_from_quad (triangulation, sides[i].treeid, *(sides[i].is.hanging.quad[j])); + dealii::types::subdomain_id *subid = + static_cast(sc_array_push (subids)); + *subid = cell->subdomain_id(); + } + } } - } } - } - if (!subids->elem_count) { - return; - } + if (!subids->elem_count) + { + return; + } nsubs = (int) subids->elem_count; subdomain_ids = (dealii::types::subdomain_id *) (subids->array); - for (i = 0; i < nsides; i++) { - if (sides[i].is_hanging) { - for (j = 0; j < limit; j++) { - if (!sides[i].is.hanging.is_ghost[j]) { - typename dealii::parallel::distributed::Triangulation::cell_iterator cell = cell_from_quad (triangulation, sides[i].treeid, *(sides[i].is.hanging.quad[j])); + for (i = 0; i < nsides; i++) + { + if (sides[i].is_hanging) + { + for (j = 0; j < limit; j++) + { + if (!sides[i].is.hanging.is_ghost[j]) + { + typename dealii::parallel::distributed::Triangulation::cell_iterator cell = cell_from_quad (triangulation, sides[i].treeid, *(sides[i].is.hanging.quad[j])); - for (k = 0; k < nsubs; k++) { - if (dim == 2) { - (*vertices_with_ghost_neighbors)[cell->vertex_index(p4est_face_corners[sides[i].face][(limit - 1)^j])] - .insert (subdomain_ids[k]); - } - else { - (*vertices_with_ghost_neighbors)[cell->vertex_index(p8est_face_corners[sides[i].face][(limit - 1)^j])] - .insert (subdomain_ids[k]); + for (k = 0; k < nsubs; k++) + { + if (dim == 2) + { + (*vertices_with_ghost_neighbors)[cell->vertex_index(p4est_face_corners[sides[i].face][(limit - 1)^j])] + .insert (subdomain_ids[k]); + } + else + { + (*vertices_with_ghost_neighbors)[cell->vertex_index(p8est_face_corners[sides[i].face][(limit - 1)^j])] + .insert (subdomain_ids[k]); + } + } + } } - } } - } } - } subids->elem_count = 0; } @@ -3347,8 +3376,8 @@ namespace parallel void Triangulation<1,1>:: fill_vertices_with_ghost_neighbors - (std::map > - &vertices_with_ghost_neighbors) + (std::map > + &vertices_with_ghost_neighbors) { Assert (false, ExcNotImplemented()); } @@ -3357,8 +3386,8 @@ namespace parallel void Triangulation<1,2>:: fill_vertices_with_ghost_neighbors - (std::map > - &vertices_with_ghost_neighbors) + (std::map > + &vertices_with_ghost_neighbors) { Assert (false, ExcNotImplemented()); } @@ -3367,8 +3396,8 @@ namespace parallel void Triangulation<1,3>:: fill_vertices_with_ghost_neighbors - (std::map > - &vertices_with_ghost_neighbors) + (std::map > + &vertices_with_ghost_neighbors) { Assert (false, ExcNotImplemented()); } @@ -3381,8 +3410,8 @@ namespace parallel void Triangulation<2,2>:: fill_vertices_with_ghost_neighbors - (std::map > - &vertices_with_ghost_neighbors) + (std::map > + &vertices_with_ghost_neighbors) { struct find_ghosts<2,2> fg; @@ -3404,8 +3433,8 @@ namespace parallel void Triangulation<2,3>:: fill_vertices_with_ghost_neighbors - (std::map > - &vertices_with_ghost_neighbors) + (std::map > + &vertices_with_ghost_neighbors) { struct find_ghosts<2,3> fg; @@ -3427,8 +3456,8 @@ namespace parallel void Triangulation<3,3>:: fill_vertices_with_ghost_neighbors - (std::map > - &vertices_with_ghost_neighbors) + (std::map > + &vertices_with_ghost_neighbors) { struct find_ghosts<3,3> fg; @@ -3452,43 +3481,43 @@ namespace parallel template void Triangulation::add_periodicity - (const std::vector >& - periodicity_vector) + (const std::vector > & + periodicity_vector) { - #if DEAL_II_P4EST_VERSION_GTE(0,3,4,1) +#if DEAL_II_P4EST_VERSION_GTE(0,3,4,1) Assert (triangulation_has_content == true, ExcMessage ("The triangulation is empty!")); Assert (this->n_levels() == 1, ExcMessage ("The triangulation is refined!")); - + typedef std::vector > - FaceVector; + FaceVector; typename FaceVector::const_iterator it, periodic_end; it = periodicity_vector.begin(); periodic_end = periodicity_vector.end(); - + for (; itcell[0]; - const cell_iterator second_cell = it->cell[1]; - const unsigned int face_left = it->face_idx[0]; - const unsigned int face_right = it->face_idx[1]; - - //respective cells of the matching faces in p4est - const unsigned int tree_left - = coarse_cell_to_p4est_tree_permutation[std::distance(this->begin(), - first_cell)]; - const unsigned int tree_right - = coarse_cell_to_p4est_tree_permutation[std::distance(this->begin(), - second_cell)]; - - //TODO Add support for non default orientation. - Assert(it->orientation == 1, - ExcMessage("Found a face match with non standard orientation. " - "This function is only suitable for meshes with " - "cells in default orientation")); - - dealii::internal::p4est::functions:: + { + const cell_iterator first_cell = it->cell[0]; + const cell_iterator second_cell = it->cell[1]; + const unsigned int face_left = it->face_idx[0]; + const unsigned int face_right = it->face_idx[1]; + + //respective cells of the matching faces in p4est + const unsigned int tree_left + = coarse_cell_to_p4est_tree_permutation[std::distance(this->begin(), + first_cell)]; + const unsigned int tree_right + = coarse_cell_to_p4est_tree_permutation[std::distance(this->begin(), + second_cell)]; + + //TODO Add support for non default orientation. + Assert(it->orientation == 1, + ExcMessage("Found a face match with non standard orientation. " + "This function is only suitable for meshes with " + "cells in default orientation")); + + dealii::internal::p4est::functions:: connectivity_join_faces (connectivity, tree_left, tree_right, @@ -3496,50 +3525,50 @@ namespace parallel face_right, /* orientation */ 0); - /* The orientation parameter above describes the difference between - * the cell on the left and the cell on the right would number of the - * corners of the face. In the periodic domains most users will want, - * this orientation will be 0, i.e. the two cells would number the - * corners the same way. More exotic periodicity, like moebius strips - * or converting an unstructured quad/hex mesh into a periodic domain, - * are not supported right now, and undefined behavior will occur if - * users try to make them periodic. This may be addressed at a later - * date. - */ - } - - + /* The orientation parameter above describes the difference between + * the cell on the left and the cell on the right would number of the + * corners of the face. In the periodic domains most users will want, + * this orientation will be 0, i.e. the two cells would number the + * corners the same way. More exotic periodicity, like moebius strips + * or converting an unstructured quad/hex mesh into a periodic domain, + * are not supported right now, and undefined behavior will occur if + * users try to make them periodic. This may be addressed at a later + * date. + */ + } + + Assert(dealii::internal::p4est::functions::connectivity_is_valid - (connectivity) == 1, ExcInternalError()); - + (connectivity) == 1, ExcInternalError()); + // now create a forest out of the connectivity data structure dealii::internal::p4est::functions::destroy (parallel_forest); parallel_forest = dealii::internal::p4est::functions:: - new_forest (mpi_communicator, - connectivity, - /* minimum initial number of quadrants per tree */ 0, - /* minimum level of upfront refinement */ 0, - /* use uniform upfront refinement */ 1, - /* user_data_size = */ 0, - /* user_data_constructor = */ NULL, - /* user_pointer */ this); + new_forest (mpi_communicator, + connectivity, + /* minimum initial number of quadrants per tree */ 0, + /* minimum level of upfront refinement */ 0, + /* use uniform upfront refinement */ 1, + /* user_data_size = */ 0, + /* user_data_constructor = */ NULL, + /* user_pointer */ this); try - { - copy_local_forest_to_triangulation (); - } + { + copy_local_forest_to_triangulation (); + } catch (const typename Triangulation::DistortedCellList &) - { - // the underlying triangulation should not be checking for distorted - // cells - AssertThrow (false, ExcInternalError()); - } - - #else + { + // the underlying triangulation should not be checking for distorted + // cells + AssertThrow (false, ExcInternalError()); + } + +#else Assert(false, ExcMessage ("Need p4est version >= 0.3.4.1!")); - #endif +#endif } @@ -3707,12 +3736,13 @@ namespace parallel const std::vector perm = triangulation->get_p4est_tree_to_coarse_cell_permutation (); types::global_dof_index dealii_index = perm[treeidx]; - for (i = 0; i < l; i++) { - typename dealii::Triangulation::cell_iterator cell (triangulation, i, dealii_index); - child_id = internal::p4est::functions::quadrant_ancestor_id (&quad, i + 1); - Assert (cell->has_children (), ExcMessage ("p4est quadrant does not correspond to a cell!")); - dealii_index = cell->child_index(child_id); - } + for (i = 0; i < l; i++) + { + typename dealii::Triangulation::cell_iterator cell (triangulation, i, dealii_index); + child_id = internal::p4est::functions::quadrant_ancestor_id (&quad, i + 1); + Assert (cell->has_children (), ExcMessage ("p4est quadrant does not correspond to a cell!")); + dealii_index = cell->child_index(child_id); + } typename dealii::Triangulation::cell_iterator out_cell (triangulation, l, dealii_index); diff --git a/deal.II/source/dofs/dof_handler.cc b/deal.II/source/dofs/dof_handler.cc index 119a9ee2c5..ce78e1d5d2 100644 --- a/deal.II/source/dofs/dof_handler.cc +++ b/deal.II/source/dofs/dof_handler.cc @@ -66,18 +66,17 @@ namespace internal namespace internal { template - std::string policy_to_string(const dealii::internal::DoFHandler::Policy::PolicyBase & policy) + std::string policy_to_string(const dealii::internal::DoFHandler::Policy::PolicyBase &policy) { std::string policy_name; if (dynamic_cast*>(&policy)) - policy_name = "Policy::Sequential<"; + policy_name = "Policy::Sequential<"; + else if (dynamic_cast*>(&policy)) + policy_name = "Policy::ParallelDistributed<"; else - if (dynamic_cast*>(&policy)) - policy_name = "Policy::ParallelDistributed<"; - else - AssertThrow(false, ExcNotImplemented()); + AssertThrow(false, ExcNotImplemented()); policy_name += Utilities::int_to_string(dim)+ - ","+Utilities::int_to_string(spacedim)+">"; + ","+Utilities::int_to_string(spacedim)+">"; return policy_name; } @@ -168,10 +167,10 @@ namespace internal 16*dof_handler.selected_fe->dofs_per_quad; break; - // the following numbers are not based on actual counting but by - // extrapolating the number sequences from the previous ones (for - // example, for dofs_per_vertex, the sequence above is 19, 21, 28, - // 30, 37, and is continued as follows): + // the following numbers are not based on actual counting but by + // extrapolating the number sequences from the previous ones (for + // example, for dofs_per_vertex, the sequence above is 19, 21, 28, + // 30, 37, and is continued as follows): case 9: max_couplings=39*dof_handler.selected_fe->dofs_per_vertex + 59*dof_handler.selected_fe->dofs_per_line + diff --git a/deal.II/source/dofs/dof_handler_policy.cc b/deal.II/source/dofs/dof_handler_policy.cc index 3db4b2104a..3e71bbd9c1 100644 --- a/deal.II/source/dofs/dof_handler_policy.cc +++ b/deal.II/source/dofs/dof_handler_policy.cc @@ -1216,7 +1216,7 @@ namespace internal //have us as a neighbor. In this case we and the children are active. if (dealii_cell->active()) { - for (unsigned int f=0;f::faces_per_cell;++f) + for (unsigned int f=0; f::faces_per_cell; ++f) { if (dealii_cell->at_boundary(f)) continue; diff --git a/deal.II/source/dofs/dof_tools.cc b/deal.II/source/dofs/dof_tools.cc index 51b5f2ec55..15beb53ea5 100644 --- a/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/source/dofs/dof_tools.cc @@ -615,19 +615,19 @@ namespace DoFTools : (dim == 2 ? (i<2*fe.dofs_per_vertex ? i : i+2*fe.dofs_per_vertex) + : + (dim == 3 ? + (i<4*fe.dofs_per_vertex ? + i : - (dim == 3 ? - (i<4*fe.dofs_per_vertex ? - i - : - (i<4*fe.dofs_per_vertex+4*fe.dofs_per_line ? - i+4*fe.dofs_per_vertex - : - i+4*fe.dofs_per_vertex+8*fe.dofs_per_line)) + (i<4*fe.dofs_per_vertex+4*fe.dofs_per_line ? + i+4*fe.dofs_per_vertex : - numbers::invalid_unsigned_int))); + i+4*fe.dofs_per_vertex+8*fe.dofs_per_line)) + : + numbers::invalid_unsigned_int))); if (fe.is_primitive (cell_index)) - { + { if (component_mask[fe.face_system_to_component_index(i).first] == true) selected_dofs.add_index (face_dof_indices[i]); diff --git a/deal.II/source/dofs/dof_tools_constraints.cc b/deal.II/source/dofs/dof_tools_constraints.cc index b2b3aeb36c..890f2ac036 100644 --- a/deal.II/source/dofs/dof_tools_constraints.cc +++ b/deal.II/source/dofs/dof_tools_constraints.cc @@ -844,7 +844,7 @@ namespace DoFTools continue; for (unsigned int dof=0; dof!=fe.dofs_per_line; ++dof) dofs_on_children.push_back( - this_face->child(child)->dof_index(dof, fe_index)); + this_face->child(child)->dof_index(dof, fe_index)); } // note: can get fewer DoFs when we have artificial cells Assert(dofs_on_children.size() <= n_dofs_on_children, ExcInternalError()); @@ -1058,8 +1058,8 @@ namespace DoFTools if (cell->neighbor_child_on_subface (face, child)->is_artificial()) continue; for (unsigned int dof=0; dof!=fe.dofs_per_quad; ++dof) - dofs_on_children.push_back( - this_face->child(child)->dof_index(dof, fe_index)); + dofs_on_children.push_back( + this_face->child(child)->dof_index(dof, fe_index)); } // note: can get fewer DoFs when we have artificial cells: @@ -1580,13 +1580,13 @@ namespace DoFTools // there, we have FESystem(FE_Q(1),FE_DGQ(0)) vs. // FESystem(FE_Q(1),FE_DGQ(1)). neither of them // dominates the other. - // - // a final possibility is that we have something like - // FESystem(FE_Q(1),FE_Q(1)) vs - // FESystem(FE_Q(1),FE_Nothing()), see - // hp/fe_nothing_18/19. - // - // in any case, the point is that it doesn't + // + // a final possibility is that we have something like + // FESystem(FE_Q(1),FE_Q(1)) vs + // FESystem(FE_Q(1),FE_Nothing()), see + // hp/fe_nothing_18/19. + // + // in any case, the point is that it doesn't // matter. there is nothing to do here. break; } @@ -1730,28 +1730,30 @@ namespace DoFTools face_1->get_dof_indices(dofs_1, face_1_index); face_2->get_dof_indices(dofs_2, face_2_index); - for (unsigned int i=0; i < dofs_per_face; i++) { - if (dofs_1[i] == numbers::invalid_dof_index || - dofs_2[i] == numbers::invalid_dof_index) { - /* If either of these faces have no indices, stop. This is so - * that there is no attempt to match artificial cells of - * parallel distributed triangulations. - * - * While it seems like we ought to be able to avoid even calling - * set_periodicity_constraints for artificial faces, this - * situation can arise when a face that is being made periodic - * is only partially touched by the local subdomain. - * make_periodicity_constraints will be called recursively even - * for the section of the face that is not touched by the local - * subdomain. - * - * Until there is a better way to determine if the cells that - * neighbor a face are artificial, we simply test to see if the - * face does not have a valid dof initialization. - */ - return; + for (unsigned int i=0; i < dofs_per_face; i++) + { + if (dofs_1[i] == numbers::invalid_dof_index || + dofs_2[i] == numbers::invalid_dof_index) + { + /* If either of these faces have no indices, stop. This is so + * that there is no attempt to match artificial cells of + * parallel distributed triangulations. + * + * While it seems like we ought to be able to avoid even calling + * set_periodicity_constraints for artificial faces, this + * situation can arise when a face that is being made periodic + * is only partially touched by the local subdomain. + * make_periodicity_constraints will be called recursively even + * for the section of the face that is not touched by the local + * subdomain. + * + * Until there is a better way to determine if the cells that + * neighbor a face are artificial, we simply test to see if the + * face does not have a valid dof initialization. + */ + return; + } } - } // Well, this is a hack: // @@ -1833,7 +1835,7 @@ namespace DoFTools // orientation: const unsigned int j = cell_to_rotated_face_index[fe.face_to_cell_index(identity_constraint_target, - 0, /* It doesn't really matter, just assume + 0, /* It doesn't really matter, just assume * we're on the first face... */ face_orientation, face_flip, face_rotation)]; @@ -2031,14 +2033,14 @@ namespace DoFTools "different to denote different boundaries.")); std::vector > matched_faces; + > matched_faces; // Collect matching periodic cells on the coarsest level: - GridTools::collect_periodic_faces(dof_handler, b_id1, b_id2, direction, + GridTools::collect_periodic_faces(dof_handler, b_id1, b_id2, direction, matched_faces, offset); make_periodicity_constraints - (matched_faces, constraint_matrix, component_mask); + (matched_faces, constraint_matrix, component_mask); } @@ -2081,14 +2083,14 @@ namespace DoFTools ExcNotImplemented()); std::vector > matched_faces; + > matched_faces; // Collect matching periodic cells on the coarsest level: GridTools::collect_periodic_faces(dof_handler, b_id, direction, matched_faces, offset); make_periodicity_constraints - (matched_faces, constraint_matrix, component_mask); + (matched_faces, constraint_matrix, component_mask); } @@ -2097,7 +2099,7 @@ namespace DoFTools void make_periodicity_constraints (const std::vector > - &periodic_faces, + &periodic_faces, dealii::ConstraintMatrix &constraint_matrix, const ComponentMask &component_mask) { @@ -2110,26 +2112,26 @@ namespace DoFTools // And apply the low level make_periodicity_constraints function to // every matching pair: - for(; it!=end_periodic; ++it) - { - typedef typename DH::face_iterator FaceIterator; - const FaceIterator face_1 = it->cell[0]->face(it->face_idx[0]); - const FaceIterator face_2 = it->cell[1]->face(it->face_idx[1]); + for (; it!=end_periodic; ++it) + { + typedef typename DH::face_iterator FaceIterator; + const FaceIterator face_1 = it->cell[0]->face(it->face_idx[0]); + const FaceIterator face_2 = it->cell[1]->face(it->face_idx[1]); - Assert(face_1->at_boundary() && face_2->at_boundary(), - ExcInternalError()); + Assert(face_1->at_boundary() && face_2->at_boundary(), + ExcInternalError()); - Assert (face_1 != face_2, - ExcInternalError()); + Assert (face_1 != face_2, + ExcInternalError()); - make_periodicity_constraints(face_1, - face_2, - constraint_matrix, - component_mask, - it->orientation[0], - it->orientation[1], - it->orientation[2]); - } + make_periodicity_constraints(face_1, + face_2, + constraint_matrix, + component_mask, + it->orientation[0], + it->orientation[1], + it->orientation[2]); + } } @@ -2159,14 +2161,14 @@ namespace DoFTools */ template void compute_intergrid_weights_3 ( - const typename dealii::DoFHandler::active_cell_iterator &cell, - const Assembler::Scratch &, - Assembler::CopyData ©_data, - const unsigned int coarse_component, - const FiniteElement &coarse_fe, - const InterGridMap > &coarse_to_fine_grid_map, - const std::vector > ¶meter_dofs, - const std::vector &weight_mapping) + const typename dealii::DoFHandler::active_cell_iterator &cell, + const Assembler::Scratch &, + Assembler::CopyData ©_data, + const unsigned int coarse_component, + const FiniteElement &coarse_fe, + const InterGridMap > &coarse_to_fine_grid_map, + const std::vector > ¶meter_dofs, + const std::vector &weight_mapping) { // for each cell on the parameter grid: find out which degrees of // freedom on the fine grid correspond in which way to the degrees @@ -2223,8 +2225,8 @@ namespace DoFTools // parameter grid cell cell->get_dof_indices (copy_data.parameter_dof_indices); - // reset the output array to a pristine state - copy_data.global_parameter_representation.clear (); + // reset the output array to a pristine state + copy_data.global_parameter_representation.clear (); // loop over all dofs on this cell and check whether they are // interesting for us @@ -2238,7 +2240,7 @@ namespace DoFTools = coarse_fe.system_to_component_index(local_dof).second; copy_data.global_parameter_representation.push_back( - dealii::Vector (n_fine_dofs)); + dealii::Vector (n_fine_dofs)); // distribute the representation of // @p{local_parameter_dof} on the parameter grid cell @@ -2258,9 +2260,9 @@ namespace DoFTools */ template void copy_intergrid_weights_3(const Assembler::CopyData ©_data, - const unsigned int coarse_component, + const unsigned int coarse_component, const FiniteElement &coarse_fe, - const std::vector &weight_mapping, + const std::vector &weight_mapping, std::vector > &weights) { unsigned int pos = 0; @@ -2268,7 +2270,7 @@ namespace DoFTools if (coarse_fe.system_to_component_index(local_dof).first == coarse_component) - { + { // now that we've got the global representation of each // parameter dof, we've only got to clobber the non-zero // entries in that vector and store the result @@ -2293,7 +2295,7 @@ namespace DoFTools // several threads operating on different intergrid // weights, have only one mutex for all of them for (types::global_dof_index i=0; i copy_data; WorkStream::run(coarse_grid.begin_active(), - coarse_grid.end(), - std_cxx1x::bind(&compute_intergrid_weights_3, - std_cxx1x::_1, - std_cxx1x::_2, - std_cxx1x::_3, - coarse_component, - std_cxx1x::cref(coarse_grid.get_fe()), - std_cxx1x::cref(coarse_to_fine_grid_map), - std_cxx1x::cref(parameter_dofs), - std_cxx1x::cref(weight_mapping)), - std_cxx1x::bind(©_intergrid_weights_3, - std_cxx1x::_1, - coarse_component, - std_cxx1x::cref(coarse_grid.get_fe()), - std_cxx1x::cref(weight_mapping), - std_cxx1x::ref(weights)), - scratch, - copy_data); + coarse_grid.end(), + std_cxx1x::bind(&compute_intergrid_weights_3, + std_cxx1x::_1, + std_cxx1x::_2, + std_cxx1x::_3, + coarse_component, + std_cxx1x::cref(coarse_grid.get_fe()), + std_cxx1x::cref(coarse_to_fine_grid_map), + std_cxx1x::cref(parameter_dofs), + std_cxx1x::cref(weight_mapping)), + std_cxx1x::bind(©_intergrid_weights_3, + std_cxx1x::_1, + coarse_component, + std_cxx1x::cref(coarse_grid.get_fe()), + std_cxx1x::cref(weight_mapping), + std_cxx1x::ref(weights)), + scratch, + copy_data); } @@ -2860,57 +2862,57 @@ namespace DoFTools if (!cell->is_artificial() && cell->at_boundary ()) - { - const FiniteElement &fe = cell->get_fe(); + { + const FiniteElement &fe = cell->get_fe(); - // get global indices of dofs on the cell - cell_dofs.resize (fe.dofs_per_cell); - cell->get_dof_indices (cell_dofs); + // get global indices of dofs on the cell + cell_dofs.resize (fe.dofs_per_cell); + cell->get_dof_indices (cell_dofs); - for (unsigned int face_no = 0; face_no < GeometryInfo::faces_per_cell; - ++face_no) - { - const typename DH::face_iterator face = cell->face(face_no); - - // if face is on the boundary and satisfies the correct - // boundary id property - if (face->at_boundary () - && - ((boundary_indicator == numbers::invalid_boundary_id) - || - (face->boundary_indicator() == boundary_indicator))) - { - // get indices and physical location on this face - face_dofs.resize (fe.dofs_per_face); - face->get_dof_indices (face_dofs, cell->active_fe_index()); + for (unsigned int face_no = 0; face_no < GeometryInfo::faces_per_cell; + ++face_no) + { + const typename DH::face_iterator face = cell->face(face_no); + + // if face is on the boundary and satisfies the correct + // boundary id property + if (face->at_boundary () + && + ((boundary_indicator == numbers::invalid_boundary_id) + || + (face->boundary_indicator() == boundary_indicator))) + { + // get indices and physical location on this face + face_dofs.resize (fe.dofs_per_face); + face->get_dof_indices (face_dofs, cell->active_fe_index()); - // enter those dofs into the list that match the component - // signature. - for (unsigned int i=0; i::iterator it_index_on_cell - = std::find (cell_dofs.begin(), cell_dofs.end(), face_dofs[i]); - Assert (it_index_on_cell != cell_dofs.end(), ExcInvalidIterator()); - const unsigned int index_on_cell = std::distance(cell_dofs.begin(), - it_index_on_cell); - const ComponentMask &nonzero_component_array - = cell->get_fe().get_nonzero_components (index_on_cell); - bool nonzero = false; - for (unsigned int c=0; c::iterator it_index_on_cell + = std::find (cell_dofs.begin(), cell_dofs.end(), face_dofs[i]); + Assert (it_index_on_cell != cell_dofs.end(), ExcInvalidIterator()); + const unsigned int index_on_cell = std::distance(cell_dofs.begin(), + it_index_on_cell); + const ComponentMask &nonzero_component_array + = cell->get_fe().get_nonzero_components (index_on_cell); + bool nonzero = false; + for (unsigned int c=0; c::FiniteElement ( system_to_component_table.resize(this->dofs_per_cell); face_system_to_component_table.resize(this->dofs_per_face); for (unsigned int j=0 ; jdofs_per_cell ; ++j) - system_to_component_table[j] = std::pair(0,j); + system_to_component_table[j] = std::pair(0,j); for (unsigned int j=0 ; jdofs_per_face ; ++j) - face_system_to_component_table[j] = std::pair(0,j); + face_system_to_component_table[j] = std::pair(0,j); } - + for (unsigned int j=0 ; jdofs_per_cell ; ++j) system_to_base_table[j] = std::make_pair(std::make_pair(0U,0U),j); for (unsigned int j=0 ; jdofs_per_face ; ++j) face_system_to_base_table[j] = std::make_pair(std::make_pair(0U,0U),j); - + // Fill with default value; may be changed by constructor of derived class. base_to_block_indices.reinit(1,1); diff --git a/deal.II/source/fe/fe_dgq.cc b/deal.II/source/fe/fe_dgq.cc index 07139d90a8..7b23f08e94 100644 --- a/deal.II/source/fe/fe_dgq.cc +++ b/deal.II/source/fe/fe_dgq.cc @@ -312,8 +312,8 @@ FE_DGQ::rotate_indices (std::vector &numbers, { switch (direction) { - // Rotate xy-plane - // counter-clockwise + // Rotate xy-plane + // counter-clockwise case 'z': for (unsigned int iz=0; iz<((dim>2) ? n:1); ++iz) for (unsigned int j=0; j::rotate_indices (std::vector &numbers, numbers[l++] = k; } break; - // Rotate xy-plane - // clockwise + // Rotate xy-plane + // clockwise case 'Z': for (unsigned int iz=0; iz<((dim>2) ? n:1); ++iz) for (unsigned int iy=0; iy::rotate_indices (std::vector &numbers, numbers[k] = l++; } break; - // Rotate yz-plane - // counter-clockwise + // Rotate yz-plane + // counter-clockwise case 'x': Assert (dim>2, ExcDimensionMismatch (dim,3)); for (unsigned int iz=0; iz::rotate_indices (std::vector &numbers, numbers[l++] = k; } break; - // Rotate yz-plane - // clockwise + // Rotate yz-plane + // clockwise case 'X': Assert (dim>2, ExcDimensionMismatch (dim,3)); for (unsigned int iz=0; iz::FE_FaceQ (const unsigned int degree) for (unsigned int iy=0; iy <= ((codim>1) ? this->degree : 0) ; ++iy) for (unsigned int ix=0; ix<=this->degree; ++ix) { - Point p; - + Point p; + p(0) = points[ix][0]; if (codim>1) p(1) = points[iy][0]; @@ -164,7 +164,7 @@ get_subface_interpolation_matrix (const FiniteElement &x_source_fe (typename FiniteElement:: ExcInterpolationNotImplemented ())); - // generate a quadrature with the unit face support points. + // generate a quadrature with the unit face support points. const Quadrature face_quadrature (source_fe->get_unit_face_support_points ()); // Rule of thumb for FP accuracy, that can be expected for a given @@ -291,8 +291,8 @@ FE_FaceP::FE_FaceP (const unsigned int degree) : FE_PolyFace, dim, spacedim> (PolynomialSpace(Polynomials::Legendre::generate_complete_basis(degree)), - FiniteElementData(get_dpo_vector(degree), 1, degree, FiniteElementData::L2), - std::vector(1,true)) + FiniteElementData(get_dpo_vector(degree), 1, degree, FiniteElementData::L2), + std::vector(1,true)) {} @@ -437,7 +437,7 @@ get_subface_interpolation_matrix (const FiniteElement &x_source_fe const double eps = 2e-13*(this->degree+1)*(dim-1); FullMatrix mass (face_quadrature.size(), source_fe->dofs_per_face); - + for (unsigned int k = 0; k < face_quadrature.size(); ++k) { const Point p = @@ -462,9 +462,9 @@ get_subface_interpolation_matrix (const FiniteElement &x_source_fe for (unsigned int k = 0; k < face_quadrature.size(); ++k) { const Point p = numbers::invalid_unsigned_int ? - face_quadrature.point(k) : - GeometryInfo::child_to_cell_coordinates (face_quadrature.point(k), - subface); + face_quadrature.point(k) : + GeometryInfo::child_to_cell_coordinates (face_quadrature.point(k), + subface); v_in(k) = this->poly_space.compute_value(i, p); } const double result = H.least_squares(v_out, v_in); diff --git a/deal.II/source/fe/fe_q_base.cc b/deal.II/source/fe/fe_q_base.cc index 40096c09cf..10db7b4839 100644 --- a/deal.II/source/fe/fe_q_base.cc +++ b/deal.II/source/fe/fe_q_base.cc @@ -606,10 +606,10 @@ get_subface_interpolation_matrix (const FiniteElement &x_source_fe // be done for the face orientation flag in 3D. const Quadrature subface_quadrature = subface == numbers::invalid_unsigned_int - ? - QProjector::project_to_face (quad_face_support, 0) - : - QProjector::project_to_subface (quad_face_support, 0, subface); + ? + QProjector::project_to_face (quad_face_support, 0) + : + QProjector::project_to_subface (quad_face_support, 0, subface); for (unsigned int i=0; idofs_per_face; ++i) { const Point &p = subface_quadrature.point (i); @@ -995,35 +995,35 @@ face_to_cell_index (const unsigned int face_index, // face orientation, face flips, etc unsigned int adjusted_dof_index_on_line; switch (dim) - { - case 1: - Assert (false, ExcInternalError()); - - case 2: - // in 2d, only face_flip has a meaning. if it is set, consider - // dofs in reverse order - if (face_flip == false) + { + case 1: + Assert (false, ExcInternalError()); + + case 2: + // in 2d, only face_flip has a meaning. if it is set, consider + // dofs in reverse order + if (face_flip == false) + adjusted_dof_index_on_line = dof_index_on_line; + else + adjusted_dof_index_on_line = this->dofs_per_line - dof_index_on_line - 1; + break; + + case 3: + // in 3d, things are difficult. someone will have to think + // about how this code here should look like, by drawing a bunch + // of pictures of how all the faces can look like with the various + // flips and rotations. + // + // that said, the Q2 case is easy enough to implement, as is the case + // where everything is in standard orientation + Assert ((this->dofs_per_line <= 1) || + ((face_orientation == true) && + (face_flip == false) && + (face_rotation == false)), + ExcNotImplemented()); adjusted_dof_index_on_line = dof_index_on_line; - else - adjusted_dof_index_on_line = this->dofs_per_line - dof_index_on_line - 1; - break; - - case 3: - // in 3d, things are difficult. someone will have to think - // about how this code here should look like, by drawing a bunch - // of pictures of how all the faces can look like with the various - // flips and rotations. - // - // that said, the Q2 case is easy enough to implement, as is the case - // where everything is in standard orientation - Assert ((this->dofs_per_line <= 1) || - ((face_orientation == true) && - (face_flip == false) && - (face_rotation == false)), - ExcNotImplemented()); - adjusted_dof_index_on_line = dof_index_on_line; - break; - } + break; + } return (this->first_line_index + GeometryInfo::face_to_cell_lines(face, face_line, diff --git a/deal.II/source/fe/fe_system.cc b/deal.II/source/fe/fe_system.cc index 2b5e504a5e..bf70ec76a6 100644 --- a/deal.II/source/fe/fe_system.cc +++ b/deal.II/source/fe/fe_system.cc @@ -48,7 +48,7 @@ namespace template FESystem::InternalData::InternalData(const unsigned int n_base_elements, const bool compute_hessians) -: + : compute_hessians (compute_hessians), base_fe_datas(n_base_elements), base_fe_values_datas(n_base_elements) @@ -765,11 +765,11 @@ face_to_cell_index (const unsigned int face_dof_index, const unsigned int base_face_to_cell_index - = this->base_element(face_base_index.first.first).face_to_cell_index (face_base_index.second, - face, - face_orientation, - face_flip, - face_rotation); + = this->base_element(face_base_index.first.first).face_to_cell_index (face_base_index.second, + face, + face_orientation, + face_flip, + face_rotation); // it would be nice if we had a base_to_system_index function, but // all that exists is a component_to_system_index function. we can't do diff --git a/deal.II/source/fe/fe_tools.cc b/deal.II/source/fe/fe_tools.cc index 4ba84c5a43..b72d5a6671 100644 --- a/deal.II/source/fe/fe_tools.cc +++ b/deal.II/source/fe/fe_tools.cc @@ -390,7 +390,7 @@ namespace FETools start_indices[i] = k; k += block_data[i]; } - + for (unsigned int i=0; i diff --git a/deal.II/source/fe/fe_tools_interpolate.cc b/deal.II/source/fe/fe_tools_interpolate.cc index a1983255a1..eee88ee74b 100644 --- a/deal.II/source/fe/fe_tools_interpolate.cc +++ b/deal.II/source/fe/fe_tools_interpolate.cc @@ -52,9 +52,9 @@ DEAL_II_NAMESPACE_OPEN namespace FETools { template class DH1, - template class DH2, - class InVector, class OutVector> + template class DH1, + template class DH2, + class InVector, class OutVector> void interpolate(const DH1 &dof1, const InVector &u1, @@ -69,9 +69,9 @@ namespace FETools template class DH1, - template class DH2, - class InVector, class OutVector> + template class DH1, + template class DH2, + class InVector, class OutVector> void interpolate (const DH1 &dof1, const InVector &u1, @@ -314,8 +314,8 @@ namespace FETools template class DH, - class InVector, class OutVector, int spacedim> + template class DH, + class InVector, class OutVector, int spacedim> void back_interpolate(const DH &dof1, const InVector &u1, diff --git a/deal.II/source/fe/fe_values.cc b/deal.II/source/fe/fe_values.cc index 23534addf4..a027938320 100644 --- a/deal.II/source/fe/fe_values.cc +++ b/deal.II/source/fe/fe_values.cc @@ -3393,7 +3393,7 @@ namespace (typeid(*present_cell.get()) == typeid(Type))) { // call destructor of the old object - static_cast(present_cell.get())->~Type(); + static_cast(present_cell.get())->~Type(); // then construct a new object in-place new(const_cast(static_cast(present_cell.get()))) Type(new_cell); diff --git a/deal.II/source/fe/mapping_q.cc b/deal.II/source/fe/mapping_q.cc index eeb52d8a3a..afc17259d3 100644 --- a/deal.II/source/fe/mapping_q.cc +++ b/deal.II/source/fe/mapping_q.cc @@ -134,7 +134,7 @@ MappingQ::MappingQ (const unsigned int p, // Qp mapping of cells at the boundary. const QGaussLobatto<1> points(degree+1); tensor_pols = new TensorProductPolynomials - (Polynomials::generate_complete_Lagrange_basis(points.get_points())); + (Polynomials::generate_complete_Lagrange_basis(points.get_points())); Assert (n_shape_functions==tensor_pols->n(), ExcInternalError()); Assert(n_inner+n_outer==n_shape_functions, ExcInternalError()); @@ -468,8 +468,8 @@ MappingQ::set_laplace_on_quad_vector(Table<2,double> &loqvs) const double const *loqv_ptr=0; switch (degree) { - // for degree==1, we shouldn't have to compute any support points, since - // all of them are on the vertices + // for degree==1, we shouldn't have to compute any support points, since + // all of them are on the vertices case 2: { @@ -606,14 +606,14 @@ MappingQ::compute_laplace_vector(Table<2,double> &lvs) const for (unsigned int point=0; point::compute_laplace_vector(Table<2,double> &lvs) const for (unsigned int point=0; point S_1(n_inner); S_1.invert(S); diff --git a/deal.II/source/fe/mapping_q1.cc b/deal.II/source/fe/mapping_q1.cc index 32bc51a094..24c1fc8c8b 100644 --- a/deal.II/source/fe/mapping_q1.cc +++ b/deal.II/source/fe/mapping_q1.cc @@ -1705,7 +1705,7 @@ transform_real_to_unit_cell_internal // early out if we already have our point if (f.square() < 1e-24 * cell->diameter() * cell->diameter()) return p_unit; - + // we need to compare the position of the computed p(x) against the given // point 'p'. We will terminate the iteration and return 'x' if they are // less than eps apart. The question is how to choose eps -- or, put maybe @@ -1749,7 +1749,7 @@ transform_real_to_unit_cell_internal #ifdef DEBUG_TRANSFORM_REAL_TO_UNIT_CELL std::cout << "Newton iteration " << newton_iteration << std::endl; #endif - + // f'(x) Tensor<2,spacedim> df; for (unsigned int k=0; k 0.05) step_length /= 2; else - AssertThrow (false, - (typename Mapping::ExcTransformationFailed())); + AssertThrow (false, + (typename Mapping::ExcTransformationFailed())); } while (true); ++newton_iteration; if (newton_iteration > newton_iteration_limit) - AssertThrow (false, - (typename Mapping::ExcTransformationFailed())); + AssertThrow (false, + (typename Mapping::ExcTransformationFailed())); last_f_weighted_norm = (df_inverse * f).norm(); } while (last_f_weighted_norm > eps); - + return p_unit; } diff --git a/deal.II/source/grid/grid_generator.cc b/deal.II/source/grid/grid_generator.cc index 158ef79423..0fc9d742a3 100644 --- a/deal.II/source/grid/grid_generator.cc +++ b/deal.II/source/grid/grid_generator.cc @@ -731,12 +731,12 @@ namespace GridGenerator switch (dim) { - // A line (1d parallelepiped) + // A line (1d parallelepiped) case 1: vertices[1] = corners[0]; break; - // A parallelogram (2d parallelepiped) + // A parallelogram (2d parallelepiped) case 2: // assign corners to vertices: vertices[1] = corners[0]; @@ -746,7 +746,7 @@ namespace GridGenerator vertices[3] = vertices[1] + vertices[2]; break; - // A parallelepiped (3d parallelepiped) + // A parallelepiped (3d parallelepiped) case 3: // assign corners to vertices: vertices[1] = corners[0]; @@ -2500,8 +2500,8 @@ namespace GridGenerator // Determine number of cells and vertices const unsigned int n_cells = static_cast(std::ceil (half_length / - std::max (radius_0, - radius_1))); + std::max (radius_0, + radius_1))); const unsigned int n_vertices = 4 * (n_cells + 1); std::vector > vertices_tmp(n_vertices); diff --git a/deal.II/source/grid/grid_in.cc b/deal.II/source/grid/grid_in.cc index e61de813d6..c41f034ca3 100644 --- a/deal.II/source/grid/grid_in.cc +++ b/deal.II/source/grid/grid_in.cc @@ -63,7 +63,7 @@ void GridIn::read_vtk(std::istream &in) text[2] = "ASCII"; text[3] = "DATASET UNSTRUCTURED_GRID"; - for(unsigned int i = 0;i < 4;i++)//Checking for the match between initial strings/text in the file. + for (unsigned int i = 0; i < 4; i++) //Checking for the match between initial strings/text in the file. { getline(in,line); @@ -95,15 +95,15 @@ void GridIn::read_vtk(std::istream &in) in>>no_vertices;// taking the no. of vertices in.ignore(256, '\n');//ignoring the number beside the total no. of points. - for(unsigned int count = 0; count < no_vertices; count++)//loop to read three values till the no . vertices is satisfied + for (unsigned int count = 0; count < no_vertices; count++) //loop to read three values till the no . vertices is satisfied { - // VTK format always specifies vertex coordinates with 3 components - Point<3> x; + // VTK format always specifies vertex coordinates with 3 components + Point<3> x; in >> x(0) >> x(1) >> x(2); vertices.push_back(Point()); - for (unsigned int d=0; d::read_vtk(std::istream &in) if (dim == 3) { - for(unsigned int count = 0; count < total_cells; count++) + for (unsigned int count = 0; count < total_cells; count++) { in>>type; - if(type == 8) + if (type == 8) { cells.push_back(CellData()); - for(j = 0; j < type; j++)//loop to feed data + for (j = 0; j < type; j++) //loop to feed data in >> cells.back().vertices[j]; cells.back().material_id = 0; - for(j = 0; j < type; j++)//loop to feed the data of the vertices to the cell + for (j = 0; j < type; j++) //loop to feed the data of the vertices to the cell { cells.back().vertices[j] = vertex_indices[cells.back().vertices[j]]; } @@ -171,12 +171,12 @@ void GridIn::read_vtk(std::istream &in) subcelldata.boundary_quads.push_back(CellData<2>()); int no_quads = 0; - for(j = 0; j < type; j++)//loop to feed the data to the boundary + for (j = 0; j < type; j++) //loop to feed the data to the boundary { in >> subcelldata.boundary_quads.back().vertices[j]; } subcelldata.boundary_quads.back().material_id = 0; - for(unsigned int j = 0; j < type; j++) + for (unsigned int j = 0; j < type; j++) { subcelldata.boundary_quads.back().vertices[j] = vertex_indices[subcelldata.boundary_quads.back().vertices[j]]; } @@ -192,20 +192,20 @@ void GridIn::read_vtk(std::istream &in) else if (dim == 2) { - for(unsigned int count = 0; count < total_cells; count++) + for (unsigned int count = 0; count < total_cells; count++) { in>>type; - if(type == 4) + if (type == 4) { cells.push_back(CellData()); - for(j = 0; j < type; j++)//loop to feed data + for (j = 0; j < type; j++) //loop to feed data in >> cells.back().vertices[j]; cells.back().material_id = 0; - for(j = 0; j < type; j++)//loop to feed the data of the vertices to the cell + for (j = 0; j < type; j++) //loop to feed the data of the vertices to the cell { cells.back().vertices[j] = vertex_indices[cells.back().vertices[j]]; } @@ -213,19 +213,19 @@ void GridIn::read_vtk(std::istream &in) no_cells++; } - else if(type == 2) + else if (type == 2) { //If this is encountered, the pointer comes out of the loop //and starts processing boundaries. subcelldata.boundary_lines.push_back(CellData<1>()); int no_lines = 0; - for(j = 0; j < type; j++)//loop to feed the data to the boundary + for (j = 0; j < type; j++) //loop to feed the data to the boundary { in >> subcelldata.boundary_lines.back().vertices[j]; } subcelldata.boundary_lines.back().material_id = 0; - for(unsigned int j = 0; j < type; j++) + for (unsigned int j = 0; j < type; j++) { subcelldata.boundary_lines.back().vertices[j] = vertex_indices[subcelldata.boundary_lines.back().vertices[j]]; } @@ -250,10 +250,10 @@ void GridIn::read_vtk(std::istream &in) { in.ignore(256, '\n'); - while(!in.eof()) + while (!in.eof()) { in>>keyword_3; - if(std::strcmp(keyword_3,"12") && std::strcmp(keyword_3,"9")) + if (std::strcmp(keyword_3,"12") && std::strcmp(keyword_3,"9")) { break; } @@ -274,11 +274,11 @@ void GridIn::read_vtk(std::istream &in) in.ignore(256, '\n'); - for(unsigned int i = 0;i < 2;i++) + for (unsigned int i = 0; i < 2; i++) { getline(in,linenew); - if(linenew.compare(textnew[i]) == 0) + if (linenew.compare(textnew[i]) == 0) {} else AssertThrow (false, @@ -286,7 +286,7 @@ void GridIn::read_vtk(std::istream &in) textnew[i] + "> section")); } - for(unsigned int i = 0; i < no_cells; i++)//assigning IDs to cells. + for (unsigned int i = 0; i < no_cells; i++) //assigning IDs to cells. { int id; in>>id; @@ -295,7 +295,7 @@ void GridIn::read_vtk(std::istream &in) if (dim == 3) { - for(unsigned int i = 0; i < no_quads; i++)//assigning IDs to bounds. + for (unsigned int i = 0; i < no_quads; i++) //assigning IDs to bounds. { int id; in>>id; @@ -304,7 +304,7 @@ void GridIn::read_vtk(std::istream &in) } else if (dim == 2) { - for(unsigned int i = 0; i < no_lines; i++)//assigning IDs to bounds. + for (unsigned int i = 0; i < no_lines; i++) //assigning IDs to bounds. { int id; in>>id; @@ -323,9 +323,9 @@ void GridIn::read_vtk(std::istream &in) cells, subcelldata); - if(dim == spacedim) + if (dim == spacedim) GridReordering::invert_all_cells_of_negative_grid(vertices, - cells); + cells); GridReordering::reorder_cells(cells); tria->create_triangulation_compatibility(vertices, @@ -2642,8 +2642,8 @@ void GridIn::read (std::istream &in, return; case vtk: - read_vtk (in); - return; + read_vtk (in); + return; case unv: read_unv (in); diff --git a/deal.II/source/grid/grid_out.cc b/deal.II/source/grid/grid_out.cc index c110dcfdc8..edf857458e 100644 --- a/deal.II/source/grid/grid_out.cc +++ b/deal.II/source/grid/grid_out.cc @@ -687,7 +687,7 @@ void GridOut::write_dx (const Triangulation &tria, for (unsigned int i=0; i(p)); + ExcPointNotFound(p)); return best_cell; } @@ -1105,7 +1105,7 @@ next_cell: } AssertThrow (best_cell.first.state() == IteratorState::valid, - ExcPointNotFound(p)); + ExcPointNotFound(p)); return best_cell; } @@ -1136,7 +1136,7 @@ next_cell: // pointer/index clashes when saving/restoring them. The following approach // works, but this map can get quite big. Not sure about more efficient solutions. std::map< std::pair, unsigned int > - indexmap; + indexmap; unsigned int index = 0; for (typename Triangulation::active_cell_iterator cell = triangulation.begin_active(); @@ -1171,7 +1171,7 @@ next_cell: (cell->neighbor(f)->has_children() == false)) { unsigned int other_index = indexmap.find( - std::pair(cell->neighbor(f)->level(),cell->neighbor(f)->index()))->second; + std::pair(cell->neighbor(f)->level(),cell->neighbor(f)->index()))->second; cell_connectivity.add (index, other_index); cell_connectivity.add (other_index, index); } @@ -2369,12 +2369,12 @@ next_cell: */ template void - match_periodic_face_pairs - (std::set > &pairs1, - std::set::type, unsigned int> > &pairs2, - const int direction, - std::vector > & matched_pairs, - const dealii::Tensor<1,CellIterator::AccessorType::space_dimension> &offset) + match_periodic_face_pairs + (std::set > &pairs1, + std::set::type, unsigned int> > &pairs2, + const int direction, + std::vector > &matched_pairs, + const dealii::Tensor<1,CellIterator::AccessorType::space_dimension> &offset) { static const int space_dim = CellIterator::AccessorType::space_dimension; Assert (0<=direction && direction orientation; typedef typename std::set - >::const_iterator PairIterator; + >::const_iterator PairIterator; for (PairIterator it1 = pairs1.begin(); it1 != pairs1.end(); ++it1) { for (PairIterator it2 = pairs2.begin(); it2 != pairs2.end(); ++it2) @@ -2406,7 +2406,7 @@ next_cell: // remove the matched cell in pairs2 to speed up the // matching: const PeriodicFacePair matched_face - = {{cell1, cell2},{face_idx1, face_idx2}, orientation}; + = {{cell1, cell2},{face_idx1, face_idx2}, orientation}; matched_pairs.push_back(matched_face); pairs2.erase(it2); ++n_matches; @@ -2425,12 +2425,12 @@ next_cell: template void collect_periodic_faces - (const CONTAINER &container, - const types::boundary_id b_id1, - const types::boundary_id b_id2, - const int direction, - std::vector > & matched_pairs, - const dealii::Tensor<1,CONTAINER::space_dimension> &offset) + (const CONTAINER &container, + const types::boundary_id b_id1, + const types::boundary_id b_id2, + const int direction, + std::vector > &matched_pairs, + const dealii::Tensor<1,CONTAINER::space_dimension> &offset) { static const int dim = CONTAINER::dimension; static const int space_dim = CONTAINER::space_dimension; @@ -2450,18 +2450,18 @@ next_cell: { const typename CONTAINER::face_iterator face = cell->face(i); if (face->at_boundary() && face->boundary_indicator() == b_id1) - { - const std::pair pair1 - = std::make_pair(cell, i); - pairs1.insert(pair1); - } + { + const std::pair pair1 + = std::make_pair(cell, i); + pairs1.insert(pair1); + } if (face->at_boundary() && face->boundary_indicator() == b_id2) - { - const std::pair pair2 - = std::make_pair(cell, i); - pairs2.insert(pair2); - } + { + const std::pair pair2 + = std::make_pair(cell, i); + pairs2.insert(pair2); + } } } @@ -2477,11 +2477,11 @@ next_cell: template void collect_periodic_faces - (const CONTAINER &container, - const types::boundary_id b_id, - const int direction, - std::vector > & matched_pairs, - const dealii::Tensor<1,CONTAINER::space_dimension> &offset) + (const CONTAINER &container, + const types::boundary_id b_id, + const int direction, + std::vector > &matched_pairs, + const dealii::Tensor<1,CONTAINER::space_dimension> &offset) { static const int dim = CONTAINER::dimension; static const int space_dim = CONTAINER::space_dimension; @@ -2499,24 +2499,24 @@ next_cell: for (typename CONTAINER::cell_iterator cell = container.begin(0); cell != container.end(0); ++cell) - { - const typename CONTAINER::face_iterator face_1 = cell->face(2*direction); - const typename CONTAINER::face_iterator face_2 = cell->face(2*direction+1); - - if (face_1->at_boundary() && face_1->boundary_indicator() == b_id) - { - const std::pair pair1 - = std::make_pair(cell, 2*direction); - pairs1.insert(pair1); - } - - if (face_2->at_boundary() && face_2->boundary_indicator() == b_id) - { - const std::pair pair2 - = std::make_pair(cell, 2*direction+1); - pairs2.insert(pair2); - } - } + { + const typename CONTAINER::face_iterator face_1 = cell->face(2*direction); + const typename CONTAINER::face_iterator face_2 = cell->face(2*direction+1); + + if (face_1->at_boundary() && face_1->boundary_indicator() == b_id) + { + const std::pair pair1 + = std::make_pair(cell, 2*direction); + pairs1.insert(pair1); + } + + if (face_2->at_boundary() && face_2->boundary_indicator() == b_id) + { + const std::pair pair2 + = std::make_pair(cell, 2*direction+1); + pairs2.insert(pair2); + } + } Assert (pairs1.size() == pairs2.size(), ExcMessage ("Unmatched faces on periodic boundaries")); @@ -2525,21 +2525,21 @@ next_cell: #ifdef DEBUG const unsigned int size_old = matched_pairs.size(); #endif - - // and call match_periodic_face_pairs that does the actual matching: + + // and call match_periodic_face_pairs that does the actual matching: match_periodic_face_pairs(pairs1, pairs2, direction, matched_pairs, offset); #ifdef DEBUG //check for standard orientation const unsigned int size_new = matched_pairs.size(); for (unsigned int i = size_old; i < size_new; ++i) - { - Assert(matched_pairs[i].orientation == 1, - ExcMessage("Found a face match with non standard orientation. " - "This function is only suitable for meshes with cells " - "in default orientation")); - } -#endif + { + Assert(matched_pairs[i].orientation == 1, + ExcMessage("Found a face match with non standard orientation. " + "This function is only suitable for meshes with cells " + "in default orientation")); + } +#endif } diff --git a/deal.II/source/grid/tria_boundary.cc b/deal.II/source/grid/tria_boundary.cc index 65b3bafe7b..098f82b776 100644 --- a/deal.II/source/grid/tria_boundary.cc +++ b/deal.II/source/grid/tria_boundary.cc @@ -264,7 +264,7 @@ get_line_support_points (const unsigned int n_intermediate_points) const if (points[n_intermediate_points].get() == 0) { std_cxx1x::shared_ptr > - quadrature (new QGaussLobatto<1>(n_intermediate_points+2)); + quadrature (new QGaussLobatto<1>(n_intermediate_points+2)); points[n_intermediate_points] = quadrature; } } diff --git a/deal.II/source/grid/tria_boundary_lib.cc b/deal.II/source/grid/tria_boundary_lib.cc index 1cbd41c77a..0043e63e3b 100644 --- a/deal.II/source/grid/tria_boundary_lib.cc +++ b/deal.II/source/grid/tria_boundary_lib.cc @@ -963,8 +963,8 @@ get_new_point_on_line (const typename Triangulation::line_iterator &line) c { switch (dim) { - // in 2d, first check whether the two end points of the line are on the - // axis of symmetry. if so, then return the mid point + // in 2d, first check whether the two end points of the line are on the + // axis of symmetry. if so, then return the mid point case 2: { if ((line->vertex(0)(0) == this->center(0)) @@ -1083,8 +1083,8 @@ get_intermediate_points_on_line (const typename Triangulation::line_iterato { switch (dim) { - // in 2d, first check whether the two end points of the line are on the - // axis of symmetry. if so, then return the mid point + // in 2d, first check whether the two end points of the line are on the + // axis of symmetry. if so, then return the mid point case 2: { if ((line->vertex(0)(0) == this->center(0)) diff --git a/deal.II/source/grid/tria_objects.cc b/deal.II/source/grid/tria_objects.cc index e3358d6c58..2a26ec1c83 100644 --- a/deal.II/source/grid/tria_objects.cc +++ b/deal.II/source/grid/tria_objects.cc @@ -193,9 +193,9 @@ namespace internal } // first reserve, then resize. Otherwise the std library can decide to allocate - // more entries. - boundary_or_material_id.reserve (new_size); - boundary_or_material_id.resize (new_size); + // more entries. + boundary_or_material_id.reserve (new_size); + boundary_or_material_id.resize (new_size); user_data.reserve (new_size); user_data.resize (new_size); } @@ -269,10 +269,10 @@ namespace internal 4*new_size-children.size(), -1); - // for the following two fields, we know exactly how many elements - // we need, so first reserve then resize (resize itself, at least - // with some compiler libraries, appears to round up the size it - // actually reserves) + // for the following two fields, we know exactly how many elements + // we need, so first reserve then resize (resize itself, at least + // with some compiler libraries, appears to round up the size it + // actually reserves) boundary_or_material_id.reserve (new_size); boundary_or_material_id.resize (new_size); diff --git a/deal.II/source/hp/dof_handler.cc b/deal.II/source/hp/dof_handler.cc index fa6d95cadd..85a37b7aac 100644 --- a/deal.II/source/hp/dof_handler.cc +++ b/deal.II/source/hp/dof_handler.cc @@ -543,7 +543,7 @@ namespace internal active_fe_backup(dof_handler.levels.size ()); for (unsigned int level = 0; levelactive_fe_indices, - active_fe_backup[level]); + active_fe_backup[level]); // delete all levels and set them up // newly, since vectors are @@ -870,7 +870,7 @@ namespace internal // non-invalid value later on dof_handler.faces->lines.dof_offsets = std::vector (dof_handler.tria->n_raw_lines(), - (unsigned int)(-1)); + (unsigned int)(-1)); dof_handler.faces->lines.dofs = std::vector (n_line_slots, DoFHandler::invalid_dof_index); @@ -1250,8 +1250,8 @@ namespace internal { dof_handler.faces->quads.dof_offsets = std::vector - (dof_handler.tria->n_raw_quads(), - (unsigned int)(-1)); + (dof_handler.tria->n_raw_quads(), + (unsigned int)(-1)); dof_handler.faces->quads.dofs = std::vector (n_quad_slots, DoFHandler::invalid_dof_index); @@ -1992,7 +1992,7 @@ namespace hp dofs_on_face.resize (dofs_per_face); cell->face(f)->get_dof_indices (dofs_on_face, - cell->active_fe_index()); + cell->active_fe_index()); for (unsigned int i=0; i(), ExcInternalError()); @@ -88,12 +88,12 @@ namespace internal // find the next cell active on this level unsigned int next_cell = cell+1; while ((next_cell(), ExcInternalError()); @@ -172,12 +172,12 @@ namespace internal // find the next cell active on this level unsigned int next_cell = cell+1; while ((next_cell &indices) const { const unsigned int indices_size = indices.size(); - const std::vector > * line_ptr; + const std::vector > *line_ptr; for (unsigned int i=0; iset_context (solver_data->eps); - - // set target eigenvalues to solve for - ierr = EPSSetTarget (solver_data->eps, target_eigenvalue); - AssertThrow (ierr == 0, ExcSLEPcError(ierr)); + // set transformation type if any + transformation->set_context (solver_data->eps); + + // set target eigenvalues to solve for + ierr = EPSSetTarget (solver_data->eps, target_eigenvalue); + AssertThrow (ierr == 0, ExcSLEPcError(ierr)); } // set which portion of the eigenspectrum to solve for @@ -195,7 +195,7 @@ namespace SLEPcWrappers // get number of converged eigenstates ierr = EPSGetConverged (solver_data->eps, - reinterpret_cast(n_converged)); + reinterpret_cast(n_converged)); AssertThrow (ierr == 0, ExcSLEPcError(ierr)); PetscInt n_iterations = 0; @@ -211,10 +211,10 @@ namespace SLEPcWrappers // get the residual norm of the most extreme eigenvalue if and // only if at least one eigenvector has converged. if ((*n_converged)>0) - { - ierr = EPSComputeResidualNorm (solver_data->eps, 0, &residual_norm); - AssertThrow (ierr == 0, ExcSLEPcError(ierr)); - } + { + ierr = EPSComputeResidualNorm (solver_data->eps, 0, &residual_norm); + AssertThrow (ierr == 0, ExcSLEPcError(ierr)); + } // check the solver state const SolverControl::State state diff --git a/deal.II/source/lac/solver_control.cc b/deal.II/source/lac/solver_control.cc index 6eab7e4d4f..41ad2ca9eb 100644 --- a/deal.II/source/lac/solver_control.cc +++ b/deal.II/source/lac/solver_control.cc @@ -312,7 +312,7 @@ IterationNumberControl::IterationNumberControl(const unsigned int n, const bool m_log_history, const bool m_log_result) : - SolverControl (n, tolerance, m_log_history, m_log_result){} + SolverControl (n, tolerance, m_log_history, m_log_result) {} IterationNumberControl::~IterationNumberControl() diff --git a/deal.II/source/lac/sparse_direct.cc b/deal.II/source/lac/sparse_direct.cc index 4333b64fa1..77cdb3bd1f 100644 --- a/deal.II/source/lac/sparse_direct.cc +++ b/deal.II/source/lac/sparse_direct.cc @@ -514,7 +514,7 @@ SparseDirectMUMPS::~SparseDirectMUMPS () template void SparseDirectMUMPS::initialize_matrix (const Matrix &matrix) { - Assert(matrix.n() == matrix.m(), ExcMessage("Matrix needs to be square.")); + Assert(matrix.n() == matrix.m(), ExcMessage("Matrix needs to be square.")); // Check we haven't been here before: diff --git a/deal.II/source/lac/sparsity_tools.cc b/deal.II/source/lac/sparsity_tools.cc index 066aa09a9b..57a04430c0 100644 --- a/deal.II/source/lac/sparsity_tools.cc +++ b/deal.II/source/lac/sparsity_tools.cc @@ -506,130 +506,130 @@ namespace SparsityTools } -template -void distribute_sparsity_pattern(CSP_t &csp, + template + void distribute_sparsity_pattern(CSP_t &csp, const std::vector &owned_set_per_cpu, const MPI_Comm &mpi_comm, const IndexSet &myrange) -{ - size_type myid = Utilities::MPI::this_mpi_process(mpi_comm); + { + size_type myid = Utilities::MPI::this_mpi_process(mpi_comm); - typedef std::map > map_vec_t; - map_vec_t send_data; + typedef std::map > map_vec_t; + map_vec_t send_data; - { - unsigned int dest_cpu=0; + { + unsigned int dest_cpu=0; - size_type n_local_rel_rows = myrange.n_elements(); - for (size_type row_idx=0; row_idx &dst = send_data[dest_cpu]; + //save entries + std::vector &dst = send_data[dest_cpu]; - dst.push_back(rlen); // number of entries - dst.push_back(row); // row index - for (size_type c=0; c send_to; - send_to.reserve(send_data.size()); - for (map_vec_t::iterator it=send_data.begin(); it!=send_data.end(); ++it) - send_to.push_back(it->first); - - num_receive = - Utilities::MPI:: - compute_point_to_point_communication_pattern(mpi_comm, send_to).size(); - } + unsigned int num_receive=0; + { + std::vector send_to; + send_to.reserve(send_data.size()); + for (map_vec_t::iterator it=send_data.begin(); it!=send_data.end(); ++it) + send_to.push_back(it->first); - std::vector requests(send_data.size()); + num_receive = + Utilities::MPI:: + compute_point_to_point_communication_pattern(mpi_comm, send_to).size(); + } + std::vector requests(send_data.size()); - // send data - { - unsigned int idx=0; - for (map_vec_t::iterator it=send_data.begin(); it!=send_data.end(); ++it, ++idx) - MPI_Isend(&(it->second[0]), - it->second.size(), - DEAL_II_DOF_INDEX_MPI_TYPE, - it->first, - 124, - mpi_comm, - &requests[idx]); - } + + // send data + { + unsigned int idx=0; + for (map_vec_t::iterator it=send_data.begin(); it!=send_data.end(); ++it, ++idx) + MPI_Isend(&(it->second[0]), + it->second.size(), + DEAL_II_DOF_INDEX_MPI_TYPE, + it->first, + 124, + mpi_comm, + &requests[idx]); + } //TODO: In the following, we read individual bytes and then reinterpret them // as size_type objects. this is error prone. use properly typed reads that // match the write above - { - //receive - std::vector recv_buf; - for (unsigned int index=0; index recv_buf; + for (unsigned int index=0; index::const_iterator ptr = recv_buf.begin(); + std::vector::const_iterator end = recv_buf.end(); + while (ptr+1::const_iterator ptr = recv_buf.begin(); - std::vector::const_iterator end = recv_buf.end(); - while (ptr+1 (BlockCompressedSimpleSparsityPattern &csp, - const std::vector &owned_set_per_cpu, - const MPI_Comm &mpi_comm, - const IndexSet &myrange); + const std::vector &owned_set_per_cpu, + const MPI_Comm &mpi_comm, + const IndexSet &myrange); #endif diff --git a/deal.II/source/lac/trilinos_block_vector.cc b/deal.II/source/lac/trilinos_block_vector.cc index 7344ec1199..a0f645a3fe 100644 --- a/deal.II/source/lac/trilinos_block_vector.cc +++ b/deal.II/source/lac/trilinos_block_vector.cc @@ -62,7 +62,7 @@ namespace TrilinosWrappers // we only allow assignment to vectors with the same number of blocks // or to an empty BlockVector Assert (n_blocks() == 0 || n_blocks() == v.n_blocks(), - ExcDimensionMismatch(n_blocks(), v.n_blocks())); + ExcDimensionMismatch(n_blocks(), v.n_blocks())); if (this->n_blocks() != v.n_blocks()) reinit(v.n_blocks()); diff --git a/deal.II/source/lac/trilinos_precondition.cc b/deal.II/source/lac/trilinos_precondition.cc index a014bdd2f3..d939607b0c 100644 --- a/deal.II/source/lac/trilinos_precondition.cc +++ b/deal.II/source/lac/trilinos_precondition.cc @@ -750,7 +750,7 @@ namespace TrilinosWrappers /* -------------------------- PreconditionAMG -------------------------- */ - void + void PreconditionIdentity::vmult(VectorBase &dst, const VectorBase &src) const { @@ -764,7 +764,7 @@ namespace TrilinosWrappers dst = src; } - void + void PreconditionIdentity::vmult(dealii::Vector &dst, const dealii::Vector &src) const { diff --git a/deal.II/source/lac/trilinos_solver.cc b/deal.II/source/lac/trilinos_solver.cc index 6eb7ae8567..7d206765fd 100644 --- a/deal.II/source/lac/trilinos_solver.cc +++ b/deal.II/source/lac/trilinos_solver.cc @@ -208,15 +208,15 @@ namespace TrilinosWrappers Assert (false, ExcNotImplemented()); } - // Introduce the preconditioner, + // Introduce the preconditioner, // if the identity preconditioner is used, // the precondioner is set to none, ... if (preconditioner.preconditioner.use_count()!=0) - { - ierr = solver.SetPrecOperator (const_cast - (preconditioner.preconditioner.get())); - AssertThrow (ierr == 0, ExcTrilinosError(ierr)); - } + { + ierr = solver.SetPrecOperator (const_cast + (preconditioner.preconditioner.get())); + AssertThrow (ierr == 0, ExcTrilinosError(ierr)); + } else solver.SetAztecOption(AZ_precond,AZ_none); diff --git a/deal.II/source/multigrid/mg_tools.cc b/deal.II/source/multigrid/mg_tools.cc index 5d74887ef2..a9da2451be 100644 --- a/deal.II/source/multigrid/mg_tools.cc +++ b/deal.II/source/multigrid/mg_tools.cc @@ -1336,17 +1336,17 @@ namespace MGTools : (dim == 2 ? (i<2*fe.dofs_per_vertex ? i : i+2*fe.dofs_per_vertex) + : + (dim == 3 ? + (i<4*fe.dofs_per_vertex ? + i : - (dim == 3 ? - (i<4*fe.dofs_per_vertex ? - i - : - (i<4*fe.dofs_per_vertex+4*fe.dofs_per_line ? - i+4*fe.dofs_per_vertex - : - i+4*fe.dofs_per_vertex+8*fe.dofs_per_line)) + (i<4*fe.dofs_per_vertex+4*fe.dofs_per_line ? + i+4*fe.dofs_per_vertex : - numbers::invalid_unsigned_int))); + i+4*fe.dofs_per_vertex+8*fe.dofs_per_line)) + : + numbers::invalid_unsigned_int))); Assert (cell_i < fe.dofs_per_cell, ExcInternalError()); // make sure @@ -1394,7 +1394,7 @@ namespace MGTools const typename FunctionMap::type &function_map, std::vector &boundary_indices, const ComponentMask &component_mask) -{ + { Assert (boundary_indices.size() == dof.get_tria().n_global_levels(), ExcDimensionMismatch (boundary_indices.size(), dof.get_tria().n_global_levels())); diff --git a/deal.II/source/numerics/data_out.cc b/deal.II/source/numerics/data_out.cc index d242eaa816..546d89a217 100644 --- a/deal.II/source/numerics/data_out.cc +++ b/deal.II/source/numerics/data_out.cc @@ -294,7 +294,7 @@ build_one_patch (const std::pair *cell_and_index, } const unsigned int patch_idx = - (*data.cell_to_patch_index_map)[cell_and_index->first->level()][cell_and_index->first->index()]; + (*data.cell_to_patch_index_map)[cell_and_index->first->level()][cell_and_index->first->index()]; // did we mess up the indices? Assert(patch_idx < patches.size(), ExcInternalError()); @@ -373,13 +373,13 @@ void DataOut::build_patches (const Mappingtriangulation->end(); - cell = next_locally_owned_cell(cell)) + cell = next_locally_owned_cell(cell)) { // move forward until active_cell points at the cell (cell) we are looking // at to compute the current active_index while (active_cell!=this->triangulation->end() - && cell->active() - && active_cell_iterator(cell) != active_cell) + && cell->active() + && active_cell_iterator(cell) != active_cell) { ++active_cell; ++active_index; @@ -392,7 +392,7 @@ void DataOut::build_patches (const Mappinglevel()].size(), ExcInternalError()); Assert (active_index < this->triangulation->n_active_cells(), - ExcInternalError()); + ExcInternalError()); cell_to_patch_index_map[cell->level()][cell->index()] = all_cells.size(); all_cells.push_back (std::make_pair(cell, active_index)); @@ -451,18 +451,18 @@ void DataOut::build_patches (const Mapping::build_one_patch, this, std_cxx1x::_1, std_cxx1x::_2, std_cxx1x::_3, curved_cell_region,std_cxx1x::ref(this->patches)), - // no copy-local-to-global function needed here - std_cxx1x::function &)>(), + // no copy-local-to-global function needed here + std_cxx1x::function &)>(), thread_data, sample_patch, - // experimenting shows that we can make things run a bit - // faster if we increase the number of cells we work on - // per item (i.e., WorkStream's chunk_size argument, - // about 10% improvement) and the items in flight at any - // given time (another 5% on the testcase discussed in - // @ref workstream_paper, on 32 cores) and if - 8*multithread_info.n_threads(), - 64); + // experimenting shows that we can make things run a bit + // faster if we increase the number of cells we work on + // per item (i.e., WorkStream's chunk_size argument, + // about 10% improvement) and the items in flight at any + // given time (another 5% on the testcase discussed in + // @ref workstream_paper, on 32 cores) and if + 8*multithread_info.n_threads(), + 64); } @@ -483,7 +483,7 @@ DataOut::next_cell (const typename DataOut::cell_iterator &cell) // convert the iterator to an active_iterator and advance this to the next // active cell typename Triangulation:: - active_cell_iterator active_cell = cell; + active_cell_iterator active_cell = cell; ++active_cell; return active_cell; } @@ -495,7 +495,7 @@ typename DataOut::cell_iterator DataOut::first_locally_owned_cell () { typename DataOut::cell_iterator - cell = first_cell(); + cell = first_cell(); // skip cells if the current one has no children (is active) and is a ghost // or artificial cell diff --git a/deal.II/source/numerics/data_out_dof_data.cc b/deal.II/source/numerics/data_out_dof_data.cc index 37ff85b983..db456bc6eb 100644 --- a/deal.II/source/numerics/data_out_dof_data.cc +++ b/deal.II/source/numerics/data_out_dof_data.cc @@ -68,7 +68,7 @@ namespace internal if (use_face_values == false) { dealii::hp::QCollection - quadrature(QIterated(QTrapez<1>(), n_subdivisions)); + quadrature(QIterated(QTrapez<1>(), n_subdivisions)); n_q_points = quadrature[0].size(); x_fe_values.resize(this->finite_elements.size()); for (unsigned int i=0; ifinite_elements.size(); ++i) @@ -93,7 +93,7 @@ namespace internal else { dealii::hp::QCollection - quadrature(QIterated(QTrapez<1>(), n_subdivisions)); + quadrature(QIterated(QTrapez<1>(), n_subdivisions)); n_q_points = quadrature[0].size(); x_fe_face_values.resize(this->finite_elements.size()); for (unsigned int i=0; ifinite_elements.size(); ++i) @@ -157,7 +157,7 @@ namespace internal { Assert(data.x_fe_face_values.empty() == true, ExcInternalError()); dealii::hp::QCollection - quadrature(QIterated(QTrapez<1>(), n_subdivisions)); + quadrature(QIterated(QTrapez<1>(), n_subdivisions)); x_fe_values.resize(this->finite_elements.size()); for (unsigned int i=0; ifinite_elements.size(); ++i) { @@ -181,7 +181,7 @@ namespace internal else { dealii::hp::QCollection - quadrature(QIterated(QTrapez<1>(), n_subdivisions)); + quadrature(QIterated(QTrapez<1>(), n_subdivisions)); x_fe_face_values.resize(this->finite_elements.size()); for (unsigned int i=0; ifinite_elements.size(); ++i) { @@ -631,7 +631,7 @@ namespace internal template + int patch_dim, int patch_space_dim> DataOut_DoFData::DataOut_DoFData () : triangulation(0,typeid(*this).name()), @@ -677,7 +677,7 @@ attach_triangulation (const Triangulation &tr template + int patch_dim, int patch_space_dim> template void DataOut_DoFData:: @@ -715,7 +715,7 @@ add_data_vector (const VECTOR &vec, template + int patch_dim, int patch_space_dim> template void DataOut_DoFData:: @@ -783,7 +783,7 @@ add_data_vector (const VECTOR &vec, template + int patch_dim, int patch_space_dim> template void DataOut_DoFData:: @@ -810,7 +810,7 @@ add_data_vector (const VECTOR &vec, template + int patch_dim, int patch_space_dim> template void DataOut_DoFData:: @@ -833,7 +833,7 @@ add_data_vector (const DH &dof_handler, template + int patch_dim, int patch_space_dim> template void DataOut_DoFData:: @@ -866,7 +866,7 @@ add_data_vector (const DH &dof_handler, template + int patch_dim, int patch_space_dim> template void DataOut_DoFData:: @@ -906,7 +906,7 @@ add_data_vector (const DH &dof_handler, template + int patch_dim, int patch_space_dim> void DataOut_DoFData::clear_data_vectors () { dof_data.erase (dof_data.begin(), dof_data.end()); @@ -920,7 +920,7 @@ void DataOut_DoFData::clear_data_vectors () template + int patch_dim, int patch_space_dim> void DataOut_DoFData:: clear_input_data_references () @@ -938,7 +938,7 @@ clear_input_data_references () template + int patch_dim, int patch_space_dim> void DataOut_DoFData::clear () { @@ -956,7 +956,7 @@ DataOut_DoFData::clear () template + int patch_dim, int patch_space_dim> std::vector DataOut_DoFData:: get_dataset_names () const @@ -984,7 +984,7 @@ get_dataset_names () const template + int patch_dim, int patch_space_dim> std::vector > DataOut_DoFData::get_vector_data_ranges () const { @@ -1078,7 +1078,7 @@ DataOut_DoFData::get_vector_data_ranges () const template + int patch_dim, int patch_space_dim> const std::vector< dealii::DataOutBase::Patch > & DataOut_DoFData::get_patches () const { @@ -1088,14 +1088,14 @@ DataOut_DoFData::get_patches () const template + int patch_dim, int patch_space_dim> std::vector > > DataOut_DoFData::get_finite_elements() const { const unsigned int dhdim = DH::dimension; const unsigned int dhspacedim = DH::space_dimension; std::vector > > - finite_elements(this->dof_data.size()); + finite_elements(this->dof_data.size()); for (unsigned int i=0; idof_data.size(); ++i) { Assert (dof_data[i]->dof_handler != 0, ExcNoDoFHandlerSelected ()); @@ -1129,7 +1129,7 @@ DataOut_DoFData::get_finite_elements() const template + int patch_dim, int patch_space_dim> std::size_t DataOut_DoFData::memory_consumption () const { diff --git a/deal.II/source/numerics/data_out_rotation.cc b/deal.II/source/numerics/data_out_rotation.cc index 5082a83008..82464c5557 100644 --- a/deal.II/source/numerics/data_out_rotation.cc +++ b/deal.II/source/numerics/data_out_rotation.cc @@ -187,7 +187,7 @@ build_one_patch (const cell_iterator *cell, // first fill dof_data for (unsigned int dataset=0; datasetdof_data.size(); ++dataset) { - const FEValuesBase & fe_patch_values + const FEValuesBase &fe_patch_values = data.get_present_fe_values(dataset); const unsigned int n_components = fe_patch_values.get_fe().n_components(); diff --git a/deal.II/source/numerics/derivative_approximation.cc b/deal.II/source/numerics/derivative_approximation.cc index 79884b4258..dd2a9ca41d 100644 --- a/deal.II/source/numerics/derivative_approximation.cc +++ b/deal.II/source/numerics/derivative_approximation.cc @@ -631,7 +631,7 @@ approximate_derivative_tensor (const DH template class DH, class InputVector, int spacedim> + template class DH, class InputVector, int spacedim> void DerivativeApproximation:: approximate_derivative (const Mapping &mapping, @@ -648,33 +648,33 @@ approximate_derivative (const Mapping &mapping, // Only act on the locally owned cells typedef FilteredIterator::active_cell_iterator> CellFilter; - + typedef std_cxx1x::tuple::iterator> - Iterators; + Iterators; SynchronousIterators begin(Iterators (CellFilter(IteratorFilters::LocallyOwnedCell(), - dof_handler.begin_active()),derivative_norm.begin())), - end(Iterators (CellFilter(IteratorFilters::LocallyOwnedCell(),dof_handler.end()), - derivative_norm.end())); - - // There is no need for a copier because there is no conflict between threads + dof_handler.begin_active()),derivative_norm.begin())), + end(Iterators (CellFilter(IteratorFilters::LocallyOwnedCell(),dof_handler.end()), + derivative_norm.end())); + + // There is no need for a copier because there is no conflict between threads // to write in derivative_norm. Scratch and CopyData are also useless. WorkStream::run(begin,end, - static_cast const&, - internal::Assembler::Scratch const&,internal::Assembler::CopyData &)> > - (std_cxx1x::bind(&DerivativeApproximation::template approximate, - std_cxx1x::_1, - std_cxx1x::cref(mapping), - std_cxx1x::cref(dof_handler), - std_cxx1x::cref(solution),component)), - std_cxx1x::function (), - internal::Assembler::Scratch (),internal::Assembler::CopyData ()); + static_cast const &, + internal::Assembler::Scratch const &,internal::Assembler::CopyData &)> > + (std_cxx1x::bind(&DerivativeApproximation::template approximate, + std_cxx1x::_1, + std_cxx1x::cref(mapping), + std_cxx1x::cref(dof_handler), + std_cxx1x::cref(solution),component)), + std_cxx1x::function (), + internal::Assembler::Scratch (),internal::Assembler::CopyData ()); } template class DH, class InputVector, int spacedim> + template class DH, class InputVector, int spacedim> void DerivativeApproximation::approximate (SynchronousIterators::active_cell_iterator>,Vector::iterator> > const &cell, const Mapping &mapping, @@ -686,7 +686,7 @@ DerivativeApproximation::approximate (SynchronousIterators - (mapping,dof_handler,solution,component,std_cxx1x::get<0>(cell.iterators),derivative); + (mapping,dof_handler,solution,component,std_cxx1x::get<0>(cell.iterators),derivative); // evaluate the norm and fill the vector //*derivative_norm_on_this_cell *std_cxx1x::get<1>(cell.iterators) = DerivativeDescription::derivative_norm (derivative); @@ -695,7 +695,7 @@ DerivativeApproximation::approximate (SynchronousIterators class DH, class InputVector, int spacedim> + template class DH, class InputVector, int spacedim> void DerivativeApproximation:: approximate_cell (const Mapping &mapping, diff --git a/deal.II/source/numerics/matrix_tools.cc b/deal.II/source/numerics/matrix_tools.cc index 0423f1f794..bdc0e62cd3 100644 --- a/deal.II/source/numerics/matrix_tools.cc +++ b/deal.II/source/numerics/matrix_tools.cc @@ -139,7 +139,7 @@ namespace MatrixCreator namespace AssemblerData { template + int spacedim> struct Scratch { Scratch (const ::dealii::hp::FECollection &fe, @@ -214,8 +214,8 @@ namespace MatrixCreator template + int spacedim, + typename CellIterator> void mass_assembler (const CellIterator &cell, MatrixCreator::internal::AssemblerData::Scratch &data, MatrixCreator::internal::AssemblerData::CopyData ©_data) @@ -395,8 +395,8 @@ namespace MatrixCreator template + int spacedim, + typename CellIterator> void laplace_assembler (const CellIterator &cell, MatrixCreator::internal::AssemblerData::Scratch &data, MatrixCreator::internal::AssemblerData::CopyData ©_data) @@ -576,7 +576,7 @@ namespace MatrixCreator template + typename VectorType> void copy_local_to_global (const AssemblerData::CopyData &data, MatrixType *matrix, VectorType *right_hand_side) @@ -629,12 +629,12 @@ namespace MatrixCreator template CopyData::CopyData(CopyData const &data) : - dofs_per_cell(data.dofs_per_cell), - dofs(data.dofs), - dof_is_on_face(data.dof_is_on_face), - cell(data.cell), - cell_matrix(data.cell_matrix), - cell_vector(data.cell_vector) + dofs_per_cell(data.dofs_per_cell), + dofs(data.dofs), + dof_is_on_face(data.dof_is_on_face), + cell(data.cell), + cell_matrix(data.cell_matrix), + cell_vector(data.cell_vector) {} } } @@ -878,7 +878,7 @@ namespace MatrixCreator typename FunctionMap::type const &boundary_functions, Function const *const coefficient, std::vector const &component_mapping) - + { // All assertions for this function // are in the calling function @@ -889,7 +889,7 @@ namespace MatrixCreator const bool fe_is_primitive = fe.is_primitive(); const unsigned int dofs_per_face = fe.dofs_per_face; - + copy_data.cell = cell; copy_data.dofs_per_cell = fe.dofs_per_cell; @@ -910,7 +910,7 @@ namespace MatrixCreator std::vector rhs_values_scalar (fe_values.n_quadrature_points); std::vector > rhs_values_system (fe_values.n_quadrature_points, - Vector(n_function_components)); + Vector(n_function_components)); copy_data.dofs.resize(copy_data.dofs_per_cell); cell->get_dof_indices (copy_data.dofs); @@ -931,7 +931,7 @@ namespace MatrixCreator boundary_functions.end()) { copy_data.cell_matrix.push_back(FullMatrix (copy_data.dofs_per_cell, - copy_data.dofs_per_cell)); + copy_data.dofs_per_cell)); copy_data.cell_vector.push_back(Vector (copy_data.dofs_per_cell)); fe_values.reinit (cell, face); @@ -1007,8 +1007,8 @@ namespace MatrixCreator } } copy_data.cell_vector.back()(i) += fe_values.shape_value(i,point) - * rhs_values_system[point](component_mapping[fe.system_to_component_index(i).first]) - * weight; + * rhs_values_system[point](component_mapping[fe.system_to_component_index(i).first]) + * weight; } else { @@ -1021,9 +1021,9 @@ namespace MatrixCreator * normal_adjustment[point][comp] * weight * coefficient_vector_values[point](comp); copy_data.cell_vector.back()(i) += fe_values.shape_value_component(i,point,comp) * - rhs_values_system[point](component_mapping[comp]) - * normal_adjustment[point][comp] - * weight; + rhs_values_system[point](component_mapping[comp]) + * normal_adjustment[point][comp] + * weight; } } } @@ -1066,7 +1066,7 @@ namespace MatrixCreator copy_data.dofs[i]) != dofs_on_face_vector.end()); - } + } } template @@ -1105,34 +1105,34 @@ namespace MatrixCreator // searches. unsigned int pos(0); for (unsigned int face=0; face::faces_per_cell; ++face) - { - // check if this face is on that part of - // the boundary we are interested in - if (boundary_functions.find(copy_data.cell->face(face)->boundary_indicator()) != - boundary_functions.end()) - { - for (unsigned int i=0; iface(face)->boundary_indicator()) != + boundary_functions.end()) + { + for (unsigned int i=0; i void create_boundary_mass_matrix_1<2,3> (DoFHandler<2,3>::active_cell_iterator const &cell, - MatrixCreator::internal::AssemblerBoundary::Scratch const - &scratch, + MatrixCreator::internal::AssemblerBoundary::Scratch const + &scratch, MatrixCreator::internal::AssemblerBoundary::CopyData > ©_data, - Mapping<2,3> const &mapping, - FiniteElement<2,3> const &fe, - Quadrature<1> const &q, - FunctionMap<3>::type const &boundary_functions, - Function<3> const *const coefficient, - std::vector const &component_mapping) + 3> > ©_data, + Mapping<2,3> const &mapping, + FiniteElement<2,3> const &fe, + Quadrature<1> const &q, + FunctionMap<3>::type const &boundary_functions, + Function<3> const *const coefficient, + std::vector const &component_mapping) { Assert(false,ExcNotImplemented()); } @@ -1159,16 +1159,16 @@ namespace MatrixCreator template <> void create_boundary_mass_matrix_1<1,3> (DoFHandler<1,3>::active_cell_iterator const &cell, - MatrixCreator::internal::AssemblerBoundary::Scratch const + MatrixCreator::internal::AssemblerBoundary::Scratch const &scratch, MatrixCreator::internal::AssemblerBoundary::CopyData > ©_data, + 3> > ©_data, Mapping<1,3> const &mapping, FiniteElement<1,3> const &fe, Quadrature<0> const &q, FunctionMap<3>::type const &boundary_functions, Function<3> const *const coefficient, - std::vector const &component_mapping) + std::vector const &component_mapping) { Assert(false,ExcNotImplemented()); } @@ -1225,24 +1225,24 @@ namespace MatrixCreator MatrixCreator::internal::AssemblerBoundary::CopyData > copy_data; WorkStream::run(dof.begin_active(),dof.end(), - static_cast::active_cell_iterator - const &,MatrixCreator::internal::AssemblerBoundary::Scratch const &, - MatrixCreator::internal::AssemblerBoundary::CopyData > &)> > - (std_cxx1x::bind(&create_boundary_mass_matrix_1,std_cxx1x::_1,std_cxx1x::_2, - std_cxx1x::_3, - std_cxx1x::cref(mapping),std_cxx1x::cref(fe),std_cxx1x::cref(q), - std_cxx1x::cref(boundary_functions),coefficient, - std_cxx1x::cref(component_mapping))), - static_cast > const &)> > (std_cxx1x::bind( - ©_boundary_mass_matrix_1, - std_cxx1x::_1, - std_cxx1x::cref(boundary_functions), - std_cxx1x::cref(dof_to_boundary_mapping), - std_cxx1x::ref(matrix), - std_cxx1x::ref(rhs_vector))), - scratch, - copy_data); + static_cast::active_cell_iterator + const &,MatrixCreator::internal::AssemblerBoundary::Scratch const &, + MatrixCreator::internal::AssemblerBoundary::CopyData > &)> > + (std_cxx1x::bind(&create_boundary_mass_matrix_1,std_cxx1x::_1,std_cxx1x::_2, + std_cxx1x::_3, + std_cxx1x::cref(mapping),std_cxx1x::cref(fe),std_cxx1x::cref(q), + std_cxx1x::cref(boundary_functions),coefficient, + std_cxx1x::cref(component_mapping))), + static_cast > const &)> > (std_cxx1x::bind( + ©_boundary_mass_matrix_1, + std_cxx1x::_1, + std_cxx1x::cref(boundary_functions), + std_cxx1x::cref(dof_to_boundary_mapping), + std_cxx1x::ref(matrix), + std_cxx1x::ref(rhs_vector))), + scratch, + copy_data); } @@ -1252,7 +1252,7 @@ namespace MatrixCreator template void - create_hp_boundary_mass_matrix_1 (typename hp::DoFHandler::active_cell_iterator const + create_hp_boundary_mass_matrix_1 (typename hp::DoFHandler::active_cell_iterator const &cell, MatrixCreator::internal::AssemblerBoundary::Scratch const &scratch, MatrixCreator::internal::AssemblerBoundary @@ -1314,7 +1314,7 @@ namespace MatrixCreator const FEFaceValues &fe_values = x_fe_values.get_present_fe_values (); copy_data.cell_matrix.push_back(FullMatrix (copy_data.dofs_per_cell, - copy_data.dofs_per_cell)); + copy_data.dofs_per_cell)); copy_data.cell_vector.push_back(Vector (copy_data.dofs_per_cell)); if (fe_is_system) @@ -1349,8 +1349,8 @@ namespace MatrixCreator } copy_data.cell_vector.back()(i) += v * - rhs_values_system[point]( - component_mapping[fe.system_to_component_index(i).first]) * weight; + rhs_values_system[point]( + component_mapping[fe.system_to_component_index(i).first]) * weight; } } } @@ -1376,8 +1376,8 @@ namespace MatrixCreator copy_data.cell_matrix.back()(i,j) += (u * v * weight * coefficient_vector_values[point](component_i)); } - copy_data.cell_vector.back()(i) += v * - rhs_values_system[point](component_mapping[component_i]) * weight; + copy_data.cell_vector.back()(i) += v * + rhs_values_system[point](component_mapping[component_i]) * weight; } } } @@ -1397,9 +1397,9 @@ namespace MatrixCreator copy_data.cell_matrix.back()(i,j) += (u * v * weight); } copy_data.cell_vector.back()(i) += v * - rhs_values_system[point]( - fe.system_to_component_index(i).first) * - weight; + rhs_values_system[point]( + fe.system_to_component_index(i).first) * + weight; } } } @@ -1424,8 +1424,8 @@ namespace MatrixCreator for (unsigned int j=0; j::faces_per_cell; ++face) - { - // check if this face is on that part of - // the boundary we are interested in - if (boundary_functions.find(copy_data.cell->face(face)->boundary_indicator()) != - boundary_functions.end()) - { + { + // check if this face is on that part of + // the boundary we are interested in + if (boundary_functions.find(copy_data.cell->face(face)->boundary_indicator()) != + boundary_functions.end()) + { #ifdef DEBUG - // in debug mode: compute an element in the matrix which is - // guaranteed to belong to a boundary dof. We do this to check that the - // entries in the cell matrix are guaranteed to be zero if the - // respective dof is not on the boundary. Since because of - // round-off, the actual value of the matrix entry may be - // only close to zero, we assert that it is small relative to an element - // which is guaranteed to be nonzero. (absolute smallness does not - // suffice since the size of the domain scales in here) - // - // for this purpose we seek the diagonal of the matrix, where there - // must be an element belonging to the boundary. we take the maximum - // diagonal entry. - types::global_dof_index max_element = static_cast(0); - for (std::vector::const_iterator i=dof_to_boundary_mapping.begin(); - i!=dof_to_boundary_mapping.end(); ++i) - if ((*i != hp::DoFHandler::invalid_dof_index) && - (*i > max_element)) - max_element = *i; - Assert (max_element == matrix.n()-1, ExcInternalError()); - - double max_diag_entry = 0; - for (unsigned int i=0; i max_diag_entry) - max_diag_entry = std::fabs(copy_data.cell_matrix[pos](i,i)); + // in debug mode: compute an element in the matrix which is + // guaranteed to belong to a boundary dof. We do this to check that the + // entries in the cell matrix are guaranteed to be zero if the + // respective dof is not on the boundary. Since because of + // round-off, the actual value of the matrix entry may be + // only close to zero, we assert that it is small relative to an element + // which is guaranteed to be nonzero. (absolute smallness does not + // suffice since the size of the domain scales in here) + // + // for this purpose we seek the diagonal of the matrix, where there + // must be an element belonging to the boundary. we take the maximum + // diagonal entry. + types::global_dof_index max_element = static_cast(0); + for (std::vector::const_iterator i=dof_to_boundary_mapping.begin(); + i!=dof_to_boundary_mapping.end(); ++i) + if ((*i != hp::DoFHandler::invalid_dof_index) && + (*i > max_element)) + max_element = *i; + Assert (max_element == matrix.n()-1, ExcInternalError()); + + double max_diag_entry = 0; + for (unsigned int i=0; i max_diag_entry) + max_diag_entry = std::fabs(copy_data.cell_matrix[pos](i,i)); #endif - for (unsigned int i=0; i > copy_data; WorkStream::run(dof.begin_active(),dof.end(), - static_cast::active_cell_iterator - const &,MatrixCreator::internal::AssemblerBoundary::Scratch const &, - MatrixCreator::internal::AssemblerBoundary::CopyData > &)> > - (std_cxx1x::bind( &create_hp_boundary_mass_matrix_1,std_cxx1x::_1,std_cxx1x::_2, - std_cxx1x::_3, - std_cxx1x::cref(mapping),std_cxx1x::cref(fe_collection),std_cxx1x::cref(q), - std_cxx1x::cref(boundary_functions),coefficient, - std_cxx1x::cref(component_mapping))), - static_cast > const &)> > ( - std_cxx1x::bind( ©_hp_boundary_mass_matrix_1, - std_cxx1x::_1, - std_cxx1x::cref(boundary_functions), - std_cxx1x::cref(dof_to_boundary_mapping), - std_cxx1x::ref(matrix), - std_cxx1x::ref(rhs_vector))), - scratch, - copy_data); + static_cast::active_cell_iterator + const &,MatrixCreator::internal::AssemblerBoundary::Scratch const &, + MatrixCreator::internal::AssemblerBoundary::CopyData > &)> > + (std_cxx1x::bind( &create_hp_boundary_mass_matrix_1,std_cxx1x::_1,std_cxx1x::_2, + std_cxx1x::_3, + std_cxx1x::cref(mapping),std_cxx1x::cref(fe_collection),std_cxx1x::cref(q), + std_cxx1x::cref(boundary_functions),coefficient, + std_cxx1x::cref(component_mapping))), + static_cast > const &)> > ( + std_cxx1x::bind( ©_hp_boundary_mass_matrix_1, + std_cxx1x::_1, + std_cxx1x::cref(boundary_functions), + std_cxx1x::cref(dof_to_boundary_mapping), + std_cxx1x::ref(matrix), + std_cxx1x::ref(rhs_vector))), + scratch, + copy_data); } @@ -1712,10 +1712,10 @@ namespace MatrixCreator static_cast::active_cell_iterator>(dof.end()), &MatrixCreator::internal::laplace_assembler::active_cell_iterator>, std_cxx1x::bind (&MatrixCreator::internal:: - copy_local_to_global, Vector >, - std_cxx1x::_1, - &matrix, - (Vector *)NULL), + copy_local_to_global, Vector >, + std_cxx1x::_1, + &matrix, + (Vector *)NULL), assembler_data, copy_data); } @@ -1769,10 +1769,10 @@ namespace MatrixCreator static_cast::active_cell_iterator>(dof.end()), &MatrixCreator::internal::laplace_assembler::active_cell_iterator>, std_cxx1x::bind (&MatrixCreator::internal:: - copy_local_to_global, Vector >, - std_cxx1x::_1, - &matrix, - &rhs_vector), + copy_local_to_global, Vector >, + std_cxx1x::_1, + &matrix, + &rhs_vector), assembler_data, copy_data); } @@ -1824,10 +1824,10 @@ namespace MatrixCreator static_cast::active_cell_iterator>(dof.end()), &MatrixCreator::internal::laplace_assembler::active_cell_iterator>, std_cxx1x::bind (&MatrixCreator::internal:: - copy_local_to_global, Vector >, - std_cxx1x::_1, - &matrix, - (Vector *)0), + copy_local_to_global, Vector >, + std_cxx1x::_1, + &matrix, + (Vector *)0), assembler_data, copy_data); } @@ -1878,10 +1878,10 @@ namespace MatrixCreator static_cast::active_cell_iterator>(dof.end()), &MatrixCreator::internal::laplace_assembler::active_cell_iterator>, std_cxx1x::bind (&MatrixCreator::internal:: - copy_local_to_global, Vector >, - std_cxx1x::_1, - &matrix, - &rhs_vector), + copy_local_to_global, Vector >, + std_cxx1x::_1, + &matrix, + &rhs_vector), assembler_data, copy_data); } diff --git a/deal.II/source/numerics/solution_transfer.cc b/deal.II/source/numerics/solution_transfer.cc index beb4b0155d..5e0ac217ed 100644 --- a/deal.II/source/numerics/solution_transfer.cc +++ b/deal.II/source/numerics/solution_transfer.cc @@ -563,41 +563,41 @@ interpolate (const std::vector &all_in, local_values.reinit (cell->has_children() ? cell->child(0)->get_fe().dofs_per_cell : cell->get_fe().dofs_per_cell, true); - // do the interpolation. we get into trouble if the - // interpolation_hp(new,old) matrix hasn't been computed. - // this can happen if the respective elements don't support - // the corresponding interpolation; if that's the case, then - // the computation of the matrix simply sets the matrix - // back to size zero. so if we get here and that is - // the wrong size, then this may be because the elements - // haven't implemented the correct function yet - // - // there is one wrinkle. we would like to only error out if - // the size of the matrix is 0 times 0 but at least one - // of the elements has more than one dof per cell. the - // problem is that if you reinit a matrix to 4x0, it automatically - // sets its size to 0x0. so we can only execute the following - // test if *both* elements have dofs_per_cell>0, not if *at - // least one* have. - Assert (! ((interpolation_hp(new_fe_index,old_index).m() == 0) - && - (interpolation_hp(new_fe_index,old_index).n() == 0) - && - ((dof_handler->get_fe()[new_fe_index].dofs_per_cell > 0) - && - (dof_handler->get_fe()[old_index].dofs_per_cell > 0))), - ExcMessage ("The interpolation between two different " - "elements you are trying to use here has " - "not been implemented for this pair of " - "elements!")); + // do the interpolation. we get into trouble if the + // interpolation_hp(new,old) matrix hasn't been computed. + // this can happen if the respective elements don't support + // the corresponding interpolation; if that's the case, then + // the computation of the matrix simply sets the matrix + // back to size zero. so if we get here and that is + // the wrong size, then this may be because the elements + // haven't implemented the correct function yet + // + // there is one wrinkle. we would like to only error out if + // the size of the matrix is 0 times 0 but at least one + // of the elements has more than one dof per cell. the + // problem is that if you reinit a matrix to 4x0, it automatically + // sets its size to 0x0. so we can only execute the following + // test if *both* elements have dofs_per_cell>0, not if *at + // least one* have. + Assert (! ((interpolation_hp(new_fe_index,old_index).m() == 0) + && + (interpolation_hp(new_fe_index,old_index).n() == 0) + && + ((dof_handler->get_fe()[new_fe_index].dofs_per_cell > 0) + && + (dof_handler->get_fe()[old_index].dofs_per_cell > 0))), + ExcMessage ("The interpolation between two different " + "elements you are trying to use here has " + "not been implemented for this pair of " + "elements!")); // simple case where all children have the // same FE index: just interpolate to their FE // first and then use the standard routines - if (tmp.size() > 0) - interpolation_hp(new_fe_index,old_index).vmult (local_values, tmp); - else - local_values = 0; + if (tmp.size() > 0) + interpolation_hp(new_fe_index,old_index).vmult (local_values, tmp); + else + local_values = 0; } if (cell->has_children() == false) @@ -615,21 +615,21 @@ interpolate (const std::vector &all_in, interpolation_hp(c_index,old_index).n()); local_values.reinit(cell->child(child)->get_fe().dofs_per_cell, true); - // do the interpolation. same problem as above - Assert (! ((interpolation_hp(c_index,old_index).m() == 0) - && - (interpolation_hp(c_index,old_index).n() == 0) - && - ((dof_handler->get_fe()[c_index].dofs_per_cell > 0) - && - (dof_handler->get_fe()[old_index].dofs_per_cell > 0))), - ExcMessage ("The interpolation between two different " - "elements you are trying to use here has " - "not been implemented for this pair of " - "elements!")); - - if (tmp.size() > 0) - interpolation_hp(c_index,old_index).vmult (local_values, tmp); + // do the interpolation. same problem as above + Assert (! ((interpolation_hp(c_index,old_index).m() == 0) + && + (interpolation_hp(c_index,old_index).n() == 0) + && + ((dof_handler->get_fe()[c_index].dofs_per_cell > 0) + && + (dof_handler->get_fe()[old_index].dofs_per_cell > 0))), + ExcMessage ("The interpolation between two different " + "elements you are trying to use here has " + "not been implemented for this pair of " + "elements!")); + + if (tmp.size() > 0) + interpolation_hp(c_index,old_index).vmult (local_values, tmp); else local_values = 0; } -- 2.39.5