Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add nonlinear shell elements and solver (#193)
* Define some additional nonlinear element types * Add cantilever example/benchmark * Add cantilever example mesh * Add more nonlinear example cases * Add option to specify that problem is nonlinear This is a temporary implementation until I can figure out how to figure it out automatically from the element/contitutive objects. * add a `getForces` method * fix capitalisation of `isNonlinear` * black format * more black formatting * Revert "more black formatting" This reverts commit 03676ce. * More black formatting * Nonlinear solver functioning with basic incrementation * Remove skin_buckle benchmark * Fix bug `addDirectorJacobian` in `TACSQuadraticRotation` * Add moderate rotation elements to shell tests * Improve clarity of printout for element mat derivative tests * Add SolverHistory to utils * Add methods for retreiving number of iterations and residual norm from KSM solvers * black formatting * Nonlinear solver working with solver history * Example tweaks * Add methods for retreiving number of iterations and residual norm from KSM solvers * PCG fix * clang-format * Test `getResidualNorm` and `getIterCount` in `StaticTestCase` * PCG fix * Fix SuiteSparse installation commands * Fix solution file writing * Fix compiler warning * Implemented adaptive linear solver convergence using Eisenstat-Walker method * Add __init__ method to BaseUI * Examples options tweaks * More example options tweaks * Add __init__ method to BaseUI * Modify problem classes to use __init__ from BaseUI * Modify problem classes to use __init__ from BaseUI * add back isNonlinear to transient problem * black formatting * Fixing some imports * Adding new standalone solver classes * Add solvers docs pages * Solvers __init__ * Starting to incorporate NewtonSolver insto Static problem, not working yet * Address Graeme's comments * Treat resNorm consistently in all solvers * typo * Remove unnecessary abs * Make resNorm and iterCount getters virtual * Fix bug in nonlinear solver option passing * Fix bugs in `NewtonSolver`, now produces same result as StaticProblem solver * Static problem working with continuatiuon and newton solver classes * Fix dumb issue in `_nonlinearCallback` * Add nonlinear shell regression test * Fix bug in problem __init__ * Only create solver history if static problem is nonlinear * Add test for solution history file writing * Unignore bdf files used for regression tests * Add nonlinear annular shell example * Fix bug in hemisphere mesh generation * Add .pkl files to gitignore * Tune annular shell example solver settings * Update nonlinear hemisphere benchmark reference values * Fix history file test * Cleanup static problem code, ensure Jacobian is refactored before adjoint in nonlinear case * Ensure `optLoadScale` is real * Make shell element test failure messages more helpful * Turn off excessive printout * Update some example meshes * Tuning example solver settings * Fix some bugs related to restarting the continuation solver from a previous solution * Add guard against failed linear solves to NewtonSolver * Fix some NewtonSolverTypos * Remove solver options from static problem * Fix bug in basesolver __init__ * Add predictor step to continuation solver * Remove some relative imports * Move solverHistory reset to `_initializeSolve` * Add inner solver default options to continuation solver default options * Add continuation solver docs page * Change `_stiffnessUpdateRequired` to `_jacobianUpdateRequired` * Chane `_factorOnNext` to `_preconditionerUpdateRequired` * print fix * clang-format * Revert "clang-format" This reverts commit 4c31e15. * clang-format the right way * Add option to force at least 1 Newton iteration (fixes complex test failure) * Rename `newtonSolverMonitorVars` option to `nonlinearSolverMonitorVars` and move to static problem * Make continuation solver exit if minimum step size fails * Fix some bugs in static problem option setting * Make sure nonlinear solver vecs and mats are updated after `_createVariables` is called * `black .` * Rename `solveJacLinear`, add some docstrings * Fix so that continuation solver correctly passes options to inner solver * Make static problem solve method return a success flag * Add solve failure checking to mphys * Starting to add a blade-stiffened shell constitutive model * Add ContinuationSolver logic for recovering from failed inner solves * Renaming solver files * Playing around with solver options in nonlinear examples again * Give nonlinear shell classes in cython wrapper con and transform attributes * Revert "Starting to add a blade-stiffened shell constitutive model" This reverts commit b19ec44. * minor changes * Reset predictor states if inner solve fails * Fix problem initialization bug * Update nonlinear integration test tolerances * Fix bug introduced by merge commit * Change how nonlinear solver options are handled so they don't appear in StaticProblem default options * Alter `TacsTestElementMatXptSens` to test derivative components individually * Trying to debug `TacsTestElementMatXptSens` test failure * Change default complex step size to 1e-200 * fix in `TacsTestElementMatXptSens` * option name change in NL cantilever example * Make `solveLinear` a private method * Remove unused TACS vector * `black .` * Implement cheap method for determining if problem is nonlinear * Move nonlinearity check to pyTACS so it is easily passed to all problem types * Normalise nonlinearity check by the residual norm * Fix nonlinear option handling when `options` is `None` * Fix nonlinearity check for case where r(0) != 0 * Include velocity and accelerations in nonlinearity check * Fixes in continuation solver to avoid divide by zeros * Remove unnecessary call to `applyBCs` in staticProblem * Add `setBCsInVec` method to pyTACS * add `setBCs` to `setVariables` so that MPhys wrapper works * Fix mphys masked_converter imports * Fix complex type issue in `_checkNonlinearity` * Revert "Change default complex step size to 1e-200" This reverts commit 56adb88. * Fix mat indexing in matrix product sens tests * Make element test CS step size consistent with size used in element functions * add method to set multiple options at once * Add helper function for printing out any modified options * `black .` * Remove all logic for automatically passing options from static problem to solvers, remove solver names from their options * Update cantilever example to use new options system * Don't create solver history until user has chance to set solver options * Fix nonlinear integration test * Documentation improvements * Rename solver in static problem * Add section on nonlinear solvers to static problem docs * Add validation data to nonlinear cantilever example * Fix local node ID conversion in `getLocalNodeIDsForComps` * Add `linearityTol` option to pyTACS * Rename benchmarks * `black .` * Make final section of `solve` consistent for linear and nonlinear staticProblems * Rename `solveNonlinear` to `_solveNonlinearProblem` * Add `_solveLinearProblem` method * Rename `res` to `rhs` in `_solveLinear` * Fixing typo in yield strain * update nonlinear solver name in examples and test * Fix reference failure function value * Rename nonlinear solver in static problem * Rename self.KSM to self.linearSolver, remove self.newtonSolver * Move solver history from static problem to solvers * Don't write history file if don't have a nonlinear Solver * Update uses of old solver names * Fix some linter complaints * Add `printLevel` option to `StaticProblem` * rename `_solveLinearProblem` and `_solveNonlinearProblem` * Give nonlinear solvers their own vectors and linear solvers * Update options used in nonlinear examples * black formatting * Fix linear solve call in adjoint solve * Add numNodes in new element type docstrings * Revert "Give nonlinear solvers their own vectors and linear solvers" This reverts commit 92a9f5d. * Make nonlinear solvers apply boundary conditions to initial state * Give nonlinear solvers their own vectors and linear solvers * Minor formatting fix * Removing `isNonlinear` option from examples * add `nonlinerSolver` option to staticproblem * Reducing tol on locally failing test * Remove BaseSolver from UI documentation * Fix some mistakes in solver options documentation --------- Co-authored-by: Tim Brooks <41971846+timryanb@users.noreply.github.com>
- Loading branch information