From: Denis Davydov Date: Tue, 16 Jun 2015 21:10:37 +0000 (+0200) Subject: preliminary changes in pack_callback and unpack_callback to use complex numbers X-Git-Tag: v8.3.0-rc1~104^2~11 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8452e537a679c6af42592a8761930e3a9c73aae3;p=dealii.git preliminary changes in pack_callback and unpack_callback to use complex numbers --- diff --git a/source/distributed/solution_transfer.cc b/source/distributed/solution_transfer.cc index 428744839e..bf49ec5443 100644 --- a/source/distributed/solution_transfer.cc +++ b/source/distributed/solution_transfer.cc @@ -216,18 +216,19 @@ namespace parallel const typename Triangulation::CellStatus /*status*/, void *data) { - double *data_store = reinterpret_cast(data); + typename VECTOR::value_type *data_store = reinterpret_cast(data); typename DH::cell_iterator cell(*cell_, dof_handler); const unsigned int dofs_per_cell=cell->get_fe().dofs_per_cell; - ::dealii::Vector dofvalues(dofs_per_cell); + ::dealii::Vector dofvalues(dofs_per_cell); for (typename std::vector::iterator it=input_vectors.begin(); it !=input_vectors.end(); ++it) { cell->get_interpolated_dof_values(*(*it), dofvalues); - std::memcpy(data_store, &dofvalues(0), sizeof(double)*dofs_per_cell); + Assert (typeid(typename VECTOR::value_type) == typeid(double), ExcNotImplemented()); + std::memcpy(data_store, &dofvalues(0), sizeof(typename VECTOR::value_type)*dofs_per_cell); data_store += dofs_per_cell; } } @@ -245,14 +246,15 @@ namespace parallel cell(*cell_, dof_handler); const unsigned int dofs_per_cell=cell->get_fe().dofs_per_cell; - ::dealii::Vector dofvalues(dofs_per_cell); - const double *data_store = reinterpret_cast(data); + ::dealii::Vector dofvalues(dofs_per_cell); + const typename VECTOR::value_type *data_store = reinterpret_cast(data); for (typename std::vector::iterator it = all_out.begin(); it != all_out.end(); ++it) { - std::memcpy(&dofvalues(0), data_store, sizeof(double)*dofs_per_cell); + Assert (typeid(typename VECTOR::value_type) == typeid(double), ExcNotImplemented()); + std::memcpy(&dofvalues(0), data_store, sizeof(typename VECTOR::value_type)*dofs_per_cell); cell->set_dof_values_by_interpolation(dofvalues, *(*it)); data_store += dofs_per_cell; }