58#ifdef __MPI_PARALLEL_MODE
92NonLinearStatic :: ~NonLinearStatic()
100 if ( mStep == NULL ) {
138NonLinearStatic :: updateAttributes(
MetaStep *mStep)
143 LinearStatic :: updateAttributes(mStep1);
182 _val = SparseNonLinearSystemNM :: rlm_total;
184 this->
refLoadInputMode = ( SparseNonLinearSystemNM :: referenceLoadInputModeType ) _val;
196 LinearStatic :: initializeFrom(ir);
206#ifdef __MPI_PARALLEL_MODE
223double NonLinearStatic :: giveUnknownComponent(ValueModeType mode,
TimeStep *tStep,
Domain *d,
Dof *dof)
232 if (mode == VM_Residual) {
245 }
else if (mode == VM_Total) {
247 if ( eq == 0 )
OOFEM_ERROR(
"invalid equation number");
254 }
else if (mode == VM_Incremental) {
256 if ( eq == 0 )
OOFEM_ERROR(
"invalid equation number");
265 }
else if (mode == VM_Velocity) {
267 if ( eq == 0 )
OOFEM_ERROR(
"invalid equation number");
275 OOFEM_ERROR(
"Unknown is of undefined ValueModeType for this problem");
279TimeStep *NonLinearStatic :: giveSolutionStepWhenIcApply(
bool force)
281 if (
master && ( !force ) ) {
282 return master->giveSolutionStepWhenIcApply();
299 double totalTime = 0.0;
307 totalTime =
currentStep->giveTargetTime() + deltaTtmp;
308 counter =
currentStep->giveSolutionStateCounter() + 1;
321 currentStep = std :: make_unique< TimeStep >(* newStep);
325 currentStep = std :: make_unique< TimeStep >(istep,
this, mStepNum, totalTime, deltaTtmp, counter);
333NonLinearStatic :: giveDtFunction()
345NonLinearStatic :: giveDeltaT(
int n)
361void NonLinearStatic :: solveYourself()
364#ifdef __VERBOSE_PARALLEL
375 StructuralEngngModel :: solveYourself();
396NonLinearStatic :: updateLoadVectors(
TimeStep *tStep)
403 if ( isLastMetaStep ) {
453NonLinearStatic :: proceedStep(
int di,
TimeStep *tStep)
475 OOFEM_ERROR(
"stiffnessMatrix does not support asymmetric storage");
483 if ( ( mstep->giveFirstStepNumber() == tStep->
giveNumber() ) ) {
674NonLinearStatic :: printOutputAt(FILE *file,
TimeStep *tStep)
676 if ( !this->
giveDomain(1)->giveOutputManager()->testTimeStepOutput(tStep) ) {
680 fprintf( file,
"\n\nOutput for time %.3e, solution step number %d\n", tStep->
giveTargetTime(), tStep->
giveNumber() );
681 fprintf(file,
"Reached load level : %20.6f in %d iterations\n\n",
686 this->
giveDomain(1)->giveOutputManager()->doDofManOutput(file, tStep);
687 this->
giveDomain(1)->giveOutputManager()->doElementOutput(file, tStep);
697 EngngModel :: saveContext(stream, mode);
708 if ( !stream.
write(_cm) ) {
735 EngngModel :: restoreContext(stream, mode);
748 if ( !stream.
read(_cm) ) {
774NonLinearStatic :: updateDomainLinks()
776 LinearStatic :: updateDomainLinks();
779#ifdef __MPI_PARALLEL_MODE
797 LinearStatic :: assemble(answer, tStep, ma, s, domain);
828 ctype = TangentStiffnessMatrix;
830 ctype = SecantStiffnessMatrix;
832 ctype = SecantStiffnessMatrix;
836 elem->showSparseMtrxStructure(ctype,
gc, tStep);
840 elem->showExtendedSparseMtrxStructure(ctype,
gc, tStep);
847NonLinearStatic :: computeExternalLoadReactionContribution(
FloatArray &reactions,
TimeStep *tStep,
int di)
853 OOFEM_ERROR(
"unable to respond due to invalid solution step or domain");
859NonLinearStatic :: assembleIncrementalReferenceLoadVectors(
FloatArray &_incrementalLoadVector,
860 FloatArray &_incrementalLoadVectorOfPrescribed,
861 SparseNonLinearSystemNM :: referenceLoadInputModeType _refMode,
865 _incrementalLoadVector.
zero();
867 _incrementalLoadVectorOfPrescribed.
zero();
869 if ( _refMode == SparseNonLinearSystemNM :: rlm_incremental ) {
891 int count = 0, pcount = 0;
894 if ( packUnpackType == 0 ) {
895 for (
int map : commMap ) {
897 for (
Dof *dof : *dman ) {
898 if ( dof->isPrimaryDof() && ( dof->__giveEquationNumber() ) ) {
908 }
else if ( packUnpackType == 1 ) {
909 for (
int map : commMap ) {
920#ifdef __MPI_PARALLEL_MODE
922NonLinearStatic :: giveLoadBalancer()
939NonLinearStatic :: giveLoadBalancerMonitor()
955NonLinearStatic :: packMigratingData(
TimeStep *tStep)
962 for (
int idofman = 1; idofman <= ndofman; idofman++ ) {
964 for (
Dof *_dof : *_dm ) {
965 if ( _dof->isPrimaryDof() ) {
967 if ( ( _eq = _dof->__giveEquationNumber() ) ) {
970 if ( initialLoadVectorEmpty ) {
971 _dof->updateUnknownsDictionary(tStep, VM_RhsInitial, 0.0);
973 _dof->updateUnknownsDictionary( tStep, VM_RhsInitial,
initialLoadVector.at(_eq) );
977 }
else if ( ( _eq = _dof->__givePrescribedEquationNumber() ) ) {
979 if ( initialLoadVectorOfPrescribedEmpty ) {
980 _dof->updateUnknownsDictionary(tStep, VM_RhsInitial, 0.0);
994NonLinearStatic :: unpackMigratingData(
TimeStep *tStep)
1009 for (
int idofman = 1; idofman <= ndofman; idofman++ ) {
1011 for (
Dof *_dof : *_dm ) {
1012 if ( _dof->isPrimaryDof() ) {
1014 if ( ( _eq = _dof->__giveEquationNumber() ) ) {
1017 initialLoadVector.at(_eq) = _dof->giveUnknownsDictionaryValue(tStep, VM_RhsInitial);
1023 fprintf(stderr,
"[%d] Shared: %d(%d) -> %d\n", myrank, idofman, idof, _eq);
1025 fprintf(stderr,
"[%d] Local : %d(%d) -> %d\n", myrank, idofman, idof, _eq);
1029 }
else if ( ( _eq = _dof->__givePrescribedEquationNumber() ) ) {
1036 fprintf(stderr,
"[%d] %d(%d) -> %d\n", myrank, idofman, idof, -_eq);
#define REGISTER_EngngModel(class)
virtual int read(int *data, std::size_t count)=0
Reads count integer values into array pointed by data.
virtual int givePackSizeOfDouble(std::size_t count)=0
virtual int write(const int *data, std::size_t count)=0
Writes count integer values from array pointed by data.
dofManagerParallelMode giveParallelMode() const
virtual int __giveEquationNumber() const =0
int giveNumber()
Returns domain number.
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
DofManager * giveDofManager(int n)
Element * giveElement(int n)
EngngModel * giveEngngModel()
std ::vector< std ::unique_ptr< Element > > & giveElements()
int estimatePackSize(DataStream &buff)
int giveNumberOfTimeStepWhenIcApply()
Returns the time step number, when initial conditions should apply.
void initializeCommMaps(bool forceInit=false)
std::unique_ptr< LoadBalancer > lb
Load Balancer.
virtual TimeStep * giveCurrentStep(bool force=false)
virtual int giveNumberOfDomainEquations(int di, const UnknownNumberingScheme &num)
int giveNumberOfProcesses() const
Returns the number of collaborating processes.
int giveRank() const
Returns domain rank in a group of collaborating processes (0..groupSize-1).
ProblemCommunicator * communicator
Communicator.
@ IG_None
No special treatment for new iterations. Probably means ending up using for all free dofs.
@ IG_Tangent
Solves an approximated tangent problem from the last iteration. Useful for changing Dirichlet boundar...
std ::unique_ptr< TimeStep > previousStep
Previous time step.
MetaStep * giveCurrentMetaStep()
Returns current meta step.
ProblemCommunicator * nonlocCommunicator
NonLocal Communicator. Necessary when nonlocal constitutive models are used.
Domain * giveDomain(int n)
virtual void doStepOutput(TimeStep *tStep)
std ::unique_ptr< TimeStep > currentStep
Current time step.
int nonlocalExt
Flag indicating if nonlocal extension active, which will cause data to be sent between shared element...
bool loadBalancingFlag
If set to true, load balancing is active.
virtual ErrorEstimator * giveDomainErrorEstimator(int n)
MetaStep * giveMetaStep(int i)
Returns the i-th meta step.
CommunicatorBuff * commBuff
Common Communicator buffer.
void assemblePrescribedExtrapolatedForces(FloatArray &answer, TimeStep *tStep, CharType type, Domain *domain)
void saveStepContext(TimeStep *tStep, ContextMode mode)
EngngModel * master
Master e-model; if defined receiver is in maintained (slave) mode.
std::unique_ptr< LoadBalancerMonitor > lbm
virtual int giveNumberOfFirstStep(bool force=false)
bool isParallel() const
Returns true if receiver in parallel mode.
int updateSharedDofManagers(FloatArray &answer, const UnknownNumberingScheme &s, int ExchangeTag)
std ::unique_ptr< TimeStep > stepWhenIcApply
Solution step when IC (initial conditions) apply.
void assembleVector(FloatArray &answer, TimeStep *tStep, const VectorAssembler &va, ValueModeType mode, const UnknownNumberingScheme &s, Domain *domain, FloatArray *eNorms=NULL)
problemScale pScale
Multiscale mode.
void zero()
Zeroes all coefficients of receiver.
void add(const FloatArray &src)
SparseMtrxType sparseMtrxType
LinearStatic(int i, EngngModel *master=nullptr)
std ::unique_ptr< SparseMtrx > stiffnessMatrix
SparseNonLinearSystemNM::referenceLoadInputModeType refLoadInputMode
FloatArray initialLoadVectorOfPrescribed
A load vector which does not scale for prescribed DOFs.
FloatArray internalForces
FloatArray incrementalLoadVector
FloatArray incrementalLoadVectorOfPrescribed
Incremental Load Vector for prescribed DOFs.
int nonlocalStiffnessFlag
int dtFunction
Associated time function for time step increment.
double deltaT
Intrinsic time increment.
double giveInitialTime() override
return time at the begining of analysis
double cumulatedLoadLevel
TimeStep * giveSolutionStepWhenIcApply(bool force=false) override
void proceedStep(int di, TimeStep *tStep)
LoadBalancer * giveLoadBalancer() override
void assembleIncrementalReferenceLoadVectors(FloatArray &_incrementalLoadVector, FloatArray &_incrementalLoadVectorOfPrescribed, SparseNonLinearSystemNM ::referenceLoadInputModeType _refMode, Domain *sourceDomain, TimeStep *tStep)
bool mstepCumulateLoadLevelFlag
FloatArray totalDisplacement
NonLinearStatic_controlType controlMode
Characterizes the type of control used.
NumericalMethod * giveNumericalMethod(MetaStep *mStep) override
Returns reference to receiver's numerical method.
virtual void updateLoadVectors(TimeStep *tStep)
InitialGuess initialGuessType
The initial guess type to use before starting the nonlinear solver.
NonLinearStatic_stiffnessMode stiffMode
void updateMatrix(SparseMtrx &mat, TimeStep *tStep, Domain *d) override
ConvergedReason numMetStatus
bool updateElasticStiffnessFlag
Function * giveDtFunction()
FloatArray incrementOfDisplacement
SparseNonLinearSystemNM * nMethod
Numerical method used to solve the problem.
FloatArray initialLoadVector
A load vector already applied, which does not scales.
virtual ConvergedReason solve(SparseMtrx &A, FloatArray &b, FloatArray &x)=0
virtual void zero()=0
Zeroes the receiver.
virtual void printStatistics() const
Prints the receiver statistics (one-line) to stdout.
virtual void addNonlocalStiffnessContributions(SparseMtrx &dest, const UnknownNumberingScheme &s, TimeStep *tStep)
StateCounterType internalVarUpdateStamp
FloatArray internalForcesEBENorm
Norm of nodal internal forces evaluated on element by element basis (squared).
void printReactionForces(TimeStep *tStep, int id, FILE *out)
void updateInternalRHS(FloatArray &answer, TimeStep *tStep, Domain *d, FloatArray *eNorm) override
int giveVersion()
Returns receiver's version.
int giveMetaStepNumber()
Returns receiver's meta step number.
ConvergedReason convergedReason
Status of solution step (Converged,.
double giveTimeIncrement()
Returns solution step associated time increment.
double giveTargetTime()
Returns target time.
int numberOfIterations
Number of itarations needed to achieve convergence.
int giveNumber()
Returns receiver's number.
double giveIntrinsicTime()
Returns intrinsic time, e.g. time in which constitutive model is evaluated.
double getUtime()
Returns total user time elapsed in seconds.
#define _IFT_EngngModel_initialGuess
#define OOFEM_LOG_INFO(...)
#define OOFEM_LOG_RELEVANT(...)
#define OOFEM_LOG_DEBUG(...)
FloatArrayF< N > assemble(const FloatArrayF< M > &x, int const (&c)[M])
Assemble components into zero matrix.
long StateCounterType
StateCounterType type used to indicate solution state.
FloatArrayF< N > max(const FloatArrayF< N > &a, const FloatArrayF< N > &b)
NonLinearStatic_stiffnessMode
Type determining the stiffness mode.
@ nls_secantInitialStiffness
The secant stiffness is used and updated only at the beginning of new load step.
@ nls_secantStiffness
The secant stiffness is used and updated whenever requested.
@ nls_tangentStiffness
The tangent stiffness is used and updated whenever requested.
@ nls_elasticStiffness
The initial elastic stiffness is used in the whole solution.
ClassFactory & classFactory
NonLinearStatic_controlType
Type determining type of loading control. This type determines the solver to be used.
@ nls_indirectControl
A generalized norm of displacement and loading vectors is controlled. In current implementation,...
@ nls_directControl
Describes the direct control where load or displacement (or both) are controlled.
@ CIO_IOERR
General IO error.
#define _IFT_NonLinearStatic_updateElasticStiffnessFlag
#define _IFT_NonLinearStatic_deltatfunction
#define _IFT_NonLinearStatic_refloadmode
#define _IFT_NonLinearStatic_stiffmode
#define _IFT_NonLinearStatic_controlmode
#define _IFT_NonLinearStatic_donotfixload
#define _IFT_NonLinearStatic_keepll
#define _IFT_NonLinearStatic_nonlocstiff
#define _IFT_NonLinearStatic_deltat
#define _IFT_NonLinearStatic_nonlocalext
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]