wrong size. Previously we got the null-information exception
--------------------------------------------------------
An error occurred in line <83> of file <source/numerics/data_out.cc> in function
void DataOut_DoFData<2>::add_data_vector(const Vector<double> &, const vector<basic_string<char,string_char_traits<char>,__malloc_alloc_template<0> >,allocator<basic_string<char,string_char_traits<char>,__malloc_alloc_template<0> > > > &)
The violated condition was:
((vec.size() == dofs->get_tria().n_active_cells()) && (names.size() == 1)) || ((vec.size() == dofs->n_dofs()) && (names.size() == dofs->get_fe().n_components()))
The name and call sequence of the exception was:
ExcInvalidNumberOfNames (names.size(), dofs->get_fe().n_components())
Additional Information:
You have to give one name per component in your data vector. The number you gave was 1, but the number of components is 1
--------------------------------------------------------
which does not shed much light on what the problem is (number of
components seems to be ok, not?)
Now we get
1--------------------------------------------------------
An error occurred in line <81> of file <source/numerics/data_out.cc> in function
void DataOut_DoFData<2>::add_data_vector(const Vector<double> &, const vector<basic_string<char,string_char_traits<char>,__malloc_alloc_template<0> >,allocator<basic_string<char,string_char_traits<char>,__malloc_alloc_template<0> > > > &)
The violated condition was:
(vec.size() == dofs->get_tria().n_active_cells()) || (vec.size() == dofs->n_dofs())
The name and call sequence of the exception was:
ExcInvalidVectorSize(vec.size(), dofs->get_tria().n_active_cells(), dofs->n_dofs())
Additional Information:
The vector has size 0 but the DoFHandler objects says there are 2560 degrees of freedom and there are 2641 active cells.
--------------------------------------------------------
git-svn-id: https://svn.dealii.org/trunk@3008
0785d39b-7218-0410-832d-
ea1e28bc413d
const vector<string> &names)
{
Assert (dofs != 0, ExcNoDoFHandlerSelected ());
+
+ // check for allowed sizes of
+ // vectors
+ Assert ((vec.size() == dofs->get_tria().n_active_cells()) ||
+ (vec.size() == dofs->n_dofs()),
+ ExcInvalidVectorSize(vec.size(), dofs->get_tria().n_active_cells(), dofs->n_dofs()));
+
// either cell data and one name,
// or dof data and n_components names
- Assert (((vec.size() == dofs->get_tria().n_active_cells()) &&
- (names.size() == 1))
- ||
- ((vec.size() == dofs->n_dofs()) &&
- (names.size() == dofs->get_fe().n_components())),
- ExcInvalidNumberOfNames (names.size(), dofs->get_fe().n_components()));
+ if (vec.size() == dofs->get_tria().n_active_cells())
+ Assert (names.size() == 1,
+ ExcInvalidNumberOfNames (names.size(), 1));
+ if (vec.size() == dofs->n_dofs())
+ Assert (names.size() == dofs->get_fe().n_components(),
+ ExcInvalidNumberOfNames (names.size(), dofs->get_fe().n_components()));
for (unsigned int i=0; i<names.size(); ++i)
Assert (names[i].find_first_not_of("abcdefghijklmnopqrstuvwxyz"
"ABCDEFGHIJKLMNOPQRSTUVWXYZ"