From: bangerth Date: Sun, 6 Jan 2013 01:55:02 +0000 (+0000) Subject: Merge the changes made to the sources on the branch_deprecated branch. This introduce... X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=026f142ef97cd1d0c527858c2c52920ade3edd8f;p=dealii-svn.git Merge the changes made to the sources on the branch_deprecated branch. This introduces a lot of places where we get warnings right now. In an ideal world, these would have been fixed on the branch. However, and unfortunately, the branch_deprecated is off branch_cmake, neither of which can currently be tested on the regression tester machine. Consequently, it is difficult to do incremental changes on the branch because one doesn't get to see the effects of these changes in the tests. It may just be a way to get the warnings fixed sooner, rather than later. git-svn-id: https://svn.dealii.org/trunk@27942 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/include/deal.II/base/mg_level_object.h b/deal.II/include/deal.II/base/mg_level_object.h index 89dae1ab30..eca7a5f534 100644 --- a/deal.II/include/deal.II/base/mg_level_object.h +++ b/deal.II/include/deal.II/base/mg_level_object.h @@ -100,12 +100,12 @@ public: /** * @deprecated Replaced by min_level() */ - unsigned int get_minlevel () const; + unsigned int get_minlevel () const DEAL_II_DEPRECATED; /** * @deprecated Replaced by max_level() */ - unsigned int get_maxlevel () const; + unsigned int get_maxlevel () const DEAL_II_DEPRECATED; /** * Memory used by this object. diff --git a/deal.II/include/deal.II/base/table.h b/deal.II/include/deal.II/base/table.h index fc28f61f82..607eb1a7eb 100644 --- a/deal.II/include/deal.II/base/table.h +++ b/deal.II/include/deal.II/base/table.h @@ -700,7 +700,7 @@ protected: * cast from const), otherwise, * keep away! */ - typename std::vector::const_pointer data () const; + typename std::vector::const_pointer data () const DEAL_II_DEPRECATED; protected: /** diff --git a/deal.II/include/deal.II/base/thread_management.h b/deal.II/include/deal.II/base/thread_management.h index 2e0f5691f0..c97ad381a5 100644 --- a/deal.II/include/deal.II/base/thread_management.h +++ b/deal.II/include/deal.II/base/thread_management.h @@ -571,7 +571,7 @@ namespace Threads * * @deprecated */ - typedef Mutex ThreadMutex; + typedef Mutex ThreadMutex DEAL_II_DEPRECATED; /** * Provide a backward compatible name (we @@ -581,7 +581,7 @@ namespace Threads * * @deprecated */ - typedef ConditionVariable ThreadCondition; + typedef ConditionVariable ThreadCondition DEAL_II_DEPRECATED; /** * If using POSIX functions, then @@ -589,7 +589,7 @@ namespace Threads * to the names we use throughout * the library. */ - typedef PosixThreadBarrier Barrier; + typedef PosixThreadBarrier Barrier; #else /** diff --git a/deal.II/include/deal.II/base/timer.h b/deal.II/include/deal.II/base/timer.h index 553445e70f..fed57a32bd 100644 --- a/deal.II/include/deal.II/base/timer.h +++ b/deal.II/include/deal.II/base/timer.h @@ -516,7 +516,7 @@ private: * class gives reasonable results even * when used with several threads. */ - Threads::ThreadMutex mutex; + Threads::Mutex mutex; }; diff --git a/deal.II/include/deal.II/base/types.h b/deal.II/include/deal.II/base/types.h index 87b2d5531d..a8cfcc6776 100644 --- a/deal.II/include/deal.II/base/types.h +++ b/deal.II/include/deal.II/base/types.h @@ -40,17 +40,17 @@ namespace types /** * @deprecated Old name for the typedef above. */ - typedef subdomain_id subdomain_id_t; + typedef subdomain_id subdomain_id_t DEAL_II_DEPRECATED; /** * @deprecated Use numbers::invalid_subdomain_id */ - const unsigned int invalid_subdomain_id = static_cast(-1); + const unsigned int invalid_subdomain_id DEAL_II_DEPRECATED = static_cast(-1); /** * @deprecated Use numbers::artificial_subdomain_id */ - const unsigned int artificial_subdomain_id = static_cast(-2); + const unsigned int artificial_subdomain_id DEAL_II_DEPRECATED = static_cast(-2); /** * The type used to denote global dof @@ -61,7 +61,7 @@ namespace types /** * @deprecated Use numbers::invalid_dof_index */ - const global_dof_index invalid_dof_index = static_cast(-1); + const global_dof_index invalid_dof_index DEAL_II_DEPRECATED = static_cast(-1); /** * The type used to denote boundary indicators associated with every @@ -79,7 +79,7 @@ namespace types /** * @deprecated Old name for the typedef above. */ - typedef boundary_id boundary_id_t; + typedef boundary_id boundary_id_t DEAL_II_DEPRECATED; /** * The type used to denote material indicators associated with every @@ -93,7 +93,7 @@ namespace types /** * @deprecated Old name for the typedef above. */ - typedef material_id material_id_t; + typedef material_id material_id_t DEAL_II_DEPRECATED; } diff --git a/deal.II/include/deal.II/base/utilities.h b/deal.II/include/deal.II/base/utilities.h index 657472427d..54ef56638f 100644 --- a/deal.II/include/deal.II/base/utilities.h +++ b/deal.II/include/deal.II/base/utilities.h @@ -410,7 +410,7 @@ namespace Utilities * * @deprecated */ - bool program_uses_mpi (); + bool program_uses_mpi () DEAL_II_DEPRECATED; /** * @name Functions that work @@ -428,7 +428,7 @@ namespace Utilities * * @deprecated */ - unsigned int get_n_mpi_processes (const MPI_Comm &mpi_communicator); + unsigned int get_n_mpi_processes (const MPI_Comm &mpi_communicator) DEAL_II_DEPRECATED; /** * This function is an alias for @@ -436,7 +436,7 @@ namespace Utilities * * @deprecated */ - unsigned int get_this_mpi_process (const MPI_Comm &mpi_communicator); + unsigned int get_this_mpi_process (const MPI_Comm &mpi_communicator) DEAL_II_DEPRECATED; /** @@ -472,7 +472,7 @@ namespace Utilities void calculate_collective_mpi_min_max_avg (const MPI_Comm &mpi_communicator, const double my_value, - MinMaxAvg &result); + MinMaxAvg &result) DEAL_II_DEPRECATED; /** * An alias for Utilities::MPI::MPI_InitFinalize. diff --git a/deal.II/include/deal.II/dofs/dof_handler.h b/deal.II/include/deal.II/dofs/dof_handler.h index 972d1c1864..9deec237d0 100644 --- a/deal.II/include/deal.II/dofs/dof_handler.h +++ b/deal.II/include/deal.II/dofs/dof_handler.h @@ -464,7 +464,7 @@ public: * found in the implementation of this * function. * - * Note that this function is most often + * @note This function is most often * used to determine the maximal row * length for sparsity * patterns. Unfortunately, while the @@ -486,7 +486,7 @@ public: * is also discussed in the documentation * of the module on @ref Sparsity. */ - unsigned int max_couplings_between_dofs () const; + unsigned int max_couplings_between_dofs () const DEAL_II_DEPRECATED; /** * @deprecated Use @@ -503,7 +503,7 @@ public: * max_couplings_between_dofs() in one * dimension less. */ - unsigned int max_couplings_between_boundary_dofs () const; + unsigned int max_couplings_between_boundary_dofs () const DEAL_II_DEPRECATED; /*--------------------------------------*/ diff --git a/deal.II/include/deal.II/dofs/dof_renumbering.h b/deal.II/include/deal.II/dofs/dof_renumbering.h index 93c3c1b8c7..1595102000 100644 --- a/deal.II/include/deal.II/dofs/dof_renumbering.h +++ b/deal.II/include/deal.II/dofs/dof_renumbering.h @@ -1,7 +1,7 @@ //--------------------------------------------------------------------------- // $Id$ // -// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 by the deal.II authors +// Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -1078,12 +1078,27 @@ namespace DoFRenumbering const Point &direction, const bool dof_wise_renumbering = false); - // The following three are only temporary for compatibility reasons and will be removed in 8.0 + /** + * This function does the downstream numbering for the individual + * levels of a multigrid hierarchy, but not for the global degrees + * of freedom. + * + * @deprecated Call downstream() function that takes a level + * argument for each of the levels of the multigrid hierarchy. + */ template void downstream (MGDoFHandler &dof_handler, const Point &direction, - const bool dof_wise_renumbering = false); + const bool dof_wise_renumbering = false) DEAL_II_DEPRECATED; + + /** + * @deprecated Use downstream() instead. + */ + template + void + downstream_dg (DH &dof, + const Point &direction) DEAL_II_DEPRECATED; template void @@ -1093,6 +1108,16 @@ namespace DoFRenumbering downstream(dof, direction); } + + /** + * @deprecated Use downstream() instead. + */ + template + void + downstream_dg (DH &dof, + unsigned int level, + const Point &direction) DEAL_II_DEPRECATED; + template void downstream_dg (DH &dof, diff --git a/deal.II/include/deal.II/dofs/dof_tools.h b/deal.II/include/deal.II/dofs/dof_tools.h index 432b04b2b8..fbdb8625ba 100644 --- a/deal.II/include/deal.II/dofs/dof_tools.h +++ b/deal.II/include/deal.II/dofs/dof_tools.h @@ -497,7 +497,7 @@ namespace DoFTools SparsityPattern &sparsity_pattern, const ConstraintMatrix &constraints = ConstraintMatrix(), const bool keep_constrained_dofs = true, - const types::subdomain_id subdomain_id = types::invalid_subdomain_id); + const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id); /** * Locate non-zero entries for @@ -659,7 +659,7 @@ namespace DoFTools SparsityPattern &sparsity_pattern, const ConstraintMatrix &constraints = ConstraintMatrix(), const bool keep_constrained_dofs = true, - const types::subdomain_id subdomain_id = types::invalid_subdomain_id); + const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id); /** * @deprecated This is the old @@ -677,7 +677,7 @@ namespace DoFTools void make_sparsity_pattern (const DH &dof, const std::vector > &mask, - SparsityPattern &sparsity_pattern); + SparsityPattern &sparsity_pattern) DEAL_II_DEPRECATED; /** * Construct a sparsity pattern that @@ -2298,7 +2298,7 @@ namespace DoFTools void count_dofs_per_component (const DoFHandler &dof_handler, std::vector &dofs_per_component, - std::vector target_component); + std::vector target_component) DEAL_II_DEPRECATED; /** * This function can be used when diff --git a/deal.II/include/deal.II/fe/fe.h b/deal.II/include/deal.II/fe/fe.h index 6c018ffbe3..70565a9095 100644 --- a/deal.II/include/deal.II/fe/fe.h +++ b/deal.II/include/deal.II/fe/fe.h @@ -2875,7 +2875,7 @@ FiniteElement::face_system_to_component_index (const unsigned int // // in 1d, the face index is equal // to the cell index - Assert (is_primitive(this->face_to_equivalent_cell_index(index)), + Assert (is_primitive(this->face_to_cell_index(0, index)), (typename FiniteElement::ExcShapeFunctionNotPrimitive(index)) ); return face_system_to_component_table[index]; diff --git a/deal.II/include/deal.II/fe/fe_base.h b/deal.II/include/deal.II/fe/fe_base.h index 4c9e71463c..5b7aa6373d 100644 --- a/deal.II/include/deal.II/fe/fe_base.h +++ b/deal.II/include/deal.II/fe/fe_base.h @@ -450,7 +450,7 @@ public: * @endcode * */ - unsigned int face_to_equivalent_cell_index (const unsigned int index) const; + unsigned int face_to_equivalent_cell_index (const unsigned int index) const DEAL_II_DEPRECATED; /** * Comparison operator. diff --git a/deal.II/include/deal.II/fe/fe_values.h b/deal.II/include/deal.II/fe/fe_values.h index f5ad8363e4..8b465e3c8a 100644 --- a/deal.II/include/deal.II/fe/fe_values.h +++ b/deal.II/include/deal.II/fe/fe_values.h @@ -1853,7 +1853,7 @@ public: */ const Tensor<2,spacedim> & shape_2nd_derivative (const unsigned int function_no, - const unsigned int point_no) const; + const unsigned int point_no) const DEAL_II_DEPRECATED; /** @@ -1897,7 +1897,7 @@ public: Tensor<2,spacedim> shape_2nd_derivative_component (const unsigned int function_no, const unsigned int point_no, - const unsigned int component) const; + const unsigned int component) const DEAL_II_DEPRECATED; //@} @@ -2285,7 +2285,7 @@ public: */ template void get_function_grads (const InputVector &fe_function, - std::vector > &gradients) const; + std::vector > &gradients) const DEAL_II_DEPRECATED; /** * @deprecated Use @@ -2293,7 +2293,7 @@ public: */ template void get_function_grads (const InputVector &fe_function, - std::vector > > &gradients) const; + std::vector > > &gradients) const DEAL_II_DEPRECATED; /** * @deprecated Use @@ -2302,7 +2302,7 @@ public: template void get_function_grads (const InputVector &fe_function, const VectorSlice > &indices, - std::vector > &gradients) const; + std::vector > &gradients) const DEAL_II_DEPRECATED; /** * @deprecated Use @@ -2312,7 +2312,7 @@ public: void get_function_grads (const InputVector &fe_function, const VectorSlice > &indices, std::vector > > &gradients, - bool quadrature_points_fastest = false) const; + bool quadrature_points_fastest = false) const DEAL_II_DEPRECATED; //@} /// @name Access to second derivatives (Hessian matrices and Laplacians) of global finite element fields @@ -2464,7 +2464,7 @@ public: template void get_function_2nd_derivatives (const InputVector &, - std::vector > &) const; + std::vector > &) const DEAL_II_DEPRECATED; /** * @deprecated Wrapper for get_function_hessians() @@ -2473,7 +2473,7 @@ public: void get_function_2nd_derivatives (const InputVector &, std::vector > > &, - bool = false) const; + bool = false) const DEAL_II_DEPRECATED; /** * Compute the (scalar) Laplacian (i.e. the trace of the tensor of second @@ -2775,7 +2775,7 @@ public: * point. The length of the vector * is normalized to one. */ - const Point &cell_normal_vector (const unsigned int i) const; + const Point &cell_normal_vector (const unsigned int i) const DEAL_II_DEPRECATED; /** * @deprecated Use @@ -2785,7 +2785,7 @@ public: * the cell in each of the * quadrature points. */ - const std::vector > &get_cell_normal_vectors () const; + const std::vector > &get_cell_normal_vectors () const DEAL_II_DEPRECATED; //@} diff --git a/deal.II/include/deal.II/fe/mapping.h b/deal.II/include/deal.II/fe/mapping.h index 73a327eded..3a5dc60777 100644 --- a/deal.II/include/deal.II/fe/mapping.h +++ b/deal.II/include/deal.II/fe/mapping.h @@ -609,7 +609,7 @@ public: transform_covariant (const VectorSlice > > input, const unsigned int offset, VectorSlice > > output, - const InternalDataBase &internal) const; + const InternalDataBase &internal) const DEAL_II_DEPRECATED; /** * @deprecated Use transform() instead. @@ -618,7 +618,7 @@ public: transform_covariant (const VectorSlice > > input, const unsigned int offset, VectorSlice > > output, - const InternalDataBase &internal) const; + const InternalDataBase &internal) const DEAL_II_DEPRECATED; /** * @deprecated Use transform() instead. @@ -627,7 +627,7 @@ public: transform_contravariant (const VectorSlice > > input, const unsigned int offset, VectorSlice > > output, - const typename Mapping::InternalDataBase &internal) const; + const typename Mapping::InternalDataBase &internal) const DEAL_II_DEPRECATED; /** * @deprecated Use transform() instead. @@ -637,7 +637,7 @@ public: transform_contravariant (const VectorSlice > > input, const unsigned int offset, const VectorSlice > > output, - const typename Mapping::InternalDataBase &internal) const; + const typename Mapping::InternalDataBase &internal) const DEAL_II_DEPRECATED; /** * The transformed (generalized) diff --git a/deal.II/include/deal.II/fe/mapping_q_eulerian.h b/deal.II/include/deal.II/fe/mapping_q_eulerian.h index df7b094683..e887c0c5e3 100644 --- a/deal.II/include/deal.II/fe/mapping_q_eulerian.h +++ b/deal.II/include/deal.II/fe/mapping_q_eulerian.h @@ -220,7 +220,7 @@ private: * A variable to guard access to * the fe_values variable. */ - mutable Threads::ThreadMutex fe_values_mutex; + mutable Threads::Mutex fe_values_mutex; /** * Compute the positions of the diff --git a/deal.II/include/deal.II/grid/grid_tools.h b/deal.II/include/deal.II/grid/grid_tools.h index 6abe799679..f9face699a 100644 --- a/deal.II/include/deal.II/grid/grid_tools.h +++ b/deal.II/include/deal.II/grid/grid_tools.h @@ -267,22 +267,9 @@ namespace GridTools const Point &p); /** - * @deprecated This function might - * be acceptable to find a patch - * around a single vertex, but it - * wastes resources creating - * patches around all vertices. The - * function mail fail on - * anisotropic meshes, and an easy - * fix is not obvious. Therefore, - * it should be replaced by a - * function which computes all - * active vertex patches by looping - * over cells. - * * Find and return a vector of * iterators to active cells that - * surround a given vertex @p vertex. + * surround a given vertex with index @p vertex_index. * The type of the first parameter * may be either Triangulation, * DoFHandler, hp::DoFHandler, or @@ -292,14 +279,18 @@ namespace GridTools * vertex itself might not be a vertex * of all adjacent cells that are returned. * However, it will - * always be either a vertex of a cell of be + * always be either a vertex of a cell or be * a hanging node located on a face or an * edge of it. + * + * @note It isn't entirely clear at this time whether the function + * does the right thing with anisotropically refined meshes. It needs + * to be checked for this case. */ template class Container, int spacedim> std::vector::active_cell_iterator> find_cells_adjacent_to_vertex (const Container &container, - const unsigned int vertex); + const unsigned int vertex_index); /** diff --git a/deal.II/include/deal.II/grid/tria.h b/deal.II/include/deal.II/grid/tria.h index 703116ba20..888acd678e 100644 --- a/deal.II/include/deal.II/grid/tria.h +++ b/deal.II/include/deal.II/grid/tria.h @@ -1475,7 +1475,7 @@ public: * * @deprecated */ - virtual ~RefinementListener (); + virtual ~RefinementListener () DEAL_II_DEPRECATED; /** * Before refinement is actually @@ -1493,7 +1493,7 @@ public: */ virtual void - pre_refinement_notification (const Triangulation &tria); + pre_refinement_notification (const Triangulation &tria) DEAL_II_DEPRECATED; /** * After refinement is actually @@ -1511,7 +1511,7 @@ public: */ virtual void - post_refinement_notification (const Triangulation &tria); + post_refinement_notification (const Triangulation &tria) DEAL_II_DEPRECATED; /** * At the end of a call to @@ -1537,7 +1537,7 @@ public: virtual void copy_notification (const Triangulation &old_tria, - const Triangulation &new_tria); + const Triangulation &new_tria) DEAL_II_DEPRECATED; /** * At the end of a call to @@ -1559,7 +1559,8 @@ public: */ virtual void - create_notification (const Triangulation &tria); + create_notification (const Triangulation &tria) DEAL_II_DEPRECATED; + }; /** @@ -2196,7 +2197,7 @@ public: * * @deprecated */ - void add_refinement_listener (RefinementListener &listener) const; + void add_refinement_listener (RefinementListener &listener) const DEAL_II_DEPRECATED; /** * Remove a @@ -2214,7 +2215,7 @@ public: * * @deprecated */ - void remove_refinement_listener (RefinementListener &listener) const; + void remove_refinement_listener (RefinementListener &listener) const DEAL_II_DEPRECATED; /** * A structure that has boost::signal objects for a number of actions that a @@ -2460,7 +2461,7 @@ public: * Clear all user pointers. * See also @ref GlossUserData . */ - void clear_user_pointers (); + void clear_user_pointers () DEAL_II_DEPRECATED; /** * Save all user indices. The diff --git a/deal.II/include/deal.II/grid/tria_accessor.h b/deal.II/include/deal.II/grid/tria_accessor.h index 2c565fb292..e90be3648e 100644 --- a/deal.II/include/deal.II/grid/tria_accessor.h +++ b/deal.II/include/deal.II/grid/tria_accessor.h @@ -2702,12 +2702,12 @@ public: /** * Get the level subdomain id of this cell. This is used for parallel multigrid. */ - types::subdomain_id_t level_subdomain_id () const; + types::subdomain_id level_subdomain_id () const; /** * Set the level subdomain id of this cell. This is used for parallel multigrid. */ - void set_level_subdomain_id (const types::subdomain_id_t new_level_subdomain_id) const; + void set_level_subdomain_id (const types::subdomain_id new_level_subdomain_id) const; /** diff --git a/deal.II/include/deal.II/grid/tria_accessor.templates.h b/deal.II/include/deal.II/grid/tria_accessor.templates.h index 4bc326d50a..b34c505fcb 100644 --- a/deal.II/include/deal.II/grid/tria_accessor.templates.h +++ b/deal.II/include/deal.II/grid/tria_accessor.templates.h @@ -2887,7 +2887,7 @@ CellAccessor::is_locally_owned () const return true; #else const types::subdomain_id subdomain = this->subdomain_id(); - if (subdomain == types::artificial_subdomain_id) + if (subdomain == numbers::artificial_subdomain_id) return false; const parallel::distributed::Triangulation *pdt @@ -2910,7 +2910,7 @@ CellAccessor::is_ghost () const return false; #else const types::subdomain_id subdomain = this->subdomain_id(); - if (subdomain == types::artificial_subdomain_id) + if (subdomain == numbers::artificial_subdomain_id) return false; const parallel::distributed::Triangulation *pdt @@ -2933,7 +2933,7 @@ CellAccessor::is_artificial () const #ifndef DEAL_II_USE_P4EST return false; #else - return (this->subdomain_id() == types::artificial_subdomain_id); + return (this->subdomain_id() == numbers::artificial_subdomain_id); #endif } diff --git a/deal.II/include/deal.II/grid/tria_levels.h b/deal.II/include/deal.II/grid/tria_levels.h index 8fa3eb101a..70f35c0a4d 100644 --- a/deal.II/include/deal.II/grid/tria_levels.h +++ b/deal.II/include/deal.II/grid/tria_levels.h @@ -143,7 +143,7 @@ namespace internal /** * for parallel multigrid */ - std::vector level_subdomain_ids; + std::vector level_subdomain_ids; /** * One integer for every consecutive @@ -248,7 +248,7 @@ namespace internal std::vector coarsen_flags; std::vector > neighbors; std::vector subdomain_ids; - std::vector level_subdomain_ids; + std::vector level_subdomain_ids; std::vector parents; // The following is not used diff --git a/deal.II/include/deal.II/lac/block_list.h b/deal.II/include/deal.II/lac/block_list.h index d40c9c9814..04c312d806 100644 --- a/deal.II/include/deal.II/lac/block_list.h +++ b/deal.II/include/deal.II/lac/block_list.h @@ -135,7 +135,7 @@ public: template void initialize_mg(unsigned int n_blocks, const ITERATOR begin, - const typename identity::type end); + const typename identity::type end) DEAL_II_DEPRECATED; /** * @deprecated This function will @@ -173,7 +173,7 @@ public: const ITERATOR begin, const typename identity::type end, const std::vector &selected_dofs, - unsigned int offset = 0); + unsigned int offset = 0) DEAL_II_DEPRECATED; /** * @deprecated This function will * move to DoFTools. @@ -210,7 +210,7 @@ public: const ITERATOR begin, const typename identity::type end, const std::vector &selected_dofs, - unsigned int offset = 0); + unsigned int offset = 0) DEAL_II_DEPRECATED; /** * @deprecated This function will @@ -228,7 +228,7 @@ public: const ITERATOR begin, const typename identity::type end, const std::vector &selected_dofs = std::vector(), - unsigned int offset = 0); + unsigned int offset = 0) DEAL_II_DEPRECATED; /** * @deprecated This function will @@ -241,7 +241,7 @@ public: unsigned int count_vertex_patches( const ITERATOR begin, const typename identity::type end, - bool same_level_only) const; + bool same_level_only) const DEAL_II_DEPRECATED; /** * @deprecated This function will @@ -250,7 +250,7 @@ public: */ template bool cell_generates_vertex_patch(const ITERATOR cell, - bool same_level_only) const; + bool same_level_only) const DEAL_II_DEPRECATED; /** * The number of blocks. @@ -284,7 +284,7 @@ private: * The container for t he index sets. */ std::vector index_sets; -}; +} DEAL_II_DEPRECATED; inline diff --git a/deal.II/include/deal.II/lac/block_matrix_array.h b/deal.II/include/deal.II/lac/block_matrix_array.h index 028ead966e..73ae0d19a0 100644 --- a/deal.II/include/deal.II/lac/block_matrix_array.h +++ b/deal.II/include/deal.II/lac/block_matrix_array.h @@ -144,9 +144,6 @@ public: * function to call for an object * created by the default * constructor. - * - * @deprecated the last argument - * is ignored. */ void initialize (const unsigned int n_block_rows, const unsigned int n_block_cols); @@ -160,7 +157,7 @@ public: */ BlockMatrixArray (const unsigned int n_block_rows, const unsigned int n_block_cols, - VectorMemory > &mem); + VectorMemory > &mem) DEAL_II_DEPRECATED; /** * Initialize object @@ -174,7 +171,7 @@ public: */ void initialize (const unsigned int n_block_rows, const unsigned int n_block_cols, - VectorMemory > &mem); + VectorMemory > &mem) DEAL_II_DEPRECATED; /** * Adjust the matrix to a new @@ -224,7 +221,7 @@ public: const unsigned int row, const unsigned int col, const double prefix = 1., - const bool transpose = false); + const bool transpose = false) DEAL_II_DEPRECATED; /** @@ -500,7 +497,7 @@ public: */ BlockTrianglePrecondition (unsigned int n_block_rows, VectorMemory > &mem, - bool backward = false); + bool backward = false) DEAL_II_DEPRECATED; /** * Initialize object @@ -514,7 +511,7 @@ public: */ void initialize (const unsigned int n_block_rows, VectorMemory > &mem, - bool backward = false); + bool backward = false) DEAL_II_DEPRECATED; /** * Resize preconditioner to a new @@ -554,7 +551,7 @@ public: const unsigned int row, const unsigned int col, const double prefix = 1., - const bool transpose = false); + const bool transpose = false) DEAL_II_DEPRECATED; /** * Preconditioning. diff --git a/deal.II/include/deal.II/lac/block_sparsity_pattern.h b/deal.II/include/deal.II/lac/block_sparsity_pattern.h index ef700e9218..9b412967b0 100644 --- a/deal.II/include/deal.II/lac/block_sparsity_pattern.h +++ b/deal.II/include/deal.II/lac/block_sparsity_pattern.h @@ -745,7 +745,7 @@ public: * * @deprecated */ -typedef BlockCompressedSparsityPattern CompressedBlockSparsityPattern; +typedef BlockCompressedSparsityPattern CompressedBlockSparsityPattern DEAL_II_DEPRECATED; diff --git a/deal.II/include/deal.II/lac/block_vector.h b/deal.II/include/deal.II/lac/block_vector.h index c090a14a51..2ce6364d1b 100644 --- a/deal.II/include/deal.II/lac/block_vector.h +++ b/deal.II/include/deal.II/lac/block_vector.h @@ -368,7 +368,7 @@ public: * @deprecated Use operator*= * instead. */ - void scale (const value_type factor); + void scale (const value_type factor) DEAL_II_DEPRECATED; /** * Multiply each element of this diff --git a/deal.II/include/deal.II/lac/full_matrix.templates.h b/deal.II/include/deal.II/lac/full_matrix.templates.h index 735bf1f2a3..d7adfc766f 100644 --- a/deal.II/include/deal.II/lac/full_matrix.templates.h +++ b/deal.II/include/deal.II/lac/full_matrix.templates.h @@ -130,8 +130,8 @@ FullMatrix::all_zero () const { Assert (!this->empty(), ExcEmptyMatrix()); - const number *p = this->data(); - const number *const e = this->data() + this->n_elements(); + const number *p = &this->values[0]; + const number *const e = &this->values[0] + this->n_elements(); while (p!=e) if (*p++ != number(0.0)) return false; @@ -194,7 +194,7 @@ FullMatrix::vmult (Vector &dst, Assert (&src != &dst, ExcSourceEqualsDestination()); - const number *e = this->data(); + const number *e = &this->values[0]; // get access to the data in order to // avoid copying it when using the () // operator @@ -224,7 +224,7 @@ void FullMatrix::Tvmult (Vector &dst, Assert (&src != &dst, ExcSourceEqualsDestination()); - const number *e = this->data(); + const number *e = &this->values[0]; number2 *dst_ptr = &dst(0); const unsigned int size_m = m(), size_n = n(); @@ -370,7 +370,7 @@ void FullMatrix::fill_permutation (const FullMatrix &src, /* void FullMatrix::fill (const number2* entries) */ /* { */ /* if (n_cols()*n_rows() != 0) */ -/* std::copy (entries, entries+n_rows()*n_cols(), this->data()); */ +/* std::copy (entries, entries+n_rows()*n_cols(), &this->values[0]); */ /* } */ @@ -949,7 +949,7 @@ FullMatrix::matrix_norm_square (const Vector &v) const number2 sum = 0.; const unsigned int n_rows = m(); - const number *val_ptr = this->data(); + const number *val_ptr = &this->values[0]; const number2 *v_ptr; for (unsigned int row=0; row::matrix_scalar_product (const Vector &u, number2 sum = 0.; const unsigned int n_rows = m(); const unsigned int n_cols = n(); - const number *val_ptr = this->data(); + const number *val_ptr = &this->values[0]; const number2 *v_ptr; for (unsigned int row=0; row bool FullMatrix::operator == (const FullMatrix &M) const { - // the matrices may either be both - // empty, or of same size and with - // same values, if they shall be - // equal - bool result = (this->data()==0) && (M.data()==0); - result = result || ((m()==M.m()) && (n()==M.n()) && - std::equal (this->data(), this->data()+m()*n(), - M.data())); - - return result; + // simply pass down to the base class + return Table<2,number>::operator==(M); } @@ -1284,7 +1276,7 @@ FullMatrix::frobenius_norm () const real_type s = 0.; for (unsigned int i=0; in_rows()*this->n_cols(); ++i) - s += numbers::NumberTraits::abs_square(this->data()[i]); + s += numbers::NumberTraits::abs_square(this->values[i]); return std::sqrt(s); } 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 76c81f708a..221570efd0 100644 --- a/deal.II/include/deal.II/lac/parallel_block_vector.h +++ b/deal.II/include/deal.II/lac/parallel_block_vector.h @@ -284,7 +284,7 @@ namespace parallel * @deprecated Use operator*= * instead. */ - void scale (const value_type factor); + void scale (const value_type factor) DEAL_II_DEPRECATED; /** * Multiply each element of this diff --git a/deal.II/include/deal.II/lac/parallel_vector.h b/deal.II/include/deal.II/lac/parallel_vector.h index 9404d915b2..a10ad71f34 100644 --- a/deal.II/include/deal.II/lac/parallel_vector.h +++ b/deal.II/include/deal.II/lac/parallel_vector.h @@ -754,7 +754,7 @@ namespace parallel * operator *= and * operator /= instead. */ - void scale (const Number factor); + void scale (const Number factor) DEAL_II_DEPRECATED; /** @@ -947,7 +947,7 @@ namespace parallel * when used with several * threads. */ - mutable Threads::ThreadMutex mutex; + mutable Threads::Mutex mutex; /** * A helper function that clears the diff --git a/deal.II/include/deal.II/lac/parallel_vector.templates.h b/deal.II/include/deal.II/lac/parallel_vector.templates.h index d841e0a1f5..10b601f0cd 100644 --- a/deal.II/include/deal.II/lac/parallel_vector.templates.h +++ b/deal.II/include/deal.II/lac/parallel_vector.templates.h @@ -211,7 +211,7 @@ namespace parallel return; // make this function thread safe - Threads::ThreadMutex::ScopedLock lock (mutex); + Threads::Mutex::ScopedLock lock (mutex); const unsigned int n_import_targets = part.import_targets().size(); const unsigned int n_ghost_targets = part.ghost_targets().size(); @@ -292,7 +292,7 @@ namespace parallel return; // make this function thread safe - Threads::ThreadMutex::ScopedLock lock (mutex); + Threads::Mutex::ScopedLock lock (mutex); const unsigned int n_import_targets = part.import_targets().size(); const unsigned int n_ghost_targets = part.ghost_targets().size(); @@ -357,7 +357,7 @@ namespace parallel return; // make this function thread safe - Threads::ThreadMutex::ScopedLock lock (mutex); + Threads::Mutex::ScopedLock lock (mutex); const unsigned int n_import_targets = part.import_targets().size(); const unsigned int n_ghost_targets = part.ghost_targets().size(); @@ -452,7 +452,7 @@ namespace parallel if (update_ghost_values_requests.size() > 0) { // make this function thread safe - Threads::ThreadMutex::ScopedLock lock (mutex); + Threads::Mutex::ScopedLock lock (mutex); int ierr; ierr = MPI_Waitall (update_ghost_values_requests.size(), diff --git a/deal.II/include/deal.II/lac/precondition_block.h b/deal.II/include/deal.II/lac/precondition_block.h index d9e4711c10..d3d7feb3ed 100644 --- a/deal.II/include/deal.II/lac/precondition_block.h +++ b/deal.II/include/deal.II/lac/precondition_block.h @@ -376,7 +376,7 @@ public: * The number of blocks of the * matrix. */ - unsigned int n_blocks() const; + unsigned int n_blocks() const DEAL_II_DEPRECATED; /** * Determine an estimate for the @@ -1087,7 +1087,7 @@ Accessor (const PreconditionBlockJacobi *matrix, // This is the end accessor, which // does not hava a valid block. - if (a_block == matrix->n_blocks()) + if (a_block == matrix->size()) return; const unsigned int r = row % bs; @@ -1095,8 +1095,8 @@ Accessor (const PreconditionBlockJacobi *matrix, b_iterator = matrix->inverse(a_block).begin(r); b_end = matrix->inverse(a_block).end(); - Assert (a_block < matrix->n_blocks(), - ExcIndexRange(a_block, 0, matrix->n_blocks())); + Assert (a_block < matrix->size(), + ExcIndexRange(a_block, 0, matrix->size())); } @@ -1105,7 +1105,7 @@ inline unsigned int PreconditionBlockJacobi::const_iterator::Accessor::row() const { - Assert (a_block < matrix->n_blocks(), + Assert (a_block < matrix->size(), ExcIteratorPastEnd()); return bs * a_block + b_iterator->row(); @@ -1117,7 +1117,7 @@ inline unsigned int PreconditionBlockJacobi::const_iterator::Accessor::column() const { - Assert (a_block < matrix->n_blocks(), + Assert (a_block < matrix->size(), ExcIteratorPastEnd()); return bs * a_block + b_iterator->column(); @@ -1129,7 +1129,7 @@ inline inverse_type PreconditionBlockJacobi::const_iterator::Accessor::value() const { - Assert (a_block < matrix->n_blocks(), + Assert (a_block < matrix->size(), ExcIteratorPastEnd()); return b_iterator->value(); @@ -1158,7 +1158,7 @@ PreconditionBlockJacobi::const_iterator::operator++ () { ++accessor.a_block; - if (accessor.a_block < accessor.matrix->n_blocks()) + if (accessor.a_block < accessor.matrix->size()) { accessor.b_iterator = accessor.matrix->inverse(accessor.a_block).begin(); accessor.b_end = accessor.matrix->inverse(accessor.a_block).end(); @@ -1192,7 +1192,7 @@ bool PreconditionBlockJacobi::const_iterator:: operator == (const const_iterator &other) const { - if (accessor.a_block == accessor.matrix->n_blocks() && + if (accessor.a_block == accessor.matrix->size() && accessor.a_block == other.accessor.a_block) return true; @@ -1240,7 +1240,7 @@ inline typename PreconditionBlockJacobi::const_iterator PreconditionBlockJacobi::end () const { - return const_iterator(this, this->n_blocks() * this->block_size()); + return const_iterator(this, this->size() * this->block_size()); } diff --git a/deal.II/include/deal.II/lac/precondition_block.templates.h b/deal.II/include/deal.II/lac/precondition_block.templates.h index 1379139aef..41fc24ad95 100644 --- a/deal.II/include/deal.II/lac/precondition_block.templates.h +++ b/deal.II/include/deal.II/lac/precondition_block.templates.h @@ -625,7 +625,7 @@ void PreconditionBlockJacobi begin_diag_block+=this->blocksize; } - dst.scale(this->relaxation); + dst *= this->relaxation; } diff --git a/deal.II/include/deal.II/lac/relaxation_block.h b/deal.II/include/deal.II/lac/relaxation_block.h index 6a2d94fc25..c4414385d8 100644 --- a/deal.II/include/deal.II/lac/relaxation_block.h +++ b/deal.II/include/deal.II/lac/relaxation_block.h @@ -86,7 +86,7 @@ public: AdditionalData (const BlockList &block_list, const double relaxation = 1., const bool invert_diagonal = true, - const bool same_diagonal = false); + const bool same_diagonal = false) DEAL_II_DEPRECATED; /** diff --git a/deal.II/include/deal.II/lac/sparse_decomposition.h b/deal.II/include/deal.II/lac/sparse_decomposition.h index 19abf9986c..17e25c9bd7 100644 --- a/deal.II/include/deal.II/lac/sparse_decomposition.h +++ b/deal.II/include/deal.II/lac/sparse_decomposition.h @@ -153,7 +153,7 @@ protected: * compability. It will be removed * in later versions. */ - SparseLUDecomposition (const SparsityPattern &sparsity); + SparseLUDecomposition (const SparsityPattern &sparsity) DEAL_II_DEPRECATED; public: /** @@ -302,7 +302,7 @@ public: * * @deprecated */ - void reinit (const SparsityPattern &sparsity); + void reinit (const SparsityPattern &sparsity) DEAL_II_DEPRECATED; /** * This method is deprecated, @@ -314,7 +314,7 @@ public: */ template void decompose (const SparseMatrix &matrix, - const double strengthen_diagonal=0.); + const double strengthen_diagonal=0.) DEAL_II_DEPRECATED; /** * This method is deprecated, @@ -324,7 +324,7 @@ public: * * @deprecated */ - virtual bool is_decomposed () const; + virtual bool is_decomposed () const DEAL_II_DEPRECATED; /** * Return whether the object is diff --git a/deal.II/include/deal.II/lac/sparse_direct.h b/deal.II/include/deal.II/lac/sparse_direct.h index 03b3e1ce07..db7c679161 100644 --- a/deal.II/include/deal.II/lac/sparse_direct.h +++ b/deal.II/include/deal.II/lac/sparse_direct.h @@ -331,7 +331,7 @@ public: * this class for more * information. */ - Threads::ThreadMutex &get_synchronisation_lock () const; + Threads::Mutex &get_synchronisation_lock () const; /** @addtogroup Exceptions * @{ */ @@ -520,8 +520,8 @@ private: * Mutexes for synchronising access * to this class. */ - static Threads::ThreadMutex static_synchronisation_lock; - mutable Threads::ThreadMutex non_static_synchronisation_lock; + static Threads::Mutex static_synchronisation_lock; + mutable Threads::Mutex non_static_synchronisation_lock; /** * Fill the A array from the @@ -801,7 +801,7 @@ public: * this class for more * information. */ - Threads::ThreadMutex &get_synchronisation_lock () const; + Threads::Mutex &get_synchronisation_lock () const; /** @addtogroup Exceptions * @{ */ @@ -948,7 +948,7 @@ private: * Mutex for synchronising access * to this class. */ - static Threads::ThreadMutex synchronisation_lock; + static Threads::Mutex synchronisation_lock; /** * Fill the A array from the diff --git a/deal.II/include/deal.II/lac/sparse_ilu.h b/deal.II/include/deal.II/lac/sparse_ilu.h index 7569b43260..900c857232 100644 --- a/deal.II/include/deal.II/lac/sparse_ilu.h +++ b/deal.II/include/deal.II/lac/sparse_ilu.h @@ -67,7 +67,7 @@ public: * backward compability. It will * be removed in later versions. */ - SparseILU (const SparsityPattern &sparsity); + SparseILU (const SparsityPattern &sparsity) DEAL_II_DEPRECATED; /** * Make @@ -122,7 +122,7 @@ public: */ template void decompose (const SparseMatrix &matrix, - const double strengthen_diagonal=0.); + const double strengthen_diagonal=0.) DEAL_II_DEPRECATED; /** * This method is deprecated, and @@ -132,7 +132,7 @@ public: */ template void apply_decomposition (Vector &dst, - const Vector &src) const; + const Vector &src) const DEAL_II_DEPRECATED; /** * Apply the incomplete decomposition, diff --git a/deal.II/include/deal.II/lac/sparse_matrix.h b/deal.II/include/deal.II/lac/sparse_matrix.h index 9092530630..7b150ae638 100644 --- a/deal.II/include/deal.II/lac/sparse_matrix.h +++ b/deal.II/include/deal.II/lac/sparse_matrix.h @@ -908,7 +908,7 @@ public: * @deprecated Use iterator or const_iterator instead! */ number raw_entry (const unsigned int row, - const unsigned int index) const; + const unsigned int index) const DEAL_II_DEPRECATED; /** * This is for hackers. Get access to the ith element of this @@ -923,14 +923,14 @@ public: * * @internal @deprecated Use iterator or const_iterator instead! */ - number global_entry (const unsigned int i) const; + number global_entry (const unsigned int i) const DEAL_II_DEPRECATED; /** * Same as above, but with write access. You certainly know what you do? * * @internal @deprecated Use iterator or const_iterator instead! */ - number &global_entry (const unsigned int i); + number &global_entry (const unsigned int i) DEAL_II_DEPRECATED; //@} /** @@ -1497,6 +1497,16 @@ private: */ std::size_t max_len; + /** + * Return the value of the indexth entry in row. Here, + * index refers to the internal representation of the matrix, not + * the column. This is an internal function because it exposes the actual + * format in which data is stored -- be sure to understand what you are + * doing here. + */ + number nth_entry_in_row (const unsigned int row, + const unsigned int index) const; + // make all other sparse matrices friends template friend class SparseMatrix; template friend class SparseLUDecomposition; @@ -1506,6 +1516,13 @@ private: * To allow it calling private prepare_add() and prepare_set(). */ template friend class BlockMatrixBase; + + /** + * Also give access to internal details to the iterator/accessor + * classes. + */ + template friend class SparseMatrixIterators::Iterator; + template friend class SparseMatrixIterators::Accessor; }; /** @@ -1812,6 +1829,20 @@ inline number SparseMatrix::raw_entry (const unsigned int row, const unsigned int index) const +{ + // this is the (deprecated) public version of the + // nth_entry_in_row() function. this function will soon + // go away. + return nth_entry_in_row (row, index); +} + + + +template +inline +number +SparseMatrix::nth_entry_in_row (const unsigned int row, + const unsigned int index) const { Assert(rowrows, ExcIndexRange(row,0,cols->rows)); Assert(indexrow_length(row), @@ -1917,7 +1948,7 @@ namespace SparseMatrixIterators number Accessor::value () const { - return matrix->raw_entry(a_row, a_index); + return matrix->nth_entry_in_row(a_row, a_index); } @@ -1946,8 +1977,8 @@ namespace SparseMatrixIterators inline Accessor::Reference::operator number() const { - return accessor->matrix->raw_entry(accessor->a_row, - accessor->a_index); + return accessor->matrix->nth_entry_in_row(accessor->a_row, + accessor->a_index); } diff --git a/deal.II/include/deal.II/lac/sparse_mic.h b/deal.II/include/deal.II/lac/sparse_mic.h index 3e82b16e99..f4ba0fbc2b 100644 --- a/deal.II/include/deal.II/lac/sparse_mic.h +++ b/deal.II/include/deal.II/lac/sparse_mic.h @@ -85,7 +85,7 @@ public: * compability. It will be * removed in later versions. */ - void reinit (const SparsityPattern &sparsity); + void reinit (const SparsityPattern &sparsity) DEAL_II_DEPRECATED; /** * Same as @p decompose. @@ -102,7 +102,7 @@ public: */ template void decompose (const SparseMatrix &matrix, - const double strengthen_diagonal=0.); + const double strengthen_diagonal=0.) DEAL_II_DEPRECATED; /** * Apply the incomplete decomposition, diff --git a/deal.II/include/deal.II/lac/sparsity_pattern.h b/deal.II/include/deal.II/lac/sparsity_pattern.h index fe87da3f19..a31894c2c8 100644 --- a/deal.II/include/deal.II/lac/sparsity_pattern.h +++ b/deal.II/include/deal.II/lac/sparsity_pattern.h @@ -790,7 +790,13 @@ public: * complexity of this function is log(m) if the sparsity pattern is * compressed. * - * @deprecated Use SparseMatrix::const_iterator + * @note This function is not cheap since it has to search through all + * of the elements of the given row i to find whether index + * j exists. Thus, it is more expensive than necessary in cases + * where you want to loop over all of the nonzero elements of this + * sparsity pattern (or of a sparse matrix associated with it) or of a + * single row. In such cases, it is more efficient to use iterators over + * the elements of the sparsity pattern or of the sparse matrix. */ unsigned int operator() (const unsigned int i, const unsigned int j) const; @@ -949,7 +955,7 @@ public: * done by calling @p GridTools::partition_triangulation. */ void partition (const unsigned int n_partitions, - std::vector &partition_indices) const; + std::vector &partition_indices) const DEAL_II_DEPRECATED; /** diff --git a/deal.II/include/deal.II/lac/swappable_vector.h b/deal.II/include/deal.II/lac/swappable_vector.h index 47464dd98e..02db61b625 100644 --- a/deal.II/include/deal.II/lac/swappable_vector.h +++ b/deal.II/include/deal.II/lac/swappable_vector.h @@ -253,7 +253,7 @@ private: * we can as well get away * with it. */ - Threads::ThreadMutex lock; + Threads::Mutex lock; /** * Flag by which the @p alert diff --git a/deal.II/include/deal.II/lac/swappable_vector.templates.h b/deal.II/include/deal.II/lac/swappable_vector.templates.h index 92577e585a..e8780cd968 100644 --- a/deal.II/include/deal.II/lac/swappable_vector.templates.h +++ b/deal.II/include/deal.II/lac/swappable_vector.templates.h @@ -66,7 +66,7 @@ SwappableVector::operator= (const SwappableVector &v) // if in MT mode, block all other // operations. if not in MT mode, // this is a no-op - Threads::ThreadMutex::ScopedLock lock(this->lock); + Threads::Mutex::ScopedLock lock(this->lock); Vector::operator = (v); data_is_preloaded = false; @@ -94,7 +94,7 @@ void SwappableVector::swap_out (const std::string &name) // if in MT mode, block all other // operations. if not in MT mode, // this is a no-op - Threads::ThreadMutex::ScopedLock lock(this->lock); + Threads::Mutex::ScopedLock lock(this->lock); // check that we have not called // @p alert without the respective @@ -206,7 +206,7 @@ void SwappableVector::kill_file () // (there should be none, but who // knows). if not in MT mode, // this is a no-op - Threads::ThreadMutex::ScopedLock lock(this->lock); + Threads::Mutex::ScopedLock lock(this->lock); // this is too bad: someone // requested the vector in advance, diff --git a/deal.II/include/deal.II/lac/trilinos_block_vector.h b/deal.II/include/deal.II/lac/trilinos_block_vector.h index 8c898ed3bb..2a6dd0f02b 100644 --- a/deal.II/include/deal.II/lac/trilinos_block_vector.h +++ b/deal.II/include/deal.II/lac/trilinos_block_vector.h @@ -195,7 +195,7 @@ namespace TrilinosWrappers * distributed objects" for more * information. */ - void compress (const Epetra_CombineMode last_action); + void compress (const Epetra_CombineMode last_action) DEAL_II_DEPRECATED; /** * so it is not hidden 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 34b7bd28e3..df5bb65a79 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 @@ -316,7 +316,7 @@ namespace TrilinosWrappers * distributed objects" for more * information. */ - void compress (const Epetra_CombineMode last_action); + void compress (const Epetra_CombineMode last_action) DEAL_II_DEPRECATED; /** * so it is not hidden 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 6e386f86bf..234677f9fd 100644 --- a/deal.II/include/deal.II/lac/trilinos_vector_base.h +++ b/deal.II/include/deal.II/lac/trilinos_vector_base.h @@ -351,7 +351,7 @@ namespace TrilinosWrappers /** * @deprecated */ - void compress (const Epetra_CombineMode last_action); + void compress (const Epetra_CombineMode last_action) DEAL_II_DEPRECATED; /** * Returns the state of the diff --git a/deal.II/include/deal.II/lac/vector.h b/deal.II/include/deal.II/lac/vector.h index fccc27c794..ca8980b124 100644 --- a/deal.II/include/deal.II/lac/vector.h +++ b/deal.II/include/deal.II/lac/vector.h @@ -800,7 +800,10 @@ public: * operator *= and * operator /= instead. */ - void scale (const Number factor); + void scale (const Number factor) DEAL_II_DEPRECATED + { + this->operator *= (factor); + } /** @@ -1265,19 +1268,6 @@ Number &Vector::operator[] (const unsigned int i) -template -inline -Vector &Vector::operator *= (const Number factor) -{ - - Assert (numbers::is_finite(factor),ExcNumberNotFinite()); - - scale (factor); - return *this; -} - - - template inline Vector & diff --git a/deal.II/include/deal.II/lac/vector.templates.h b/deal.II/include/deal.II/lac/vector.templates.h index e7f981240d..ddd7128aa9 100644 --- a/deal.II/include/deal.II/lac/vector.templates.h +++ b/deal.II/include/deal.II/lac/vector.templates.h @@ -430,8 +430,7 @@ Vector >::operator = (const std::complex s) template -void -Vector::scale (const Number factor) +Vector &Vector::operator *= (const Number factor) { Assert (numbers::is_finite(factor),ExcNumberNotFinite()); @@ -442,6 +441,8 @@ Vector::scale (const Number factor) val, (factor*boost::lambda::_1), internal::Vector::minimum_parallel_grain_size); + + return *this; } diff --git a/deal.II/include/deal.II/lac/vector_memory.h b/deal.II/include/deal.II/lac/vector_memory.h index ec8926a42c..a5f35ac422 100644 --- a/deal.II/include/deal.II/lac/vector_memory.h +++ b/deal.II/include/deal.II/lac/vector_memory.h @@ -396,7 +396,7 @@ private: * internal data of this object * from multiple threads. */ - static Threads::ThreadMutex mutex; + static Threads::Mutex mutex; }; /*@}*/ diff --git a/deal.II/include/deal.II/multigrid/mg_matrix.h b/deal.II/include/deal.II/multigrid/mg_matrix.h index befb99f998..dcba1d20b7 100644 --- a/deal.II/include/deal.II/multigrid/mg_matrix.h +++ b/deal.II/include/deal.II/multigrid/mg_matrix.h @@ -109,7 +109,7 @@ public: std::size_t memory_consumption () const; private: SmartPointer,MGMatrix > matrix; -}; +} DEAL_II_DEPRECATED; /** diff --git a/deal.II/include/deal.II/multigrid/mg_smoother.h b/deal.II/include/deal.II/multigrid/mg_smoother.h index 6f05959715..c3737cffd3 100644 --- a/deal.II/include/deal.II/multigrid/mg_smoother.h +++ b/deal.II/include/deal.II/multigrid/mg_smoother.h @@ -68,7 +68,7 @@ public: const unsigned int steps = 1, const bool variable = false, const bool symmetric = false, - const bool transpose = false); + const bool transpose = false) DEAL_II_DEPRECATED; /** * Modify the number of smoothing diff --git a/deal.II/include/deal.II/multigrid/mg_tools.h b/deal.II/include/deal.II/multigrid/mg_tools.h index aca7bcfaa1..e2d05f0fd3 100644 --- a/deal.II/include/deal.II/multigrid/mg_tools.h +++ b/deal.II/include/deal.II/multigrid/mg_tools.h @@ -205,7 +205,7 @@ namespace MGTools void count_dofs_per_component (const DoFHandler &mg_dof, std::vector > &result, - std::vector target_component); + std::vector target_component) DEAL_II_DEPRECATED; /** * Generate a list of those diff --git a/deal.II/include/deal.II/multigrid/multigrid.h b/deal.II/include/deal.II/multigrid/multigrid.h index 04692f7996..4116300ad5 100644 --- a/deal.II/include/deal.II/multigrid/multigrid.h +++ b/deal.II/include/deal.II/multigrid/multigrid.h @@ -176,7 +176,7 @@ public: * level of this Multigrid * object. */ - void vmult(VECTOR &dst, const VECTOR &src) const; + void vmult(VECTOR &dst, const VECTOR &src) const DEAL_II_DEPRECATED; /** * @deprecated This function is @@ -194,7 +194,7 @@ public: * level of this Multigrid * object. */ - void vmult_add(VECTOR &dst, const VECTOR &src) const; + void vmult_add(VECTOR &dst, const VECTOR &src) const DEAL_II_DEPRECATED; /** * @deprecated Even worse than @@ -204,7 +204,7 @@ public: * objects relying on it can be * constructed. */ - void Tvmult(VECTOR &dst, const VECTOR &src) const; + void Tvmult(VECTOR &dst, const VECTOR &src) const DEAL_II_DEPRECATED; /** * @deprecated Even worse than @@ -214,7 +214,7 @@ public: * objects relying on it can be * constructed. */ - void Tvmult_add(VECTOR &dst, const VECTOR &src) const; + void Tvmult_add(VECTOR &dst, const VECTOR &src) const DEAL_II_DEPRECATED; /** * Set additional matrices to diff --git a/deal.II/include/deal.II/numerics/data_postprocessor.h b/deal.II/include/deal.II/numerics/data_postprocessor.h index 912b65fc7d..f8101e1634 100644 --- a/deal.II/include/deal.II/numerics/data_postprocessor.h +++ b/deal.II/include/deal.II/numerics/data_postprocessor.h @@ -124,7 +124,7 @@ public: const std::vector > &duh, const std::vector > &dduh, const std::vector > &normals, - std::vector > &computed_quantities) const; + std::vector > &computed_quantities) const DEAL_II_DEPRECATED; /** * This is the main function which actually @@ -182,7 +182,7 @@ public: const std::vector > > &duh, const std::vector > > &dduh, const std::vector > &normals, - std::vector > &computed_quantities) const; + std::vector > &computed_quantities) const DEAL_II_DEPRECATED; /** * Same as the diff --git a/deal.II/include/deal.II/numerics/error_estimator.h b/deal.II/include/deal.II/numerics/error_estimator.h index a17ce5ae70..4bbba974eb 100644 --- a/deal.II/include/deal.II/numerics/error_estimator.h +++ b/deal.II/include/deal.II/numerics/error_estimator.h @@ -349,7 +349,7 @@ public: const ComponentMask &component_mask = ComponentMask(), const Function *coefficients = 0, const unsigned int n_threads = numbers::invalid_unsigned_int, - const types::subdomain_id subdomain_id = types::invalid_subdomain_id, + const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id, const types::material_id material_id = numbers::invalid_material_id); /** @@ -366,7 +366,7 @@ public: const ComponentMask &component_mask = ComponentMask(), const Function *coefficients = 0, const unsigned int n_threads = multithread_info.n_default_threads, - const types::subdomain_id subdomain_id = types::invalid_subdomain_id, + const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id, const types::material_id material_id = numbers::invalid_material_id); /** @@ -406,7 +406,7 @@ public: const ComponentMask &component_mask = ComponentMask(), const Function *coefficients = 0, const unsigned int n_threads = multithread_info.n_default_threads, - const types::subdomain_id subdomain_id = types::invalid_subdomain_id, + const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id, const types::material_id material_id = numbers::invalid_material_id); /** @@ -423,7 +423,7 @@ public: const ComponentMask &component_mask = ComponentMask(), const Function *coefficients = 0, const unsigned int n_threads = multithread_info.n_default_threads, - const types::subdomain_id subdomain_id = types::invalid_subdomain_id, + const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id, const types::material_id material_id = numbers::invalid_material_id); @@ -443,7 +443,7 @@ public: const ComponentMask &component_mask = ComponentMask(), const Function *coefficients = 0, const unsigned int n_threads = multithread_info.n_default_threads, - const types::subdomain_id subdomain_id = types::invalid_subdomain_id, + const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id, const types::material_id material_id = numbers::invalid_material_id); @@ -462,7 +462,7 @@ public: const ComponentMask &component_mask = ComponentMask(), const Function *coefficients = 0, const unsigned int n_threads = multithread_info.n_default_threads, - const types::subdomain_id subdomain_id = types::invalid_subdomain_id, + const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id, const types::material_id material_id = numbers::invalid_material_id); @@ -482,7 +482,7 @@ public: const ComponentMask &component_mask = ComponentMask(), const Function *coefficients = 0, const unsigned int n_threads = multithread_info.n_default_threads, - const types::subdomain_id subdomain_id = types::invalid_subdomain_id, + const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id, const types::material_id material_id = numbers::invalid_material_id); @@ -501,7 +501,7 @@ public: const ComponentMask &component_mask = ComponentMask(), const Function *coefficients = 0, const unsigned int n_threads = multithread_info.n_default_threads, - const types::subdomain_id subdomain_id = types::invalid_subdomain_id, + const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id, const types::material_id material_id = numbers::invalid_material_id); @@ -612,7 +612,7 @@ public: const ComponentMask &component_mask = ComponentMask(), const Function *coefficients = 0, const unsigned int n_threads = multithread_info.n_default_threads, - const types::subdomain_id subdomain_id = types::invalid_subdomain_id, + const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id, const types::material_id material_id = numbers::invalid_material_id); /** @@ -629,7 +629,7 @@ public: const ComponentMask &component_mask = ComponentMask(), const Function *coefficients = 0, const unsigned int n_threads = multithread_info.n_default_threads, - const types::subdomain_id subdomain_id = types::invalid_subdomain_id, + const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id, const types::material_id material_id = numbers::invalid_material_id); /** @@ -669,7 +669,7 @@ public: const ComponentMask &component_mask = ComponentMask(), const Function *coefficients = 0, const unsigned int n_threads = multithread_info.n_default_threads, - const types::subdomain_id subdomain_id = types::invalid_subdomain_id, + const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id, const types::material_id material_id = numbers::invalid_material_id); /** @@ -686,7 +686,7 @@ public: const ComponentMask &component_mask = ComponentMask(), const Function *coefficients = 0, const unsigned int n_threads = multithread_info.n_default_threads, - const types::subdomain_id subdomain_id = types::invalid_subdomain_id, + const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id, const types::material_id material_id = numbers::invalid_material_id); @@ -706,7 +706,7 @@ public: const ComponentMask &component_mask = ComponentMask(), const Function *coefficients = 0, const unsigned int n_threads = multithread_info.n_default_threads, - const types::subdomain_id subdomain_id = types::invalid_subdomain_id, + const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id, const types::material_id material_id = numbers::invalid_material_id); @@ -725,7 +725,7 @@ public: const ComponentMask &component_mask = ComponentMask(), const Function *coefficients = 0, const unsigned int n_threads = multithread_info.n_default_threads, - const types::subdomain_id subdomain_id = types::invalid_subdomain_id, + const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id, const types::material_id material_id = numbers::invalid_material_id); @@ -745,7 +745,7 @@ public: const ComponentMask &component_mask = ComponentMask(), const Function *coefficients = 0, const unsigned int n_threads = multithread_info.n_default_threads, - const types::subdomain_id subdomain_id = types::invalid_subdomain_id, + const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id, const types::material_id material_id = numbers::invalid_material_id); @@ -764,7 +764,7 @@ public: const ComponentMask &component_mask = ComponentMask(), const Function *coefficients = 0, const unsigned int n_threads = multithread_info.n_default_threads, - const types::subdomain_id subdomain_id = types::invalid_subdomain_id, + const types::subdomain_id subdomain_id = numbers::invalid_subdomain_id, const types::material_id material_id = numbers::invalid_material_id); /** diff --git a/deal.II/include/deal.II/numerics/point_value_history.h b/deal.II/include/deal.II/numerics/point_value_history.h index b8178902e9..0e7877caf1 100644 --- a/deal.II/include/deal.II/numerics/point_value_history.h +++ b/deal.II/include/deal.II/numerics/point_value_history.h @@ -554,7 +554,7 @@ public: * * @deprecated */ - Vector mark_locations(); + Vector mark_locations() DEAL_II_DEPRECATED; /** diff --git a/deal.II/include/deal.II/numerics/vector_tools.h b/deal.II/include/deal.II/numerics/vector_tools.h index 1f2160480a..99cf1511f0 100644 --- a/deal.II/include/deal.II/numerics/vector_tools.h +++ b/deal.II/include/deal.II/numerics/vector_tools.h @@ -751,9 +751,6 @@ namespace VectorTools const ComponentMask &component_mask = ComponentMask()); /** - * @deprecated This function exists mainly - * for backward compatibility. - * * Same function as above, but * taking only one pair of * boundary indicator and @@ -893,9 +890,6 @@ namespace VectorTools const ComponentMask &component_mask = ComponentMask()); /** - * @deprecated This function exists - * only for backward compatibility. - * * Same function as above, but taking * only one pair of boundary indicator * and corresponding boundary 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 a96dfb3a24..33c30e9dfa 100644 --- a/deal.II/include/deal.II/numerics/vector_tools.templates.h +++ b/deal.II/include/deal.II/numerics/vector_tools.templates.h @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -1688,7 +1689,7 @@ namespace VectorTools std::vector > unit_support_points (fe.dofs_per_face); for (unsigned int i=0; i::vector_value ( result.add(-8., aux); f.vector_value(p+incr[0], aux); result.add(8., aux); - result.scale(1./(12*h)); + result/=(12.*h); return; default: Assert(false, ExcInvalidFormula()); diff --git a/deal.II/source/base/logstream.cc b/deal.II/source/base/logstream.cc index 8fb571cb3d..67852cb616 100644 --- a/deal.II/source/base/logstream.cc +++ b/deal.II/source/base/logstream.cc @@ -35,8 +35,8 @@ DEAL_II_NAMESPACE_OPEN namespace { - Threads::ThreadMutex log_lock; - Threads::ThreadMutex write_lock; + Threads::Mutex log_lock; + Threads::Mutex write_lock; } @@ -151,7 +151,7 @@ LogStream::~LogStream() void LogStream::test_mode(bool on) { - Threads::ThreadMutex::ScopedLock lock(log_lock); + Threads::Mutex::ScopedLock lock(log_lock); if (on) { double_threshold = 1.e-10; @@ -180,7 +180,7 @@ LogStream::operator<< (std::ostream& (*p) (std::ostream &)) std::ostream & (* const p_endl) (std::ostream &) = &std::endl; if (p == p_endl) { - Threads::ThreadMutex::ScopedLock lock(write_lock); + Threads::Mutex::ScopedLock lock(write_lock); print_line_head(); std::ostringstream &stream = get_stream(); if (prefixes.size() <= std_depth) @@ -200,7 +200,7 @@ std::ostringstream & LogStream::get_stream() { //TODO: use a ThreadLocalStorage object here - Threads::ThreadMutex::ScopedLock lock(log_lock); + Threads::Mutex::ScopedLock lock(log_lock); const unsigned int id = Threads::this_thread_id(); // if necessary allocate a stream object @@ -217,7 +217,7 @@ LogStream::get_stream() void LogStream::attach(std::ostream &o) { - Threads::ThreadMutex::ScopedLock lock(log_lock); + Threads::Mutex::ScopedLock lock(log_lock); file = &o; o.setf(std::ios::showpoint | std::ios::left); o << dealjobid(); @@ -226,14 +226,14 @@ LogStream::attach(std::ostream &o) void LogStream::detach () { - Threads::ThreadMutex::ScopedLock lock(log_lock); + Threads::Mutex::ScopedLock lock(log_lock); file = 0; } void LogStream::log_cerr () { - Threads::ThreadMutex::ScopedLock lock(log_lock); + Threads::Mutex::ScopedLock lock(log_lock); if (old_cerr == 0) { old_cerr = std::cerr.rdbuf(file->rdbuf()); @@ -278,7 +278,7 @@ LogStream::get_prefix() const void LogStream::push (const std::string &text) { - Threads::ThreadMutex::ScopedLock lock(log_lock); + Threads::Mutex::ScopedLock lock(log_lock); std::string pre=prefixes.top(); pre += text; pre += std::string(":"); @@ -288,7 +288,7 @@ LogStream::push (const std::string &text) void LogStream::pop () { - Threads::ThreadMutex::ScopedLock lock(log_lock); + Threads::Mutex::ScopedLock lock(log_lock); if (prefixes.size() > 1) prefixes.pop(); } @@ -297,7 +297,7 @@ void LogStream::pop () unsigned int LogStream::depth_console (const unsigned int n) { - Threads::ThreadMutex::ScopedLock lock(log_lock); + Threads::Mutex::ScopedLock lock(log_lock); const unsigned int h = std_depth; std_depth = n; return h; @@ -307,7 +307,7 @@ LogStream::depth_console (const unsigned int n) unsigned int LogStream::depth_file (const unsigned int n) { - Threads::ThreadMutex::ScopedLock lock(log_lock); + Threads::Mutex::ScopedLock lock(log_lock); const unsigned int h = file_depth; file_depth = n; return h; @@ -317,7 +317,7 @@ LogStream::depth_file (const unsigned int n) void LogStream::threshold_double (const double t) { - Threads::ThreadMutex::ScopedLock lock(log_lock); + Threads::Mutex::ScopedLock lock(log_lock); double_threshold = t; } @@ -325,7 +325,7 @@ LogStream::threshold_double (const double t) void LogStream::threshold_float (const float t) { - Threads::ThreadMutex::ScopedLock lock(log_lock); + Threads::Mutex::ScopedLock lock(log_lock); float_threshold = t; } @@ -333,7 +333,7 @@ LogStream::threshold_float (const float t) bool LogStream::log_execution_time (const bool flag) { - Threads::ThreadMutex::ScopedLock lock(log_lock); + Threads::Mutex::ScopedLock lock(log_lock); const bool h = print_utime; print_utime = flag; return h; @@ -343,7 +343,7 @@ LogStream::log_execution_time (const bool flag) bool LogStream::log_time_differences (const bool flag) { - Threads::ThreadMutex::ScopedLock lock(log_lock); + Threads::Mutex::ScopedLock lock(log_lock); const bool h = diff_utime; diff_utime = flag; return h; @@ -353,7 +353,7 @@ LogStream::log_time_differences (const bool flag) bool LogStream::log_thread_id (const bool flag) { - Threads::ThreadMutex::ScopedLock lock(log_lock); + Threads::Mutex::ScopedLock lock(log_lock); const bool h = print_thread_id; print_thread_id = flag; return h; diff --git a/deal.II/source/base/mpi.cc b/deal.II/source/base/mpi.cc index 15917ddfb9..4ad632d348 100644 --- a/deal.II/source/base/mpi.cc +++ b/deal.II/source/base/mpi.cc @@ -392,7 +392,7 @@ namespace Utilities int MPI_has_been_started = 0; MPI_Initialized(&MPI_has_been_started); - if (Utilities::System::program_uses_mpi() == true && owns_mpi == true && + if (Utilities::System::job_supports_mpi() == true && owns_mpi == true && MPI_has_been_started != 0) { if (std::uncaught_exception()) diff --git a/deal.II/source/base/polynomial.cc b/deal.II/source/base/polynomial.cc index 7f1a627bcb..0664ce5e2a 100644 --- a/deal.II/source/base/polynomial.cc +++ b/deal.II/source/base/polynomial.cc @@ -34,7 +34,7 @@ DEAL_II_NAMESPACE_OPEN // more fine-grained solution namespace { - Threads::ThreadMutex coefficients_lock; + Threads::Mutex coefficients_lock; } @@ -888,7 +888,7 @@ namespace Polynomials // operation of this function; // for this, acquire the lock // until we quit this function - Threads::ThreadMutex::ScopedLock lock(coefficients_lock); + Threads::Mutex::ScopedLock lock(coefficients_lock); // The first 2 coefficients are hard-coded if (k==0) @@ -1021,7 +1021,7 @@ namespace Polynomials // then get a pointer to the array // of coefficients. do that in a MT // safe way - Threads::ThreadMutex::ScopedLock lock (coefficients_lock); + Threads::Mutex::ScopedLock lock (coefficients_lock); return *shifted_coefficients[k]; } @@ -1153,7 +1153,7 @@ namespace Polynomials // of this function // for this, acquire the lock // until we quit this function - Threads::ThreadMutex::ScopedLock lock(coefficients_lock); + Threads::Mutex::ScopedLock lock(coefficients_lock); // The first 2 coefficients // are hard-coded @@ -1288,7 +1288,7 @@ namespace Polynomials // then get a pointer to the array // of coefficients. do that in a MT // safe way - Threads::ThreadMutex::ScopedLock lock (coefficients_lock); + Threads::Mutex::ScopedLock lock (coefficients_lock); return *recursive_coefficients[k]; } diff --git a/deal.II/source/base/polynomials_raviart_thomas.cc b/deal.II/source/base/polynomials_raviart_thomas.cc index aa0ee7137f..367b2443e1 100644 --- a/deal.II/source/base/polynomials_raviart_thomas.cc +++ b/deal.II/source/base/polynomials_raviart_thomas.cc @@ -78,8 +78,8 @@ PolynomialsRaviartThomas::compute (const Point &unit_point, // deal.II/create_mass_matrix_05) // will start to produce random // results in multithread mode - static Threads::ThreadMutex mutex; - Threads::ThreadMutex::ScopedLock lock(mutex); + static Threads::Mutex mutex; + Threads::Mutex::ScopedLock lock(mutex); static std::vector p_values; static std::vector > p_grads; diff --git a/deal.II/source/base/subscriptor.cc b/deal.II/source/base/subscriptor.cc index dad0b8aafb..46c965b9c4 100644 --- a/deal.II/source/base/subscriptor.cc +++ b/deal.II/source/base/subscriptor.cc @@ -34,7 +34,7 @@ namespace // operates on a per-object base (in which case we would have to // include the huge file into the // file). - Threads::ThreadMutex subscription_lock; + Threads::Mutex subscription_lock; } @@ -144,7 +144,7 @@ void Subscriptor::do_subscribe (const char *id) const #ifdef DEBUG if (object_info == 0) object_info = &typeid(*this); - Threads::ThreadMutex::ScopedLock lock (subscription_lock); + Threads::Mutex::ScopedLock lock (subscription_lock); ++counter; #if DEAL_USE_MT == 0 @@ -171,7 +171,7 @@ void Subscriptor::do_unsubscribe (const char *id) const if (counter == 0) return; - Threads::ThreadMutex::ScopedLock lock (subscription_lock); + Threads::Mutex::ScopedLock lock (subscription_lock); --counter; #if DEAL_USE_MT == 0 diff --git a/deal.II/source/base/thread_management.cc b/deal.II/source/base/thread_management.cc index 7eb404cc31..f6bcb4ecb5 100644 --- a/deal.II/source/base/thread_management.cc +++ b/deal.II/source/base/thread_management.cc @@ -34,12 +34,12 @@ namespace Threads // counter and access mutex for the // number of threads volatile unsigned int n_existing_threads_counter = 1; - ThreadMutex n_existing_threads_mutex; + Mutex n_existing_threads_mutex; void register_thread () { - ThreadMutex::ScopedLock lock (n_existing_threads_mutex); + Mutex::ScopedLock lock (n_existing_threads_mutex); ++n_existing_threads_counter; } @@ -47,7 +47,7 @@ namespace Threads void deregister_thread () { - ThreadMutex::ScopedLock lock (n_existing_threads_mutex); + Mutex::ScopedLock lock (n_existing_threads_mutex); --n_existing_threads_counter; Assert (n_existing_threads_counter >= 1, ExcInternalError()); @@ -127,7 +127,7 @@ namespace Threads unsigned int n_existing_threads () { - ThreadMutex::ScopedLock lock (internal::n_existing_threads_mutex); + Mutex::ScopedLock lock (internal::n_existing_threads_mutex); return internal::n_existing_threads_counter; } diff --git a/deal.II/source/base/timer.cc b/deal.II/source/base/timer.cc index e7bfbdb8f2..f8c0df85cf 100644 --- a/deal.II/source/base/timer.cc +++ b/deal.II/source/base/timer.cc @@ -336,7 +336,7 @@ TimerOutput::~TimerOutput() void TimerOutput::enter_subsection (const std::string §ion_name) { - Threads::ThreadMutex::ScopedLock lock (mutex); + Threads::Mutex::ScopedLock lock (mutex); Assert (section_name.empty() == false, ExcMessage ("Section string is empty.")); @@ -368,7 +368,7 @@ TimerOutput::leave_subsection (const std::string §ion_name) Assert (!active_sections.empty(), ExcMessage("Cannot exit any section because none has been entered!")); - Threads::ThreadMutex::ScopedLock lock (mutex); + Threads::Mutex::ScopedLock lock (mutex); if (section_name != "") { diff --git a/deal.II/source/base/utilities.cc b/deal.II/source/base/utilities.cc index 3b0f832fc8..b96b284b27 100644 --- a/deal.II/source/base/utilities.cc +++ b/deal.II/source/base/utilities.cc @@ -553,13 +553,6 @@ namespace Utilities bool job_supports_mpi () { - return program_uses_mpi(); - } - - - bool - program_uses_mpi () - { #ifdef DEAL_II_COMPILER_SUPPORTS_MPI int MPI_has_been_started = 0; MPI_Initialized(&MPI_has_been_started); @@ -571,6 +564,13 @@ namespace Utilities } + bool + program_uses_mpi () + { + return job_supports_mpi(); + } + + unsigned int get_n_mpi_processes (const MPI_Comm &mpi_communicator) { return MPI::n_mpi_processes (mpi_communicator); diff --git a/deal.II/source/distributed/tria.cc b/deal.II/source/distributed/tria.cc index 8419530180..33405c73c6 100644 --- a/deal.II/source/distributed/tria.cc +++ b/deal.II/source/distributed/tria.cc @@ -1133,7 +1133,7 @@ namespace // not local. delete_all_children (dealii_cell->child(c)); dealii_cell->child(c) - ->recursively_set_subdomain_id(types::artificial_subdomain_id); + ->recursively_set_subdomain_id(numbers::artificial_subdomain_id); } else { @@ -2066,7 +2066,7 @@ namespace parallel { std::string fname=std::string(filename)+".info"; std::ofstream f(fname.c_str()); - f << Utilities::System::get_n_mpi_processes (mpi_communicator) << " " + f << Utilities::MPI::n_mpi_processes (mpi_communicator) << " " << real_data_size << " " << attached_data_pack_callbacks.size() << std::endl; } @@ -2108,7 +2108,7 @@ namespace parallel std::string fname=std::string(filename)+".info"; std::ifstream f(fname.c_str()); f >> numcpus >> attached_size >> attached_count; - if (numcpus != Utilities::System::get_n_mpi_processes (mpi_communicator)) + if (numcpus != Utilities::MPI::n_mpi_processes (mpi_communicator)) throw ExcInternalError(); } @@ -2552,7 +2552,7 @@ namespace parallel cell = this->begin(0); cell != this->end(0); ++cell) - cell->recursively_set_subdomain_id(types::artificial_subdomain_id); + cell->recursively_set_subdomain_id(numbers::artificial_subdomain_id); do { @@ -2574,7 +2574,7 @@ namespace parallel == false) { delete_all_children (cell); - cell->set_subdomain_id (types::artificial_subdomain_id); + cell->set_subdomain_id (numbers::artificial_subdomain_id); } else @@ -2681,7 +2681,7 @@ namespace parallel { if (cell->subdomain_id() != my_subdomain && - cell->subdomain_id() != types::artificial_subdomain_id) + cell->subdomain_id() != numbers::artificial_subdomain_id) ++num_ghosts; } diff --git a/deal.II/source/dofs/dof_handler_policy.cc b/deal.II/source/dofs/dof_handler_policy.cc index f6bd0c8242..475b14699d 100644 --- a/deal.II/source/dofs/dof_handler_policy.cc +++ b/deal.II/source/dofs/dof_handler_policy.cc @@ -215,7 +215,7 @@ namespace internal /** * Distribute degrees of freedom on all cells, or on cells with the * correct subdomain_id if the corresponding argument is not equal to - * types::invalid_subdomain_id. Return the total number of dofs + * numbers::invalid_subdomain_id. Return the total number of dofs * returned. */ template @@ -243,7 +243,7 @@ namespace internal endc = dof_handler.end(); for (; cell != endc; ++cell) - if ((subdomain_id == types::invalid_subdomain_id) + if ((subdomain_id == numbers::invalid_subdomain_id) || (cell->subdomain_id() == subdomain_id)) next_free_dof @@ -254,7 +254,7 @@ namespace internal // update the cache used for cell dof indices for (typename DoFHandler::level_cell_iterator cell = dof_handler.begin(); cell != dof_handler.end(); ++cell) - if (cell->subdomain_id() != types::artificial_subdomain_id) + if (cell->subdomain_id() != numbers::artificial_subdomain_id) cell->update_cell_dof_indices_cache (); // finally restore the user flags @@ -871,7 +871,7 @@ namespace internal { const unsigned int n_dofs = Implementation::distribute_dofs (0, - types::invalid_subdomain_id, + numbers::invalid_subdomain_id, dof_handler); // now set the elements of the @@ -2570,8 +2570,7 @@ namespace internal // * Create global_dof_indexsets by // transferring our own owned_dofs to // every other machine. - const unsigned int n_cpus = Utilities::System:: - get_n_mpi_processes (tr->get_communicator()); + const unsigned int n_cpus = Utilities::MPI::n_mpi_processes (tr->get_communicator()); // Serialize our IndexSet and // determine size. diff --git a/deal.II/source/dofs/dof_tools.cc b/deal.II/source/dofs/dof_tools.cc index a5bcc64258..6165c9ed58 100644 --- a/deal.II/source/dofs/dof_tools.cc +++ b/deal.II/source/dofs/dof_tools.cc @@ -72,9 +72,9 @@ namespace DoFTools // subdomain. Not setting a subdomain is also okay, because we skip // ghost cells in the loop below. Assert ( - (dof.get_tria().locally_owned_subdomain() == types::invalid_subdomain_id) + (dof.get_tria().locally_owned_subdomain() == numbers::invalid_subdomain_id) || - (subdomain_id == types::invalid_subdomain_id) + (subdomain_id == numbers::invalid_subdomain_id) || (subdomain_id == dof.get_tria().locally_owned_subdomain()), ExcMessage ("For parallel::distributed::Triangulation objects and " @@ -90,7 +90,7 @@ namespace DoFTools // type, we only have to do the work if the current cell is owned by // the calling processor. Otherwise, just continue. for (; cell!=endc; ++cell) - if (((subdomain_id == types::invalid_subdomain_id) + if (((subdomain_id == numbers::invalid_subdomain_id) || (subdomain_id == cell->subdomain_id())) && @@ -135,9 +135,9 @@ namespace DoFTools // subdomain. Not setting a subdomain is also okay, because we skip // ghost cells in the loop below. Assert ( - (dof.get_tria().locally_owned_subdomain() == types::invalid_subdomain_id) + (dof.get_tria().locally_owned_subdomain() == numbers::invalid_subdomain_id) || - (subdomain_id == types::invalid_subdomain_id) + (subdomain_id == numbers::invalid_subdomain_id) || (subdomain_id == dof.get_tria().locally_owned_subdomain()), ExcMessage ("For parallel::distributed::Triangulation objects and " @@ -200,7 +200,7 @@ namespace DoFTools // type, we only have to do the work if the current cell is owned by // the calling processor. Otherwise, just continue. for (; cell!=endc; ++cell) - if (((subdomain_id == types::invalid_subdomain_id) + if (((subdomain_id == numbers::invalid_subdomain_id) || (subdomain_id == cell->subdomain_id())) && @@ -502,9 +502,9 @@ namespace DoFTools // subdomain. Not setting a subdomain is also okay, because we skip // ghost cells in the loop below. Assert ( - (dof.get_tria().locally_owned_subdomain() == types::invalid_subdomain_id) + (dof.get_tria().locally_owned_subdomain() == numbers::invalid_subdomain_id) || - (subdomain_id == types::invalid_subdomain_id) + (subdomain_id == numbers::invalid_subdomain_id) || (subdomain_id == dof.get_tria().locally_owned_subdomain()), ExcMessage ("For parallel::distributed::Triangulation objects and " @@ -527,7 +527,7 @@ namespace DoFTools // type, we only have to do the work if the current cell is owned by // the calling processor. Otherwise, just continue. for (; cell!=endc; ++cell) - if (((subdomain_id == types::invalid_subdomain_id) + if (((subdomain_id == numbers::invalid_subdomain_id) || (subdomain_id == cell->subdomain_id())) && @@ -4139,7 +4139,7 @@ namespace DoFTools // preset all values by an invalid value std::fill_n (subdomain_association.begin(), dof_handler.n_dofs(), - types::invalid_subdomain_id); + numbers::invalid_subdomain_id); std::vector local_dof_indices; local_dof_indices.reserve (max_dofs_per_cell(dof_handler)); @@ -4182,7 +4182,7 @@ namespace DoFTools Assert (std::find (subdomain_association.begin(), subdomain_association.end(), - types::invalid_subdomain_id) + numbers::invalid_subdomain_id) == subdomain_association.end(), ExcInternalError()); } @@ -4213,7 +4213,7 @@ namespace DoFTools // If we have a distributed::Triangulation only allow locally_owned // subdomain. Assert ( - (dof_handler.get_tria().locally_owned_subdomain() == types::invalid_subdomain_id) + (dof_handler.get_tria().locally_owned_subdomain() == numbers::invalid_subdomain_id) || (subdomain == dof_handler.get_tria().locally_owned_subdomain()), ExcMessage ("For parallel::distributed::Triangulation objects and " @@ -4719,8 +4719,8 @@ namespace DoFTools // since it should happen rather rarely that there are // several threads operating on different intergrid // weights, have only one mutex for all of them - static Threads::ThreadMutex mutex; - Threads::ThreadMutex::ScopedLock lock (mutex); + static Threads::Mutex mutex; + Threads::Mutex::ScopedLock lock (mutex); for (unsigned int i=0; isubdomain_id() == subdomain_id) || - (subdomain_id == types::invalid_subdomain_id)) + (subdomain_id == numbers::invalid_subdomain_id)) { Assert(cell1->get_fe().n_components() == cell2->get_fe().n_components(), ExcDimensionMismatch (cell1->get_fe().n_components(), @@ -1508,7 +1508,7 @@ namespace FETools for (; cell!=endc; ++cell) if ((cell->subdomain_id() == subdomain_id) || - (subdomain_id == types::invalid_subdomain_id)) + (subdomain_id == numbers::invalid_subdomain_id)) { if (hanging_nodes_not_allowed) for (unsigned int face=0; face::faces_per_cell; ++face) @@ -1581,7 +1581,7 @@ namespace FETools for (; cell!=endc; ++cell) if ((cell->subdomain_id() == subdomain_id) || - (subdomain_id == types::invalid_subdomain_id)) + (subdomain_id == numbers::invalid_subdomain_id)) { Assert(cell->get_fe().n_components() == fe2.n_components(), ExcDimensionMismatch(cell->get_fe().n_components(), @@ -1755,7 +1755,7 @@ namespace FETools for (; cell!=endc; ++cell) if ((cell->subdomain_id() == subdomain_id) || - (subdomain_id == types::invalid_subdomain_id)) + (subdomain_id == numbers::invalid_subdomain_id)) { if (hanging_nodes_not_allowed) for (unsigned int face=0; face::faces_per_cell; ++face) @@ -1951,7 +1951,7 @@ namespace FETools // operation of this function; // for this, acquire the lock // until we quit this function - Threads::ThreadMutex::ScopedLock lock(fe_name_map_lock); + Threads::Mutex::ScopedLock lock(fe_name_map_lock); Assert(fe_name_map_1d.find(name) == fe_name_map_1d.end(), ExcMessage("Cannot change existing element in finite element name list")); @@ -1981,7 +1981,7 @@ namespace FETools // operation of this function; // for this, acquire the lock // until we quit this function - Threads::ThreadMutex::ScopedLock lock(fe_name_map_lock); + Threads::Mutex::ScopedLock lock(fe_name_map_lock); Assert(fe_name_map_2d.find(name) == fe_name_map_2d.end(), ExcMessage("Cannot change existing element in finite element name list")); @@ -2010,7 +2010,7 @@ namespace FETools // operation of this function; // for this, acquire the lock // until we quit this function - Threads::ThreadMutex::ScopedLock lock(fe_name_map_lock); + Threads::Mutex::ScopedLock lock(fe_name_map_lock); Assert(fe_name_map_3d.find(name) == fe_name_map_3d.end(), ExcMessage("Cannot change existing element in finite element name list")); @@ -2200,7 +2200,7 @@ namespace FETools { // Make sure no other thread // is just adding an element - Threads::ThreadMutex::ScopedLock lock (fe_name_map_lock); + Threads::Mutex::ScopedLock lock (fe_name_map_lock); AssertThrow (fe_name_map.find(name_part) != fe_name_map.end(), ExcInvalidFEName(name)); diff --git a/deal.II/source/fe/mapping_q_eulerian.cc b/deal.II/source/fe/mapping_q_eulerian.cc index 2cf6197caa..a294849a02 100644 --- a/deal.II/source/fe/mapping_q_eulerian.cc +++ b/deal.II/source/fe/mapping_q_eulerian.cc @@ -158,7 +158,7 @@ compute_mapping_support_points // fe_values variable isn't used // simulatenously from different // threads - Threads::ThreadMutex::ScopedLock lock(fe_values_mutex); + Threads::Mutex::ScopedLock lock(fe_values_mutex); fe_values.reinit(dof_cell); fe_values.get_function_values(*euler_vector, shift_vector); diff --git a/deal.II/source/grid/grid_generator.cc b/deal.II/source/grid/grid_generator.cc index a2b6d02c63..b976ca453a 100644 --- a/deal.II/source/grid/grid_generator.cc +++ b/deal.II/source/grid/grid_generator.cc @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -3196,9 +3197,14 @@ void GridGenerator::laplace_transformation (Triangulation &tria, DoFHandler dof_handler(tria); dof_handler.distribute_dofs(q1); - SparsityPattern sparsity_pattern (dof_handler.n_dofs (), dof_handler.n_dofs (), - dof_handler.max_couplings_between_dofs()); - DoFTools::make_sparsity_pattern (dof_handler, sparsity_pattern); + + CompressedSparsityPattern c_sparsity_pattern (dof_handler.n_dofs (), + dof_handler.n_dofs ()); + DoFTools::make_sparsity_pattern (dof_handler, c_sparsity_pattern); + c_sparsity_pattern.compress (); + + SparsityPattern sparsity_pattern; + sparsity_pattern.copy_from (c_sparsity_pattern); sparsity_pattern.compress (); SparseMatrix S(sparsity_pattern); diff --git a/deal.II/source/grid/tria.cc b/deal.II/source/grid/tria.cc index 6b0834b82b..876a36e15e 100644 --- a/deal.II/source/grid/tria.cc +++ b/deal.II/source/grid/tria.cc @@ -12046,7 +12046,7 @@ template types::subdomain_id Triangulation::locally_owned_subdomain () const { - return types::invalid_subdomain_id; + return numbers::invalid_subdomain_id; } diff --git a/deal.II/source/grid/tria_accessor.cc b/deal.II/source/grid/tria_accessor.cc index 64de72813f..0661e03696 100644 --- a/deal.II/source/grid/tria_accessor.cc +++ b/deal.II/source/grid/tria_accessor.cc @@ -1348,7 +1348,7 @@ CellAccessor::set_subdomain_id (const types::subdomain_id new_sub template -types::subdomain_id_t CellAccessor::level_subdomain_id () const +types::subdomain_id CellAccessor::level_subdomain_id () const { Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed()); return this->tria->levels[this->present_level]->level_subdomain_ids[this->present_index]; @@ -1358,7 +1358,7 @@ types::subdomain_id_t CellAccessor::level_subdomain_id () const template void -CellAccessor::set_level_subdomain_id (const types::subdomain_id_t new_level_subdomain_id) const +CellAccessor::set_level_subdomain_id (const types::subdomain_id new_level_subdomain_id) const { Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed()); this->tria->levels[this->present_level]->level_subdomain_ids[this->present_index] diff --git a/deal.II/source/lac/block_matrix_array.cc b/deal.II/source/lac/block_matrix_array.cc index ae8a5a3a80..3e1cb14ed0 100644 --- a/deal.II/source/lac/block_matrix_array.cc +++ b/deal.II/source/lac/block_matrix_array.cc @@ -385,12 +385,12 @@ BlockTrianglePrecondition::do_row ( // First, divide by the current // factor, such that we can // multiply by it later. - aux.scale(1./m->prefix); + aux /= m->prefix; if (m->transpose) m->matrix->Tvmult_add(aux, dst.block(row_num)); else m->matrix->vmult_add(aux, dst.block(row_num)); - aux.scale(m->prefix); + aux *= m->prefix; } dst.block(row_num) = aux; } diff --git a/deal.II/source/lac/lapack_full_matrix.cc b/deal.II/source/lac/lapack_full_matrix.cc index 2cbcc23c67..5582ef2b5a 100644 --- a/deal.II/source/lac/lapack_full_matrix.cc +++ b/deal.II/source/lac/lapack_full_matrix.cc @@ -112,7 +112,7 @@ LAPACKFullMatrix::vmult ( AssertDimension(v.size(), this->n_cols()); AssertDimension(w.size(), this->n_rows()); - gemv("N", &mm, &nn, &alpha, this->data(), &mm, v.val, &one, &beta, w.val, &one); + gemv("N", &mm, &nn, &alpha, &this->values[0], &mm, v.val, &one, &beta, w.val, &one); break; } case svd: @@ -121,12 +121,12 @@ LAPACKFullMatrix::vmult ( AssertDimension(w.size(), this->n_rows()); // Compute V^T v work.resize(std::max(mm,nn)); - gemv("N", &nn, &nn, &alpha, svd_vt->data(), &nn, v.val, &one, &null, &work[0], &one); + gemv("N", &nn, &nn, &alpha, &svd_vt->values[0], &nn, v.val, &one, &null, &work[0], &one); // Multiply by singular values for (unsigned int i=0; idata(), &mm, &work[0], &one, &beta, w.val, &one); + gemv("N", &mm, &mm, &alpha, &svd_u->values[0], &mm, &work[0], &one, &beta, w.val, &one); break; } case inverse_svd: @@ -135,12 +135,12 @@ LAPACKFullMatrix::vmult ( AssertDimension(v.size(), this->n_rows()); // Compute U^T v work.resize(std::max(mm,nn)); - gemv("T", &mm, &mm, &alpha, svd_u->data(), &mm, v.val, &one, &null, &work[0], &one); + gemv("T", &mm, &mm, &alpha, &svd_u->values[0], &mm, v.val, &one, &null, &work[0], &one); // Multiply by singular values for (unsigned int i=0; idata(), &nn, &work[0], &one, &beta, w.val, &one); + gemv("T", &nn, &nn, &alpha, &svd_vt->values[0], &nn, &work[0], &one, &beta, w.val, &one); break; } default: @@ -170,7 +170,7 @@ LAPACKFullMatrix::Tvmult ( AssertDimension(w.size(), this->n_cols()); AssertDimension(v.size(), this->n_rows()); - gemv("T", &mm, &nn, &alpha, this->data(), &mm, v.val, &one, &beta, w.val, &one); + gemv("T", &mm, &nn, &alpha, &this->values[0], &mm, v.val, &one, &beta, w.val, &one); break; } case svd: @@ -180,12 +180,12 @@ LAPACKFullMatrix::Tvmult ( // Compute U^T v work.resize(std::max(mm,nn)); - gemv("T", &mm, &mm, &alpha, svd_u->data(), &mm, v.val, &one, &null, &work[0], &one); + gemv("T", &mm, &mm, &alpha, &svd_u->values[0], &mm, v.val, &one, &null, &work[0], &one); // Multiply by singular values for (unsigned int i=0; idata(), &nn, &work[0], &one, &beta, w.val, &one); + gemv("T", &nn, &nn, &alpha, &svd_vt->values[0], &nn, &work[0], &one, &beta, w.val, &one); break; case inverse_svd: { @@ -194,12 +194,12 @@ LAPACKFullMatrix::Tvmult ( // Compute V^T v work.resize(std::max(mm,nn)); - gemv("N", &nn, &nn, &alpha, svd_vt->data(), &nn, v.val, &one, &null, &work[0], &one); + gemv("N", &nn, &nn, &alpha, &svd_vt->values[0], &nn, v.val, &one, &null, &work[0], &one); // Multiply by singular values for (unsigned int i=0; idata(), &mm, &work[0], &one, &beta, w.val, &one); + gemv("N", &mm, &mm, &alpha, &svd_u->values[0], &mm, &work[0], &one, &beta, w.val, &one); break; } } @@ -216,7 +216,7 @@ LAPACKFullMatrix::compute_lu_factorization() Assert(state == matrix, ExcState(state)); const int mm = this->n_rows(); const int nn = this->n_cols(); - number *values = const_cast (this->data()); + number *values = const_cast (&this->values[0]); ipiv.resize(mm); int info = 0; getrf(&mm, &nn, values, &mm, &ipiv[0], &info); @@ -237,15 +237,15 @@ LAPACKFullMatrix::compute_svd() const int mm = this->n_rows(); const int nn = this->n_cols(); - number *values = const_cast (this->data()); + number *values = const_cast (&this->values[0]); wr.resize(std::max(mm,nn)); std::fill(wr.begin(), wr.end(), 0.); ipiv.resize(8*mm); svd_u.reset (new LAPACKFullMatrix(mm,mm)); svd_vt.reset (new LAPACKFullMatrix(nn,nn)); - number *mu = const_cast (svd_u->data()); - number *mvt = const_cast (svd_vt->data()); + number *mu = const_cast (&svd_u->values[0]); + number *mvt = const_cast (&svd_vt->values[0]); int info = 0; // see comment on this #if @@ -311,7 +311,7 @@ LAPACKFullMatrix::invert() const int nn = this->n_cols(); Assert (nn == mm, ExcNotQuadratic()); - number *values = const_cast (this->data()); + number *values = const_cast (&this->values[0]); ipiv.resize(mm); int info = 0; @@ -344,7 +344,7 @@ LAPACKFullMatrix::apply_lu_factorization(Vector &v, const char *trans = transposed ? &T : &N; const int nn = this->n_cols(); - const number *values = this->data(); + const number *values = &this->values[0]; int info = 0; getrs(trans, &nn, &one, values, &nn, &ipiv[0], @@ -367,7 +367,7 @@ LAPACKFullMatrix::compute_eigenvalues( if (right) vr.resize(nn*nn); if (left) vl.resize(nn*nn); - number *values = const_cast (this->data()); + number *values = const_cast (&this->values[0]); int info = 0; int lwork = 1; @@ -450,8 +450,8 @@ LAPACKFullMatrix::compute_eigenvalues_symmetric( wr.resize(nn); LAPACKFullMatrix matrix_eigenvectors(nn, nn); - number *values_A = const_cast (this->data()); - number *values_eigenvectors = const_cast (matrix_eigenvectors.data()); + number *values_A = const_cast (&this->values[0]); + number *values_eigenvectors = const_cast (&matrix_eigenvectors.values[0]); int info(0), lwork(1), @@ -562,9 +562,9 @@ LAPACKFullMatrix::compute_generalized_eigenvalues_symmetric( wr.resize(nn); LAPACKFullMatrix matrix_eigenvectors(nn, nn); - number *values_A = const_cast (this->data()); - number *values_B = const_cast (B.data()); - number *values_eigenvectors = const_cast (matrix_eigenvectors.data()); + number *values_A = const_cast (&this->values[0]); + number *values_B = const_cast (&B.values[0]); + number *values_eigenvectors = const_cast (&matrix_eigenvectors.values[0]); int info(0), lwork(1), @@ -672,8 +672,8 @@ LAPACKFullMatrix::compute_generalized_eigenvalues_symmetric ( wi.resize(nn); //This is set purley for consistency reasons with the //eigenvalues() function. - number *values_A = const_cast (this->data()); - number *values_B = const_cast (B.data()); + number *values_A = const_cast (&this->values[0]); + number *values_B = const_cast (&B.values[0]); int info = 0; int lwork = 1; diff --git a/deal.II/source/lac/sparse_direct.cc b/deal.II/source/lac/sparse_direct.cc index 200a2d09de..9a7cf69508 100644 --- a/deal.II/source/lac/sparse_direct.cc +++ b/deal.II/source/lac/sparse_direct.cc @@ -254,7 +254,7 @@ namespace /* -------------------------- MA27 ---------------------------- */ -Threads::ThreadMutex SparseDirectMA27::static_synchronisation_lock; +Threads::Mutex SparseDirectMA27::static_synchronisation_lock; struct SparseDirectMA27::DetachedModeData @@ -264,7 +264,7 @@ struct SparseDirectMA27::DetachedModeData * thread is currently talking * through the pipe. */ - Threads::ThreadMutex mutex; + Threads::Mutex mutex; /** * File handles for the pipe @@ -387,7 +387,7 @@ SparseDirectMA27::~SparseDirectMA27() if (detached_mode_data != 0) { // close down client - Threads::ThreadMutex::ScopedLock lock (detached_mode_data->mutex); + Threads::Mutex::ScopedLock lock (detached_mode_data->mutex); // Assign the result of write // and reset the variable to // avoid compiler warnings @@ -850,7 +850,7 @@ SparseDirectMA27::memory_consumption () const -Threads::ThreadMutex & +Threads::Mutex & SparseDirectMA27::get_synchronisation_lock () const { if (detached_mode) @@ -928,7 +928,7 @@ void SparseDirectMA27::call_ma27ad (const unsigned int *N, IKEEP, IW1, NSTEPS, IFLAG); else { - Threads::ThreadMutex::ScopedLock lock (detached_mode_data->mutex); + Threads::Mutex::ScopedLock lock (detached_mode_data->mutex); // first write the data we have // to push over, i.e. first // function index, then array @@ -978,7 +978,7 @@ void SparseDirectMA27::call_ma27bd (const unsigned int *N, // basically, everything is // already over the line, // except for A and LA - Threads::ThreadMutex::ScopedLock lock (detached_mode_data->mutex); + Threads::Mutex::ScopedLock lock (detached_mode_data->mutex); detached_mode_data->put ("2", 1, "ACTION 2"); detached_mode_data->put (LA, 1, "LA"); @@ -1026,7 +1026,7 @@ void SparseDirectMA27::call_ma27x1 (unsigned int *NRLNEC) HSL::MA27::ma27x1_ (NRLNEC); else { - Threads::ThreadMutex::ScopedLock lock (detached_mode_data->mutex); + Threads::Mutex::ScopedLock lock (detached_mode_data->mutex); // ma27x1 only reads data, so // don't send anything except // for the id @@ -1043,7 +1043,7 @@ void SparseDirectMA27::call_ma27x2 (unsigned int *NIRNEC) HSL::MA27::ma27x2_ (NIRNEC); else { - Threads::ThreadMutex::ScopedLock lock (detached_mode_data->mutex); + Threads::Mutex::ScopedLock lock (detached_mode_data->mutex); // ma27x2 only reads data, so // don't send anything except // for the id @@ -1060,7 +1060,7 @@ void SparseDirectMA27::call_ma27x3 (const unsigned int *LP) HSL::MA27::ma27x3_ (LP); else { - Threads::ThreadMutex::ScopedLock lock (detached_mode_data->mutex); + Threads::Mutex::ScopedLock lock (detached_mode_data->mutex); // ma27x2 only reads data, so // don't send anything except // for the id @@ -1075,7 +1075,7 @@ void SparseDirectMA27::call_ma27x3 (const unsigned int *LP) /* -------------------------- MA47 ---------------------------- */ -Threads::ThreadMutex SparseDirectMA47::synchronisation_lock; +Threads::Mutex SparseDirectMA47::synchronisation_lock; SparseDirectMA47::SparseDirectMA47 (const double LIW_factor_1, @@ -1373,7 +1373,7 @@ SparseDirectMA47::memory_consumption () const -Threads::ThreadMutex & +Threads::Mutex & SparseDirectMA47::get_synchronisation_lock () const { return synchronisation_lock; diff --git a/deal.II/source/lac/vector_memory.cc b/deal.II/source/lac/vector_memory.cc index b5019968f4..2e138a2644 100644 --- a/deal.II/source/lac/vector_memory.cc +++ b/deal.II/source/lac/vector_memory.cc @@ -31,7 +31,7 @@ template typename GrowingVectorMemory::Pool GrowingVectorMemory::pool; template -Threads::ThreadMutex GrowingVectorMemory::mutex; +Threads::Mutex GrowingVectorMemory::mutex; template inline @@ -96,7 +96,7 @@ GrowingVectorMemory::GrowingVectorMemory (const unsigned int initial_siz current_alloc(0), log_statistics(log_statistics) { - Threads::ThreadMutex::ScopedLock lock(mutex); + Threads::Mutex::ScopedLock lock(mutex); pool.initialize(initial_size); } @@ -123,7 +123,7 @@ inline VECTOR * GrowingVectorMemory::alloc () { - Threads::ThreadMutex::ScopedLock lock(mutex); + Threads::Mutex::ScopedLock lock(mutex); ++total_alloc; ++current_alloc; // see if there is a free vector @@ -153,7 +153,7 @@ inline void GrowingVectorMemory::free(const VECTOR *const v) { - Threads::ThreadMutex::ScopedLock lock(mutex); + Threads::Mutex::ScopedLock lock(mutex); for (typename std::vector::iterator i=pool.data->begin(); i != pool.data->end(); ++i) { @@ -174,7 +174,7 @@ inline void GrowingVectorMemory::release_unused_memory () { - Threads::ThreadMutex::ScopedLock lock(mutex); + Threads::Mutex::ScopedLock lock(mutex); std::vector new_data; @@ -200,7 +200,7 @@ inline std::size_t GrowingVectorMemory::memory_consumption () const { - Threads::ThreadMutex::ScopedLock lock(mutex); + Threads::Mutex::ScopedLock lock(mutex); std::size_t result = sizeof (*this); const typename std::vector::const_iterator diff --git a/deal.II/source/numerics/error_estimator.cc b/deal.II/source/numerics/error_estimator.cc index 786fbc34ec..6deea66bda 100644 --- a/deal.II/source/numerics/error_estimator.cc +++ b/deal.II/source/numerics/error_estimator.cc @@ -903,7 +903,7 @@ namespace internal // material_id), or if one of the // neighbors behind the face is on // the subdomain we care for - if ( ! ( ((subdomain_id == types::invalid_subdomain_id) + if ( ! ( ((subdomain_id == numbers::invalid_subdomain_id) || (cell->subdomain_id() == subdomain_id)) && @@ -923,7 +923,7 @@ namespace internal if (face->has_children() == false) care_for_cell |= ((cell->neighbor(face_no)->subdomain_id() == subdomain_id) || - (subdomain_id == types::invalid_subdomain_id)) + (subdomain_id == numbers::invalid_subdomain_id)) && ((cell->neighbor(face_no)->material_id() == material_id) || @@ -941,7 +941,7 @@ namespace internal ->material_id() == material_id) && (subdomain_id == - types::invalid_subdomain_id))) + numbers::invalid_subdomain_id))) { care_for_cell = true; break; @@ -1176,7 +1176,7 @@ estimate (const Mapping<1,spacedim> &mapping, if (dynamic_cast*> (&dof_handler.get_tria()) != 0) - Assert ((subdomain_id_ == types::invalid_subdomain_id) + Assert ((subdomain_id_ == numbers::invalid_subdomain_id) || (subdomain_id_ == dynamic_cast&> @@ -1287,7 +1287,7 @@ estimate (const Mapping<1,spacedim> &mapping, typename DH::active_cell_iterator cell = dof_handler.begin_active(); for (unsigned int cell_index=0; cell != dof_handler.end(); ++cell, ++cell_index) - if (((subdomain_id == types::invalid_subdomain_id) + if (((subdomain_id == numbers::invalid_subdomain_id) || (cell->subdomain_id() == subdomain_id)) && @@ -1527,7 +1527,7 @@ estimate (const Mapping &mapping, if (dynamic_cast*> (&dof_handler.get_tria()) != 0) - Assert ((subdomain_id_ == types::invalid_subdomain_id) + Assert ((subdomain_id_ == numbers::invalid_subdomain_id) || (subdomain_id_ == dynamic_cast&> @@ -1637,7 +1637,7 @@ estimate (const Mapping &mapping, for (typename DH::active_cell_iterator cell=dof_handler.begin_active(); cell!=dof_handler.end(); ++cell, ++present_cell) - if ( ((subdomain_id == types::invalid_subdomain_id) + if ( ((subdomain_id == numbers::invalid_subdomain_id) || (cell->subdomain_id() == subdomain_id)) && diff --git a/deal.II/source/numerics/matrix_tools.cc b/deal.II/source/numerics/matrix_tools.cc index 9fe2a393d1..16eaf0ff75 100644 --- a/deal.II/source/numerics/matrix_tools.cc +++ b/deal.II/source/numerics/matrix_tools.cc @@ -825,7 +825,7 @@ namespace MatrixCreator const Function *const coefficient, const std::vector &component_mapping, const MatrixCreator::internal::IteratorRange > range, - Threads::ThreadMutex &mutex) + Threads::Mutex &mutex) { // All assertions for this function // are in the calling function @@ -1060,7 +1060,7 @@ namespace MatrixCreator dofs_on_face_vector.end()); // lock the matrix - Threads::ThreadMutex::ScopedLock lock (mutex); + Threads::Mutex::ScopedLock lock (mutex); for (unsigned int i=0; i *const , const std::vector &, const MatrixCreator::internal::IteratorRange > , - Threads::ThreadMutex &) + Threads::Mutex &) { Assert(false,ExcNotImplemented()); } @@ -1112,7 +1112,7 @@ namespace MatrixCreator const Function<3> *const , const std::vector &, const MatrixCreator::internal::IteratorRange > , - Threads::ThreadMutex &) + Threads::Mutex &) { Assert(false,ExcNotImplemented()); } @@ -1177,7 +1177,7 @@ namespace MatrixCreator // mutex to synchronise access to // the matrix - Threads::ThreadMutex mutex; + Threads::Mutex mutex; typedef std_cxx1x::tuple &, const DoFHandler &, @@ -1193,7 +1193,7 @@ namespace MatrixCreator const Function *const coefficient, const std::vector &component_mapping, const MatrixCreator::internal::IteratorRange > range, - Threads::ThreadMutex &mutex); + Threads::Mutex &mutex); create_boundary_mass_matrix_1_t p = &create_boundary_mass_matrix_1; @@ -1225,7 +1225,7 @@ namespace MatrixCreator const Function *const coefficient, const std::vector &component_mapping, const MatrixCreator::internal::IteratorRange > range, - Threads::ThreadMutex &mutex) + Threads::Mutex &mutex) { const hp::MappingCollection &mapping = std_cxx1x::get<0>(commons); const hp::DoFHandler &dof = std_cxx1x::get<1>(commons); @@ -1522,7 +1522,7 @@ namespace MatrixCreator #endif // lock the matrix - Threads::ThreadMutex::ScopedLock lock (mutex); + Threads::Mutex::ScopedLock lock (mutex); for (unsigned int i=0; i *const coefficient, const std::vector &component_mapping, const MatrixCreator::internal::IteratorRange > range, - Threads::ThreadMutex &mutex); + Threads::Mutex &mutex); create_boundary_mass_matrix_1_t p = &create_boundary_mass_matrix_1; //TODO: Use WorkStream here @@ -1982,18 +1982,13 @@ namespace MatrixTools const unsigned int dof_number = dof->first; // for each boundary dof: - // set entries of this line - // to zero except for the diagonal - // entry. Note that the diagonal - // entry is always the first one - // for square matrices, i.e. - // we shall not set - // matrix.global_entry( - // sparsity_rowstart[dof.first]) - const unsigned int last = sparsity_rowstart[dof_number+1]; - for (unsigned int j=sparsity_rowstart[dof_number]+1; j::iterator + p = matrix.begin(dof_number); + p != matrix.end(dof_number); ++p) + if (p->column() != dof_number) + p->value() = 0.; // set right hand side to // wanted value: if main diagonal @@ -2053,6 +2048,7 @@ namespace MatrixTools // since that is the // diagonal element and // thus the present row + const unsigned int last = sparsity_rowstart[dof_number+1]; for (unsigned int j=sparsity_rowstart[dof_number]+1; j