// couple different bases (or
// multiplicity indices) are really
// zero. then assign entries
- interpolation_matrix.set_zero ();
+ interpolation_matrix = 0;
for (unsigned int i=0; i<this->dofs_per_cell; ++i)
for (unsigned int j=0; j<source_fe.dofs_per_cell; ++j)
if (this->system_to_base_table[i].first ==
ExcMatrixDimensionMismatch(matrix.m(), matrix.n(),
fe2.dofs_per_cell,
fe1.dofs_per_cell));
- matrix.set_zero();
+ matrix = 0;
unsigned int n1 = fe1.dofs_per_cell;
unsigned int n2 = fe2.dofs_per_cell;
{
fe_values.reinit (cell);
- cell_matrix.set_zero ();
+ cell_matrix = 0;
cell->get_dof_indices (dof_indices);
if (coefficient != 0)
{
fe_values.reinit (cell);
- cell_matrix.set_zero ();
+ cell_matrix = 0;
local_rhs = 0;
cell->get_dof_indices (dof_indices);
if (boundary_functions.find(cell->face(face)->boundary_indicator()) !=
boundary_functions.end())
{
- cell_matrix.set_zero ();
+ cell_matrix = 0;
cell_vector = 0;
fe_values.reinit (cell, face);
{
fe_values.reinit (cell);
- cell_matrix.set_zero ();
+ cell_matrix = 0;
cell->get_dof_indices (dof_indices);
if (coefficient != 0)
{
fe_values.reinit (cell);
- cell_matrix.set_zero ();
+ cell_matrix = 0;
local_rhs = 0;
cell->get_dof_indices (dof_indices);
built has changed, an inherently risky procedure. The no-argument code
<class="member">reinit</code> function has therefore been removed to
avoid confusion with the <code class="member">reinit</code> functions
- that take arguments. Instead, a <code class="member">set_zero</code>
- function has been introduced that simply sets all elements of the
+ that take arguments. Instead, you should now use <code
+ class="member">matrix=0</code> to simply sets all elements of the
matrix to zero. If you want to notify a sparse matrix that its sparsity
pattern has changed, use the <code
class="member">reinit(SparsityPattern)</code> function.
remaining instances where deal.II classes have a function of
that name really mean that the object is reset to its virginial
state. To set all
- elements of a vector to zero without changing its size, the
+ elements of a matrix or vector to zero without changing its size, the
recommended way is to use the more obvious notation <code
- class="member">v=0</code>, while the full matrix class now has
- a function <code class="member">FullMatrix::set_zero()</code>. To
+ class="member">vector=0</code> and <code
+ class="member">matrix=0</code>. To
reset the elements of a table over arbitrary objects, use
- <code class="member">Table<T>::reset_values()</code>.
+ <code class="member">Table<T>::reset_values()</code>.
<br>
(WB 2004/05/10)
</p>
// ``u_v_matrix'' and
// ``cell_vector'' to zero,
// before assembling the cell terms.
- u_v_matrix.set_zero ();
+ u_v_matrix = 0;
cell_vector = 0;
// Now we reinit the ``FEValues''
// and clear the
// ``un_v_matrix'' on each
// face.
- un_v_matrix.set_zero();
+ un_v_matrix = 0;
// Now we distinguish the
// four different cases in
// different
// neighboring
// cells.
- un_v_matrix.set_zero();
+ un_v_matrix = 0;
// As already
// mentioned
endc = dof_handler.end();
for (;cell!=endc; ++cell)
{
- u_v_matrix.set_zero ();
+ u_v_matrix = 0;
cell_vector = 0;
fe_v.reinit (cell);
ExcInternalError());
Assert (!neighbor_child->has_children(), ExcInternalError());
- un_v_matrix.set_zero();
- u_vn_matrix.set_zero();
- un_vn_matrix.set_zero();
+ un_v_matrix = 0;
+ u_vn_matrix = 0;
+ un_vn_matrix = 0;
fe_v_subface.reinit (cell, face_no, subface_no);
fe_v_face_neighbor.reinit (neighbor_child, neighbor2);
{
const unsigned int neighbor2=cell->neighbor_of_neighbor(face_no);
- un_v_matrix.set_zero();
- u_vn_matrix.set_zero();
- un_vn_matrix.set_zero();
+ un_v_matrix = 0;
+ u_vn_matrix = 0;
+ un_vn_matrix = 0;
fe_v_face.reinit (cell, face_no);
fe_v_face_neighbor.reinit (neighbor, neighbor2);
// reinit the system matrix, the
// right hand side vector and
// the Timer object.
- system_matrix.set_zero();
+ system_matrix = 0;
right_hand_side = 0;
assemble_timer.reset();
for (typename DoFHandler<dim>::active_cell_iterator cell=begin_cell;
cell!=end_cell; ++cell)
{
- cell_matrix.set_zero ();
+ cell_matrix = 0;
fe_values.reinit (cell);
for (typename DoFHandler<dim>::active_cell_iterator cell=begin_cell;
cell!=end_cell; ++cell)
{
- cell_matrix.set_zero ();
+ cell_matrix = 0;
fe_values.reinit (cell);
// First, clear the objects that hold
// the local matrix and right hand side
// contributions for this cell:
- cell_matrix.set_zero ();
+ cell_matrix = 0;
cell_rhs = 0;
// Then initialize the values and
endc = mg_dof_handler.end();
for (; cell!=endc; ++cell)
{
- cell_matrix.set_zero ();
+ cell_matrix = 0;
cell_rhs = 0;
// As before, we want the
// Remember the level of the
// current cell.
const unsigned int level = cell->level();
- cell_matrix.set_zero ();
+ cell_matrix = 0;
// Compute the values specified
// by update flags above.
for (; cell!=endc; ++cell)
if (cell->subdomain_id() == this_mpi_process)
{
- cell_matrix.set_zero ();
+ cell_matrix = 0;
cell_rhs = 0;
fe_values.reinit (cell);
// to global matrix and global
// right hand side to zero,
// before we fill them.
- cell_matrix.set_zero ();
+ cell_matrix = 0;
cell_rhs = 0;
// Assemble the matrix: For the
for (; cell!=endc; ++cell)
{
fe_values.reinit (cell);
- cell_matrix.set_zero ();
+ cell_matrix = 0;
cell_rhs = 0;
// Now we have to assemble the
endc = dof_handler.end();
for (; cell!=endc; ++cell)
{
- cell_matrix.set_zero ();
+ cell_matrix = 0;
cell_rhs = 0;
// As before, we want the
endc = dof_handler.end();
for (; cell!=endc; ++cell)
{
- cell_matrix.set_zero ();
+ cell_matrix = 0;
cell_rhs = 0;
fe_values.reinit (cell);
endc = dof_handler.end();
for (; cell!=endc; ++cell)
{
- cell_matrix.set_zero ();
+ cell_matrix = 0;
cell_rhs = 0;
fe_values.reinit (cell);
endc = dof_handler.end();
for (; cell!=endc; ++cell)
{
- cell_matrix.set_zero ();
+ cell_matrix = 0;
cell_rhs = 0;
fe_values.reinit (cell);
{
// First clear old contents of
// the cell contributions...
- cell_matrix.set_zero ();
+ cell_matrix = 0;
cell_rhs = 0;
// ... then initialize
operator = (const BlockSparseMatrix<number> &);
/**
- * Set all elements of the matrix to
- * zero, but keep the sparsity pattern
+ * This operator assigns a scalar to a
+ * matrix. Since this does usually not
+ * make much sense (should we set all
+ * matrix entries to this value? Only the
+ * nonzero entries of the sparsity
+ * pattern?), this operation is only
+ * allowed if the actual value to be
+ * assigned is zero. This operator only
+ * exists to allow for the obvious
+ * notation <tt>matrix=0</tt>, which sets
+ * all elements of the matrix to zero,
+ * but keep the sparsity pattern
* previously used.
*/
- void set_zero ();
+ BlockSparseMatrix<number> &
+ operator = (const double d);
/**
* Reinitialize the sparse matrix
* Exception
*/
DeclException0 (ExcMatrixNotInitialized);
-
+ /**
+ * Exception
+ */
+ DeclException0 (ExcScalarAssignmentOnlyForZeroValue);
private:
/**
template <typename number>
-void
-BlockSparseMatrix<number>::set_zero ()
+BlockSparseMatrix<number> &
+BlockSparseMatrix<number>::operator = (const double d)
{
+ Assert (d==0, ExcScalarAssignmentOnlyForZeroValue());
+
for (unsigned int r=0; r<rows; ++r)
for (unsigned int c=0; c<columns; ++c)
- block(r,c).set_zero ();
+ block(r,c) = 0;
+
+ return *this;
}
get_block_indices () const;
/**
- * $U(0-N) = s$: fill all components.
+ * Set all components of the vector to
+ * the given number @p s. Simply pass
+ * this down to the individual block
+ * objects, but we still need to declare
+ * this function to make the example
+ * given in the discussion about making
+ * the constructor explicit work.
+ *
+ *
+ * Since the semantics of assigning a
+ * scalar to a vector are not
+ * immediately clear, this operator
+ * should really only be used if you
+ * want to set the entire vector to
+ * zero. This allows the intuitive
+ * notation <tt>v=0</tt>. Assigning
+ * other values is deprecated and may
+ * be disallowed in the future.
*/
- BlockVector<Number> & operator= (const Number s);
+ BlockVector<Number> & operator = (const Number s);
/**
* $U = V$: copy all components.
/**
* Assignment operator.
*/
- FullMatrix<number>& operator = (const FullMatrix<number>&);
+ FullMatrix<number> &
+ operator = (const FullMatrix<number>&);
/**
* Variable assignment operator.
*/
template<typename number2>
- FullMatrix<number>& operator = (const FullMatrix<number2>&);
+ FullMatrix<number> &
+ operator = (const FullMatrix<number2>&);
/**
+ * This operator assigns a scalar to a
+ * matrix. Since this does usually not
+ * make much sense (should we set all
+ * matrix entries to this value? Only the
+ * nonzero entries of the sparsity
+ * pattern?), this operation is only
+ * allowed if the actual value to be
+ * assigned is zero. This operator only
+ * exists to allow for the obvious
+ * notation <tt>matrix=0</tt>, which sets
+ * all elements of the matrix to zero.
+ */
+ FullMatrix<number> &
+ operator = (const double d);
+
+ /**
* Assignment from different
* matrix classes. This
* assignment operator uses
* Final iterator of row <tt>r</tt>.
*/
const_iterator end (const unsigned int r) const;
-
- /**
- * Set all entries to zero, but
- * do not change the size of the
- * matrix.
- */
- void set_zero ();
/**
* Scale the entire matrix by a
<< "Target region not in matrix: size in this direction="
<< arg1 << ", size of new matrix=" << arg2
<< ", offset=" << arg3);
+ /**
+ * Exception
+ */
+ DeclException0 (ExcScalarAssignmentOnlyForZeroValue);
/**
* Exception
*/
template <typename number>
-void
-FullMatrix<number>::set_zero ()
+FullMatrix<number> &
+FullMatrix<number>::operator = (const double d)
{
+ Assert (d==0, ExcScalarAssignmentOnlyForZeroValue());
+
if (this->n_elements() != 0)
std::fill_n (this->val, this->n_elements(), number());
+
+ return *this;
}
* can use pointers to this class.
*/
virtual ~MatrixBase ();
-
+ /**
+ * This operator assigns a scalar to a
+ * matrix. Since this does usually not
+ * make much sense (should we set all
+ * matrix entries to this value? Only
+ * the nonzero entries of the sparsity
+ * pattern?), this operation is only
+ * allowed if the actual value to be
+ * assigned is zero. This operator only
+ * exists to allow for the obvious
+ * notation <tt>matrix=0</tt>, which
+ * sets all elements of the matrix to
+ * zero, but keeps the sparsity pattern
+ * previously used.
+ */
+ MatrixBase &
+ operator = (const double d);
/**
* Release all memory and return
* to a state just like after
*/
void clear ();
- /**
- * Set all matrix entries to zero, but
- * retain the sparsity pattern and all
- * the other properties of the matrix.
- */
- void set_zero ();
-
/**
* Set the element (<i>i,j</i>)
* to @p value. Throws an
* Exception
*/
DeclException0 (ExcMatrixNotSquare);
+ /**
+ * Exception
+ */
+ DeclException0 (ExcScalarAssignmentOnlyForZeroValue);
protected:
/**
const bool is_symmetric = false);
/**
- * Set all matrix entries to zero, but
- * retain the sparsity pattern. This
- * function simply calls the respective
- * function of the base class.
+ * This operator assigns a scalar to
+ * a matrix. Since this does usually
+ * not make much sense (should we set
+ * all matrix entries to this value?
+ * Only the nonzero entries of the
+ * sparsity pattern?), this operation
+ * is only allowed if the actual
+ * value to be assigned is zero. This
+ * operator only exists to allow for
+ * the obvious notation
+ * <tt>matrix=0</tt>, which sets all
+ * elements of the matrix to zero,
+ * but keep the sparsity pattern
+ * previously used.
*/
- void set_zero ();
+ SparseMatrix & operator = (const double d);
/**
* Throw away the present matrix and
const std::vector<unsigned int> &row_lengths,
const bool is_symmetric = false);
+ /**
+ * This operator assigns a scalar to
+ * a matrix. Since this does usually
+ * not make much sense (should we set
+ * all matrix entries to this value?
+ * Only the nonzero entries of the
+ * sparsity pattern?), this operation
+ * is only allowed if the actual
+ * value to be assigned is zero. This
+ * operator only exists to allow for
+ * the obvious notation
+ * <tt>matrix=0</tt>, which sets all
+ * elements of the matrix to zero,
+ * but keep the sparsity pattern
+ * previously used.
+ */
+ SparseMatrix & operator = (const double d);
+
/**
* Throw away the present matrix and
* generate one that has the same
* to make the example given in the
* discussion about making the
* constructor explicit work.
+ *
+ * Since the semantics of assigning a
+ * scalar to a vector are not
+ * immediately clear, this operator
+ * should really only be used if you
+ * want to set the entire vector to
+ * zero. This allows the intuitive
+ * notation <tt>v=0</tt>. Assigning
+ * other values is deprecated and may
+ * be disallowed in the future.
*/
Vector & operator = (const PetscScalar s);
/**
* Set all components of the vector to
- * the given number @p s.
+ * the given number @p s. Simply pass
+ * this down to the individual block
+ * objects, but we still need to declare
+ * this function to make the example
+ * given in the discussion about making
+ * the constructor explicit work.
+ *
+ *
+ * Since the semantics of assigning a
+ * scalar to a vector are not
+ * immediately clear, this operator
+ * should really only be used if you
+ * want to set the entire vector to
+ * zero. This allows the intuitive
+ * notation <tt>v=0</tt>. Assigning
+ * other values is deprecated and may
+ * be disallowed in the future.
*/
VectorBase & operator = (const PetscScalar s);
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal.II authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
// soon as possible
};
- M_cell.set_zero ();
+ M_cell = 0;
for (unsigned int cell=0; cell<nblocks; ++cell)
{
*/
SparseMatrix<number>& operator = (const SparseMatrix<number> &);
- /**
- * Set all elements to zero, but keep to
- * the sparsity pattern of the matrix.
- */
- virtual void set_zero ();
+ /**
+ * This operator assigns a scalar to
+ * a matrix. Since this does usually
+ * not make much sense (should we set
+ * all matrix entries to this value?
+ * Only the nonzero entries of the
+ * sparsity pattern?), this operation
+ * is only allowed if the actual
+ * value to be assigned is zero. This
+ * operator only exists to allow for
+ * the obvious notation
+ * <tt>matrix=0</tt>, which sets all
+ * elements of the matrix to zero,
+ * but keep the sparsity pattern
+ * previously used.
+ */
+ SparseMatrix & operator = (const double d);
/**
* Reinitialize the sparse matrix
* Exception
*/
DeclException0 (ExcSourceEqualsDestination);
+ /**
+ * Exception
+ */
+ DeclException0 (ExcScalarAssignmentOnlyForZeroValue);
private:
/**
template <typename number>
-void
-SparseMatrix<number>::set_zero ()
+SparseMatrix<number> &
+SparseMatrix<number>::operator = (const double d)
{
+ Assert (d==0, ExcScalarAssignmentOnlyForZeroValue());
+
Assert (cols != 0, ExcMatrixNotInitialized());
Assert (cols->compressed || cols->empty(), ExcNotCompressed());
if (val)
- std::fill_n (&val[0], cols->n_nonzero_elements(), 0);
+ std::fill_n (&val[0], cols->n_nonzero_elements(), 0.);
+
+ return *this;
}
SparseMatrix<number>::copy_from (const FullMatrix<somenumber> &matrix)
{
// first delete previous content
- set_zero ();
+ *this = 0;
// then copy old matrix
for (unsigned int row=0; row<matrix.m(); ++row)
void swap (Vector<Number> &v);
/**
- * Set all components of the vector to
- * the given number @p s.
- */
- Vector<Number> & operator= (const Number s);
+ * Set all components of the vector to
+ * the given number @p s. Simply pass
+ * this down to the individual block
+ * objects, but we still need to declare
+ * this function to make the example
+ * given in the discussion about making
+ * the constructor explicit work.
+ *
+ *
+ * Since the semantics of assigning a
+ * scalar to a vector are not
+ * immediately clear, this operator
+ * should really only be used if you
+ * want to set the entire vector to
+ * zero. This allows the intuitive
+ * notation <tt>v=0</tt>. Assigning
+ * other values is deprecated and may
+ * be disallowed in the future.
+ */
+ Vector<Number> & operator = (const Number s);
/**
* Copy the given vector. Resize the
- void
- MatrixBase::set_zero ()
+ MatrixBase &
+ MatrixBase::operator = (const double d)
{
+ Assert (d==0, ExcScalarAssignmentOnlyForZeroValue());
+
const int ierr = MatZeroEntries (matrix);
- AssertThrow (ierr == 0, ExcPETScError(ierr));
+ AssertThrow (ierr == 0, ExcPETScError(ierr));
+
+ return *this;
}
cell != dof_handler.end(); ++cell)
{
cell->get_dof_indices (local_dofs);
- local_matrix.set_zero ();
+ local_matrix = 0;
for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
local_matrix(i,j) = (i+1.)*(j+1.)*(local_dofs[i]+1.)*(local_dofs[j]+1.);
cell != dof_handler.end(); ++cell)
{
cell->get_dof_indices (local_dofs);
- local_matrix.set_zero ();
+ local_matrix = 0;
for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
local_matrix(i,j) = (i+1.)*(j+1.)*(local_dofs[i]+1.)*(local_dofs[j]+1.);
cell != dof_handler.end(); ++cell)
{
cell->get_dof_indices (local_dofs);
- local_matrix.set_zero ();
+ local_matrix = 0;
for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
local_matrix(i,j) = (i+1.)*(j+1.)*(local_dofs[i]+1.)*(local_dofs[j]+1.);
cell != dof_handler.end(); ++cell)
{
cell->get_dof_indices (local_dofs);
- local_matrix.set_zero ();
+ local_matrix = 0;
for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
local_matrix(i,j) = (i+1.)*(j+1.)*(local_dofs[i]+1.)*(local_dofs[j]+1.);
cell != dof_handler.end(); ++cell)
{
cell->get_dof_indices (local_dofs);
- local_matrix.set_zero ();
+ local_matrix = 0;
for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
for (unsigned int j=0; j<fe.dofs_per_cell; ++j)
local_matrix(i,j) = (i+1.)*(j+1.)*(local_dofs[i]+1.)*(local_dofs[j]+1.);
//---------------------------- petsc_63.cc ---------------------------
-// PETScWrappers::SparseMatrix::set_zero () was declared but not defined
+// PETScWrappers::SparseMatrix::operator = (double) was declared but not
+// defined
#include "../tests.h"
#include <lac/petsc_sparse_matrix.h>
Assert (m.m() == 100, ExcInternalError());
Assert (m.n() == 100, ExcInternalError());
- m.set_zero ();
+ m = 0;
Assert (m.m() == 100, ExcInternalError());
Assert (m.n() == 100, ExcInternalError());
{
fe_values.reinit (cell);
- cell_matrix.set_zero ();
+ cell_matrix = 0;
cell_rhs = 0;
for (unsigned int i=0; i<dofs_per_cell; ++i)
cell->get_dof_values (*this->u, local_u);
cell->get_dof_values (*this->v, local_v);
- cell_matrix.set_zero ();
+ cell_matrix = 0;
this->density->value_list (fe_values.get_quadrature_points(),
density_values);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
total_energy += 1./2. * cell_matrix.matrix_norm_square (local_v);
- cell_matrix.set_zero ();
+ cell_matrix = 0;
this->stiffness->value_list (fe_values.get_quadrature_points(),
stiffness_values);
for (unsigned int point=0; point<fe_values.n_quadrature_points; ++point)
cell != dof_handler->end(); ++cell)
{
fe_values.reinit (cell);
- cell_mass_matrix.set_zero ();
- cell_laplace_matrix.set_zero ();
+ cell_mass_matrix = 0;
+ cell_laplace_matrix = 0;
cell->get_dof_indices (dof_indices_on_cell);
if (!density_constant || !stiffness_constant)
old_cell->get_dof_values (previous_time_level.u, tmp);
cell_matrix.vmult (local_M_u, tmp);
- cell_matrix.set_zero ();
+ cell_matrix = 0;
std::vector<double> stiffness_values(fe_values.n_quadrature_points);
this->parameters.stiffness->value_list (fe_values.get_quadrature_points(),
stiffness_values);
old_child->get_dof_values (previous_time_level.u, local_old_dof_values_u);
old_child->get_dof_values (previous_time_level.v, local_old_dof_values_v);
- cell_matrix.set_zero ();
+ cell_matrix = 0;
std::vector<double> density_values(fe_values.n_quadrature_points);
this->parameters.density->value_list (fe_values.get_quadrature_points(),
density_values);
cell_matrix.vmult (local_M_u, local_old_dof_values_u);
cell_matrix.vmult (local_M_v, local_old_dof_values_v);
- cell_matrix.set_zero ();
+ cell_matrix = 0;
std::vector<double> stiffness_values(fe_values.n_quadrature_points);
this->parameters.stiffness->value_list (fe_values.get_quadrature_points(),
stiffness_values);
else
{
fe_values.reinit (new_child);
- cell_matrix.set_zero ();
+ cell_matrix = 0;
std::vector<double> density_values(fe_values.n_quadrature_points);
this->parameters.density->value_list (fe_values.get_quadrature_points(),
density_values);
cell_matrix.vmult (local_M_u, local_old_dof_values_u);
cell_matrix.vmult (local_M_v, local_old_dof_values_v);
- cell_matrix.set_zero ();
+ cell_matrix = 0;
std::vector<double> stiffness_values(fe_values.n_quadrature_points);
this->parameters.stiffness->value_list (fe_values.get_quadrature_points(),
stiffness_values);
old_cell->get_dof_values (previous_time_level.v, tmp);
cell_matrix.vmult (local_M_v, tmp);
- cell_matrix.set_zero ();
+ cell_matrix = 0;
std::vector<double> stiffness_values(fe_values.n_quadrature_points);
this->parameters.stiffness->value_list (fe_values.get_quadrature_points(),
stiffness_values);
old_child->get_dof_values (previous_time_level.u, local_old_dof_values_u);
old_child->get_dof_values (previous_time_level.v, local_old_dof_values_v);
- cell_matrix.set_zero ();
+ cell_matrix = 0;
std::vector<double> density_values(fe_values.n_quadrature_points);
this->parameters.density->value_list (fe_values.get_quadrature_points(),
density_values);
cell_matrix.vmult (local_M_u, local_old_dof_values_u);
cell_matrix.vmult (local_M_v, local_old_dof_values_v);
- cell_matrix.set_zero ();
+ cell_matrix = 0;
std::vector<double> stiffness_values(fe_values.n_quadrature_points);
this->parameters.stiffness->value_list (fe_values.get_quadrature_points(),
else
{
fe_values.reinit (new_child);
- cell_matrix.set_zero ();
+ cell_matrix = 0;
std::vector<double> density_values(fe_values.n_quadrature_points);
this->parameters.density->value_list (fe_values.get_quadrature_points(),
density_values);
cell_matrix.vmult (local_M_u, local_old_dof_values_u);
cell_matrix.vmult (local_M_v, local_old_dof_values_v);
- cell_matrix.set_zero ();
+ cell_matrix = 0;
std::vector<double> stiffness_values(fe_values.n_quadrature_points);
this->parameters.stiffness->value_list (fe_values.get_quadrature_points(),
stiffness_values);
for (; cell!=endc; ++cell)
{
- local_matrix.set_zero ();
+ local_matrix = 0;
fe_values.reinit (cell);
for (unsigned int i=0; i<dofs_per_cell; ++i)
for (; cell!=endc; ++cell)
{
- local_matrix.set_zero ();
+ local_matrix = 0;
fe_values.reinit (cell);
for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
for (unsigned int comp_i=0; comp_i<fe.n_components(); ++comp_i)
for (; cell!=endc; ++cell)
{
- local_matrix.set_zero ();
+ local_matrix = 0;
fe_values.reinit (cell);
for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
for (unsigned int comp_i=0; comp_i<fe.n_components(); ++comp_i)
for (; cell!=endc; ++cell)
{
- local_matrix.set_zero ();
+ local_matrix = 0;
fe_values.reinit (cell);
for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
for (unsigned int comp_i=0; comp_i<fe.n_components(); ++comp_i)
for (; cell!=endc; ++cell)
{
- local_matrix.set_zero ();
+ local_matrix = 0;
fe_values.reinit (cell);
for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
for (unsigned int comp_i=0; comp_i<fe.n_components(); ++comp_i)
for (unsigned int i=0;i<4;++i)
{
// Setup rotation matrix
- C.set_zero();
+ C = 0;
C.diagadd(1.);
C(i,i) = C(i+1,i+1) = std::cos(i+1.);
C(i+1,i) = std::sin(i+1.);