namespace PETScWrappers
{
template <typename VectorType, typename PMatrixType, typename AMatrixType>
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
NonlinearSolver<VectorType, PMatrixType, AMatrixType>::NonlinearSolver(
const NonlinearSolverData &data,
const MPI_Comm & mpi_comm)
template <typename VectorType, typename PMatrixType, typename AMatrixType>
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
NonlinearSolver<VectorType, PMatrixType, AMatrixType>::operator SNES() const
{
return snes;
template <typename VectorType, typename PMatrixType, typename AMatrixType>
- SNES
- NonlinearSolver<VectorType, PMatrixType, AMatrixType>::petsc_snes()
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
+ SNES NonlinearSolver<VectorType, PMatrixType, AMatrixType>::petsc_snes()
{
return snes;
}
template <typename VectorType, typename PMatrixType, typename AMatrixType>
- MPI_Comm
- NonlinearSolver<VectorType, PMatrixType, AMatrixType>::get_mpi_communicator()
- const
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
+ MPI_Comm NonlinearSolver<VectorType, PMatrixType, AMatrixType>::
+ get_mpi_communicator() const
{
return PetscObjectComm(reinterpret_cast<PetscObject>(snes));
}
template <typename VectorType, typename PMatrixType, typename AMatrixType>
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
NonlinearSolver<VectorType, PMatrixType, AMatrixType>::~NonlinearSolver()
{
AssertPETSc(SNESDestroy(&snes));
template <typename VectorType, typename PMatrixType, typename AMatrixType>
- void
- NonlinearSolver<VectorType, PMatrixType, AMatrixType>::reinit()
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
+ void NonlinearSolver<VectorType, PMatrixType, AMatrixType>::reinit()
{
AssertPETSc(SNESReset(snes));
}
template <typename VectorType, typename PMatrixType, typename AMatrixType>
- void
- NonlinearSolver<VectorType, PMatrixType, AMatrixType>::reinit(
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
+ void NonlinearSolver<VectorType, PMatrixType, AMatrixType>::reinit(
const NonlinearSolverData &data)
{
reinit();
template <typename VectorType, typename PMatrixType, typename AMatrixType>
- void
- NonlinearSolver<VectorType, PMatrixType, AMatrixType>::set_matrix(
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
+ void NonlinearSolver<VectorType, PMatrixType, AMatrixType>::set_matrix(
PMatrixType &P)
{
this->A = nullptr;
template <typename VectorType, typename PMatrixType, typename AMatrixType>
- void
- NonlinearSolver<VectorType, PMatrixType, AMatrixType>::set_matrices(
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
+ void NonlinearSolver<VectorType, PMatrixType, AMatrixType>::set_matrices(
AMatrixType &A,
PMatrixType &P)
{
template <typename VectorType, typename PMatrixType, typename AMatrixType>
- unsigned int
- NonlinearSolver<VectorType, PMatrixType, AMatrixType>::solve(VectorType &x)
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
+ unsigned int NonlinearSolver<VectorType, PMatrixType, AMatrixType>::solve(
+ VectorType &x)
{
const auto snes_function =
[](SNES, Vec x, Vec f, void *ctx) -> PetscErrorCode {
template <typename VectorType, typename PMatrixType, typename AMatrixType>
- unsigned int
- NonlinearSolver<VectorType, PMatrixType, AMatrixType>::solve(VectorType & x,
- PMatrixType &P)
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
+ unsigned int NonlinearSolver<VectorType, PMatrixType, AMatrixType>::solve(
+ VectorType & x,
+ PMatrixType &P)
{
set_matrix(P);
return solve(x);
template <typename VectorType, typename PMatrixType, typename AMatrixType>
- unsigned int
- NonlinearSolver<VectorType, PMatrixType, AMatrixType>::solve(VectorType & x,
- AMatrixType &A,
- PMatrixType &P)
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
+ unsigned int NonlinearSolver<VectorType, PMatrixType, AMatrixType>::solve(
+ VectorType & x,
+ AMatrixType &A,
+ PMatrixType &P)
{
set_matrices(A, P);
return solve(x);
namespace PETScWrappers
{
template <typename VectorType, typename PMatrixType, typename AMatrixType>
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
TimeStepper<VectorType, PMatrixType, AMatrixType>::TimeStepper(
const TimeStepperData &data,
const MPI_Comm & mpi_comm)
template <typename VectorType, typename PMatrixType, typename AMatrixType>
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
TimeStepper<VectorType, PMatrixType, AMatrixType>::~TimeStepper()
{
AssertPETSc(TSDestroy(&ts));
template <typename VectorType, typename PMatrixType, typename AMatrixType>
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
TimeStepper<VectorType, PMatrixType, AMatrixType>::operator TS() const
{
return ts;
template <typename VectorType, typename PMatrixType, typename AMatrixType>
- TS
- TimeStepper<VectorType, PMatrixType, AMatrixType>::petsc_ts()
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
+ TS TimeStepper<VectorType, PMatrixType, AMatrixType>::petsc_ts()
{
return ts;
}
template <typename VectorType, typename PMatrixType, typename AMatrixType>
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
inline MPI_Comm
- TimeStepper<VectorType, PMatrixType, AMatrixType>::get_mpi_communicator()
- const
+ TimeStepper<VectorType, PMatrixType, AMatrixType>::get_mpi_communicator()
+ const
{
return PetscObjectComm(reinterpret_cast<PetscObject>(ts));
}
template <typename VectorType, typename PMatrixType, typename AMatrixType>
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
typename TimeStepper<VectorType, PMatrixType, AMatrixType>::real_type
- TimeStepper<VectorType, PMatrixType, AMatrixType>::get_time()
+ TimeStepper<VectorType, PMatrixType, AMatrixType>::get_time()
{
PetscReal t;
PetscErrorCode ierr = TSGetTime(ts, &t);
template <typename VectorType, typename PMatrixType, typename AMatrixType>
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
typename TimeStepper<VectorType, PMatrixType, AMatrixType>::real_type
- TimeStepper<VectorType, PMatrixType, AMatrixType>::get_time_step()
+ TimeStepper<VectorType, PMatrixType, AMatrixType>::get_time_step()
{
PetscReal dt;
PetscErrorCode ierr = TSGetTimeStep(ts, &dt);
template <typename VectorType, typename PMatrixType, typename AMatrixType>
- void
- TimeStepper<VectorType, PMatrixType, AMatrixType>::reinit()
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
+ void TimeStepper<VectorType, PMatrixType, AMatrixType>::reinit()
{
AssertPETSc(TSReset(ts));
}
template <typename VectorType, typename PMatrixType, typename AMatrixType>
- void
- TimeStepper<VectorType, PMatrixType, AMatrixType>::reinit(
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
+ void TimeStepper<VectorType, PMatrixType, AMatrixType>::reinit(
const TimeStepperData &data)
{
reinit();
template <typename VectorType, typename PMatrixType, typename AMatrixType>
- void
- TimeStepper<VectorType, PMatrixType, AMatrixType>::set_matrix(PMatrixType &P)
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
+ void TimeStepper<VectorType, PMatrixType, AMatrixType>::set_matrix(
+ PMatrixType &P)
{
this->A = nullptr;
this->P = &P;
template <typename VectorType, typename PMatrixType, typename AMatrixType>
- void
- TimeStepper<VectorType, PMatrixType, AMatrixType>::set_matrices(
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
+ void TimeStepper<VectorType, PMatrixType, AMatrixType>::set_matrices(
AMatrixType &A,
PMatrixType &P)
{
template <typename VectorType, typename PMatrixType, typename AMatrixType>
- unsigned int
- TimeStepper<VectorType, PMatrixType, AMatrixType>::solve(VectorType &y)
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
+ unsigned int TimeStepper<VectorType, PMatrixType, AMatrixType>::solve(
+ VectorType &y)
{
const auto ts_ifunction =
[](TS, PetscReal t, Vec x, Vec xdot, Vec f, void *ctx) -> PetscErrorCode {
template <typename VectorType, typename PMatrixType, typename AMatrixType>
- unsigned int
- TimeStepper<VectorType, PMatrixType, AMatrixType>::solve(VectorType & y,
- PMatrixType &P)
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
+ unsigned int TimeStepper<VectorType, PMatrixType, AMatrixType>::solve(
+ VectorType & y,
+ PMatrixType &P)
{
set_matrix(P);
return solve(y);
template <typename VectorType, typename PMatrixType, typename AMatrixType>
- unsigned int
- TimeStepper<VectorType, PMatrixType, AMatrixType>::solve(VectorType & y,
- AMatrixType &A,
- PMatrixType &P)
+ DEAL_II_CXX20_REQUIRES((concepts::is_dealii_petsc_vector_type<VectorType> ||
+ std::constructible_from<VectorType, Vec>))
+ unsigned int TimeStepper<VectorType, PMatrixType, AMatrixType>::solve(
+ VectorType & y,
+ AMatrixType &A,
+ PMatrixType &P)
{
set_matrices(A, P);
return solve(y);