58#ifdef __MPI_PARALLEL_MODE
78#ifdef __MPI_PARALLEL_MODE
84AdaptiveNonLinearStatic :: ~AdaptiveNonLinearStatic()
91 NonLinearStatic :: initializeFrom(ir);
95 int meshPackageId = 0;
108 OOFEM_ERROR (
"AdaptiveNonLinearStatic :: initializeFrom: Error estimator not defined [eetype missing]");
113AdaptiveNonLinearStatic :: solveYourselfAt(
TimeStep *tStep)
119 ESIEventLoop( YES,
const_cast< char *
>(
"AdaptiveNonLinearStatic: Solution finished; Press Ctrl-p to continue") );
124#ifdef __MPI_PARALLEL_MODE
150 MesherInterface :: returnCode result = mesher->createMesh(this->
giveCurrentStep(), 1,
151 this->
giveDomain(1)->giveSerialNumber() + 1, & newDomain);
153 if ( result == MesherInterface :: MI_OK ) {
156 }
else if ( result == MesherInterface :: MI_NEEDS_EXTERNAL_ACTION ) {
174AdaptiveNonLinearStatic :: updateYourself(
TimeStep *tStep)
188 NonLinearStatic :: updateYourself(tStep);
192double AdaptiveNonLinearStatic :: giveUnknownComponent(ValueModeType mode,
TimeStep *tStep,
Domain *d,
Dof *dof)
222 OOFEM_ERROR(
"Unknown is of undefined ValueModeType for this problem");
225 return NonLinearStatic :: giveUnknownComponent(mode, tStep, d, dof);
233AdaptiveNonLinearStatic :: initializeAdaptiveFrom(
EngngModel *sourceProblem)
239 double mc1, mc2, mc3;
243 OOFEM_ERROR(
"source problem must also be AdaptiveNonlinearStatic.");
266 mc1 =
timer.getUtime();
270 for (
auto &e : this->
giveDomain(1)->giveElements() ) {
275 mc2 =
timer.getUtime();
279 for (
auto &e : this->
giveDomain(1)->giveElements() ) {
284 for (
auto &e : this->
giveDomain(1)->giveElements() ) {
323 mc3 =
timer.getUtime();
326 OOFEM_LOG_INFO(
"user time consumed by primary mapping: %.2fs\n", mc1);
329 OOFEM_LOG_INFO(
"user time consumed by mapping: %.2fs\n", mc1 + mc2 + mc3);
351 OOFEM_ERROR(
"stiffnessMatrix does not support asymmetric storage");
365 OOFEM_LOG_INFO(
"Equilibrating mapped configuration [step number %5d.%d]\n",
370 double deltaL =
nMethod->giveCurrentStepLength();
382 nMethod->setStepLength(deltaL / 5.0);
401 nMethod->setStepLength(deltaL);
414AdaptiveNonLinearStatic :: initializeAdaptive(
int tStepNumber)
426 int sernum = this->
giveDomain(1)->giveSerialNumber();
440AdaptiveNonLinearStatic :: adaptiveRemap(
Domain *dNew)
460 double mc1, mc2, mc3;
479 mc1 =
timer.getUtime();
483 for (
auto &e : this->
giveDomain(2)->giveElements() ) {
521#ifdef __MPI_PARALLEL_MODE
531 mc2 =
timer.getUtime();
535 for (
auto &e : this->
giveDomain(1)->giveElements() ) {
545 for (
auto &e : this->
giveDomain(1)->giveElements() ) {
593 mc3 =
timer.getUtime();
596 OOFEM_LOG_INFO(
"user time consumed by primary mapping: %.2fs\n", mc1);
599 OOFEM_LOG_INFO(
"user time consumed by mapping: %.2fs\n", mc1 + mc2 + mc3);
642 ESIEventLoop( YES,
const_cast< char *
>(
"AdaptiveRemap: Press Ctrl-p to continue") );
665 OOFEM_ERROR(
"stiffnessMatrix does not support asymmetric storage");
680 OOFEM_LOG_INFO(
"Equilibrating mapped configuration [step number %5d.%d]\n",
685 double deltaL =
nMethod->giveCurrentStepLength();
695 nMethod->setStepLength(deltaL / 5.0);
714 nMethod->setStepLength(deltaL);
729 NonLinearStatic :: saveContext(stream, mode);
740 NonLinearStatic :: restoreContext(stream, mode);
750AdaptiveNonLinearStatic :: updateDomainLinks()
752 NonLinearStatic :: updateDomainLinks();
764 FloatArray _incrementalLoadVector, _incrementalLoadVectorOfPrescribed;
765 SparseNonLinearSystemNM :: referenceLoadInputModeType rlm;
771 loadVectorOfPrescribed.
zero();
774 _incrementalLoadVector.
zero();
775 _incrementalLoadVectorOfPrescribed.
zero();
777 for (
int imstep = 1; imstep < mStepNum; imstep++ ) {
779 auto &ir = iMStep->giveAttributesRecord();
798 OOFEM_ERROR(
"fixload recovery not supported for direct displacement control");
801 int firststep = iMStep->giveFirstStepNumber();
802 int laststep = iMStep->giveLastStepNumber();
806 rlm = ( SparseNonLinearSystemNM :: referenceLoadInputModeType ) _val;
809 for (
int istep = firststep; istep <= laststep; istep++ ) {
818 loadVectorOfPrescribed.
add(_incrementalLoadVectorOfPrescribed);
829 loadVectorOfPrescribed.
add(_incrementalLoadVectorOfPrescribed);
839 auto &ir = iMStep->giveAttributesRecord();
842 int firststep = iMStep->giveFirstStepNumber();
846 rlm = ( SparseNonLinearSystemNM :: referenceLoadInputModeType ) _val;
849 for (
int istep = firststep; istep <= laststep; istep++ ) {
857 loadVectorOfPrescribed.
add(_incrementalLoadVectorOfPrescribed);
931AdaptiveNonLinearStatic :: giveTimeStepLoadLevel(
int istep)
943#ifdef __MPI_PARALLEL_MODE
945AdaptiveNonLinearStatic :: giveLoadBalancer()
959AdaptiveNonLinearStatic :: giveLoadBalancerMonitor()
#define _IFT_AdaptiveNonLinearStatic_ddm
#define _IFT_AdaptiveNonLinearStatic_preMappingLoadBalancingFlag
#define _IFT_AdaptiveNonLinearStatic_controlmode
#define _IFT_AdaptiveNonLinearStatic_meshpackage
#define _IFT_AdaptiveNonLinearStatic_equilmc
#define _IFT_AdaptiveNonLinearStatic_refloadmode
#define REGISTER_EngngModel(class)
void assembleInitialLoadVector(FloatArray &loadVector, FloatArray &loadVectorOfPrescribed, AdaptiveNonLinearStatic *sourceProblem, int domainIndx, TimeStep *tStep)
virtual double giveTimeStepLoadLevel(int istep)
virtual int adaptiveRemap(Domain *dNew)
void restoreContext(DataStream &stream, ContextMode mode) override
MeshPackageType meshPackage
FloatArray timeStepLoadLevels
FloatArray d2_totalDisplacement
FloatArray d2_incrementOfDisplacement
AdaptiveNonLinearStatic(int i, EngngModel *master=nullptr)
int equilibrateMappedConfigurationFlag
Flag indication whether to restore equilibrium after adaptive remapping.
void updateYourself(TimeStep *tStep) override
bool preMappingLoadBalancingFlag
void updateDomainLinks() override
virtual int __giveEquationNumber() const =0
int instanciateYourself(DataReader &dr)
int giveNumber()
Returns domain number.
int mapAndUpdate(FloatArray &answer, ValueModeType mode, Domain *oldd, Domain *newd, TimeStep *tStep) override
virtual void initStepIncrements()
void initializeCommMaps(bool forceInit=false)
std::unique_ptr< LoadBalancer > lb
Load Balancer.
std ::vector< std ::unique_ptr< Domain > > domainList
List of problem domains.
void setContextOutputMode(ContextOutputMode contextMode)
int numberOfEquations
Total number of equation in current time step.
virtual void balanceLoad(TimeStep *tStep)
virtual TimeStep * giveCurrentStep(bool force=false)
virtual int giveNumberOfDomainEquations(int di, const UnknownNumberingScheme &num)
std ::unique_ptr< TimeStep > previousStep
Previous time step.
std::string giveContextFileName(int tStepNumber, int stepVersion) const
int equationNumberingCompleted
Equation numbering completed flag.
MetaStep * giveCurrentMetaStep()
Returns current meta step.
int ndomains
Number of receiver domains.
Domain * giveDomain(int n)
std ::unique_ptr< TimeStep > currentStep
Current time step.
bool loadBalancingFlag
If set to true, load balancing is active.
FILE * giveOutputStream()
Returns file descriptor of output file.
int giveNumberOfSteps(bool force=false)
MetaStep * giveMetaStep(int i)
Returns the i-th meta step.
EngngModelTimer timer
E-model timer.
@ RemoteElementExchangeTag
std ::vector< ParallelContext > parallelContextList
List where parallel contexts are stored.
int exchangeRemoteElementData(int ExchangeTag)
virtual TimeStep * givePreviousStep(bool force=false)
std::string giveDomainFileName(int domainNum, int domainSerNum) const
virtual int forceEquationNumbering(int i)
std::unique_ptr< LoadBalancerMonitor > lbm
virtual int giveNumberOfFirstStep(bool force=false)
bool isParallel() const
Returns true if receiver in parallel mode.
IntArray domainPrescribedNeqs
Number of prescribed equations per domain.
std::unique_ptr< ErrorEstimator > defaultErrEstimator
Error estimator. Useful for adaptivity, or simply printing errors output.
int numberOfPrescribedEquations
Total number or prescribed equations in current time step.
IntArray domainNeqs
Number of equations per domain.
void zero()
Zeroes all coefficients of receiver.
void add(const FloatArray &src)
SparseMtrxType sparseMtrxType
std ::unique_ptr< SparseMtrx > stiffnessMatrix
SparseNonLinearSystemNM::referenceLoadInputModeType refLoadInputMode
FloatArray initialLoadVectorOfPrescribed
A load vector which does not scale for prescribed DOFs.
void printOutputAt(FILE *file, TimeStep *tStep) override
FloatArray internalForces
FloatArray incrementalLoadVector
FloatArray incrementalLoadVectorOfPrescribed
Incremental Load Vector for prescribed DOFs.
int nonlocalStiffnessFlag
double deltaT
Intrinsic time increment.
void terminate(TimeStep *tStep) override
NonLinearStatic(int i, EngngModel *master=nullptr)
void proceedStep(int di, TimeStep *tStep)
void assembleIncrementalReferenceLoadVectors(FloatArray &_incrementalLoadVector, FloatArray &_incrementalLoadVectorOfPrescribed, SparseNonLinearSystemNM ::referenceLoadInputModeType _refMode, Domain *sourceDomain, TimeStep *tStep)
FloatArray totalDisplacement
virtual void updateLoadVectors(TimeStep *tStep)
void updateAttributes(MetaStep *mStep) override
NonLinearStatic_stiffnessMode stiffMode
ConvergedReason numMetStatus
FloatArray incrementOfDisplacement
SparseNonLinearSystemNM * nMethod
Numerical method used to solve the problem.
FloatArray initialLoadVector
A load vector already applied, which does not scales.
OOFEM terminate exception class.
FloatArray internalForcesEBENorm
Norm of nodal internal forces evaluated on element by element basis (squared).
void incrementVersion()
Increments receiver's version.
int giveMetaStepNumber()
Returns receiver's meta step number.
int giveNumber()
Returns receiver's number.
#define OOFEM_LOG_INFO(...)
#define OOFEM_LOG_RELEVANT(...)
#define OOFEM_LOG_DEBUG(...)
@ Element_remote
Element in active domain is only mirror of some remote element.
FloatArrayF< N > assemble(const FloatArrayF< M > &x, int const (&c)[M])
Assemble components into zero matrix.
@ COM_Always
Enable for post-processing.
NonLinearStatic_stiffnessMode
Type determining the stiffness mode.
@ nls_secantStiffness
The secant stiffness is used and updated whenever requested.
RemeshingStrategy
Type representing the remeshing strategy.
@ RemeshingFromPreviousState_RS
@ RemeshingFromCurrentState_RS
ClassFactory & classFactory
@ 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.
#define _IFT_NonLinearStatic_donotfixload