<h3>General</h3>
<ol>
-<li> New: The DoFTools::count_dofs_per_block function now also works
-for objects of type hp::DoFHandler.
-<br>
-(Jason Sheldon, 2011/11/13)
-
<li> Fixed: The Intel compiler complains that it can't copy Trilinos vector
reference objects, preventing the compiling of step-32. This is now fixed.
<br>
<h3>Specific improvements</h3>
<ol>
+<li> New: The copy constructor of the SparseMatrixEZ function now works
+(rather than throwing an exception) if the copied matrix has size zero.
+This is in accordance to the other matrix classes.
+<br>
+(Wolfgang Bangerth, 2011/11/15)
+
<li> New: The class ScalarFunctionFromFunctionObject provides a quick way to
convert an arbitrary function into a function object that can be passed
to part of the library that require the Function@<dim@> interface.
<br>
-(Wolfgang Bangerth, 2011/10/30)
+(Wolfgang Bangerth, 2011/11/15)
+
+<li> New: The DoFTools::count_dofs_per_block function now also works
+for objects of type hp::DoFHandler.
+<br>
+(Jason Sheldon, 2011/11/13)
<li> New: FETools::get_fe_from_name() can now return objects of type FE_Nothing.
<br>
template <typename number>
SparseMatrixEZ<number>::SparseMatrixEZ(const SparseMatrixEZ<number> &m)
:
- Subscriptor (m)
+ Subscriptor (m),
+ n_columns (0)
{
- Assert(false, ExcNotImplemented());
+ Assert(m.n() == 0, ExcNotImplemented());
+ Assert(m.m() == 0, ExcNotImplemented());
}
typename std::vector<Entry>::iterator e = data.begin();
const typename std::vector<Entry>::iterator end = data.end();
-
+
while (e != end)
{
(e++)->value = 0.;
}
-
+
return *this;
}
clear();
increment = default_increment;
-
+
n_columns = n_cols;
row_info.resize(n_rows);
if (reserve != 0)
const somenumber *src_ptr = src.begin();
typename std::vector<RowInfo>::const_iterator ri = row_info.begin();
const typename std::vector<RowInfo>::const_iterator end = row_info.end();
-
+
for (; ri != end; ++dst_ptr, ++src_ptr, ++ri)
{
Assert (ri->diagonal != RowInfo::invalid_diagonal, ExcNoDiagonal());
const somenumber *src_ptr = src.begin();
typename std::vector<RowInfo>::const_iterator ri = row_info.begin();
const typename std::vector<RowInfo>::const_iterator end = row_info.end();
-
+
for (; ri != end; ++dst_ptr, ++src_ptr, ++ri)
{
Assert (ri->diagonal != RowInfo::invalid_diagonal, ExcNoDiagonal());
const unsigned int end_row = ri->start + ri->diagonal;
for (unsigned int i=ri->start;i<end_row;++i)
s -= data[i].value * dst(data[i].column);
-
+
*dst_ptr = om * s / data[ri->start + ri->diagonal].value;
}
}
ri = row_info.rbegin();
const typename std::vector<RowInfo>::const_reverse_iterator
end = row_info.rend();
-
+
for (; ri != end; --dst_ptr, --src_ptr, ++ri)
{
Assert (ri->diagonal != RowInfo::invalid_diagonal, ExcNoDiagonal());
const unsigned int end_row = ri->start + ri->length;
for (unsigned int i=ri->start+ri->diagonal+1;i<end_row;++i)
s -= data[i].value * dst(data[i].column);
-
+
*dst_ptr = om * s / data[ri->start + ri->diagonal].value;
}
}
const unsigned int end_row = ri->start + ri->diagonal;
for (unsigned int i=ri->start;i<end_row;++i)
s += data[i].value * dst(data[i].column);
-
+
*dst_ptr = *src_ptr - s * om;
*dst_ptr /= data[ri->start + ri->diagonal].value;
}
if (max_length < row->length)
max_length = row->length;
}
-
+
// Number of entries allocated is
// position of last entry used
--row;
allocated = row->start + row->length;
reserved = data.capacity();
-
-
+
+
if (full)
{
used_by_line.resize(max_length+1);
-
+
for (row = row_info.begin() ; row != endrow; ++row)
{
++used_by_line[row->length];
template <typename number>
void
-SparseMatrixEZ<number>::print (std::ostream &out) const
+SparseMatrixEZ<number>::print (std::ostream &out) const
{
AssertThrow (out, ExcIO());
template <typename number>
-void
+void
SparseMatrixEZ<number>::print_formatted ( std::ostream &out,
const unsigned int precision,
const bool scientific,
Assert (n() != 0, ExcNotInitialized());
unsigned int width = width_;
-
+
std::ios::fmtflags old_flags = out.flags();
unsigned int old_precision = out.precision (precision);
}
out << std::endl;
};
-
+
// reset output format
out.precision(old_precision);
out.flags (old_flags);
template <typename number>
void
-SparseMatrixEZ<number>::block_write (std::ostream &out) const
+SparseMatrixEZ<number>::block_write (std::ostream &out) const
{
AssertThrow (out, ExcIO());
-
+
// first the simple objects,
// bracketed in [...]
out << '[' << row_info.size() << "]["
out.write(reinterpret_cast<const char*>(&*r),
sizeof(RowInfo) * row_info.size());
-// Just in case that vector entries are not stored consecutively
+// Just in case that vector entries are not stored consecutively
// const typename std::vector<RowInfo>::const_iterator re = row_info.end();
-
+
// while (r != re)
// {
// out.write(reinterpret_cast<const char*>(&*r),
// }
out << "][";
-
+
typename std::vector<Entry>::const_iterator d = data.begin();
out.write(reinterpret_cast<const char*>(&*d),
sizeof(Entry) * data.size());
-// Just in case that vector entries are not stored consecutively
+// Just in case that vector entries are not stored consecutively
// const typename std::vector<Entry>::const_iterator de = data.end();
// while (d != de)
// sizeof(Entry));
// ++d;
// }
-
+
out << ']';
-
+
AssertThrow (out, ExcIO());
}
DEAL_II_CHECK_INPUT(in,'[',c);
in >> n;
row_info.resize(n);
-
+
DEAL_II_CHECK_INPUT(in,']',c);
DEAL_II_CHECK_INPUT(in,'[',c);
in >> n_columns;
-
+
DEAL_II_CHECK_INPUT(in,']',c);
DEAL_II_CHECK_INPUT(in,'[',c);
in >> n;
data.resize(n);
-
+
DEAL_II_CHECK_INPUT(in,']',c);
DEAL_II_CHECK_INPUT(in,'[',c);
in >> increment;
// then read data
in.read(reinterpret_cast<char*>(&row_info[0]),
sizeof(RowInfo) * row_info.size());
-
+
DEAL_II_CHECK_INPUT(in,']',c);
DEAL_II_CHECK_INPUT(in,'[',c);
-
+
in.read(reinterpret_cast<char*>(&data[0]),
sizeof(Entry) * data.size());
-
+
DEAL_II_CHECK_INPUT(in,']',c);
}