Skip to content

Commit

Permalink
Fixing some bugs related to linesearch
Browse files Browse the repository at this point in the history
  • Loading branch information
msmejkal committed Sep 6, 2024
1 parent c2971b8 commit 06f72d9
Show file tree
Hide file tree
Showing 4 changed files with 192 additions and 227 deletions.
1 change: 1 addition & 0 deletions src/oofemlib/linesearch.C
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,7 @@ ExactLineSearchNM ::solve( FloatArray &r, FloatArray &dr, FloatArray &F, FloatAr
if ( fabs( RHSdefl ) < this->ls_tolerance ) {
dr = r - rold;
r = rold;
OOFEM_LOG_INFO( "Eta = %.7e\n", Eta );
return CR_CONVERGED;
}

Expand Down
7 changes: 5 additions & 2 deletions src/oofemlib/linesearch.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ class TimeStep;

enum LineSearchType {
LST_Default = 1,
LST_Exact = 2
LST_Exact = 2,
LST_Exact_Adaptive = 3
};

/**
Expand Down Expand Up @@ -101,6 +102,9 @@ class OOFEM_EXPORT LineSearchNM : public NumericalMethod
void initializeFrom(InputRecord &ir) override;
const char *giveClassName() const { return "LineSearchNM"; }

void setMaxIter( int maxit ) { this->max_iter = maxit; }
void setTolerance( double tol ) { this->ls_tolerance = tol; }

protected:
void search(int istep, FloatArray &prod, FloatArray &eta, double amp, double maxeta, double mineta, int &status);
};
Expand Down Expand Up @@ -128,7 +132,6 @@ class OOFEM_EXPORT ExactLineSearchNM : public LineSearchNM
void setX0defl( FloatArray &X0 ) { this->X0defl = X0; }
void setDeflation( bool doDeflation ) { this->deflation = doDeflation; }


};
} // end namespace oofem
#endif // linesearch_h
Loading

0 comments on commit 06f72d9

Please sign in to comment.