29#include "../../../Common/include/parallelization/omp_structure.hpp"
30#include "../../../Common/include/linear_algebra/CPreconditioner.hpp"
31#include "../../../Common/include/linear_algebra/CMatrixVectorProduct.hpp"
32#include "../../../Common/include/linear_algebra/CSysSolve.hpp"
36#define CNEWTON_PARFOR SU2_OMP_FOR_(simd schedule(static,omp_chunk_size) SU2_NOWAIT)
38#define CNEWTON_PARFOR SU2_OMP_FOR_(schedule(static,omp_chunk_size) SU2_NOWAIT)
40#define END_CNEWTON_PARFOR END_SU2_OMP_FOR
42#define CNEWTON_PARFOR SU2_OMP_SIMD
43#define END_CNEWTON_PARFOR
55#ifdef CODI_FORWARD_TYPE
67 enum class ResEvalType {EXPLICIT,
DEFAULT};
70 bool autoRelaxation =
false;
71 bool useDeflation =
false;
72 Scalar finDiffStepND = 0.0;
75 unsigned long omp_chunk_size;
79 unsigned short precondIters = 0;
86 bool startupPeriod =
false;
87 unsigned short startupIters = 0, iter = 0;
93 unsigned short tolRelaxFactor = 0;
109 template<class T, su2enable_if<std::is_same<T,Scalar>::value> = 0>
112 template<class T, su2enable_if<std::is_same<T,Scalar>::value> = 0>
115 template<class T, su2enable_if<!std::is_same<T,Scalar>::value> = 0>
121 template<class T, su2enable_if<!std::is_same<T,Scalar>::value> = 0>
124 for (
auto i = 0ul; i < x.
GetLocSize(); ++i) x[i] = LinSysSol[i];
134 template<class T, su2enable_if<!std::is_same<T,MixedScalar>::value> = 0>
136 unsigned long iters,
Scalar& eps)
const {
138 for (
auto i = 0ul; i < u.
GetLocSize(); ++i) precondIn[i] = u[i];
141 iters = Preconditioner_impl(precondIn, precondOut, iters, eps);
144 for (
auto i = 0ul; i < u.
GetLocSize(); ++i) v[i] = precondOut[i];
152 template<class T, su2enable_if<std::is_same<T,MixedScalar>::value> = 0>
154 unsigned long iters,
Scalar& eps)
const {
157 unsigned long nIters = 0;
166 unsigned long iters,
Scalar& eps)
const {
170 (*preconditioner)(u, v);
176 switch (inner_solver) {
205 void ComputeResiduals(ResEvalType type);
210 void ComputeFinDiffStep();
235 unsigned short RunTime_EqSystem,
unsigned short iZone,
unsigned short iInst)
override;
250#undef END_CNEWTON_PARFOR
Declaration of the main routines to orchestrate space and time integration.
CNewtonIntegration::Scalar Scalar
Definition CNewtonIntegration.cpp:31
#define CNEWTON_PARFOR
Definition CNewtonIntegration.hpp:42
#define END_CNEWTON_PARFOR
Definition CNewtonIntegration.hpp:43
Main class for defining the problem; basically this class reads the configuration file,...
Definition CConfig.hpp:64
bool GetCUDA(void) const
Get information about GPU support.
Definition CConfig.hpp:6698
LINEAR_SOLVER_INNER GetKind_Linear_Solver_Inner(void) const
Get the inner linear solver used in nested Krylov linear solvers.
Definition CConfig.hpp:4389
Parent class for defining the geometry of the problem (complete geometry, multigrid agglomerated geom...
Definition CGeometry.hpp:75
Main class for doing the space integration, time integration, and monitoring of a system of Partial D...
Definition CIntegration.hpp:47
Class for time integration using a Newton-Krylov method, based on matrix-free products with the true ...
Definition CNewtonIntegration.hpp:53
CNewtonIntegration()=default
Constructor.
su2mixedfloat MixedScalar
Definition CNewtonIntegration.hpp:62
void MultiGrid_Iteration(CGeometry ****geometry, CSolver *****solver_container, CNumerics ******numerics_container, CConfig **config, unsigned short RunTime_EqSystem, unsigned short iZone, unsigned short iInst) override
This class overrides this method to make it a drop-in replacement for CMultigridIntegration.
Definition CNewtonIntegration.cpp:181
void Preconditioner(const CSysVector< Scalar > &u, CSysVector< Scalar > &v) const
Wrapper for the preconditioner.
Definition CNewtonIntegration.cpp:377
~CNewtonIntegration()
Destructor.
Definition CNewtonIntegration.cpp:62
passivedouble Scalar
Definition CNewtonIntegration.hpp:60
void MatrixFreeProduct(const CSysVector< Scalar > &u, CSysVector< Scalar > &v)
Implementation of matrix-vector product with the real Jacobian of the nonlinear residuals.
Definition CNewtonIntegration.cpp:344
Class for defining the numerical methods.
Definition CNumerics.hpp:48
Abstract base class for defining a preconditioning operation.
Definition CPreconditioner.hpp:103
Definition CSolver.hpp:71
CSysSolve< su2mixedfloat > System
Linear solver/smoother.
Definition CSolver.hpp:202
Specialization of matrix-vector product that uses CSysMatrix class.
Definition CMatrixVectorProduct.hpp:70
Class for solving linear systems using classical and Krylov-subspace iterative methods.
Definition CSysSolve.hpp:86
unsigned long Smoother_LinSolver(const VectorType &b, VectorType &x, const ProductType &mat_vec, const PrecondType &precond, ScalarType tol, unsigned long m, ScalarType &residual, bool monitoring, const CConfig *config) const
Generic smoother (modified Richardson iteration with preconditioner)
Definition CSysSolve.cpp:1248
unsigned long BCGSTAB_LinSolver(const VectorType &b, VectorType &x, const ProductType &mat_vec, const PrecondType &precond, ScalarType tol, unsigned long m, ScalarType &residual, bool monitoring, const CConfig *config) const
Biconjugate Gradient Stabilized Method (BCGSTAB)
Definition CSysSolve.cpp:1059
unsigned long FGMRES_LinSolver(const VectorType &b, VectorType &x, const ProductType &mat_vec, const PrecondType &precond, ScalarType tol, unsigned long m, ScalarType &residual, bool monitoring, const CConfig *config) const
Flexible Generalized Minimal Residual method.
Definition CSysSolve.cpp:421
Class for holding and manipulating vectors needed by linear solvers.
Definition CSysVector.hpp:195
unsigned long GetLocSize() const
return the number of local elements in the CSysVector
Definition CSysVector.hpp:420
double passivedouble
Definition code_config.hpp:129
passivedouble su2mixedfloat
Definition code_config.hpp:189
passivedouble su2double
Definition code_config.hpp:181
void ApplyPreconditionerOnDevice(const CSysVector< ScalarType > &u, CSysVector< ScalarType > &v, bool useCuda, Apply &&apply)
Mirror of ApplyPreconditionerOnHost: applies a device preconditioner to host vectors.
Definition CPreconditioner.hpp:75
#define SU2_OMP_BARRIER
Definition omp_structure.hpp:142
@ FLOW_SOL
Position of the mean flow solution in the solver container array.
Definition option_structure.hpp:577
@ BCGSTAB
Use BCGSTAB as the preconditioning linear solver.
@ SMOOTHER
Iterative smoother.
@ NONE
Do not use a nested linear solver.
@ DEFAULT
Kind of transition correlation model (Menter-Langtry if SST, MALAN if SA).