Skip to content

Commit

Permalink
Also allow vector types that are can just wrap Vec objects.
Browse files Browse the repository at this point in the history
  • Loading branch information
bangerth committed Apr 23, 2023
1 parent 81c5479 commit 2a53b2f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
8 changes: 7 additions & 1 deletion include/deal.II/lac/petsc_snes.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@

# include <petscsnes.h>

# if defined(DEAL_II_HAVE_CXX20)
# include <concepts>
# endif


DEAL_II_NAMESPACE_OPEN

namespace PETScWrappers
Expand Down Expand Up @@ -224,7 +229,8 @@ namespace PETScWrappers
template <typename VectorType = PETScWrappers::VectorBase,
typename PMatrixType = PETScWrappers::MatrixBase,
typename AMatrixType = PMatrixType>
DEAL_II_CXX20_REQUIRES(concepts::is_dealii_petsc_vector_type<VectorType>)
DEAL_II_CXX20_REQUIRES(concepts::is_dealii_petsc_vector_type<VectorType> ||
std::constructible_from<VectorType, Vec>)
class NonlinearSolver
{
public:
Expand Down
7 changes: 6 additions & 1 deletion include/deal.II/lac/petsc_ts.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@

# include <petscts.h>

# if defined(DEAL_II_HAVE_CXX20)
# include <concepts>
# endif

DEAL_II_NAMESPACE_OPEN

namespace PETScWrappers
Expand Down Expand Up @@ -289,7 +293,8 @@ namespace PETScWrappers
template <typename VectorType = PETScWrappers::VectorBase,
typename PMatrixType = PETScWrappers::MatrixBase,
typename AMatrixType = PMatrixType>
DEAL_II_CXX20_REQUIRES(concepts::is_dealii_petsc_vector_type<VectorType>)
DEAL_II_CXX20_REQUIRES(concepts::is_dealii_petsc_vector_type<VectorType> ||
std::constructible_from<VectorType, Vec>)
class TimeStepper
{
public:
Expand Down

0 comments on commit 2a53b2f

Please sign in to comment.