From ce12e0eb30d2d04a3aafb4007cc5b4d48e4367f1 Mon Sep 17 00:00:00 2001 From: Marc Fehling Date: Fri, 6 Nov 2020 20:43:38 -0700 Subject: [PATCH] Created Legacy namespaces with copies of ... ... SolutionTransfer, FEFieldFunction, DataOut, DataOut_DoFData, DataOutFaces, DataOutRotation. --- .../changes/incompatibilities/20201120Fehling | 28 +++++++++++++++++++ .../deal.II/distributed/solution_transfer.h | 22 +++++++++++++-- include/deal.II/numerics/data_out.h | 11 ++++++++ include/deal.II/numerics/data_out_dof_data.h | 15 ++++++++++ include/deal.II/numerics/data_out_faces.h | 12 ++++++++ include/deal.II/numerics/data_out_rotation.h | 12 ++++++++ include/deal.II/numerics/fe_field_function.h | 19 +++++++++++++ include/deal.II/numerics/solution_transfer.h | 15 ++++++++++ source/numerics/fe_field_function.cc | 5 ++-- source/numerics/fe_field_function.inst.in | 9 ++++-- 10 files changed, 140 insertions(+), 8 deletions(-) create mode 100644 doc/news/changes/incompatibilities/20201120Fehling diff --git a/doc/news/changes/incompatibilities/20201120Fehling b/doc/news/changes/incompatibilities/20201120Fehling new file mode 100644 index 0000000000..fc665cf65f --- /dev/null +++ b/doc/news/changes/incompatibilities/20201120Fehling @@ -0,0 +1,28 @@ +Deprecation announcement: The template arguments of the following +classes will change in a future release: + +If for some reason, you need a code that is compatible with deal.II +9.3 and the subsequent release, a Legacy namespace has been introduced +with aliases of these classes with their original interface. You can +make the following substitutions to your code for each of the affected +classes: + +To perform this substitution automatically, you may use a *search and +replace* script like the following made for the *bash* shell: +@code{.sh} +classes=(SolutionTransfer parallel::distributed::SolutionTransfer Functions::FEFieldFunction DataOut DataOut_DoFData DataOutFaces DataOutRotation) +for c in \${classes[@]}; do + find /path/to/your/code -type f -exec sed -i -E "/(\w\${c}|\${c}[^<]|Particles::\${c}|distributed::\${c}|^\s*(\/\/|\*))/! s/\${c}/Legacy::\${c}/g" {} \; +done +@endcode +(Marc Fehling, 2020/11/20) diff --git a/include/deal.II/distributed/solution_transfer.h b/include/deal.II/distributed/solution_transfer.h index ab2061a180..f0d11ac987 100644 --- a/include/deal.II/distributed/solution_transfer.h +++ b/include/deal.II/distributed/solution_transfer.h @@ -372,11 +372,29 @@ namespace parallel void register_data_attach(); }; - - } // namespace distributed } // namespace parallel +namespace Legacy +{ + namespace parallel + { + namespace distributed + { + /** + * The template arguments of the original + * dealii::parallel::distributed::SolutionTransfer class will change in a + * future release. If for some reason, you need a code that is compatible + * with deal.II 9.3 and the subsequent release, use this alias instead. + */ + template > + using SolutionTransfer = dealii::parallel::distributed:: + SolutionTransfer; + } // namespace distributed + } // namespace parallel +} // namespace Legacy DEAL_II_NAMESPACE_CLOSE diff --git a/include/deal.II/numerics/data_out.h b/include/deal.II/numerics/data_out.h index aa6a3ffaf9..5a3278274c 100644 --- a/include/deal.II/numerics/data_out.h +++ b/include/deal.II/numerics/data_out.h @@ -516,6 +516,17 @@ private: const CurvedCellRegion curved_cell_region); }; +namespace Legacy +{ + /** + * The template arguments of the original dealii::DataOut class will + * change in a future release. If for some reason, you need a code that is + * compatible with deal.II 9.3 and the subsequent release, use this alias + * instead. + */ + template > + using DataOut = dealii::DataOut; +} // namespace Legacy DEAL_II_NAMESPACE_CLOSE diff --git a/include/deal.II/numerics/data_out_dof_data.h b/include/deal.II/numerics/data_out_dof_data.h index 86fe1fcea0..c1c09f3f99 100644 --- a/include/deal.II/numerics/data_out_dof_data.h +++ b/include/deal.II/numerics/data_out_dof_data.h @@ -1243,6 +1243,21 @@ DataOut_DoFData::merge_patches( patches[i].neighbors[n] += old_n_patches; } +namespace Legacy +{ + /** + * The template arguments of the original dealii::DataOut_DoFData class will + * change in a future release. If for some reason, you need a code that is + * compatible with deal.II 9.3 and the subsequent release, use this alias + * instead. + */ + template + using DataOut_DoFData = + dealii::DataOut_DoFData; +} // namespace Legacy + DEAL_II_NAMESPACE_CLOSE diff --git a/include/deal.II/numerics/data_out_faces.h b/include/deal.II/numerics/data_out_faces.h index 533f340b2c..1e20dd41e7 100644 --- a/include/deal.II/numerics/data_out_faces.h +++ b/include/deal.II/numerics/data_out_faces.h @@ -250,6 +250,18 @@ private: DataOutBase::Patch &patch); }; +namespace Legacy +{ + /** + * The template arguments of the original dealii::DataOutFaces class will + * change in a future release. If for some reason, you need a code that is + * compatible with deal.II 9.3 and the subsequent release, use this alias + * instead. + */ + template > + using DataOutFaces = dealii::DataOutFaces; +} // namespace Legacy + DEAL_II_NAMESPACE_CLOSE diff --git a/include/deal.II/numerics/data_out_rotation.h b/include/deal.II/numerics/data_out_rotation.h index c999c08a7f..ff7f20f0d1 100644 --- a/include/deal.II/numerics/data_out_rotation.h +++ b/include/deal.II/numerics/data_out_rotation.h @@ -215,6 +215,18 @@ private: &my_patches); }; +namespace Legacy +{ + /** + * The template arguments of the original dealii::DataOutRotation class will + * change in a future release. If for some reason, you need a code that is + * compatible with deal.II 9.3 and the subsequent release, use this alias + * instead. + */ + template > + using DataOutRotation = dealii::DataOutRotation; +} // namespace Legacy + DEAL_II_NAMESPACE_CLOSE diff --git a/include/deal.II/numerics/fe_field_function.h b/include/deal.II/numerics/fe_field_function.h index 87797dde7e..c3efd768d2 100644 --- a/include/deal.II/numerics/fe_field_function.h +++ b/include/deal.II/numerics/fe_field_function.h @@ -489,6 +489,25 @@ namespace Functions }; } // namespace Functions +namespace Legacy +{ + namespace Functions + { + /** + * The template arguments of the original dealii::Functions::FEFieldFunction + * class will change in a future release. If for some reason, you need a + * code that is compatible with deal.II 9.3 and the subsequent release, use + * this alias instead. + */ + template , + typename VectorType = Vector> + using FEFieldFunction = + dealii::Functions::FEFieldFunction; + } // namespace Functions +} // namespace Legacy + + DEAL_II_NAMESPACE_CLOSE #endif diff --git a/include/deal.II/numerics/solution_transfer.h b/include/deal.II/numerics/solution_transfer.h index 058d212654..ddaa04566e 100644 --- a/include/deal.II/numerics/solution_transfer.h +++ b/include/deal.II/numerics/solution_transfer.h @@ -574,6 +574,21 @@ private: dof_values_on_cell; }; +namespace Legacy +{ + /** + * The template arguments of the original dealii::SolutionTransfer class will + * change in a future release. If for some reason, you need a code that is + * compatible with deal.II 9.3 and the subsequent release, use this alias + * instead. + */ + template , + typename DoFHandlerType = DoFHandler> + using SolutionTransfer = + dealii::SolutionTransfer; +} // namespace Legacy + DEAL_II_NAMESPACE_CLOSE diff --git a/source/numerics/fe_field_function.cc b/source/numerics/fe_field_function.cc index 7ad838c7c1..0697528317 100644 --- a/source/numerics/fe_field_function.cc +++ b/source/numerics/fe_field_function.cc @@ -33,9 +33,8 @@ DEAL_II_NAMESPACE_OPEN -namespace Functions -{ + #include "fe_field_function.inst" -} + DEAL_II_NAMESPACE_CLOSE diff --git a/source/numerics/fe_field_function.inst.in b/source/numerics/fe_field_function.inst.in index a994eb8b32..ec114ca802 100644 --- a/source/numerics/fe_field_function.inst.in +++ b/source/numerics/fe_field_function.inst.in @@ -18,7 +18,10 @@ for (DoFHandler : DOFHANDLER_TEMPLATES; VECTOR : VECTOR_TYPES; deal_II_dimension : DIMENSIONS) { - template class FEFieldFunction, - VECTOR>; + namespace Functions + \{ + template class FEFieldFunction, + VECTOR>; + \} } -- 2.39.5