OOFEM 3.0
Loading...
Searching...
No Matches
oofem::StaggeredSolver Class Reference

#include <staggeredsolver.h>

Inheritance diagram for oofem::StaggeredSolver:
Collaboration diagram for oofem::StaggeredSolver:

Public Member Functions

 StaggeredSolver (Domain *d, EngngModel *m)
virtual ~StaggeredSolver ()
ConvergedReason solve (SparseMtrx &k, FloatArray &R, FloatArray *R0, FloatArray &X, FloatArray &dX, FloatArray &F, const FloatArray &internalForcesEBENorm, double &l, referenceLoadInputModeType rlm, int &nite, TimeStep *) override
void initializeFrom (InputRecord &ir) override
const char * giveClassName () const override
const char * giveInputRecordName () const override
Public Member Functions inherited from oofem::NRSolver
 NRSolver (Domain *d, EngngModel *m)
virtual ~NRSolver ()
void printState (FILE *outputStream) override
void setDomain (Domain *d) override
void reinitialize () override
SparseLinearSystemNMgiveLinearSolver () override
Public Member Functions inherited from oofem::SparseNonLinearSystemNM
 SparseNonLinearSystemNM (Domain *d, EngngModel *m)
 Constructor.
virtual ~SparseNonLinearSystemNM ()
 Destructor.
virtual double giveCurrentStepLength ()
virtual void setStepLength (double s)
virtual bool referenceLoad () const
virtual void convertPertMap ()
virtual void applyPerturbation (FloatArray *displacement)
std::string errorInfo (const char *func) const
 Error printing helper.
Public Member Functions inherited from oofem::NumericalMethod
 NumericalMethod (Domain *d, EngngModel *m)
virtual ~NumericalMethod ()
 Destructor.
EngngModelgiveEngngModel ()
virtual void saveContext (DataStream &stream, ContextMode mode)
virtual void restoreContext (DataStream &stream, ContextMode mode)

Private Member Functions

bool checkConvergenceDofIdArray (FloatArray &RT, FloatArray &F, FloatArray &rhs, FloatArray &ddX, FloatArray &X, double RRT, const FloatArray &internalForcesEBENorm, int nite, bool &errorOutOfRange, TimeStep *tStep, IntArray &dofIdArray)

Private Attributes

IntArray totalIdList
IntArray idPos
std ::vector< CustomEquationNumberingUnknownNumberingSchemeList

Additional Inherited Members

Public Types inherited from oofem::SparseNonLinearSystemNM
enum  referenceLoadInputModeType { rlm_total =0 , rlm_incremental =1 }
Protected Types inherited from oofem::NRSolver
enum  nrsolver_ModeType { nrsolverModifiedNRM , nrsolverFullNRM , nrsolverAccelNRM }
Protected Member Functions inherited from oofem::NRSolver
LineSearchNMgiveLineSearchSolver ()
 Constructs and returns a line search solver.
void initPrescribedEqs ()
 Initiates prescribed equations.
void applyConstraintsToStiffness (SparseMtrx &k)
void applyConstraintsToLoadIncrement (int nite, const SparseMtrx &k, FloatArray &R, referenceLoadInputModeType rlm, TimeStep *tStep)
bool checkConvergence (FloatArray &RT, FloatArray &F, FloatArray &rhs, FloatArray &ddX, FloatArray &X, double RRT, const FloatArray &internalForcesEBENorm, int nite, bool &errorOutOfRange)
Protected Attributes inherited from oofem::NRSolver
int nsmax
int minIterations
double minStepLength
nrsolver_ModeType NR_Mode
nrsolver_ModeType NR_OldMode
int NR_ModeTick
int MANRMSteps
std ::unique_ptr< SparseLinearSystemNMlinSolver
 linear system solver
LinSystSolverType solverType
 linear system solver ID
SparseMtrx::SparseMtrxVersionType smConstraintVersion
 sparse matrix version, used to control constrains application to stiffness
int numberOfPrescribedDofs
 number of prescribed displacement
bool prescribedDofsFlag
IntArray prescribedDofs
 Array of pairs identifying prescribed dofs (node, dof).
