for given t, alpha and rho. must be linear self-adjoint positive definite as it uses a conjugate gradient solver to invert the equation.
Note
This struct is a simple wrapper. It exists because self-adjoint operators appear quite often in practice and is not actually the recommended default way of writing a solver for the implicit time part. It is better to start with the following code and adapt from there
Any class for which a specialization of TensorTraits exists and which fulfills the requirements of the there defined data and execution policies derived from AnyVectorTag and AnyPolicyTag. Among others
std::vector<dg::DVec> (vector of shared device vectors), std::array<double, 4> (array of 4 doubles) or std::map < std::string, dg::DVec> ( a map of named vectors)
double (scalar) and other primitive types ...
If there are several ContainerTypes in the argument list, then TensorTraits must exist for all of them
it does not matter what values copyable contains, but its size is important; the solve method can only be called with vectors of the same size)
Template Parameters
Implicit
The self-adjoint, positive definite implicit part of the right hand side. Has signature void operator()(value_type, const ContainerType&, ContainerType&) The first argument is the time, the second is the input vector, which the functor may not override, and the third is the output, i.e. y' = I(t, y) translates to I(t, y, y'). The two ContainerType arguments never alias each other in calls to the functor. Also needs the WeightType weights() and PreconditionerType precond() member functions.
Parameters
im
The implicit part of the differential equation. Stored as a std::function.
Attention
make sure that im lives throughout the lifetime of this object, else we'll get a dangling reference