8 template <
typename _Type>
18 T_UPDATER =
Timer(
"Updating of the residual object:");
22 template <
typename _Type>
32 T_UPDATER =
Timer(
"Updating of the residual object:");
36 template <
typename _Type>
45 template <
typename _Type>
51 for(std::size_t i = 0; i < NUMBER_OF_VARS; ++i) {
52 new_state[ i ] += DELTA;
53 residual_fn(new_state, f_at_new_state);
54 new_state[ i ] -= DELTA;
55 jac.
set_col(i, (f_at_new_state - FN_AT_LAST_STATE) / DELTA);
A specification of a (double/complex) VECTOR residual class.
A matrix class that constructs a DENSE matrix as a row major std::vector of DenseVectors.
void set_col(const std::size_t &col, const DenseVector< _Type > &x)
Set a column of the matrix.
An DenseVector class – a dense vector object.
A base class to be inherited by objects that define residuals.
const DenseMatrix< _Type > & jacobian() const
Retrun a handle to the Jacobian of the residual corresponding to the last update state.
virtual ~Residual()
An empty destructor, virtual since we have virtual methods.
DenseVector< _Type > FN_AT_LAST_STATE
Residual for the last state vector.
Residual(const unsigned &order)
Constructor for a 'square' residual object that is, N residuals for N unknowns.
unsigned NUMBER_OF_VARS
The number of elements in the state vector.
DenseVector< _Type > LAST_STATE
The last state vector.
DenseMatrix< _Type > JAC_AT_LAST_STATE
Jacobian for the last state vector.
unsigned ORDER_OF_SYSTEM
The order of the system of equations.
A simple CPU-clock-tick timer for timing metods.
A collection of OO numerical routines aimed at simple (typical) applied problems in continuum mechani...