FloatArray prescribedDofsValues
 Array of prescribed values.
int prescribedDisplacementTF
 Load Time Function of prescribed values.
IntArray prescribedEqs
 Array of prescribed equations.
bool prescribedEqsInitFlag
 Flag indicating that prescribedEqs were initialized.
FloatArray lastReactions
 Computed reactions. They are stored in order to print them in printState method.
bool lsFlag
 Flag indicating whether to use line-search.
std ::unique_ptr< LineSearchNMlinesearchSolver
 Line search solver.
bool mCalcStiffBeforeRes
 Flag indicating if the stiffness should be evaluated before the residual in the first iteration.
bool constrainedNRFlag
 Flag indicating whether to use constrained Newton.
double constrainedNRalpha
 Scale factor for dX, dX_new = alpha * dX.
int constrainedNRminiter
 Minimum number of iterations before constraint is activated.
FloatArray rtolf
 Relative unbalanced force tolerance for each group.
FloatArray rtold
 Relative iterative displacement change tolerance for each group.
FloatArray forceErrVec
FloatArray forceErrVecOld
bool solutionDependentExternalForcesFlag
 Solution dependent external forces - updating then each NR iteration.
std ::map< int, double > dg_forceScale
 Optional user supplied scale of forces used in convergence check.
double maxIncAllowed
Protected Attributes inherited from oofem::SparseNonLinearSystemNM
double deltaL =0.0
 Load level.
double randPertAmplitude =0.0
 Amplitude of a random perturbation applied on the solution before the iteration process.
int randSeed =0
bool pert_init_needed
IntArray igp_PertDmanDofSrcArray
FloatArray igp_PertWeightArray
IntArray igp_Map
FloatArray igp_Weight
Protected Attributes inherited from oofem::NumericalMethod
Domaindomain
 Pointer to domain.
EngngModelengngModel
 Pointer to engineering model.

Detailed Description

The staggered solver will perform Newton iterations on subsets of DofIDs, in a staggered manner.

Author
Jim Brouzoulis

Definition at line 110 of file staggeredsolver.h.

Constructor & Destructor Documentation

◆ StaggeredSolver()

oofem::StaggeredSolver::StaggeredSolver ( Domain * d,
EngngModel * m )

Definition at line 73 of file staggeredsolver.C.

References oofem::NRSolver::NRSolver(), and UnknownNumberingSchemeList.

◆ ~StaggeredSolver()

virtual oofem::StaggeredSolver::~StaggeredSolver ( )
inlinevirtual

Definition at line 122 of file staggeredsolver.h.

Member Function Documentation

◆ checkConvergenceDofIdArray()

◆ giveClassName()

const char * oofem::StaggeredSolver::giveClassName ( ) const
inlineoverridevirtual

Reimplemented from oofem::NRSolver.

Definition at line 132 of file staggeredsolver.h.

◆ giveInputRecordName()

const char * oofem::StaggeredSolver::giveInputRecordName ( ) const
inlineoverridevirtual

Reimplemented from oofem::NRSolver.

Definition at line 133 of file staggeredsolver.h.

References _IFT_StaggeredSolver_Name.

◆ initializeFrom()

void oofem::StaggeredSolver::initializeFrom ( InputRecord & ir)
overridevirtual

◆ solve()

ConvergedReason oofem::StaggeredSolver::solve ( SparseMtrx & K,
FloatArray & R,
FloatArray * R0,
FloatArray & X,
FloatArray & dX,
FloatArray & F,
const FloatArray & internalForcesEBENorm,
double & s,
referenceLoadInputModeType rlm,
int & nite,
TimeStep * tStep )
overridevirtual

Solves the given sparse linear system of equations \( s R + R_0 - F(X) = 0 \). Total load vector is not passed, it is defined as \( s R + R_0 \), where s is scale factor.

