35 #include "../sm/EngineeringModels/adaptnlinearstatic.h" 58 #ifdef __PARALLEL_MODE 73 d2_totalDisplacement(), d2_incrementOfDisplacement(), timeStepLoadLevels()
78 #ifdef __PARALLEL_MODE 94 int meshPackageId = 0;
108 OOFEM_ERROR (
"AdaptiveNonLinearStatic :: initializeFrom: Error estimator not defined [eetype missing]");
121 ESIEventLoop( YES, const_cast< char * >(
"AdaptiveNonLinearStatic: Solution finished; Press Ctrl-p to continue") );
126 #ifdef __PARALLEL_MODE 153 this->
giveDomain(1)->giveSerialNumber() + 1, & newDomain);
227 OOFEM_ERROR(
"Unknown is of undefined ValueModeType for this problem");
244 double mc1, mc2, mc3;
247 if ( dynamic_cast< AdaptiveNonLinearStatic * >(sourceProblem) ) {
248 OOFEM_ERROR(
"source problem must also be AdaptiveNonlinearStatic.");
275 for (
auto &e : this->
giveDomain(1)->giveElements() ) {
284 for (
auto &e : this->
giveDomain(1)->giveElements() ) {
322 static_cast< AdaptiveNonLinearStatic * >(sourceProblem), 1, this->
giveCurrentStep() );
331 OOFEM_LOG_INFO(
"user time consumed by primary mapping: %.2fs\n", mc1);
334 OOFEM_LOG_INFO(
"user time consumed by mapping: %.2fs\n", mc1 + mc2 + mc3);
356 OOFEM_ERROR(
"stiffnessMatrix does not support asymmetric storage");
370 OOFEM_LOG_INFO(
"Equilibrating mapped configuration [step number %5d.%d]\n",
465 double mc1, mc2, mc3;
488 for (
auto &e : this->
giveDomain(2)->giveElements() ) {
526 #ifdef __PARALLEL_MODE 540 for (
auto &e : this->
giveDomain(1)->giveElements() ) {
550 for (
auto &e : this->
giveDomain(1)->giveElements() ) {
601 OOFEM_LOG_INFO(
"user time consumed by primary mapping: %.2fs\n", mc1);
604 OOFEM_LOG_INFO(
"user time consumed by mapping: %.2fs\n", mc1 + mc2 + mc3);
647 ESIEventLoop( YES, const_cast< char * >(
"AdaptiveRemap: Press Ctrl-p to continue") );
670 OOFEM_ERROR(
"stiffnessMatrix does not support asymmetric storage");
685 OOFEM_LOG_INFO(
"Equilibrating mapped configuration [step number %5d.%d]\n",
783 FloatArray _incrementalLoadVector, _incrementalLoadVectorOfPrescribed;
790 loadVectorOfPrescribed.
zero();
793 _incrementalLoadVector.
zero();
794 _incrementalLoadVectorOfPrescribed.
zero();
796 for (
int imstep = 1; imstep < mStepNum; imstep++ ) {
817 OOFEM_ERROR(
"fixload recovery not supported for direct displacement control");
828 for (
int istep = firststep; istep <= laststep; istep++ ) {
836 loadVector.
add(_incrementalLoadVector);
837 loadVectorOfPrescribed.
add(_incrementalLoadVectorOfPrescribed);
847 loadVector.
add(_incrementalLoadVector);
848 loadVectorOfPrescribed.
add(_incrementalLoadVectorOfPrescribed);
868 for (
int istep = firststep; istep <= laststep; istep++ ) {
875 loadVector.
add(_incrementalLoadVector);
876 loadVectorOfPrescribed.
add(_incrementalLoadVectorOfPrescribed);
964 #ifdef __PARALLEL_MODE virtual void updateYourself(TimeStep *tStep)
Updates internal state after finishing time step.
EngngModelTimer timer
E-model timer.
void setDomain(Domain *d)
Sets Domain; should also re-initialize attributes if necessary.
The representation of EngngModel default unknown numbering.
std::string giveContextFileName(int tStepNumber, int stepVersion) const
Returns the filename for the context file for the given step and version.
LoadBalancer * createLoadBalancer(const char *name, Domain *d)
std::unique_ptr< TimeStep > currentStep
Current time step.
FloatArray d2_totalDisplacement
#define _IFT_AdaptiveNonLinearStatic_meshpackage
Implementation of FileDataStream representing DataStream interface to file i/o.
virtual int giveNumberOfDomainEquations(int di, const UnknownNumberingScheme &num)
Returns number of equations for given domain in active (current time step) time step.
LoadBalancerMonitor * lbm
The class implementing the primary unknown mapper using element interpolation functions.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode)
Stores the state of model to output stream.
SparseMtrx * createSparseMtrx(SparseMtrxType type)
Creates new instance of sparse matrix corresponding to given keyword.
void incrementVersion()
Increments receiver's version.
virtual double giveCurrentStepLength()
Returns step length.
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
contextIOResultType storeYourself(DataStream &stream) const
std::vector< std::unique_ptr< Domain > > domainList
List of problem domains.
std::unique_ptr< TimeStep > previousStep
Previous time step.
double & at(int i)
Coefficient access function.
int nonlocalStiffnessFlag
MetaStep * giveMetaStep(int i)
Returns the i-th meta step.
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
virtual LoadBalancerMonitor * giveLoadBalancerMonitor()
Returns reference to receiver's load balancer monitor.
FloatArray internalForces
AdaptiveNonLinearStatic(int i, EngngModel *_master=NULL)
NonLinearStatic_stiffnessMode stiffMode
Implementation for assembling tangent matrices in standard monolithic FE-problems.
ErrorEstimator * defaultErrEstimator
Error estimator. Useful for adaptivity, or simply printing errors output.
FloatArray d2_incrementOfDisplacement
bool isParallel() const
Returns true if receiver in parallel mode.
virtual void setStepLength(double s)
Sets the step length.
virtual RemeshingStrategy giveRemeshingStrategy(TimeStep *tStep)=0
Determines, if the remeshing is needed, and if needed, the type of strategy used. ...
virtual returnCode createMesh(TimeStep *tStep, int domainNumber, int domainSerNum, Domain **dNew)=0
Runs the mesh generation, mesh will be written to corresponding domain din file.
int giveNumber()
Returns domain number.
virtual int __giveEquationNumber() const =0
Returns equation number of receiver, usually assigned by emodel.
virtual double giveTimeStepLoadLevel(int istep)
Returns the load level corresponding to given solution step number.
virtual double giveUnknownComponent(ValueModeType type, TimeStep *tStep, Domain *d, Dof *dof)
Returns requested unknown.
REGISTER_EngngModel(ProblemSequence)
virtual void terminate(TimeStep *tStep)
Terminates the solution of time step.
#define OOFEM_LOG_DEBUG(...)
int & at(int i)
Coefficient access function.
virtual int estimateMeshDensities(TimeStep *tStep)=0
Estimates the nodal densities.
FloatArray incrementalLoadVector
Incremental load vector which is applied in loading step (as a whole for direct control or proportion...
NonLinearStatic_stiffnessMode
Type determining the stiffness mode.
#define OOFEM_LOG_RELEVANT(...)
FloatArray initialLoadVectorOfPrescribed
A load vector which does not scale for prescribed DOFs.
FloatArray incrementalLoadVectorOfPrescribed
Incremental Load Vector for prescribed DOFs.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description in input reader.
virtual void initStepIncrements()
Initializes solution of new time step.
SparseNonLinearSystemNM::referenceLoadInputModeType refLoadInputMode
The following parameter allows to specify how the reference load vector is obtained from given totalL...
void assembleIncrementalReferenceLoadVectors(FloatArray &_incrementalLoadVector, FloatArray &_incrementalLoadVectorOfPrescribed, SparseNonLinearSystemNM::referenceLoadInputModeType _refMode, Domain *sourceDomain, TimeStep *tStep)
OOFEM terminate exception class.
virtual double giveUnknownComponent(ValueModeType mode, TimeStep *tStep, Domain *d, Dof *dof)
Returns requested unknown.
bool loadBalancingFlag
If set to true, load balancing is active.
void assembleInitialLoadVector(FloatArray &loadVector, FloatArray &loadVectorOfPrescribed, AdaptiveNonLinearStatic *sourceProblem, int domainIndx, TimeStep *tStep)
MetaStep * giveCurrentMetaStep()
Returns current meta step.
#define OOFEM_LOG_INFO(...)
int giveNumber()
Returns receiver's number.
FILE * giveOutputStream()
Returns file descriptor of output file.
void proceedStep(int di, TimeStep *tStep)
IntArray domainPrescribedNeqs
Number of prescribed equations per domain.
SparseNonLinearSystemNM * nMethod
Numerical method used to solve the problem.
virtual void solveYourselfAt(TimeStep *tStep)
Solves problem for given time step.
int ndomains
Number of receiver domains.
The base class representing the interface to mesh generation package.
virtual void balanceLoad(TimeStep *tStep)
Recovers the load balance between processors, if needed.
virtual int estimateError(EE_ErrorMode mode, TimeStep *tStep)=0
Estimates the error on associated domain at given time step.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode)
Stores the state of model to output stream.
#define _IFT_AdaptiveNonLinearStatic_equilmc
int equilibrateMappedConfigurationFlag
Flag indication whether to restore equilibrium after adaptive remapping.
contextIOResultType restoreYourself(DataStream &stream)
int giveNumberOfSteps(bool force=false)
Returns total number of steps.
FloatArray totalDisplacement
virtual int giveNumberOfFirstStep(bool force=false)
Returns number of first time step used by receiver.
Enable for post-processing.
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Prints output of receiver to output domain stream, for given time step.
referenceLoadInputModeType
The following parameter allows to specify how the reference load vector is obtained from given totalL...
virtual RemeshingCriteria * giveRemeshingCrit()=0
Returns reference to associated remeshing criteria.
SparseMtrxType sparseMtrxType
bool isEmpty() const
Returns true if receiver is empty.
void resize(int n)
Checks size of receiver towards requested bounds.
#define _IFT_AdaptiveNonLinearStatic_controlmode
FloatArray timeStepLoadLevels
Array storing the load levels reached in corresponding time steps.
virtual ~AdaptiveNonLinearStatic()
double deltaT
Intrinsic time increment.
void terminateAnalysis()
Performs analysis termination after finishing analysis.
Abstract base class representing general load balancer.
MesherInterface * createMesherInterface(MeshPackageType name, Domain *d)
virtual void updateYourself(TimeStep *tStep)
Updates internal state after finishing time step.
Describes the direct control where load or displacement (or both) are controlled. ...
virtual int forceEquationNumbering()
Forces equation renumbering on all domains associated to engng model.
Initializes the variable VERBOSE, in order to get a few intermediate messages on screen: beginning an...
std::string giveDomainFileName(int domainNum, int domainSerNum) const
Returns the filename for the given domain (used by adaptivity and restore)
Class representing vector of real numbers.
virtual int initializeAdaptiveFrom(EngngModel *sourceProblem)
Initializes the receiver state according to state of given source problem.
RemeshingStrategy
Type representing the remeshing strategy.
int giveSerialNumber()
Returns domain serial (version) number.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description in input reader.
IntArray domainNeqs
Number of equations per domain.
virtual void updateDomainLinks()
Updates domain links after the domains of receiver have changed.
virtual int adaptiveRemap(Domain *dNew)
Remaps the solution state to newly given domain.
FloatArray incrementOfDisplacement
IRResultType
Type defining the return values of InputRecord reading operations.
std::unique_ptr< SparseMtrx > stiffnessMatrix
int instanciateYourself(DataReader &dr)
Reads receiver description from input stream and creates corresponding components accordingly...
int giveMetaStepNumber()
Returns receiver's meta step number.
virtual void reinitialize()
Reinitializes the receiver.
The representation of EngngModel default prescribed unknown numbering.
virtual int mapAndUpdate(FloatArray &answer, ValueModeType mode, Domain *oldd, Domain *newd, TimeStep *tStep)
Maps and updates the vector(s) of primary unknowns from old mesh oldd to new mesh newd...
virtual LoadBalancer * giveLoadBalancer()
Returns reference to receiver's load balancer.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode)
Restores the state of model from output stream.
#define _IFT_AdaptiveNonLinearStatic_preMappingLoadBalancingFlag
void zero()
Zeroes all coefficients of receiver.
Class implementing single timer, providing wall clock and user time capabilities. ...
MeshPackageType meshPackage
void times(double s)
Multiplies receiver with scalar.
void initializeCommMaps(bool forceInit=false)
ClassFactory & classFactory
long ContextMode
Context mode (mask), defining the type of information written/read to/from context.
LoadBalancerMonitor * createLoadBalancerMonitor(const char *name, EngngModel *e)
LoadBalancer * lb
Load Balancer.
Element in active domain is only mirror of some remote element.
virtual TimeStep * givePreviousStep(bool force=false)
Returns previous time step.
virtual void assemble(SparseMtrx &answer, TimeStep *tStep, const MatrixAssembler &ma, const UnknownNumberingScheme &, Domain *domain)
Assembles characteristic matrix of required type into given sparse matrix.
This class implements nonlinear static engineering problem.
FloatArray internalForcesEBENorm
Norm of nodal internal forces evaluated on element by element basis (squared)
MeshPackageType
Enumerative type used to classify supported mesh packages.
A generalized norm of displacement and loading vectors is controlled. In current implementation, the CALM solver is used, the reference load vector is FIXED.
std::vector< std::unique_ptr< Element > > & giveElements()
void setContextOutputMode(ContextOutputMode contextMode)
Sets context output mode of receiver.
Abstract base class representing the "problem" under consideration.
virtual TimeStep * giveCurrentStep(bool force=false)
Returns current time step.
The secant stiffness is used and updated whenever requested.
int exchangeRemoteElementData(int ExchangeTag)
Exchanges necessary remote element data with remote partitions.
Class representing the implementation of plain text date reader.
virtual int initializeAdaptive(int tStepNumber)
Initializes the newly generated discretization state according to previous solution.
virtual void updateAttributes(MetaStep *mStep)
Update receiver attributes according to step metaStep attributes.
the oofem namespace is to define a context or scope in which all oofem names are defined.
bool isNotEmpty() const
Returns true if receiver is not empty.
virtual void updateLoadVectors(TimeStep *tStep)
Domain * giveDomain(int n)
Service for accessing particular problem domain.
FloatArray initialLoadVector
A load vector already applied, which does not scales.
bool preMappingLoadBalancingFlag
Flag to trigger load balancing before adaptive remapping.
Abstract class Dof represents Degree Of Freedom in finite element mesh.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode)
Restores the state of model from output stream.
virtual void updateDomainLinks()
Updates domain links after the domains of receiver have changed.
#define _IFT_AdaptiveNonLinearStatic_refloadmode
Context IO exception class.
double getUtime()
Returns total user time elapsed in seconds.
int numberOfPrescribedEquations
Total number or prescribed equations in current time step.
std::vector< ParallelContext > parallelContextList
List where parallel contexts are stored.
#define _IFT_AdaptiveNonLinearStatic_ddm
Class representing solution step.
This class implements Adaptive Non-LinearStatic Engineering problem.
void add(const FloatArray &src)
Adds array src to receiver.
Abstract base class representing general load balancer monitor.
virtual NM_Status solve(SparseMtrx &K, FloatArray &R, FloatArray *R0, FloatArray &X, FloatArray &dX, FloatArray &F, const FloatArray &internalForcesEBENorm, double &s, referenceLoadInputModeType rlm, int &nite, TimeStep *tStep)=0
Solves the given sparse linear system of equations .
#define _IFT_NonLinearStatic_donotfixload
void resize(int s)
Resizes receiver towards requested size.
int numberOfEquations
Total number of equation in current time step.
int equationNumberingCompleted
Equation numbering completed flag.