Ejemplo n.º 1
0
void EpetraVector<T>::insert (const T * v,
                              const std::vector<numeric_index_type> & dof_indices)
{
  libmesh_assert_equal_to (sizeof(numeric_index_type), sizeof(int));

  ReplaceGlobalValues (dof_indices.size(),
                       (int *) &dof_indices[0],
                       const_cast<T *>(v));
}
Ejemplo n.º 2
0
void EpetraVector<T>::insert (const std::vector<T>& v,
			      const std::vector<unsigned int>& dof_indices)
{
  libmesh_assert_equal_to (v.size(), dof_indices.size());

  ReplaceGlobalValues (v.size(),
                       (int*) &dof_indices[0],
                       const_cast<T*>(&v[0]));
}
Ejemplo n.º 3
0
void EpetraVector<T>::set (const numeric_index_type i_in, const T value_in)
{
  int i = static_cast<int> (i_in);
  T value = value_in;

  libmesh_assert_less (i_in, this->size());

  ReplaceGlobalValues(1, &i, &value);

  this->_is_closed = false;
}
Ejemplo n.º 4
0
void EpetraVector<T>::insert (const DenseVector<T>& v,
			      const std::vector<unsigned int>& dof_indices)
{
  libmesh_assert_equal_to (v.size(), dof_indices.size());

  std::vector<T> &vals = const_cast<DenseVector<T>&>(v).get_values();

  ReplaceGlobalValues (v.size(),
                       (int*) &dof_indices[0],
                       &vals[0]);
}
Ejemplo n.º 5
0
int Epetra_FECrsMatrix::ReplaceGlobalValues(const Epetra_LongLongSerialDenseVector& indices,
              const Epetra_SerialDenseMatrix& values,
              int format)
{
  if (indices.Length() != values.M() || indices.Length() != values.N()) {
    return(-1);
  }

  return( ReplaceGlobalValues(indices.Length(), indices.Values(),
            values.A(), format) );
}
Ejemplo n.º 6
0
int Epetra_FECrsMatrix::ReplaceGlobalValues(const Epetra_IntSerialDenseVector& rows,
              const Epetra_IntSerialDenseVector& cols,
              const Epetra_SerialDenseMatrix& values,
              int format)
{
  if (rows.Length() != values.M() || cols.Length() != values.N()) {
    return(-1);
  }

  return( ReplaceGlobalValues(rows.Length(), rows.Values(),
            cols.Length(), cols.Values(),
            values.A(), format) );
}