From: Pasquale Africa Date: Tue, 16 Apr 2024 07:49:18 +0000 (+0200) Subject: Add EpetraWrappers::VectorTraits class X-Git-Tag: v9.6.0-rc1~372^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F16880%2Fhead;p=dealii.git Add EpetraWrappers::VectorTraits class --- diff --git a/include/deal.II/lac/trilinos_epetra_vector.h b/include/deal.II/lac/trilinos_epetra_vector.h index ad2f901d92..988009a6c4 100644 --- a/include/deal.II/lac/trilinos_epetra_vector.h +++ b/include/deal.II/lac/trilinos_epetra_vector.h @@ -50,6 +50,17 @@ namespace LinearAlgebra */ namespace EpetraWrappers { + /** + * This class defines type aliases that are used in other classes + * within the EpetraWrappers namespace. + */ + class VectorTraits + { + public: + using value_type = double; + using size_type = types::global_dof_index; + }; + /** * @cond internal */ @@ -62,16 +73,6 @@ namespace LinearAlgebra */ namespace internal { - /** - * Declare type for container size. - */ - using size_type = dealii::types::global_dof_index; - - /** - * Declare type for container value type. - */ - using value_type = double; - /** * This class implements a wrapper for accessing the Trilinos Epetra * vector in the same way as we access deal.II objects: it is initialized @@ -84,6 +85,9 @@ namespace LinearAlgebra class VectorReference { private: + using value_type = VectorTraits::value_type; + using size_type = VectorTraits::size_type; + /** * Constructor. It is made private so as to only allow the actual vector * class to create it. @@ -218,11 +222,13 @@ namespace LinearAlgebra * @ingroup TrilinosWrappers * @ingroup Vectors */ - class Vector : public ReadVector, public Subscriptor + class Vector : public ReadVector, + public Subscriptor { public: - using value_type = internal::value_type; - using size_type = types::global_dof_index; + using value_type = VectorTraits::value_type; + using size_type = VectorTraits::size_type; + using real_type = value_type; using reference = internal::VectorReference; using const_reference = const internal::VectorReference;