See also
EngngModel::updateComponent Used to update the stiffness matrix and load vector.
Parameters
KCoefficient matrix ( \(\displaystyle K = \frac{\partial F}{\partial X} \); stiffness matrix).
RReference incremental RHS (incremental load).
R0Initial RHS (initial load).
XTotal solution (total displacement).
dXIncrement of solution (incremental displacements).
FInternalRhs (real internal forces).
internalForcesEBENormNorm of internal nodal forces (evaluated on element by element basis) (split into each DOF id).
sRHS scale factor (load level).
rlmReference load mode.
niteNumber of iterations needed.
tStepTime step to solve for.
Returns
ConvergedReason value.
Todo
This doesn't check units, it is nonsense and must be corrected / Mikael

Reimplemented from oofem::NRSolver.

Definition at line 145 of file staggeredsolver.C.

References oofem::FloatArray::add(), oofem::NRSolver::applyConstraintsToLoadIncrement(), oofem::NRSolver::applyConstraintsToStiffness(), oofem::FloatArray::assemble(), oofem::FloatArray::at(), oofem::FloatArray::beDifferenceOf(), oofem::NRSolver::checkConvergence(), checkConvergenceDofIdArray(), oofem::NRSolver::constrainedNRalpha, oofem::NRSolver::constrainedNRFlag, oofem::NRSolver::constrainedNRminiter, oofem::CR_CONVERGED, oofem::CR_DIVERGED_ITS, oofem::CR_DIVERGED_TOL, oofem::CR_UNKNOWN, oofem::DofGrouping::ddX, oofem::SparseNonLinearSystemNM::deltaL, oofem::NumericalMethod::domain, oofem::DofGrouping::dX, oofem::NumericalMethod::engngModel, oofem::DofGrouping::fExtList, oofem::DofGrouping::fIntList, oofem::NRSolver::forceErrVec, oofem::NRSolver::giveLinearSolver(), oofem::NRSolver::giveLineSearchSolver(), oofem::FloatArray::giveSize(), oofem::SparseMtrx::giveSubMatrix(), oofem::TimeStep::incrementStateCounter(), oofem::TimeStep::incrementSubStepNumber(), oofem::NRSolver::initPrescribedEqs(), oofem::InternalRhs, oofem::NRSolver::lastReactions, oofem::NRSolver::linSolver, oofem::ParallelContext::localNorm(), oofem::DofGrouping::locArrayList, oofem::NRSolver::lsFlag, oofem::macroScale, oofem::NRSolver::MANRMSteps, oofem::NRSolver::mCalcStiffBeforeRes, oofem::NRSolver::minIterations, oofem::NonLinearLhs, oofem::NRSolver::NR_Mode, oofem::NRSolver::nrsolverAccelNRM, oofem::NRSolver::nrsolverFullNRM, oofem::NRSolver::nsmax, oofem::NRSolver::numberOfPrescribedDofs, OOFEM_LOG_DEBUG, OOFEM_LOG_INFO, OOFEM_WARNING, oofem::NRSolver::prescribedDofs, oofem::NRSolver::prescribedDofsFlag, oofem::NRSolver::prescribedEqs, oofem::NRSolver::prescribedEqsInitFlag, oofem::FloatArray::resize(), oofem::NRSolver::rtold, oofem::NRSolver::rtolf, oofem::DofGrouping::stiffnessMatrixList, UnknownNumberingSchemeList, oofem::DofGrouping::X, and oofem::FloatArray::zero().

Member Data Documentation

◆ idPos

IntArray oofem::StaggeredSolver::idPos
private

Definition at line 114 of file staggeredsolver.h.

Referenced by initializeFrom().

◆ totalIdList

IntArray oofem::StaggeredSolver::totalIdList
private

Definition at line 113 of file staggeredsolver.h.

Referenced by initializeFrom().

◆ UnknownNumberingSchemeList

std :: vector< CustomEquationNumbering > oofem::StaggeredSolver::UnknownNumberingSchemeList
private

Definition at line 115 of file staggeredsolver.h.

Referenced by initializeFrom(), solve(), and StaggeredSolver().


The documentation for this class was generated from the following files:

This page is part of the OOFEM-3.0 documentation. Copyright Copyright (C) 1994-2025 Borek Patzak Bořek Patzák
Project e-mail: oofem@fsv.cvut.cz
Generated at for OOFEM by doxygen 1.15.0 written by Dimitri van Heesch, © 1997-2011