21 class Arc_problem :
public Residual<double>
31 f[0] = (
z[0] - 3 ) * ( (
z[0] - 2 ) * (
z[0] - 2 )
47 cout <<
"=== ARC: Scalar continuation and bifn detection =====\n";
52 residual_problem.
p = 0.0;
53 residual_problem.
eps = 0.0;
55 const double tol = 1.e-10;
62 newton.
init_arc( state, &residual_problem.
p, 0.01, 0.5 );
65 std::string dirname(
"./DATA");
66 mkdir( dirname.c_str(), S_IRWXU );
68 my_file.
push_ptr( &residual_problem.
p,
"parameter" );
69 my_file.
push_ptr( &state,
"system state" );
74 for (
int i = 0; i < 100; ++i )
82 catch (
const std::runtime_error &error )
84 cout <<
" \033[1;31;48m * FAILED THROUGH EXCEPTION BEING RAISED \033[0m\n";
90 cout <<
" Bifurcation detected near x = " << state[0] <<
91 " p = " << residual_problem.
p <<
"\n\n";
99 cout <<
"\033[1;31;48m * FAILED \033[0m\n";
104 cout <<
"\033[1;32;48m * PASSED \033[0m\n";
A shorter bundled include file for Newton iteration problems.
void init_arc(DenseVector< _Type > x, _Type *p, const double &length, const double &max_length)
Initialise the class ready for arc-length continuation.
An DenseVector class – a dense vector object.
Define the residual for arc-length continuation of a circle.
void residual_fn(const DenseVector< double > &z, DenseVector< double > &f) const
A blank virtual residual function method.
A vector NEWTON iteration class.
void set_monitor_det(bool flag)
If set then the system will monitor the sign of determinant of the Jacobian matrix and cause an Excep...
void arclength_solve(DenseVector< _Type > &x)
Arc-length solve the system.
A base class to be inherited by objects that define residuals.
void precision(unsigned prec)
void push_ptr(double *scalar, std::string desc="")
A collection of OO numerical routines aimed at simple (typical) applied problems in continuum mechani...