|
IFEM
90A354
|
Nonlinear quasi-static solution driver for isogeometric FEM simulators. More...
#include <NonLinSIM.h>


Public Types | |
| enum | CNORM { NONE_UPTAN =-1 , NONE =0 , L2 =1 , L2SOL =2 , ENERGY =3 } |
| Enum describing the norm used for convergence checks. More... | |
Public Types inherited from MultiStepSIM | |
| enum | SubIt { ITER = 0 , FIRST = 1 , LAST = 2 , NONE = 3 } |
| Enum describing sub-iteration status. | |
Public Member Functions | |
| NonLinSIM (SIMbase &sim, CNORM n=ENERGY) | |
| The constructor initializes default solution parameters. More... | |
| virtual | ~NonLinSIM () |
| The destructor prints out the slow-converging nodes, if any. | |
| void | setConvNorm (CNORM n) |
| Defines which type of iteration norm to use in convergence checks. | |
| void | init (size_t nSol, const RealArray &initVal) |
| Initializes the primary solution vectors. More... | |
| virtual void | initPrm () |
| Initializes some integration parameters for the integrand. | |
| virtual bool | advanceStep (TimeStep ¶m, bool updateTime=true) |
| Advances the load step one step forward. More... | |
| SIM::ConvStatus | solve (double zero_tol=1.0e-8, std::streamsize outPrec=0) |
| Solves the nonlinear equations by Newton-Raphson iterations. More... | |
| virtual SIM::ConvStatus | solveStep (TimeStep ¶m, SIM::SolutionMode mode=SIM::STATIC, double zero_tolerance=1.0e-8, std::streamsize outPrec=0) |
| Solves the nonlinear equations by Newton-Raphson iterations. More... | |
| SIM::ConvStatus | solveIteration (TimeStep ¶m) |
| Solves the linearized system of current iteration. More... | |
| int | getMaxit () const |
| Returns the maximum number of iterations. | |
| virtual bool | isLinear () const |
| Returns whether this solution driver is linear or not. | |
| virtual bool | parse (char *keyWord, std::istream &is) |
| Parses a data section from an input stream. More... | |
| virtual bool | parse (const tinyxml2::XMLElement *elem) |
| Parses a data section from an XML document. More... | |
Public Member Functions inherited from MultiStepSIM | |
| virtual void | printProblem (bool stopInputTimer=false) const |
| Prints out problem-specific data to the log stream. More... | |
| virtual const char ** | getPrioritizedTags () const |
| Returns a list of prioritized XML-tags. | |
| virtual void | initSol (size_t nSol=1, size_t nDof=0) |
| Initializes the primary solution vectors. More... | |
| bool | initEqSystem (bool withRF=true, size_t nScl=0) |
| Allocates the FE system matrices. More... | |
| virtual bool | preprocess (const std::vector< int > &ignored, bool fixDup) |
| Performs some pre-processing tasks on the FE model. More... | |
| void | setStartGeo (int gID) |
| Initializes the geometry block counter. | |
| bool | saveModel (const char *fileName) |
| Opens a new VTF-file and writes the model geometry to it. More... | |
| bool | saveModel (int &gBlock, int &rBlock, const char *fileName=nullptr, bool clearG=true) |
| Opens a new VTF-file and writes the model geometry to it. More... | |
| bool | saveModel (int &gBlock, int &rBlock, double time) |
| Writes the model geometry and BCs to an already opened VTF-file. More... | |
| bool | saveStep (int iStep, double time, const char *vecName=nullptr) |
| Saves the converged solution to VTF file of a given time/load step. More... | |
| bool | saveStep (int iStep, int &rBlock, double time, const char *vecName=nullptr) |
| Saves the converged solution to VTF file of a given time/load step. More... | |
| bool | saveStep (int iStep, int &rBlock, const char *vecName) |
| Saves the converged solution to VTF file of a given time/load step. More... | |
| virtual bool | serialize (SerializeMap &data) const |
| Serializes the solution vectors for restarting purposes. More... | |
| virtual bool | deSerialize (const SerializeMap &data) |
| Restores the solution vectors from a serialized state. More... | |
| bool | checkForRestart () |
| Restores the solution from a serialized state in case of restart. | |
| void | dumpStep (int iStep, double time, utl::LogStream &os, bool withID=true) const |
| Dumps the primary solution for inspection. More... | |
| virtual void | dumpResults (double time, utl::LogStream &os, std::streamsize precision=3, bool formatted=true) const |
| Dumps solution variables at user-defined points. More... | |
| bool | hasPointResultFile () const |
| Returns whether a points result file has been defined or not. | |
| bool | savePoints (double time, int step) const |
| Saves point-wise solution to file for a given time/load step. More... | |
| virtual bool | isDynamic () const |
| Returns whether this is a dynamic solution driver or not. | |
| const SIMoutput & | getModel () const |
| Returns a const reference to the FE model. | |
| void | setSubIteration (SubIt flag) |
| Updates the sub-iteration flag. | |
| SubIt | getSubIteration () const |
| Returns the sub-iteration flag. | |
| virtual size_t | numSolution () const |
| Returns the number of solution vectors. | |
| virtual const Vector & | realSolution (int i=0) const |
| Returns a const reference to the current real solution vector. More... | |
| virtual const Vectors & | realSolutions (bool=false) |
| Returns a const reference to the current real solution vectors. More... | |
| double * | theRefNorm () |
| Returns a pointer to the reference norm variable. | |
| const double * | getRefNorm () const |
| Returns a const pointer to the reference norm variable. | |
| virtual bool | parse (char *keyWord, std::istream &is) |
| Parses a data section from an input stream. | |
| virtual bool | parse (const tinyxml2::XMLElement *elem) |
| Parses a data section from an XML document. | |
Public Member Functions inherited from SIMsolution | |
| virtual const Vectors & | getSolutions () const |
| Returns a const reference to the solution vectors. | |
| virtual Vectors & | theSolutions () |
| Returns a reference to the solution vectors (for assignment). | |
| virtual const Vector & | getSolution (int ix=0) const |
| Returns a const reference to current solution vector. | |
| virtual void | setSolution (const RealArray &s, int ix=0) |
| Modifies the current solution vector (used by sub-iterations only). | |
Public Member Functions inherited from SIMadmin | |
| virtual | ~SIMadmin () |
| Empty destructor. | |
| virtual bool | read (const char *fileName) |
| Reads model data from the specified input file *fileName. | |
| virtual bool | preprocessC (const IntVec &, bool, double=0.0) |
| Performs some pre-processing tasks on the FE model. | |
| const ProcessAdm & | getProcessAdm () const |
| Returns the parallel process administrator. | |
| int | getGlobalProcessID () const |
| Returns the global process ID. More... | |
| const std::string & | getHeading () const |
| Returns the simulator heading. | |
| void | setHeading (const std::string &heading) |
| Defines the simulator heading. | |
| void | printHeading (int &supStep) const |
| Prints the heading of this simulator, if any, to IFEM::cout. | |
Public Member Functions inherited from XMLInputBase | |
| bool | readXML (const char *fileName, bool verbose=true) |
| Reads an XML input file. More... | |
| bool | loadXML (const char *xml) |
| Loads data from an XML-formatted text string. More... | |
Static Public Attributes | |
| static const char * | inputContext = "nonlinearsolver" |
| Input file context for solver parameters. | |
Static Public Attributes inherited from SIMadmin | |
| static int | msgLevel = 2 |
| Controls the console output amount during solving. | |
Protected Member Functions | |
| void | printWorst (utl::LogStream &os, double eps) |
| Prints out the worst DOFs when slow convergence is detected. More... | |
| virtual SIM::ConvStatus | checkConvergence (TimeStep ¶m) |
| Checks whether the nonlinear iterations have converged or diverged. | |
| virtual bool | updateConfiguration (TimeStep ¶m) |
| Updates configuration variables (solution vector) in an iteration. | |
| virtual bool | lineSearch (TimeStep ¶m) |
| Performs line search to accelerate convergence. More... | |
| virtual bool | assembleSystem (const TimeDomain &time, const Vectors &pSol, bool newLHSmatrix=true, bool poorConvg=false) |
| Administers assembly of the linear equation system. More... | |
Protected Member Functions inherited from MultiStepSIM | |
| MultiStepSIM (SIMbase &sim) | |
| The constructor initializes the FE model reference. More... | |
| void | printStep (const TimeStep ¶m) const |
| Prints out time/load step identification. More... | |
| virtual bool | solutionNorms (const TimeDomain &, double zero_tolerance=1.0e-8, std::streamsize outPrec=0) |
| Computes and prints some solution norm quantities. More... | |
| int | getLastSavedStep () const |
| Returns the last step that was saved to VTF. | |
Protected Member Functions inherited from SIMsolution | |
| SIMsolution ()=default | |
| The default constructor is protected to allow sub-classes only. | |
| virtual | ~SIMsolution ()=default |
| Empty default destructor. | |
| void | initSolution (size_t ndof, size_t nsol=1) |
| Initializes the solution vectors. More... | |
| void | pushSolution (unsigned short int nVecState=1) |
| Pushes the solution vector stack. More... | |
| bool | saveSolution (SerializeMap &data, const std::string &name) const |
| Writes current solution to a serialization container. More... | |
| bool | restoreSolution (const SerializeMap &data, const std::string &name) |
| Restores the solution from a serialization container. More... | |
Protected Member Functions inherited from SIMadmin | |
| SIMadmin (const char *heading=nullptr) | |
| The default constructor initializes the process administrator. | |
| SIMadmin (SIMadmin &anotherSIM) | |
| Copy constructor. | |
Protected Member Functions inherited from XMLInputBase | |
| const tinyxml2::XMLElement * | loadFile (tinyxml2::XMLDocument &doc, const char *fileName, bool verbose=false) |
| Loads an XML input file into a tinyxml2::XMLDocument object. More... | |
Protected Attributes | |
| bool | fromIni |
| If true, always solve from initial configuration. | |
| CNORM | iteNorm |
| The norm type used to measure the residual. | |
| double | rTol |
| Relative convergence tolerance. | |
| double | aTol |
| Absolute convergence tolerance. | |
| double | divgLim |
| Relative divergence limit. | |
| double | eta |
| Line search tolerance. | |
| double | alpha |
| Iteration acceleration parameter (for line search) | |
| double | alphaO |
| Final line search acceleration scaling (for output only) | |
| int | maxit |
| Maximum number of iterations in a load step. | |
| int | maxIncr |
| Maximum number of iterations with increasing norm. | |
| int | nupdat |
| Number of iterations with updated tangent. | |
| int | prnSlow |
| How many DOFs to print out on slow convergence. | |
| bool | saveExL |
| If true, the external load vector will be saved to VTF. | |
| bool | updNewN |
| If true, update newly activated nodes before new step. | |
| std::map< int, int > | slowNodes |
| Nodes for which slow convergence is detected. | |
Protected Attributes inherited from MultiStepSIM | |
| SIMoutput & | model |
| The isogeometric FE model. | |
| Vector | loadVec |
| System load vector (for output to VTF) | |
| Vector | residual |
| Residual force vector. | |
| Vector | linsol |
| Linear solution vector. | |
| NormOp | refNopt |
| Reference norm option. | |
| double | refNorm |
| Reference norm value used in convergence checks. | |
| double | rCond |
| Reciprocal condition number of the linear equation system. | |
| SubIt | subiter |
| Sub-iteration flag. | |
| size_t | nRHSvec |
| Number of right-hand-side vectors to assemble. | |
| char | rotUpd |
| Option for how to update of nodal rotations. | |
| int | geoBlk |
| Running VTF geometry block counter. | |
| int | nBlock |
| Running VTF result block counter. | |
Protected Attributes inherited from SIMsolution | |
| Vectors | solution |
| Stack of solution vectors. | |
Protected Attributes inherited from SIMadmin | |
| ProcessAdm | adm |
| Parallel administrator. | |
| int | myPid |
| Processor ID in parallel simulations. | |
| int | nProc |
| Number of processors in parallel simulations. | |
| std::string | myHeading |
| Heading written before reading the input file. | |
Additional Inherited Members | |
Public Attributes inherited from SIMadmin | |
| SIMoptions & | opt |
| Simulation control parameters. | |
Protected Types inherited from MultiStepSIM | |
| enum | NormOp { MAX , ALL } |
| Enum describing reference norm options. | |
Protected Types inherited from SIMsolution | |
| using | SerializeMap = std::map< std::string, std::string > |
| Convenience type. | |
Protected Types inherited from SIMadmin | |
| using | IntVec = std::vector< int > |
| Convenience alias. | |
Static Protected Member Functions inherited from SIMsolution | |
| static std::string | serialize (const double *v, size_t n) |
| Helper method for serializing a double array into a text string. More... | |
| static void | deSerialize (const std::string &data, double *v, size_t n) |
| Helper method for deserializing a double array from a text string. More... | |
Nonlinear quasi-static solution driver for isogeometric FEM simulators.
This class contains data and methods for computing the nonlinear solution to a quasi-static FE problem based on splines/NURBS basis functions, through Newton-Raphson iterations.
| enum NonLinSIM::CNORM |
Enum describing the norm used for convergence checks.
The value NONE imples no checking at all and is used to conduct a pure linear analysis without equilibrium iterations. The value NONE_UPTAN value implies the same as NONE, but with recalculation of the tangent matrix at each step. This is needed for problems with inhomogeneous dirichlet conditions where the element tangent matrix is used to calculate the equivalent load vector.
|
virtual |
Advances the load step one step forward.
| param | Time stepping parameters | |
| [in] | updateTime | If false, the time parameters are not incremented |
Reimplemented from MultiStepSIM.
References MultiStepSIM::advanceStep(), SIMbase::hasElementActivator(), MultiStepSIM::model, SIMsolution::pushSolution(), SIMsolution::solution, TimeStep::time, SIMbase::updateForNewElements(), and updNewN.
|
protectedvirtual |
Administers assembly of the linear equation system.
| [in] | time | Parameters for nonlinear/time-dependent simulations |
| [in] | pSol | Previous primary solution vectors in DOF-order |
| [in] | newLHSmatrix | If false, only integrate the RHS vector |
| [in] | poorConvg | If true, the nonlinear driver is converging poorly |
Reimplemented in TimeIntegration::SIMImplicitLMM< Solver >::LMMNonLinSIM.
References SIMbase::assembleSystem(), and MultiStepSIM::model.
Referenced by lineSearch(), and solveIteration().
| void NonLinSIM::init | ( | size_t | nSol, |
| const RealArray & | initVal | ||
| ) |
Initializes the primary solution vectors.
| [in] | nSol | Number of consequtive solutions stored in core |
| [in] | initVal | Initial values of the primary solution |
References MultiStepSIM::initSol(), and SIMsolution::solution.
|
protectedvirtual |
Performs line search to accelerate convergence.
This procedure is as described on pages 115,116 in Kjell Magne Mathisen's Dr.Ing. thesis: "Large displacement analysis of flexible and rigid systems considering displacement-dependent loads and nonlinear constraints", 1990.
References alpha, alphaO, assembleSystem(), utl::vector< T >::dot(), eta, SIMbase::extractLoadVec(), MultiStepSIM::linsol, MultiStepSIM::model, MultiStepSIM::residual, SIMbase::setMode(), SIMsolution::solution, TimeStep::time, and updateConfiguration().
Referenced by solveIteration().
|
virtual |
Parses a data section from an input stream.
| [in] | keyWord | Keyword of current data section to read |
| is | The file stream to read from |
Reimplemented from SIMadmin.
References divgLim, eta, maxit, MultiStepSIM::model, nupdat, SIMoutput::parse(), utl::readLine(), and rTol.
|
virtual |
Parses a data section from an XML document.
| [in] | elem | The XML element to parse |
Reimplemented from MultiStepSIM.
References aTol, divgLim, eta, fromIni, utl::getAttribute(), utl::getValue(), inputContext, iteNorm, maxIncr, maxit, MultiStepSIM::model, nupdat, MultiStepSIM::parse(), SIMoutput::parse(), prnSlow, MultiStepSIM::rCond, MultiStepSIM::refNopt, MultiStepSIM::rotUpd, rTol, saveExL, and updNewN.
|
protected |
Prints out the worst DOFs when slow convergence is detected.
| os | The output stream to print to | |
| [in] | eps | Only print DOF values larger than this tolerance |
References SIMbase::getNodeType(), SIMbase::getWorstDofs(), iteNorm, MultiStepSIM::linsol, MultiStepSIM::model, prnSlow, MultiStepSIM::residual, and slowNodes.
| ConvStatus NonLinSIM::solve | ( | double | zero_tol = 1.0e-8, |
| std::streamsize | outPrec = 0 |
||
| ) |
Solves the nonlinear equations by Newton-Raphson iterations.
| [in] | zero_tol | Truncate norm values smaller than this to zero |
| [in] | outPrec | Number of digits after the decimal point in norm print |
References solveStep().
| SIM::ConvStatus NonLinSIM::solveIteration | ( | TimeStep & | param | ) |
Solves the linearized system of current iteration.
| [in] | param | Time stepping parameters |
References assembleSystem(), checkConvergence(), SIMbase::extractLoadVec(), TimeStep::iter, lineSearch(), MultiStepSIM::linsol, MultiStepSIM::model, SIMadmin::msgLevel, nupdat, MultiStepSIM::rCond, MultiStepSIM::residual, SIMbase::setMode(), SIMsolution::solution, MultiStepSIM::solutionNorms(), SIMbase::solveEqSystem(), TimeDomain::t, TimeStep::time, updateConfiguration(), and SIMbase::updateDirichlet().
|
virtual |
Solves the nonlinear equations by Newton-Raphson iterations.
| param | Time stepping parameters | |
| [in] | mode | Solution mode to use for this step |
| [in] | zero_tolerance | Truncate norm values smaller than this to zero |
| [in] | outPrec | Number of digits after the decimal point in norm print |
Implements MultiStepSIM.
References PROFILE1, and SIMsolution::solution.
Referenced by solve(), and TimeIntegration::SIMImplicitLMM< Solver >::solveStep().