/**
* @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.
* cast from const), otherwise,
* keep away!
*/
- typename std::vector<T>::const_pointer data () const;
+ typename std::vector<T>::const_pointer data () const DEAL_II_DEPRECATED;
protected:
/**
*
* @deprecated
*/
- typedef Mutex ThreadMutex;
+ typedef Mutex ThreadMutex DEAL_II_DEPRECATED;
/**
* Provide a backward compatible name (we
*
* @deprecated
*/
- typedef ConditionVariable ThreadCondition;
+ typedef ConditionVariable ThreadCondition DEAL_II_DEPRECATED;
/**
* If using POSIX functions, then
* to the names we use throughout
* the library.
*/
- typedef PosixThreadBarrier Barrier;
+ typedef PosixThreadBarrier Barrier;
#else
/**
* class gives reasonable results even
* when used with several threads.
*/
- Threads::ThreadMutex mutex;
+ Threads::Mutex mutex;
};
/**
* @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<subdomain_id>(-1);
+ const unsigned int invalid_subdomain_id DEAL_II_DEPRECATED = static_cast<subdomain_id>(-1);
/**
* @deprecated Use numbers::artificial_subdomain_id
*/
- const unsigned int artificial_subdomain_id = static_cast<subdomain_id>(-2);
+ const unsigned int artificial_subdomain_id DEAL_II_DEPRECATED = static_cast<subdomain_id>(-2);
/**
* The type used to denote global dof
/**
* @deprecated Use numbers::invalid_dof_index
*/
- const global_dof_index invalid_dof_index = static_cast<global_dof_index>(-1);
+ const global_dof_index invalid_dof_index DEAL_II_DEPRECATED = static_cast<global_dof_index>(-1);
/**
* The type used to denote boundary indicators associated with every
/**
* @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
/**
* @deprecated Old name for the typedef above.
*/
- typedef material_id material_id_t;
+ typedef material_id material_id_t DEAL_II_DEPRECATED;
}
*
* @deprecated
*/
- bool program_uses_mpi ();
+ bool program_uses_mpi () DEAL_II_DEPRECATED;
/**
* @name Functions that work
*
* @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
*
* @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;
/**
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.
* 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
* 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
* 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;
/*--------------------------------------*/
//---------------------------------------------------------------------------
// $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
const Point<DH::space_dimension> &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 <int dim, int spacedim>
void
downstream (MGDoFHandler<dim,spacedim> &dof_handler,
const Point<spacedim> &direction,
- const bool dof_wise_renumbering = false);
+ const bool dof_wise_renumbering = false) DEAL_II_DEPRECATED;
+
+ /**
+ * @deprecated Use downstream() instead.
+ */
+ template <class DH>
+ void
+ downstream_dg (DH &dof,
+ const Point<DH::space_dimension> &direction) DEAL_II_DEPRECATED;
template <class DH>
void
downstream(dof, direction);
}
+
+ /**
+ * @deprecated Use downstream() instead.
+ */
+ template <class DH>
+ void
+ downstream_dg (DH &dof,
+ unsigned int level,
+ const Point<DH::space_dimension> &direction) DEAL_II_DEPRECATED;
+
template <class DH>
void
downstream_dg (DH &dof,
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
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
void
make_sparsity_pattern (const DH &dof,
const std::vector<std::vector<bool> > &mask,
- SparsityPattern &sparsity_pattern);
+ SparsityPattern &sparsity_pattern) DEAL_II_DEPRECATED;
/**
* Construct a sparsity pattern that
void
count_dofs_per_component (const DoFHandler<dim,spacedim> &dof_handler,
std::vector<unsigned int> &dofs_per_component,
- std::vector<unsigned int> target_component);
+ std::vector<unsigned int> target_component) DEAL_II_DEPRECATED;
/**
* This function can be used when
//
// 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<dim,spacedim>::ExcShapeFunctionNotPrimitive(index)) );
return face_system_to_component_table[index];
* @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.
*/
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;
/**
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;
//@}
*/
template <class InputVector>
void get_function_grads (const InputVector &fe_function,
- std::vector<Tensor<1,spacedim> > &gradients) const;
+ std::vector<Tensor<1,spacedim> > &gradients) const DEAL_II_DEPRECATED;
/**
* @deprecated Use
*/
template <class InputVector>
void get_function_grads (const InputVector &fe_function,
- std::vector<std::vector<Tensor<1,spacedim> > > &gradients) const;
+ std::vector<std::vector<Tensor<1,spacedim> > > &gradients) const DEAL_II_DEPRECATED;
/**
* @deprecated Use
template <class InputVector>
void get_function_grads (const InputVector &fe_function,
const VectorSlice<const std::vector<unsigned int> > &indices,
- std::vector<Tensor<1,spacedim> > &gradients) const;
+ std::vector<Tensor<1,spacedim> > &gradients) const DEAL_II_DEPRECATED;
/**
* @deprecated Use
void get_function_grads (const InputVector &fe_function,
const VectorSlice<const std::vector<unsigned int> > &indices,
std::vector<std::vector<Tensor<1,spacedim> > > &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
template <class InputVector>
void
get_function_2nd_derivatives (const InputVector &,
- std::vector<Tensor<2,spacedim> > &) const;
+ std::vector<Tensor<2,spacedim> > &) const DEAL_II_DEPRECATED;
/**
* @deprecated Wrapper for get_function_hessians()
void
get_function_2nd_derivatives (const InputVector &,
std::vector<std::vector<Tensor<2,spacedim> > > &,
- bool = false) const;
+ bool = false) const DEAL_II_DEPRECATED;
/**
* Compute the (scalar) Laplacian (i.e. the trace of the tensor of second
* point. The length of the vector
* is normalized to one.
*/
- const Point<spacedim> &cell_normal_vector (const unsigned int i) const;
+ const Point<spacedim> &cell_normal_vector (const unsigned int i) const DEAL_II_DEPRECATED;
/**
* @deprecated Use
* the cell in each of the
* quadrature points.
*/
- const std::vector<Point<spacedim> > &get_cell_normal_vectors () const;
+ const std::vector<Point<spacedim> > &get_cell_normal_vectors () const DEAL_II_DEPRECATED;
//@}
transform_covariant (const VectorSlice<const std::vector<Tensor<1,dim> > > input,
const unsigned int offset,
VectorSlice<std::vector<Tensor<1,spacedim> > > output,
- const InternalDataBase &internal) const;
+ const InternalDataBase &internal) const DEAL_II_DEPRECATED;
/**
* @deprecated Use transform() instead.
transform_covariant (const VectorSlice<const std::vector<DerivativeForm<1, dim ,spacedim> > > input,
const unsigned int offset,
VectorSlice<std::vector<Tensor<2,spacedim> > > output,
- const InternalDataBase &internal) const;
+ const InternalDataBase &internal) const DEAL_II_DEPRECATED;
/**
* @deprecated Use transform() instead.
transform_contravariant (const VectorSlice<const std::vector<Tensor<1,dim> > > input,
const unsigned int offset,
VectorSlice<std::vector<Tensor<1,spacedim> > > output,
- const typename Mapping<dim,spacedim>::InternalDataBase &internal) const;
+ const typename Mapping<dim,spacedim>::InternalDataBase &internal) const DEAL_II_DEPRECATED;
/**
* @deprecated Use transform() instead.
transform_contravariant (const VectorSlice<const std::vector<DerivativeForm<1, dim,spacedim> > > input,
const unsigned int offset,
const VectorSlice<std::vector<Tensor<2,spacedim> > > output,
- const typename Mapping<dim,spacedim>::InternalDataBase &internal) const;
+ const typename Mapping<dim,spacedim>::InternalDataBase &internal) const DEAL_II_DEPRECATED;
/**
* The transformed (generalized)
* 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
const Point<spacedim> &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
* 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<int dim, template <int, int> class Container, int spacedim>
std::vector<typename Container<dim,spacedim>::active_cell_iterator>
find_cells_adjacent_to_vertex (const Container<dim,spacedim> &container,
- const unsigned int vertex);
+ const unsigned int vertex_index);
/**
*
* @deprecated
*/
- virtual ~RefinementListener ();
+ virtual ~RefinementListener () DEAL_II_DEPRECATED;
/**
* Before refinement is actually
*/
virtual
void
- pre_refinement_notification (const Triangulation<dim, spacedim> &tria);
+ pre_refinement_notification (const Triangulation<dim, spacedim> &tria) DEAL_II_DEPRECATED;
/**
* After refinement is actually
*/
virtual
void
- post_refinement_notification (const Triangulation<dim, spacedim> &tria);
+ post_refinement_notification (const Triangulation<dim, spacedim> &tria) DEAL_II_DEPRECATED;
/**
* At the end of a call to
virtual
void
copy_notification (const Triangulation<dim, spacedim> &old_tria,
- const Triangulation<dim, spacedim> &new_tria);
+ const Triangulation<dim, spacedim> &new_tria) DEAL_II_DEPRECATED;
/**
* At the end of a call to
*/
virtual
void
- create_notification (const Triangulation<dim, spacedim> &tria);
+ create_notification (const Triangulation<dim, spacedim> &tria) DEAL_II_DEPRECATED;
+
};
/**
*
* @deprecated
*/
- void add_refinement_listener (RefinementListener &listener) const;
+ void add_refinement_listener (RefinementListener &listener) const DEAL_II_DEPRECATED;
/**
* Remove a
*
* @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
* Clear all user pointers.
* See also @ref GlossUserData .
*/
- void clear_user_pointers ();
+ void clear_user_pointers () DEAL_II_DEPRECATED;
/**
* Save all user indices. The
/**
* 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;
/**
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<dim,spacedim> *pdt
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<dim,spacedim> *pdt
#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
}
/**
* for parallel multigrid
*/
- std::vector<types::subdomain_id_t> level_subdomain_ids;
+ std::vector<types::subdomain_id> level_subdomain_ids;
/**
* One integer for every consecutive
std::vector<bool> coarsen_flags;
std::vector<std::pair<int,int> > neighbors;
std::vector<types::subdomain_id> subdomain_ids;
- std::vector<types::subdomain_id_t> level_subdomain_ids;
+ std::vector<types::subdomain_id> level_subdomain_ids;
std::vector<int> parents;
// The following is not used
template <typename ITERATOR>
void initialize_mg(unsigned int n_blocks,
const ITERATOR begin,
- const typename identity<ITERATOR>::type end);
+ const typename identity<ITERATOR>::type end) DEAL_II_DEPRECATED;
/**
* @deprecated This function will
const ITERATOR begin,
const typename identity<ITERATOR>::type end,
const std::vector<bool> &selected_dofs,
- unsigned int offset = 0);
+ unsigned int offset = 0) DEAL_II_DEPRECATED;
/**
* @deprecated This function will
* move to DoFTools.
const ITERATOR begin,
const typename identity<ITERATOR>::type end,
const std::vector<bool> &selected_dofs,
- unsigned int offset = 0);
+ unsigned int offset = 0) DEAL_II_DEPRECATED;
/**
* @deprecated This function will
const ITERATOR begin,
const typename identity<ITERATOR>::type end,
const std::vector<bool> &selected_dofs = std::vector<bool>(),
- unsigned int offset = 0);
+ unsigned int offset = 0) DEAL_II_DEPRECATED;
/**
* @deprecated This function will
unsigned int count_vertex_patches(
const ITERATOR begin,
const typename identity<ITERATOR>::type end,
- bool same_level_only) const;
+ bool same_level_only) const DEAL_II_DEPRECATED;
/**
* @deprecated This function will
*/
template <int dim, typename ITERATOR>
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.
* The container for t he index sets.
*/
std::vector<block_container> index_sets;
-};
+} DEAL_II_DEPRECATED;
inline
* 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);
*/
BlockMatrixArray (const unsigned int n_block_rows,
const unsigned int n_block_cols,
- VectorMemory<Vector<number> > &mem);
+ VectorMemory<Vector<number> > &mem) DEAL_II_DEPRECATED;
/**
* Initialize object
*/
void initialize (const unsigned int n_block_rows,
const unsigned int n_block_cols,
- VectorMemory<Vector<number> > &mem);
+ VectorMemory<Vector<number> > &mem) DEAL_II_DEPRECATED;
/**
* Adjust the matrix to a new
const unsigned int row,
const unsigned int col,
const double prefix = 1.,
- const bool transpose = false);
+ const bool transpose = false) DEAL_II_DEPRECATED;
/**
*/
BlockTrianglePrecondition (unsigned int n_block_rows,
VectorMemory<Vector<number> > &mem,
- bool backward = false);
+ bool backward = false) DEAL_II_DEPRECATED;
/**
* Initialize object
*/
void initialize (const unsigned int n_block_rows,
VectorMemory<Vector<number> > &mem,
- bool backward = false);
+ bool backward = false) DEAL_II_DEPRECATED;
/**
* Resize preconditioner to a new
const unsigned int row,
const unsigned int col,
const double prefix = 1.,
- const bool transpose = false);
+ const bool transpose = false) DEAL_II_DEPRECATED;
/**
* Preconditioning.
*
* @deprecated
*/
-typedef BlockCompressedSparsityPattern CompressedBlockSparsityPattern;
+typedef BlockCompressedSparsityPattern CompressedBlockSparsityPattern DEAL_II_DEPRECATED;
* @deprecated Use <tt>operator*=</tt>
* instead.
*/
- void scale (const value_type factor);
+ void scale (const value_type factor) DEAL_II_DEPRECATED;
/**
* Multiply each element of this
{
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;
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
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();
/* void FullMatrix<number>::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]); */
/* } */
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<n_rows; ++row)
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<n_rows; ++row)
bool
FullMatrix<number>::operator == (const FullMatrix<number> &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);
}
real_type s = 0.;
for (unsigned int i=0; i<this->n_rows()*this->n_cols(); ++i)
- s += numbers::NumberTraits<number>::abs_square(this->data()[i]);
+ s += numbers::NumberTraits<number>::abs_square(this->values[i]);
return std::sqrt(s);
}
* @deprecated Use <tt>operator*=</tt>
* instead.
*/
- void scale (const value_type factor);
+ void scale (const value_type factor) DEAL_II_DEPRECATED;
/**
* Multiply each element of this
* <tt>operator *=</tt> and
* <tt>operator /=</tt> instead.
*/
- void scale (const Number factor);
+ void scale (const Number factor) DEAL_II_DEPRECATED;
/**
* when used with several
* threads.
*/
- mutable Threads::ThreadMutex mutex;
+ mutable Threads::Mutex mutex;
/**
* A helper function that clears the
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();
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();
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();
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(),
* 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
// 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;
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()));
}
unsigned int
PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::Accessor::row() const
{
- Assert (a_block < matrix->n_blocks(),
+ Assert (a_block < matrix->size(),
ExcIteratorPastEnd());
return bs * a_block + b_iterator->row();
unsigned int
PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::Accessor::column() const
{
- Assert (a_block < matrix->n_blocks(),
+ Assert (a_block < matrix->size(),
ExcIteratorPastEnd());
return bs * a_block + b_iterator->column();
inverse_type
PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator::Accessor::value() const
{
- Assert (a_block < matrix->n_blocks(),
+ Assert (a_block < matrix->size(),
ExcIteratorPastEnd());
return b_iterator->value();
{
++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();
PreconditionBlockJacobi<MATRIX, inverse_type>::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;
typename PreconditionBlockJacobi<MATRIX, inverse_type>::const_iterator
PreconditionBlockJacobi<MATRIX, inverse_type>::end () const
{
- return const_iterator(this, this->n_blocks() * this->block_size());
+ return const_iterator(this, this->size() * this->block_size());
}
begin_diag_block+=this->blocksize;
}
- dst.scale(this->relaxation);
+ dst *= this->relaxation;
}
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;
/**
* compability. It will be removed
* in later versions.
*/
- SparseLUDecomposition (const SparsityPattern &sparsity);
+ SparseLUDecomposition (const SparsityPattern &sparsity) DEAL_II_DEPRECATED;
public:
/**
*
* @deprecated
*/
- void reinit (const SparsityPattern &sparsity);
+ void reinit (const SparsityPattern &sparsity) DEAL_II_DEPRECATED;
/**
* This method is deprecated,
*/
template <typename somenumber>
void decompose (const SparseMatrix<somenumber> &matrix,
- const double strengthen_diagonal=0.);
+ const double strengthen_diagonal=0.) DEAL_II_DEPRECATED;
/**
* This method is deprecated,
*
* @deprecated
*/
- virtual bool is_decomposed () const;
+ virtual bool is_decomposed () const DEAL_II_DEPRECATED;
/**
* Return whether the object is
* this class for more
* information.
*/
- Threads::ThreadMutex &get_synchronisation_lock () const;
+ Threads::Mutex &get_synchronisation_lock () const;
/** @addtogroup Exceptions
* @{ */
* 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 <tt>A</tt> array from the
* this class for more
* information.
*/
- Threads::ThreadMutex &get_synchronisation_lock () const;
+ Threads::Mutex &get_synchronisation_lock () const;
/** @addtogroup Exceptions
* @{ */
* Mutex for synchronising access
* to this class.
*/
- static Threads::ThreadMutex synchronisation_lock;
+ static Threads::Mutex synchronisation_lock;
/**
* Fill the <tt>A</tt> array from the
* backward compability. It will
* be removed in later versions.
*/
- SparseILU (const SparsityPattern &sparsity);
+ SparseILU (const SparsityPattern &sparsity) DEAL_II_DEPRECATED;
/**
* Make
*/
template <typename somenumber>
void decompose (const SparseMatrix<somenumber> &matrix,
- const double strengthen_diagonal=0.);
+ const double strengthen_diagonal=0.) DEAL_II_DEPRECATED;
/**
* This method is deprecated, and
*/
template <typename somenumber>
void apply_decomposition (Vector<somenumber> &dst,
- const Vector<somenumber> &src) const;
+ const Vector<somenumber> &src) const DEAL_II_DEPRECATED;
/**
* Apply the incomplete decomposition,
* @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 <i>i</i>th element of this
*
* @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;
//@}
/**
*/
std::size_t max_len;
+ /**
+ * Return the value of the <tt>index</tt>th entry in <tt>row</tt>. Here,
+ * <tt>index</tt> 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 <typename somenumber> friend class SparseMatrix;
template <typename somenumber> friend class SparseLUDecomposition;
* To allow it calling private prepare_add() and prepare_set().
*/
template <typename> friend class BlockMatrixBase;
+
+ /**
+ * Also give access to internal details to the iterator/accessor
+ * classes.
+ */
+ template <typename,bool> friend class SparseMatrixIterators::Iterator;
+ template <typename,bool> friend class SparseMatrixIterators::Accessor;
};
/**
number
SparseMatrix<number>::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 <typename number>
+inline
+number
+SparseMatrix<number>::nth_entry_in_row (const unsigned int row,
+ const unsigned int index) const
{
Assert(row<cols->rows, ExcIndexRange(row,0,cols->rows));
Assert(index<cols->row_length(row),
number
Accessor<number, true>::value () const
{
- return matrix->raw_entry(a_row, a_index);
+ return matrix->nth_entry_in_row(a_row, a_index);
}
inline
Accessor<number, false>::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);
}
* 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.
*/
template <typename somenumber>
void decompose (const SparseMatrix<somenumber> &matrix,
- const double strengthen_diagonal=0.);
+ const double strengthen_diagonal=0.) DEAL_II_DEPRECATED;
/**
* Apply the incomplete decomposition,
* complexity of this function is <i>log(m)</i> 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 <tt>i</tt> to find whether index
+ * <tt>j</tt> 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;
* done by calling @p GridTools::partition_triangulation.
*/
void partition (const unsigned int n_partitions,
- std::vector<unsigned int> &partition_indices) const;
+ std::vector<unsigned int> &partition_indices) const DEAL_II_DEPRECATED;
/**
* we can as well get away
* with it.
*/
- Threads::ThreadMutex lock;
+ Threads::Mutex lock;
/**
* Flag by which the @p alert
// 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<number>::operator = (v);
data_is_preloaded = false;
// 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
// (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,
* 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
* 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
/**
* @deprecated
*/
- void compress (const Epetra_CombineMode last_action);
+ void compress (const Epetra_CombineMode last_action) DEAL_II_DEPRECATED;
/**
* Returns the state of the
* <tt>operator *=</tt> and
* <tt>operator /=</tt> instead.
*/
- void scale (const Number factor);
+ void scale (const Number factor) DEAL_II_DEPRECATED
+ {
+ this->operator *= (factor);
+ }
/**
-template <typename Number>
-inline
-Vector<Number> &Vector<Number>::operator *= (const Number factor)
-{
-
- Assert (numbers::is_finite(factor),ExcNumberNotFinite());
-
- scale (factor);
- return *this;
-}
-
-
-
template <typename Number>
inline
Vector<Number> &
template <typename Number>
-void
-Vector<Number>::scale (const Number factor)
+Vector<Number> &Vector<Number>::operator *= (const Number factor)
{
Assert (numbers::is_finite(factor),ExcNumberNotFinite());
val,
(factor*boost::lambda::_1),
internal::Vector::minimum_parallel_grain_size);
+
+ return *this;
}
* internal data of this object
* from multiple threads.
*/
- static Threads::ThreadMutex mutex;
+ static Threads::Mutex mutex;
};
/*@}*/
std::size_t memory_consumption () const;
private:
SmartPointer<MGLevelObject<MATRIX>,MGMatrix<MATRIX,VECTOR> > matrix;
-};
+} DEAL_II_DEPRECATED;
/**
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
void
count_dofs_per_component (const DoFHandler<dim,spacedim> &mg_dof,
std::vector<std::vector<unsigned int> > &result,
- std::vector<unsigned int> target_component);
+ std::vector<unsigned int> target_component) DEAL_II_DEPRECATED;
/**
* Generate a list of those
* 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
* 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
* 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
* 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
const std::vector<Tensor<1,dim> > &duh,
const std::vector<Tensor<2,dim> > &dduh,
const std::vector<Point<dim> > &normals,
- std::vector<Vector<double> > &computed_quantities) const;
+ std::vector<Vector<double> > &computed_quantities) const DEAL_II_DEPRECATED;
/**
* This is the main function which actually
const std::vector<std::vector<Tensor<1,dim> > > &duh,
const std::vector<std::vector<Tensor<2,dim> > > &dduh,
const std::vector<Point<dim> > &normals,
- std::vector<Vector<double> > &computed_quantities) const;
+ std::vector<Vector<double> > &computed_quantities) const DEAL_II_DEPRECATED;
/**
* Same as the
const ComponentMask &component_mask = ComponentMask(),
const Function<spacedim> *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);
/**
const ComponentMask &component_mask = ComponentMask(),
const Function<spacedim> *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);
/**
const ComponentMask &component_mask = ComponentMask(),
const Function<spacedim> *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);
/**
const ComponentMask &component_mask = ComponentMask(),
const Function<spacedim> *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);
const ComponentMask &component_mask = ComponentMask(),
const Function<spacedim> *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);
const ComponentMask &component_mask = ComponentMask(),
const Function<spacedim> *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);
const ComponentMask &component_mask = ComponentMask(),
const Function<spacedim> *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);
const ComponentMask &component_mask = ComponentMask(),
const Function<spacedim> *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);
const ComponentMask &component_mask = ComponentMask(),
const Function<spacedim> *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);
/**
const ComponentMask &component_mask = ComponentMask(),
const Function<spacedim> *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);
/**
const ComponentMask &component_mask = ComponentMask(),
const Function<spacedim> *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);
/**
const ComponentMask &component_mask = ComponentMask(),
const Function<spacedim> *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);
const ComponentMask &component_mask = ComponentMask(),
const Function<spacedim> *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);
const ComponentMask &component_mask = ComponentMask(),
const Function<spacedim> *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);
const ComponentMask &component_mask = ComponentMask(),
const Function<spacedim> *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);
const ComponentMask &component_mask = ComponentMask(),
const Function<spacedim> *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);
/**
*
* @deprecated
*/
- Vector<double> mark_locations();
+ Vector<double> mark_locations() DEAL_II_DEPRECATED;
/**
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
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
#include <deal.II/lac/trilinos_vector.h>
#include <deal.II/lac/trilinos_block_vector.h>
#include <deal.II/lac/sparse_matrix.h>
+#include <deal.II/lac/compressed_sparsity_pattern.h>
#include <deal.II/lac/compressed_simple_sparsity_pattern.h>
#include <deal.II/lac/precondition.h>
#include <deal.II/lac/solver_cg.h>
std::vector<Point<dim-1> > unit_support_points (fe.dofs_per_face);
for (unsigned int i=0; i<fe.dofs_per_face; ++i)
- if (fe.is_primitive (fe.face_to_equivalent_cell_index(i)))
+ if (fe.is_primitive (fe.face_to_cell_index(0,i)))
if (component_mask[fe.face_system_to_component_index(i).first]
== true)
unit_support_points[i] = fe.unit_face_support_point(i);
DoFTools::map_dof_to_boundary_indices (dof, selected_boundary_components,
dof_to_boundary_mapping);
- // Done if no degrees of freedom on
- // the boundary
+ // Done if no degrees of freedom on the boundary
if (dof.n_boundary_dofs (boundary_functions) == 0)
return;
+
// set up sparsity structure
- SparsityPattern sparsity(dof.n_boundary_dofs (boundary_functions),
- dof.max_couplings_between_boundary_dofs());
+ CompressedSparsityPattern c_sparsity(dof.n_dofs());
DoFTools::make_boundary_sparsity_pattern (dof,
boundary_functions,
dof_to_boundary_mapping,
- sparsity);
+ c_sparsity);
+ SparsityPattern sparsity;
+ sparsity.copy_from(c_sparsity);
+
+
// note: for three or more dimensions, there
// may be constrained nodes on the boundary
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());
namespace
{
- Threads::ThreadMutex log_lock;
- Threads::ThreadMutex write_lock;
+ Threads::Mutex log_lock;
+ Threads::Mutex write_lock;
}
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;
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)
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
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();
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());
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(":");
void LogStream::pop ()
{
- Threads::ThreadMutex::ScopedLock lock(log_lock);
+ Threads::Mutex::ScopedLock lock(log_lock);
if (prefixes.size() > 1)
prefixes.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;
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;
void
LogStream::threshold_double (const double t)
{
- Threads::ThreadMutex::ScopedLock lock(log_lock);
+ Threads::Mutex::ScopedLock lock(log_lock);
double_threshold = t;
}
void
LogStream::threshold_float (const float t)
{
- Threads::ThreadMutex::ScopedLock lock(log_lock);
+ Threads::Mutex::ScopedLock lock(log_lock);
float_threshold = 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;
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;
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;
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())
// more fine-grained solution
namespace
{
- Threads::ThreadMutex coefficients_lock;
+ Threads::Mutex coefficients_lock;
}
// 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)
// 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];
}
// 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
// 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];
}
// 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<double> p_values;
static std::vector<Tensor<1,dim> > p_grads;
// operates on a per-object base (in which case we would have to
// include the huge <thread_management.h> file into the
// <subscriptor.h> file).
- Threads::ThreadMutex subscription_lock;
+ Threads::Mutex subscription_lock;
}
#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
if (counter == 0)
return;
- Threads::ThreadMutex::ScopedLock lock (subscription_lock);
+ Threads::Mutex::ScopedLock lock (subscription_lock);
--counter;
#if DEAL_USE_MT == 0
// 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;
}
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());
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;
}
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."));
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 != "")
{
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);
}
+ 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);
// not local.
delete_all_children<dim,spacedim> (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
{
{
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;
}
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();
}
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
{
== false)
{
delete_all_children<dim,spacedim> (cell);
- cell->set_subdomain_id (types::artificial_subdomain_id);
+ cell->set_subdomain_id (numbers::artificial_subdomain_id);
}
else
{
if (cell->subdomain_id() != my_subdomain
&&
- cell->subdomain_id() != types::artificial_subdomain_id)
+ cell->subdomain_id() != numbers::artificial_subdomain_id)
++num_ghosts;
}
/**
* 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 <int dim, int spacedim>
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
// update the cache used for cell dof indices
for (typename DoFHandler<dim,spacedim>::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
{
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
// * 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.
// 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 "
// 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()))
&&
// 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 "
// 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()))
&&
// 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 "
// 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()))
&&
// 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<unsigned int> local_dof_indices;
local_dof_indices.reserve (max_dofs_per_cell(dof_handler));
Assert (std::find (subdomain_association.begin(),
subdomain_association.end(),
- types::invalid_subdomain_id)
+ numbers::invalid_subdomain_id)
== subdomain_association.end(),
ExcInternalError());
}
// 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 "
// 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; i<global_parameter_representation.size(); ++i)
// set this weight if it belongs to a parameter dof.
if (weight_mapping[i] != -1)
// linking libraries for more than
// one space dimension together
static
- Threads::ThreadMutex fe_name_map_lock;
+ Threads::Mutex fe_name_map_lock;
// This is the map used by
// FETools::get_fe_from_name and
for (; cell1!=endc1; ++cell1, ++cell2)
if ((cell1->subdomain_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(),
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<GeometryInfo<dim>::faces_per_cell; ++face)
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(),
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<GeometryInfo<dim>::faces_per_cell; ++face)
// 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"));
// 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"));
// 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"));
{
// 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));
// 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);
#include <deal.II/lac/precondition.h>
#include <deal.II/lac/solver_cg.h>
#include <deal.II/lac/sparse_matrix.h>
+#include <deal.II/lac/compressed_sparsity_pattern.h>
#include <deal.II/lac/constraint_matrix.h>
#include <deal.II/grid/grid_generator.h>
#include <deal.II/grid/grid_reordering.h>
DoFHandler<dim> 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<double> S(sparsity_pattern);
types::subdomain_id
Triangulation<dim,spacedim>::locally_owned_subdomain () const
{
- return types::invalid_subdomain_id;
+ return numbers::invalid_subdomain_id;
}
template <int dim, int spacedim>
-types::subdomain_id_t CellAccessor<dim, spacedim>::level_subdomain_id () const
+types::subdomain_id CellAccessor<dim, spacedim>::level_subdomain_id () const
{
Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
return this->tria->levels[this->present_level]->level_subdomain_ids[this->present_index];
template <int dim, int spacedim>
void
-CellAccessor<dim, spacedim>::set_level_subdomain_id (const types::subdomain_id_t new_level_subdomain_id) const
+CellAccessor<dim, spacedim>::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]
// 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;
}
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:
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; i<wr.size(); ++i)
work[i] *= wr[i];
// Multiply with U
- gemv("N", &mm, &mm, &alpha, svd_u->data(), &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:
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; i<wr.size(); ++i)
work[i] *= wr[i];
// Multiply with V
- gemv("T", &nn, &nn, &alpha, svd_vt->data(), &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:
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:
// 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; i<wr.size(); ++i)
work[i] *= wr[i];
// Multiply with V
- gemv("T", &nn, &nn, &alpha, svd_vt->data(), &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:
{
// 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; i<wr.size(); ++i)
work[i] *= wr[i];
// Multiply with U
- gemv("N", &mm, &mm, &alpha, svd_u->data(), &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;
}
}
Assert(state == matrix, ExcState(state));
const int mm = this->n_rows();
const int nn = this->n_cols();
- number *values = const_cast<number *> (this->data());
+ number *values = const_cast<number *> (&this->values[0]);
ipiv.resize(mm);
int info = 0;
getrf(&mm, &nn, values, &mm, &ipiv[0], &info);
const int mm = this->n_rows();
const int nn = this->n_cols();
- number *values = const_cast<number *> (this->data());
+ number *values = const_cast<number *> (&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<number>(mm,mm));
svd_vt.reset (new LAPACKFullMatrix<number>(nn,nn));
- number *mu = const_cast<number *> (svd_u->data());
- number *mvt = const_cast<number *> (svd_vt->data());
+ number *mu = const_cast<number *> (&svd_u->values[0]);
+ number *mvt = const_cast<number *> (&svd_vt->values[0]);
int info = 0;
// see comment on this #if
const int nn = this->n_cols();
Assert (nn == mm, ExcNotQuadratic());
- number *values = const_cast<number *> (this->data());
+ number *values = const_cast<number *> (&this->values[0]);
ipiv.resize(mm);
int info = 0;
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],
if (right) vr.resize(nn*nn);
if (left) vl.resize(nn*nn);
- number *values = const_cast<number *> (this->data());
+ number *values = const_cast<number *> (&this->values[0]);
int info = 0;
int lwork = 1;
wr.resize(nn);
LAPACKFullMatrix<number> matrix_eigenvectors(nn, nn);
- number *values_A = const_cast<number *> (this->data());
- number *values_eigenvectors = const_cast<number *> (matrix_eigenvectors.data());
+ number *values_A = const_cast<number *> (&this->values[0]);
+ number *values_eigenvectors = const_cast<number *> (&matrix_eigenvectors.values[0]);
int info(0),
lwork(1),
wr.resize(nn);
LAPACKFullMatrix<number> matrix_eigenvectors(nn, nn);
- number *values_A = const_cast<number *> (this->data());
- number *values_B = const_cast<number *> (B.data());
- number *values_eigenvectors = const_cast<number *> (matrix_eigenvectors.data());
+ number *values_A = const_cast<number *> (&this->values[0]);
+ number *values_B = const_cast<number *> (&B.values[0]);
+ number *values_eigenvectors = const_cast<number *> (&matrix_eigenvectors.values[0]);
int info(0),
lwork(1),
wi.resize(nn); //This is set purley for consistency reasons with the
//eigenvalues() function.
- number *values_A = const_cast<number *> (this->data());
- number *values_B = const_cast<number *> (B.data());
+ number *values_A = const_cast<number *> (&this->values[0]);
+ number *values_B = const_cast<number *> (&B.values[0]);
int info = 0;
int lwork = 1;
/* -------------------------- MA27 ---------------------------- */
-Threads::ThreadMutex SparseDirectMA27::static_synchronisation_lock;
+Threads::Mutex SparseDirectMA27::static_synchronisation_lock;
struct SparseDirectMA27::DetachedModeData
* thread is currently talking
* through the pipe.
*/
- Threads::ThreadMutex mutex;
+ Threads::Mutex mutex;
/**
* File handles for the pipe
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
-Threads::ThreadMutex &
+Threads::Mutex &
SparseDirectMA27::get_synchronisation_lock () const
{
if (detached_mode)
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
// 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");
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
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
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
/* -------------------------- MA47 ---------------------------- */
-Threads::ThreadMutex SparseDirectMA47::synchronisation_lock;
+Threads::Mutex SparseDirectMA47::synchronisation_lock;
SparseDirectMA47::SparseDirectMA47 (const double LIW_factor_1,
-Threads::ThreadMutex &
+Threads::Mutex &
SparseDirectMA47::get_synchronisation_lock () const
{
return synchronisation_lock;
typename GrowingVectorMemory<VECTOR>::Pool GrowingVectorMemory<VECTOR>::pool;
template <typename VECTOR>
-Threads::ThreadMutex GrowingVectorMemory<VECTOR>::mutex;
+Threads::Mutex GrowingVectorMemory<VECTOR>::mutex;
template <typename VECTOR>
inline
current_alloc(0),
log_statistics(log_statistics)
{
- Threads::ThreadMutex::ScopedLock lock(mutex);
+ Threads::Mutex::ScopedLock lock(mutex);
pool.initialize(initial_size);
}
VECTOR *
GrowingVectorMemory<VECTOR>::alloc ()
{
- Threads::ThreadMutex::ScopedLock lock(mutex);
+ Threads::Mutex::ScopedLock lock(mutex);
++total_alloc;
++current_alloc;
// see if there is a free vector
void
GrowingVectorMemory<VECTOR>::free(const VECTOR *const v)
{
- Threads::ThreadMutex::ScopedLock lock(mutex);
+ Threads::Mutex::ScopedLock lock(mutex);
for (typename std::vector<entry_type>::iterator i=pool.data->begin();
i != pool.data->end(); ++i)
{
void
GrowingVectorMemory<VECTOR>::release_unused_memory ()
{
- Threads::ThreadMutex::ScopedLock lock(mutex);
+ Threads::Mutex::ScopedLock lock(mutex);
std::vector<entry_type> new_data;
std::size_t
GrowingVectorMemory<VECTOR>::memory_consumption () const
{
- Threads::ThreadMutex::ScopedLock lock(mutex);
+ Threads::Mutex::ScopedLock lock(mutex);
std::size_t result = sizeof (*this);
const typename std::vector<entry_type>::const_iterator
// 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))
&&
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) ||
->material_id() == material_id)
&&
(subdomain_id ==
- types::invalid_subdomain_id)))
+ numbers::invalid_subdomain_id)))
{
care_for_cell = true;
break;
if (dynamic_cast<const parallel::distributed::Triangulation<1,spacedim>*>
(&dof_handler.get_tria())
!= 0)
- Assert ((subdomain_id_ == types::invalid_subdomain_id)
+ Assert ((subdomain_id_ == numbers::invalid_subdomain_id)
||
(subdomain_id_ ==
dynamic_cast<const parallel::distributed::Triangulation<1,spacedim>&>
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))
&&
if (dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>*>
(&dof_handler.get_tria())
!= 0)
- Assert ((subdomain_id_ == types::invalid_subdomain_id)
+ Assert ((subdomain_id_ == numbers::invalid_subdomain_id)
||
(subdomain_id_ ==
dynamic_cast<const parallel::distributed::Triangulation<dim,spacedim>&>
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))
&&
const Function<spacedim> *const coefficient,
const std::vector<unsigned int> &component_mapping,
const MatrixCreator::internal::IteratorRange<DoFHandler<dim,spacedim> > range,
- Threads::ThreadMutex &mutex)
+ Threads::Mutex &mutex)
{
// All assertions for this function
// are in the calling function
dofs_on_face_vector.end());
// lock the matrix
- Threads::ThreadMutex::ScopedLock lock (mutex);
+ Threads::Mutex::ScopedLock lock (mutex);
for (unsigned int i=0; i<dofs_per_cell; ++i)
{
if (dof_is_on_face[i] && dof_to_boundary_mapping[dofs[i]] != numbers::invalid_unsigned_int)
const Function<3> *const ,
const std::vector<unsigned int> &,
const MatrixCreator::internal::IteratorRange<DoFHandler<2,3> > ,
- Threads::ThreadMutex &)
+ Threads::Mutex &)
{
Assert(false,ExcNotImplemented());
}
const Function<3> *const ,
const std::vector<unsigned int> &,
const MatrixCreator::internal::IteratorRange<DoFHandler<1,3> > ,
- Threads::ThreadMutex &)
+ Threads::Mutex &)
{
Assert(false,ExcNotImplemented());
}
// mutex to synchronise access to
// the matrix
- Threads::ThreadMutex mutex;
+ Threads::Mutex mutex;
typedef std_cxx1x::tuple<const Mapping<dim,spacedim> &,
const DoFHandler<dim,spacedim> &,
const Function<spacedim> *const coefficient,
const std::vector<unsigned int> &component_mapping,
const MatrixCreator::internal::IteratorRange<DoFHandler<dim,spacedim> > range,
- Threads::ThreadMutex &mutex);
+ Threads::Mutex &mutex);
create_boundary_mass_matrix_1_t p
= &create_boundary_mass_matrix_1<dim,spacedim>;
const Function<spacedim> *const coefficient,
const std::vector<unsigned int> &component_mapping,
const MatrixCreator::internal::IteratorRange<hp::DoFHandler<dim,spacedim> > range,
- Threads::ThreadMutex &mutex)
+ Threads::Mutex &mutex)
{
const hp::MappingCollection<dim,spacedim> &mapping = std_cxx1x::get<0>(commons);
const hp::DoFHandler<dim,spacedim> &dof = std_cxx1x::get<1>(commons);
#endif
// lock the matrix
- Threads::ThreadMutex::ScopedLock lock (mutex);
+ Threads::Mutex::ScopedLock lock (mutex);
for (unsigned int i=0; i<dofs_per_cell; ++i)
for (unsigned int j=0; j<dofs_per_cell; ++j)
if (dof_is_on_face[i] && dof_is_on_face[j])
// mutex to synchronise access to
// the matrix
- Threads::ThreadMutex mutex;
+ Threads::Mutex mutex;
// then assemble in parallel
typedef void (*create_boundary_mass_matrix_1_t)
const Function<spacedim> *const coefficient,
const std::vector<unsigned int> &component_mapping,
const MatrixCreator::internal::IteratorRange<hp::DoFHandler<dim,spacedim> > range,
- Threads::ThreadMutex &mutex);
+ Threads::Mutex &mutex);
create_boundary_mass_matrix_1_t p = &create_boundary_mass_matrix_1<dim,spacedim>;
//TODO: Use WorkStream here
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<last; ++j)
- matrix.global_entry(j) = 0.;
-
+ // set entries of this line to zero except for the diagonal
+ // entry
+ for (typename SparseMatrix<number>::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
// 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<last; ++j)
{
const unsigned int row = sparsity_colnums[j];