OOFEM
2.4
OOFEM.org - Object Oriented Finite Element Solver
|
Implementation of sparse nonlinear solver with indirect control. More...
#include <calmls.h>
Public Member Functions | |
CylindricalALM (Domain *d, EngngModel *m) | |
virtual | ~CylindricalALM () |
virtual NM_Status | solve (SparseMtrx &K, FloatArray &R, FloatArray *R0, FloatArray &X, FloatArray &dX, FloatArray &F, const FloatArray &internalForcesEBENorm, double &ReachedLambda, referenceLoadInputModeType rlm, int &nite, TimeStep *) |
Solves the given sparse linear system of equations . More... | |
virtual double | giveCurrentStepLength () |
Returns step length. More... | |
virtual void | setStepLength (double s) |
Sets the step length. More... | |
virtual IRResultType | initializeFrom (InputRecord *ir) |
virtual bool | referenceLoad () const |
Returns true if reference loads are used (i.e. More... | |
virtual contextIOResultType | saveContext (DataStream &stream, ContextMode mode, void *obj=NULL) |
virtual contextIOResultType | restoreContext (DataStream &stream, ContextMode mode, void *obj=NULL) |
virtual void | setDomain (Domain *d) |
virtual void | reinitialize () |
Reinitializes the receiver. More... | |
virtual const char * | giveClassName () const |
virtual const char * | giveInputRecordName () const |
virtual SparseLinearSystemNM * | giveLinearSolver () |
Constructs (if necessary) and returns a linear solver. More... | |
Public Member Functions inherited from oofem::SparseNonLinearSystemNM | |
SparseNonLinearSystemNM (Domain *d, EngngModel *m) | |
Constructor. More... | |
virtual | ~SparseNonLinearSystemNM () |
Destructor. More... | |
virtual void | printState (FILE *outputStream) |
Prints status message of receiver to output stream. More... | |
IRResultType | initializeFrom (InputRecord *ir) |
virtual void | convertPertMap () |
virtual void | applyPerturbation (FloatArray *displacement) |
std::string | errorInfo (const char *func) const |
Error printing helper. More... | |
Public Member Functions inherited from oofem::NumericalMethod | |
NumericalMethod (Domain *d, EngngModel *m) | |
Constructor. More... | |
virtual | ~NumericalMethod () |
Destructor. More... | |
EngngModel * | giveEngngModel () |
Protected Types | |
enum | calm_ControlType { calm_hpc_off = 0, calm_hpc_on, calml_hpc } |
CALM mode type; determines the calm step length control. More... | |
enum | calm_NR_ModeType { calm_modifiedNRM, calm_fullNRM, calm_accelNRM } |
Controlling mode of Newton-Raphson Method. More... | |
typedef std::set< DofIDItem > | __DofIDSet |
Protected Member Functions | |
void | convertHPCMap () |
int | computeDeltaLambda (double &deltaLambda, const FloatArray &dX, const FloatArray &deltaXt, const FloatArray &deltaX_, const FloatArray &R, double RR, double eta, double deltaL, double DeltaLambda0, int neq) |
void | search (int istep, FloatArray &prod, FloatArray &eta, double amp, double maxeta, double mineta, int &status) |
bool | checkConvergence (const FloatArray &R, const FloatArray *R0, const FloatArray &F, const FloatArray &X, const FloatArray &ddX, double Lambda, double RR0, double RR, double drProduct, const FloatArray &internalForcesEBENorm, int nite, bool &errorOutOfRange) |
Evaluates the convergence criteria. More... | |
void | do_lineSearch (FloatArray &X, const FloatArray &XInitial, const FloatArray &deltaX_, const FloatArray &deltaXt, const FloatArray &dXm1, FloatArray &dX, FloatArray &ddX, const FloatArray &R, const FloatArray *R0, const FloatArray &F, double &DeltaLambda, double &DeltaLambdam1, double &deltaLambda, double &Lambda, double &ReachedLambda, double RR, double &drProduct, TimeStep *tStep) |
Perform line search optimization of step length. More... | |
Protected Attributes | |
int | nsmax |
int | maxRestarts |
double | Psi |
double | deltaL |
double | minStepLength |
double | maxStepLength |
int | solved |
int | numberOfRequiredIterations |
calm_NR_ModeType | calm_NR_Mode |
calm_NR_ModeType | calm_NR_OldMode |
int | calm_NR_ModeTick |
int | calm_MANRMSteps |
int | minIterations |
Minimum hard number of iteration.s. More... | |
int | calm_hpc_init |
Variables for HyperPlaneControl. More... | |
calm_ControlType | calm_Control |
FloatArray | calm_HPCWeights |
IntArray | calm_HPCIndirectDofMask |
Array containing equation numbers of dofs under indirect control. More... | |
IntArray | calm_HPCDmanDofSrcArray |
Input array containing dofmanagers and corresponding dof numbers under indirect control. More... | |
FloatArray | calm_HPCDmanWeightSrcArray |
Input array of dofman weights (for hpcmode 2). More... | |
std::unique_ptr< SparseLinearSystemNM > | linSolver |
Linear system solver. More... | |
LinSystSolverType | solverType |
linear system solver ID. More... | |
int | lsFlag |
Line search flag. More... | |
double | ls_tolerance |
Line search tolerance. More... | |
double | amplifFactor |
Line search amplification factor. More... | |
double | maxEta |
Line search parameters (limits). More... | |
double | minEta |
int | nccdg |
Number of convergence criteria dof groups. More... | |
std::vector< __DofIDSet > | ccDofGroups |
Convergence criteria dof groups. More... | |
FloatArray | rtolf |
Relative unbalanced force tolerance for each group. More... | |
FloatArray | rtold |
Relative iterative displacement change tolerance for each group. More... | |
ParallelContext * | parallel_context |
Parallel context for computing norms, dot products and such. More... | |
Protected Attributes inherited from oofem::SparseNonLinearSystemNM | |
double | deltaL |
Load level. More... | |
double | randPertAmplitude |
Amplitude of a random perturbation applied on the solution before the iteration process. More... | |
int | randSeed |
bool | pert_init_needed |
IntArray | igp_PertDmanDofSrcArray |
FloatArray | igp_PertWeightArray |
IntArray | igp_Map |
FloatArray | igp_Weight |
Protected Attributes inherited from oofem::NumericalMethod | |
Domain * | domain |
Pointer to domain. More... | |
EngngModel * | engngModel |
Pointer to engineering model. More... | |
Additional Inherited Members | |
Public Types inherited from oofem::SparseNonLinearSystemNM | |
enum | referenceLoadInputModeType { rlm_total =0, rlm_incremental =1 } |
The following parameter allows to specify how the reference load vector is obtained from given totalLoadVector and initialLoadVector. More... | |
Implementation of sparse nonlinear solver with indirect control.
It uses Cylindrical Arc-Length Method algorithm.
DESCRIPTION : Perform solution of non-linear problem in the form Kt * deltaR = g where g is defined as g = g(Lambda,X) = Lambda* R - F(X). During iteration process, we want g became zero vector.
This method uses Modified Newton Raphson iteration scheme
If we solve non-linear static we can interpret symbols as follows:
Kt - tangential stiffness dX - increment of displacements g - vector of unbalanced forces (at the end should be zero one) Lambda - Load level Rt - Quasi Total Load vector Rt = R0 + Lambda*R X - total displacement vector F(X) - Nodal representation of (real) internal forces. Psi - control parameter (=0. means displacement control) Bergan_k0 - variable used to compute bergan's parameters of current stiffness. calm_NR_Mode - variable controlling the mode of NRM (ModifiedNR, Full NRM (stiffness update after each iteration), Modified Accelerated NRM (we perform iteration with stiffness matrix updated only after calm_MANRMSteps) calm_NR_OldMode - variable containing the old mode of NRM, which will be restored after calm_NR_ModeTick iterations. calm_NR_ModeTick - see calm_NR_OldMode. calm_MANRMSteps - if calm_NR_Mode == calm_accelNRM, it specifies, that new updated stiffness matrix is assembled after calm_MANRMSteps. calm_Control - variable indicating the ALM control. calm_HPCIndirectDofMask - Mask, telling which dofs are used for HPC. calm_HPCWeights - dofs weights in constrain.
Tasks:
Variable description :
OUTPUT : (after call solveYourselfAt)
|
protected |
|
protected |
CALM mode type; determines the calm step length control.
|
protected |
oofem::CylindricalALM::CylindricalALM | ( | Domain * | d, |
EngngModel * | m | ||
) |
|
protected |
Evaluates the convergence criteria.
Definition at line 478 of file calmls.C.
References oofem::ParallelContext::accumulate(), oofem::FloatArray::add(), oofem::FloatArray::at(), CALM_MAX_REL_ERROR_BOUND, calm_SMALL_ERROR_NUM, ccDofGroups, oofem::NumericalMethod::domain, oofem::Element_local, oofem::Domain::giveDofManagers(), oofem::Domain::giveElements(), oofem::ParallelContext::localNorm(), nccdg, OOFEM_LOG_INFO, parallel_context, rtold, rtolf, oofem::FloatArray::subtract(), oofem::FloatArray::sum(), oofem::FloatArray::times(), and oofem::FloatArray::zero().
Referenced by solve().
|
protected |
Definition at line 987 of file calmls.C.
References oofem::ParallelContext::accumulate(), oofem::IntArray::at(), oofem::FloatArray::at(), calm_Control, calm_hpc_off, calm_hpc_on, calm_HPCIndirectDofMask, calm_HPCWeights, calm_SMALL_NUM, calml_hpc, deltaL, oofem::IntArray::giveSize(), oofem::ParallelContext::localDotProduct(), oofem::ParallelContext::localNorm(), OOFEM_ERROR, parallel_context, and Psi.
Referenced by do_lineSearch(), and solve().
|
protected |
Definition at line 886 of file calmls.C.
References oofem::IntArray::at(), oofem::FloatArray::at(), calm_Control, calm_HPCDmanDofSrcArray, calm_HPCDmanWeightSrcArray, calm_HPCIndirectDofMask, calm_HPCWeights, calml_hpc, oofem::NumericalMethod::domain, oofem::Domain::giveDofManagers(), oofem::IntArray::giveSize(), oofem::ParallelContext::isLocal(), OOFEM_WARNING, parallel_context, oofem::IntArray::resize(), and oofem::FloatArray::resize().
Referenced by solve().
|
protected |
Perform line search optimization of step length.
Definition at line 1204 of file calmls.C.
References oofem::FloatArray::add(), amplifFactor, oofem::FloatArray::at(), oofem::FloatArray::clear(), computeDeltaLambda(), deltaL, oofem::NumericalMethod::domain, oofem::NumericalMethod::engngModel, oofem::FloatArray::giveSize(), oofem::TimeStep::incrementStateCounter(), oofem::InternalRhs, oofem::ParallelContext::localDotProduct(), oofem::ParallelContext::localNorm(), ls_tolerance, maxEta, minEta, OOFEM_LOG_INFO, parallel_context, search(), and oofem::EngngModel::updateComponent().
Referenced by solve().
|
inlinevirtual |
Reimplemented from oofem::SparseNonLinearSystemNM.
|
inlinevirtual |
Returns step length.
Reimplemented from oofem::SparseNonLinearSystemNM.
|
inlinevirtual |
Definition at line 240 of file calmls.h.
References _IFT_CylindricalALM_Name.
|
virtual |
Constructs (if necessary) and returns a linear solver.
Public method because some problems require it for sensitivity analysis, etc. even for nonlinear problems (e.g. tangent relations in multiscale simulations).
Reimplemented from oofem::SparseNonLinearSystemNM.
Definition at line 969 of file calmls.C.
References oofem::classFactory, oofem::ClassFactory::createSparseLinSolver(), oofem::NumericalMethod::domain, oofem::NumericalMethod::engngModel, linSolver, OOFEM_ERROR, and solverType.
Referenced by initializeFrom(), and solve().
|
virtual |
Reimplemented from oofem::NumericalMethod.
Definition at line 675 of file calmls.C.
References _IFT_CylindricalALM_ccdg, _IFT_CylindricalALM_forcedinitialsteplength, _IFT_CylindricalALM_hpc, _IFT_CylindricalALM_hpcmode, _IFT_CylindricalALM_hpcw, _IFT_CylindricalALM_initialsteplength, _IFT_CylindricalALM_linesearch, _IFT_CylindricalALM_lsearchamp, _IFT_CylindricalALM_lsearchmaxeta, _IFT_CylindricalALM_lsearchtol, _IFT_CylindricalALM_lstype, _IFT_CylindricalALM_manrmsteps, _IFT_CylindricalALM_maxiter, _IFT_CylindricalALM_maxrestarts, _IFT_CylindricalALM_miniterations, _IFT_CylindricalALM_minsteplength, _IFT_CylindricalALM_nccdg, _IFT_CylindricalALM_psi, _IFT_CylindricalALM_reqiterations, _IFT_CylindricalALM_rtold, _IFT_CylindricalALM_rtolf, _IFT_CylindricalALM_rtolv, _IFT_CylindricalALM_steplength, amplifFactor, oofem::IntArray::at(), oofem::FloatArray::at(), calm_accelNRM, calm_Control, calm_hpc_init, calm_hpc_on, calm_HPCDmanDofSrcArray, calm_HPCDmanWeightSrcArray, calm_HPCWeights, calm_MANRMSteps, calm_modifiedNRM, calm_NR_Mode, calm_NR_OldMode, calml_hpc, ccDofGroups, oofem::IntArray::clear(), oofem::FloatArray::clear(), deltaL, giveLinearSolver(), oofem::IntArray::giveSize(), oofem::FloatArray::giveSize(), oofem::NumericalMethod::initializeFrom(), oofem::SparseNonLinearSystemNM::initializeFrom(), IR_GIVE_FIELD, IR_GIVE_OPTIONAL_FIELD, oofem::IRRT_OK, ls_tolerance, lsFlag, maxEta, maxRestarts, maxStepLength, minIterations, minStepLength, nccdg, nsmax, numberOfRequiredIterations, OOFEM_ERROR, Psi, oofem::FloatArray::resize(), rtold, rtolf, and solverType.
|
inlinevirtual |
Returns true if reference loads are used (i.e.
arc length methods).
Reimplemented from oofem::SparseNonLinearSystemNM.
|
inlinevirtual |
Reinitializes the receiver.
This is used, when topology of problem has changed (for example after adaptive refinement or load transfer in parallel applications). This is necessary for numerical methods, that cache some data between solution steps and that may depend on domain or problem topology. The caching of data by receiver is intended only for speeding up the calculation, but numerical method must be always able to generate this data again. This method clears receiver cached data dependent on topology, when it changes.
Reimplemented from oofem::NumericalMethod.
|
virtual |
Reimplemented from oofem::NumericalMethod.
Definition at line 957 of file calmls.C.
References oofem::CIO_IOERR, oofem::CIO_OK, deltaL, oofem::DataStream::read(), and THROW_CIOERR.
|
virtual |
Reimplemented from oofem::NumericalMethod.
Definition at line 945 of file calmls.C.
References oofem::CIO_IOERR, oofem::CIO_OK, deltaL, THROW_CIOERR, and oofem::DataStream::write().
|
protected |
Definition at line 1118 of file calmls.C.
References oofem::FloatArray::at(), and oofem::max().
Referenced by do_lineSearch().
|
inlinevirtual |
Reimplemented from oofem::NumericalMethod.
|
inlinevirtual |
Sets the step length.
s | New step length. |
Reimplemented from oofem::SparseNonLinearSystemNM.
|
virtual |
Solves the given sparse linear system of equations .
Total load vector is not passed, it is defined as , where s is scale factor.
K | Coefficient matrix ( ; stiffness matrix). |
R | Reference incremental RHS (incremental load). |
R0 | Initial RHS (initial load). |
X | Total solution (total displacement). |
dX | Increment of solution (incremental displacements). |
F | InternalRhs (real internal forces). |
internalForcesEBENorm | Norm of internal nodal forces (evaluated on element by element basis) (split into each DOF id). |
s | RHS scale factor (load level). |
rlm | Reference load mode. |
nite | Number of iterations needed. |
tStep | Time step to solve for. |
Implements oofem::SparseNonLinearSystemNM.
Definition at line 109 of file calmls.C.
References oofem::ParallelContext::accumulate(), oofem::FloatArray::add(), oofem::SparseNonLinearSystemNM::applyPerturbation(), oofem::IntArray::at(), oofem::FloatArray::at(), calm_accelNRM, calm_Control, CALM_DEFAULT_NRM_TICKS, calm_fullNRM, calm_hpc_init, calm_hpc_off, calm_hpc_on, calm_HPCIndirectDofMask, calm_HPCWeights, calm_MANRMSteps, calm_NR_Mode, calm_NR_ModeTick, calm_NR_OldMode, CALM_RESET_STEP_REDUCE, calml_hpc, checkConvergence(), oofem::FloatArray::clear(), computeDeltaLambda(), convertHPCMap(), deltaL, do_lineSearch(), oofem::NumericalMethod::domain, oofem::ExportModuleManager::doOutput(), oofem::NumericalMethod::engngModel, oofem::EngngModel::giveExportModuleManager(), giveLinearSolver(), oofem::TimeStep::giveNumber(), oofem::IntArray::giveSize(), oofem::FloatArray::giveSize(), oofem::TimeStep::incrementStateCounter(), oofem::TimeStep::incrementSubStepNumber(), oofem::EngngModel::initStepIncrements(), oofem::InternalRhs, linSolver, oofem::ParallelContext::localDotProduct(), oofem::ParallelContext::localNorm(), lsFlag, maxRestarts, maxStepLength, minIterations, minStepLength, nccdg, NM_None, NM_NoSuccess, NM_Success, oofem::NonLinearLhs, nsmax, numberOfRequiredIterations, OOFEM_ERROR, OOFEM_LOG_INFO, OOFEM_WARNING, parallel_context, Psi, oofem::FloatArray::resize(), oofem::sgn(), solved, oofem::FloatArray::subtract(), oofem::FloatArray::times(), oofem::EngngModel::updateComponent(), and oofem::FloatArray::zero().
|
protected |
Line search amplification factor.
Definition at line 196 of file calmls.h.
Referenced by do_lineSearch(), and initializeFrom().
|
protected |
Definition at line 177 of file calmls.h.
Referenced by computeDeltaLambda(), convertHPCMap(), initializeFrom(), and solve().
|
protected |
Variables for HyperPlaneControl.
Definition at line 176 of file calmls.h.
Referenced by initializeFrom(), and solve().
|
protected |
Input array containing dofmanagers and corresponding dof numbers under indirect control.
Definition at line 182 of file calmls.h.
Referenced by convertHPCMap(), and initializeFrom().
|
protected |
Input array of dofman weights (for hpcmode 2).
Definition at line 184 of file calmls.h.
Referenced by convertHPCMap(), and initializeFrom().
|
protected |
Array containing equation numbers of dofs under indirect control.
Definition at line 180 of file calmls.h.
Referenced by computeDeltaLambda(), convertHPCMap(), and solve().
|
protected |
Definition at line 178 of file calmls.h.
Referenced by computeDeltaLambda(), convertHPCMap(), initializeFrom(), and solve().
|
protected |
Definition at line 170 of file calmls.h.
Referenced by initializeFrom(), and solve().
|
protected |
Definition at line 168 of file calmls.h.
Referenced by initializeFrom(), and solve().
|
protected |
|
protected |
Definition at line 168 of file calmls.h.
Referenced by initializeFrom(), and solve().
|
protected |
Convergence criteria dof groups.
Definition at line 204 of file calmls.h.
Referenced by checkConvergence(), and initializeFrom().
|
protected |
Definition at line 166 of file calmls.h.
Referenced by computeDeltaLambda(), do_lineSearch(), initializeFrom(), restoreContext(), saveContext(), and solve().
|
protected |
Linear system solver.
Definition at line 187 of file calmls.h.
Referenced by giveLinearSolver(), and solve().
|
protected |
Line search tolerance.
Definition at line 194 of file calmls.h.
Referenced by do_lineSearch(), and initializeFrom().
|
protected |
Line search flag.
Definition at line 192 of file calmls.h.
Referenced by initializeFrom(), and solve().
|
protected |
Line search parameters (limits).
Definition at line 198 of file calmls.h.
Referenced by do_lineSearch(), and initializeFrom().
|
protected |
Definition at line 164 of file calmls.h.
Referenced by initializeFrom(), and solve().
|
protected |
Definition at line 166 of file calmls.h.
Referenced by initializeFrom(), and solve().
|
protected |
Definition at line 198 of file calmls.h.
Referenced by do_lineSearch().
|
protected |
Minimum hard number of iteration.s.
Definition at line 173 of file calmls.h.
Referenced by initializeFrom(), and solve().
|
protected |
Definition at line 166 of file calmls.h.
Referenced by initializeFrom(), and solve().
|
protected |
Number of convergence criteria dof groups.
Definition at line 202 of file calmls.h.
Referenced by checkConvergence(), initializeFrom(), and solve().
|
protected |
Definition at line 163 of file calmls.h.
Referenced by initializeFrom(), and solve().
|
protected |
Definition at line 167 of file calmls.h.
Referenced by initializeFrom(), and solve().
|
protected |
Parallel context for computing norms, dot products and such.
Definition at line 210 of file calmls.h.
Referenced by checkConvergence(), computeDeltaLambda(), convertHPCMap(), do_lineSearch(), and solve().
|
protected |
Definition at line 165 of file calmls.h.
Referenced by computeDeltaLambda(), initializeFrom(), and solve().
|
protected |
Relative iterative displacement change tolerance for each group.
Definition at line 208 of file calmls.h.
Referenced by checkConvergence(), and initializeFrom().
|
protected |
Relative unbalanced force tolerance for each group.
Definition at line 206 of file calmls.h.
Referenced by checkConvergence(), and initializeFrom().
|
protected |
|
protected |
linear system solver ID.
Definition at line 189 of file calmls.h.
Referenced by giveLinearSolver(), and initializeFrom().