From: Wolfgang Bangerth Date: Thu, 16 Mar 2000 16:12:40 +0000 (+0000) Subject: How can this have worked in the presence of cell data??? X-Git-Tag: v8.0.0~20783 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1fcdd1627acee4c721fbc96ef8816956417bbcf3;p=dealii.git How can this have worked in the presence of cell data??? git-svn-id: https://svn.dealii.org/trunk@2589 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/numerics/data_out.cc b/deal.II/deal.II/source/numerics/data_out.cc index f40801d10a..388a062453 100644 --- a/deal.II/deal.II/source/numerics/data_out.cc +++ b/deal.II/deal.II/source/numerics/data_out.cc @@ -35,17 +35,23 @@ DataOut_DoFData::DataEntry::DataEntry (const Vector *data, names(names) {}; + + template DataOut_DoFData::DataOut_DoFData () : dofs(0) {}; + + template DataOut_DoFData::~DataOut_DoFData () { clear (); }; + + template void DataOut_DoFData::attach_dof_handler (const DoFHandler &d) { @@ -60,6 +66,8 @@ void DataOut_DoFData::attach_dof_handler (const DoFHandler &d) dofs->subscribe (); }; + + template void DataOut_DoFData::add_data_vector (const Vector &vec, const vector &names) @@ -97,21 +105,29 @@ template void DataOut_DoFData::add_data_vector (const Vector &vec, const string &name) { - unsigned int n = dofs->get_fe().n_components (); + unsigned int n_components = dofs->get_fe().n_components (); - vector names (1); - if (n > 1) + vector names; + // if only one component or vector + // is cell vector: we only need one + // name + if ((n_components == 1) || + (vec.size() == dofs->get_tria().n_active_cells())) { - names.resize(dofs->get_fe().n_components ()); - for (unsigned int i=0;i