From: Marc Fehling Date: Sat, 21 Nov 2020 02:20:45 +0000 (-0700) Subject: Deprecated DoFHandlerType in DataOutStack. X-Git-Tag: v9.3.0-rc1~872^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d46d02b9cb51338fa89c01ab24b6783c134e1e4f;p=dealii.git Deprecated DoFHandlerType in DataOutStack. --- diff --git a/doc/news/changes/incompatibilities/20201120Fehling-2 b/doc/news/changes/incompatibilities/20201120Fehling-2 new file mode 100644 index 0000000000..3b31b67b63 --- /dev/null +++ b/doc/news/changes/incompatibilities/20201120Fehling-2 @@ -0,0 +1,4 @@ +Deprecated: The DoFHandlerType template argument for the DataOutStack +class has been deprecated. Use DataOutStack instead. +
+(Marc Fehling, 2020/11/20) diff --git a/include/deal.II/numerics/data_out_stack.h b/include/deal.II/numerics/data_out_stack.h index 43436d7a26..d3116d22c8 100644 --- a/include/deal.II/numerics/data_out_stack.h +++ b/include/deal.II/numerics/data_out_stack.h @@ -37,6 +37,25 @@ template class DoFHandler; #endif +/** + * @deprecated Use DataOutStack instead. + */ +template +class DataOutStack; + +#ifndef DOXYGEN +// prevent doxygen from complaining about potential recursive class relations +template +class DataOutStack : public DataOutStack +{ +public: + DEAL_II_DEPRECATED + DataOutStack() + : DataOutStack() + {} +}; +#endif // DOXYGEN + /** * This class is used to stack the output from several computations into one * output file by stacking the data sets in another co-ordinate direction @@ -111,10 +130,8 @@ class DoFHandler; * * @ingroup output */ -template > -class DataOutStack : public DataOutInterface +template +class DataOutStack : public DataOutInterface { public: /** @@ -156,7 +173,7 @@ public: * value. */ void - attach_dof_handler(const DoFHandlerType &dof_handler); + attach_dof_handler(const DoFHandler &dof_handler); /** * Declare a data vector. The @p vector_type argument determines whether the @@ -312,8 +329,8 @@ private: * DoF handler to be used for the data corresponding to the present * parameter value. */ - SmartPointer> + SmartPointer, + DataOutStack> dof_handler; /** diff --git a/source/numerics/data_out_stack.cc b/source/numerics/data_out_stack.cc index 68389f23eb..c2daf74cac 100644 --- a/source/numerics/data_out_stack.cc +++ b/source/numerics/data_out_stack.cc @@ -37,10 +37,9 @@ DEAL_II_NAMESPACE_OPEN -template +template std::size_t -DataOutStack::DataVector::memory_consumption() - const +DataOutStack::DataVector::memory_consumption() const { return (MemoryConsumption::memory_consumption(data) + MemoryConsumption::memory_consumption(names)); @@ -48,11 +47,10 @@ DataOutStack::DataVector::memory_consumption() -template +template void -DataOutStack::new_parameter_value( - const double p, - const double dp) +DataOutStack::new_parameter_value(const double p, + const double dp) { parameter = p; parameter_step = dp; @@ -72,23 +70,18 @@ DataOutStack::new_parameter_value( } -template +template void -DataOutStack::attach_dof_handler( - const DoFHandlerType &dof) +DataOutStack::attach_dof_handler( + const DoFHandler &dof) { - // Check consistency of redundant - // template parameter - Assert(dim == DoFHandlerType::dimension, - ExcDimensionMismatch(dim, DoFHandlerType::dimension)); - dof_handler = &dof; } -template +template void -DataOutStack::declare_data_vector( +DataOutStack::declare_data_vector( const std::string &name, const VectorType vector_type) { @@ -98,9 +91,9 @@ DataOutStack::declare_data_vector( } -template +template void -DataOutStack::declare_data_vector( +DataOutStack::declare_data_vector( const std::vector &names, const VectorType vector_type) { @@ -140,12 +133,11 @@ DataOutStack::declare_data_vector( } -template +template template void -DataOutStack::add_data_vector( - const Vector &vec, - const std::string & name) +DataOutStack::add_data_vector(const Vector &vec, + const std::string & name) { const unsigned int n_components = dof_handler->get_fe(0).n_components(); @@ -175,10 +167,10 @@ DataOutStack::add_data_vector( } -template +template template void -DataOutStack::add_data_vector( +DataOutStack::add_data_vector( const Vector & vec, const std::vector &names) { @@ -250,9 +242,9 @@ DataOutStack::add_data_vector( } -template +template void -DataOutStack::build_patches( +DataOutStack::build_patches( const unsigned int nnnn_subdivisions) { // this is mostly copied from the @@ -276,7 +268,7 @@ DataOutStack::build_patches( // create patches of and make sure // there is enough memory for that unsigned int n_patches = 0; - for (typename DoFHandlerType::active_cell_iterator cell = + for (typename DoFHandler::active_cell_iterator cell = dof_handler->begin_active(); cell != dof_handler->end(); ++cell) @@ -326,7 +318,7 @@ DataOutStack::build_patches( typename std::vector>::iterator patch = patches.begin() + (patches.size() - n_patches); unsigned int cell_number = 0; - for (typename DoFHandlerType::active_cell_iterator cell = + for (typename DoFHandler::active_cell_iterator cell = dof_handler->begin_active(); cell != dof_handler->end(); ++cell, ++patch, ++cell_number) @@ -436,9 +428,9 @@ DataOutStack::build_patches( } -template +template void -DataOutStack::finish_parameter_value() +DataOutStack::finish_parameter_value() { // release lock on dof handler dof_handler = nullptr; @@ -455,9 +447,9 @@ DataOutStack::finish_parameter_value() -template +template std::size_t -DataOutStack::memory_consumption() const +DataOutStack::memory_consumption() const { return (DataOutInterface::memory_consumption() + MemoryConsumption::memory_consumption(parameter) + @@ -470,18 +462,18 @@ DataOutStack::memory_consumption() const -template +template const std::vector> & -DataOutStack::get_patches() const +DataOutStack::get_patches() const { return patches; } -template +template std::vector -DataOutStack::get_dataset_names() const +DataOutStack::get_dataset_names() const { std::vector names; for (typename std::vector::const_iterator dataset = diff --git a/source/numerics/data_out_stack.inst.in b/source/numerics/data_out_stack.inst.in index 5308b22405..12e6ff0f67 100644 --- a/source/numerics/data_out_stack.inst.in +++ b/source/numerics/data_out_stack.inst.in @@ -17,28 +17,20 @@ for (deal_II_dimension : DIMENSIONS) { #if deal_II_dimension < 3 - template class DataOutStack>; + template class DataOutStack; - template void DataOutStack>:: - add_data_vector(const Vector &, const std::string &); - template void DataOutStack>:: - add_data_vector(const Vector &, const std::string &); + template void + DataOutStack::add_data_vector( + const Vector &, const std::string &); + template void + DataOutStack::add_data_vector( + const Vector &, const std::string &); - template void DataOutStack>:: - add_data_vector(const Vector &, - const std::vector &); - template void DataOutStack>:: - add_data_vector(const Vector &, - const std::vector &); + template void + DataOutStack::add_data_vector( + const Vector &, const std::vector &); + template void + DataOutStack::add_data_vector( + const Vector &, const std::vector &); #endif }