Hi all
I'm attempting to add the functionality to write nodal data that
comprises the components of a symmetric second order tensor for post-
processing using vtk. For example:
///////////
std::vector<std::string> solution_names
(SymmetricTensor<2,dim>::n_independent_components, "tensor_field");
std::vector<DataComponentInterpretation::DataComponentInterpretation>
data_component_interpretation
(SymmetricTensor<2,dim>::n_independent_components,
DataComponentInterpretation
::component_is_part_of_symmetric_second_order_tensor);
DataOut<dim> data_out;
data_out.attach_dof_handler (dof_handler);
data_out.add_data_vector (solution, solution_names,
DataOut<dim>::type_dof_data,
data_component_interpretation);
data_out.build_patches ();
std::ostringstream filename;
filename << "solution.vtk";
std::ofstream output (filename.str().c_str());
data_out.write_vtk (output);
//////////////
In order to do so I have added the following line, amongst other, to
"data_out_base.cc"
//////////
const unsigned int vector_component =
SymmetricTensor<2, dim>::component_to_unrolled_index
(TableIndices<2>(i,j));
//////////
The problem arises when I try and compile the project. Its a linking
error but I don't understand the problem. Here is the error message:
*************
=====base=============debug======MT== Linking library: libbase.g.dylib
Undefined symbols:
"dealii::SymmetricTensor<2,
4>::component_to_unrolled_index(dealii::TableIndices<2> const&)",
referenced from:
void dealii::DataOutBase::write_vtk<4,
4>(std::vector<dealii::DataOutBase::Patch<4, 4>,
std::allocator<dealii::DataOutBase::Patch<4, 4> > > const&,
std::vector<std::basic_string<char, std::char_traits<char>,
std::allocator<char> >, std::allocator<std::basic_string<char,
std::char_traits<char>, std::allocator<char> > > > const&,
std::vector<boost::tuples::tuple<unsigned int, unsigned int,
std::basic_string<char, std::char_traits<char>, std::allocator<char>
>, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type>,
std::allocator<boost::tuples::tuple<unsigned int, unsigned int,
std::basic_string<char, std::char_traits<char>, std::allocator<char>
>, boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type, boost::tuples::null_type,
boost::tuples::null_type> > > const&, dealii::DataOutBase::VtkFlags
const&, std::basic_ostream<char, std::char_traits<char> >&)in
data_out_base.g.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
make[1]: *** [/Users/andrewmcbride/lib/my_deal_svn/trunk/deal.II/lib/
libbase.g.dylib] Error 1
make: *** [baseg] Error 2
***************
Does anyone have an idea as to what the problem is? I have included
the additional headers in "data_out_base.h"
////////////////
#include <base/symmetric_tensor.h>
#include <base/table_indices.h>
//////////////
I'm compiling on a Mac. I'm convinced it has something to do with the
" SymmetricTensor<2, dim>::component_to_unrolled_index" call. If I
replace this with "SymmetricTensor<2, dim>::n_independent_components",
for example, all is well and the code compiles.
Kind regards
Andrew
_______________________________________________
dealii mailing list http://poisson.dealii.org/mailman/listinfo/dealii