16 #ifndef dealii_eigen_h 17 #define dealii_eigen_h 54 template <
typename VectorType = Vector<
double>>
95 template <
typename MatrixType>
129 template <
typename VectorType = Vector<
double>>
160 unsigned int start_adaption = 6,
161 bool use_residual =
true)
162 : relaxation(relaxation)
163 , start_adaption(start_adaption)
164 , use_residual(use_residual)
182 template <
typename MatrixType>
197 template <
class VectorType>
207 template <
class VectorType>
208 template <
typename MatrixType>
223 double length = x.l2_norm();
224 double old_length = 0.;
237 length = y.l2_norm();
243 double thresh = length / x.size();
254 value = (entry * x(i) < 0.) ? -length : length;
258 x.equ(1 / length, y);
266 std::fabs(1. / length - 1. / old_length),
273 iter,
std::fabs(1. / length - 1. / old_length)));
280 template <
class VectorType>
290 template <
class VectorType>
291 template <
typename MatrixType>
303 double current_shift = -
value;
322 double length = x.l2_norm();
323 double old_value =
value;
332 solver.
solve(A_s, y, x, prec);
335 length = y.l2_norm();
341 double thresh = length / x.size();
352 value = (entry * x(i) < 0. ? -1. : 1.) / length - current_shift;
357 const double new_shift =
358 relaxation * (-
value) + (1. - relaxation) * current_shift;
361 current_shift = new_shift;
367 x.equ(1. / length, y);
373 r.sadd(-1., value, x);
380 res =
std::fabs(1. / value - 1. / old_value);
AdditionalData additional_data
SymmetricTensor< 2, dim, Number > e(const Tensor< 2, dim, Number > &F)
boost::signals2::signal< SolverControl::State(const unsigned int iteration, const double check_value, const VectorType ¤t_iterate), StateCombiner > iteration_status
void solve(double &value, const MatrixType &A, VectorType &x)
#define AssertThrow(cond, exc)
void solve(double &value, const MatrixType &A, VectorType &x)
void solve(const MatrixType &A, VectorType &x, const VectorType &b, const PreconditionerType &preconditioner)
Stop iteration, goal reached.
#define Assert(cond, exc)
AdditionalData additional_data
EigenPower(SolverControl &cn, VectorMemory< VectorType > &mem, const AdditionalData &data=AdditionalData())
#define DEAL_II_NAMESPACE_CLOSE
AdditionalData(const double shift=0.)
EigenInverse(SolverControl &cn, VectorMemory< VectorType > &mem, const AdditionalData &data=AdditionalData())
Expression fabs(const Expression &x)
unsigned int start_adaption
unsigned int global_dof_index
#define DEAL_II_NAMESPACE_OPEN
LinearOperator< Range, Domain, Payload > linear_operator(const OperatorExemplar &, const Matrix &)
LinearOperator< Range, Domain, Payload > identity_operator(const LinearOperator< Range, Domain, Payload > &)
AdditionalData(double relaxation=1., unsigned int start_adaption=6, bool use_residual=true)
T max(const T &t, const MPI_Comm &mpi_communicator)
VectorMemory< VectorType > & memory
static ::ExceptionBase & ExcInternalError()