71 for (
auto eq : eqnmask ) {
75 s0 = ( -1.0 ) * g.dotProduct(dr);
100 for ( ils = 2; ils <= this->
max_iter; ils++ ) {
117 for (
auto eq : eqnmask ) {
122 double si = ( -1.0 ) * g.dotProduct(dr) / s0;
131 etaValue =
eta.
at(ils);
161 double maxetalim,
double minetalim,
int &ico)
171 for (
int i = 1; i <= istep; i++ ) {
172 etamax =
max( etamax, eta.
at(i) );
173 if ( prod.
at(i) >= 0.0 ) {
177 if ( eta.
at(i) >= etaneg ) {
190 for (
int i = 1; i <= istep; i++ ) {
191 if ( prod.
at(i) <= 0.0 ) {
195 if ( eta.
at(i) > eta.
at(ineg) ) {
199 if ( eta.
at(i) < eta.
at(ipos) ) {
207 double etaint = ( prod.
at(ineg) * eta.
at(ipos) - prod.
at(ipos) * eta.
at(ineg) ) / ( prod.
at(ineg) - prod.
at(ipos) );
209 double etaalt = eta.
at(ipos) + 0.2 * ( eta.
at(ineg) - eta.
at(ipos) );
210 etaint =
max(etaint, etaalt);
211 if ( etaint < minetalim ) {
220 eta.
at(istep + 1) = etaint;
224 double etamaxstep = amp * etamax;
226 double etaextrap = ( prod.
at(istep) * eta.
at(istep - 1) - prod.
at(istep - 1) * eta.
at(istep) ) /
227 ( prod.
at(istep) - prod.
at(istep - 1) );
228 eta.
at(istep + 1) = etaextrap;
230 if ( ( etaextrap <= 0.0 ) || ( etaextrap > etamaxstep ) ) {
231 eta.
at(istep + 1) = etamaxstep;
234 if ( ( eta.
at(istep + 1) > maxetalim ) && ( ico == 1 ) ) {
239 if ( ( eta.
at(istep + 1) > maxetalim ) ) {
241 eta.
at(istep + 1) = maxetalim;
#define NM_Success
Numerical method exited with success.
double & at(int i)
Coefficient access function.
int max(int i, int j)
Returns bigger value form two given decimals.
This base class is an abstraction for numerical algorithm.
void incrementStateCounter()
Updates solution state counter.
unsigned long NM_Status
Mask defining NumMetod Status; which can be asked after finishing computation by Numerical Method...
#define OOFEM_LOG_DEBUG(...)
Class implementing an array of integers.
LineSearchNM(Domain *d, EngngModel *m)
Constructor.
#define NM_NoSuccess
Numerical method failed to solve problem.
void search(int istep, FloatArray &prod, FloatArray &eta, double amp, double maxeta, double mineta, int &status)
Domain * domain
Pointer to domain.
virtual void updateComponent(TimeStep *tStep, NumericalCmpn cmpn, Domain *d)
Updates components mapped to numerical method if necessary during solution process.
Class representing vector of real numbers.
#define _IFT_LineSearchNM_lsearchamp
IRResultType
Type defining the return values of InputRecord reading operations.
virtual NM_Status solve(FloatArray &r, FloatArray &dr, FloatArray &F, FloatArray &R, FloatArray *R0, IntArray &eqnmask, double lambda, double &etaValue, LS_status &status, TimeStep *tStep)
Solves the line search optimization problem in the form of , The aim is to find so that the has dec...
virtual IRResultType initializeFrom(InputRecord *ir)
void times(double s)
Multiplies receiver with scalar.
#define _IFT_LineSearchNM_lsearchtol
Abstract base class representing the "problem" under consideration.
int giveSize() const
Returns the size of receiver.
the oofem namespace is to define a context or scope in which all oofem names are defined.
EngngModel * engngModel
Pointer to engineering model.
#define _IFT_LineSearchNM_lsearchmaxeta
Class representing solution step.
void add(const FloatArray &src)
Adds array src to receiver.
void resize(int s)
Resizes receiver towards requested size.