Commit b876fe11 by Francois Gygi

Settable theta default value for negative curvature.


git-svn-id: http://qboxcode.org/svn/qb/trunk@332 cba15fb0-1239-40c8-b417-11db7ca47a34
parent fb7458e6
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// AndersonMixer.h // AndersonMixer.h
// //
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// $Id: AndersonMixer.h,v 1.2 2004-12-10 01:04:06 fgygi Exp $ // $Id: AndersonMixer.h,v 1.3 2004-12-18 23:23:27 fgygi Exp $
#ifndef ANDERSONMIXER_H #ifndef ANDERSONMIXER_H
#define ANDERSONMIXER_H #define ANDERSONMIXER_H
...@@ -18,7 +18,8 @@ class AndersonMixer ...@@ -18,7 +18,8 @@ class AndersonMixer
{ {
int n_; // size of vectors int n_; // size of vectors
const Context* const pctxt_; // pointer to relevant Context, null if local const Context* const pctxt_; // pointer to relevant Context, null if local
double theta_max_; double theta_max_; // maximum extrapolation
double theta_nc_; // negative curvature value
valarray<double> flast_; // last residual valarray<double> flast_; // last residual
bool extrapolate_; // state variable bool extrapolate_; // state variable
...@@ -26,7 +27,7 @@ class AndersonMixer ...@@ -26,7 +27,7 @@ class AndersonMixer
public: public:
AndersonMixer(const int n, const Context* const pctxt) : AndersonMixer(const int n, const Context* const pctxt) :
n_(n), pctxt_(pctxt), extrapolate_(false), theta_max_(2.0) n_(n), pctxt_(pctxt), extrapolate_(false), theta_max_(2.0), theta_nc_(0.0)
{ {
assert( n > 0 ); assert( n > 0 );
flast_.resize(n); flast_.resize(n);
...@@ -35,6 +36,8 @@ class AndersonMixer ...@@ -35,6 +36,8 @@ class AndersonMixer
void update(const double* f, double* theta, double* fbar); void update(const double* f, double* theta, double* fbar);
void restart(void); void restart(void);
void set_theta_max(double theta_max) { theta_max_ = theta_max; } void set_theta_max(double theta_max) { theta_max_ = theta_max; }
void set_theta_nc(double theta_nc) { theta_nc_ = theta_nc; }
double theta_max(void) const { return theta_max_; } double theta_max(void) const { return theta_max_; }
double theta_nc(void) const { return theta_nc_; }
}; };
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment