38 #include "../sm/EngineeringModels/nlineardynamic.h" 39 #include "../sm/Elements/nlstructuralelement.h" 40 #include "../sm/Elements/structuralelementevaluator.h" 60 #ifdef __PARALLEL_MODE 70 totalDisplacement(), incrementOfDisplacement(), internalForces(), forcesVector()
87 if ( mStep == NULL ) {
173 #ifdef __PARALLEL_MODE 215 case VM_Acceleration:
219 OOFEM_ERROR(
"Unknown is of undefined ValueModeType for this problem");
231 double deltaTtmp =
deltaT;
232 double totalTime =
deltaT;
241 totalTime =
currentStep->giveTargetTime() + deltaTtmp;
243 counter =
currentStep->giveSolutionStateCounter() + 1;
247 if ( !this->
giveMetaStep(mStepNum)->isStepValid(istep) ) {
256 currentStep.reset(
new TimeStep(istep,
this, mStepNum, totalTime, deltaTtmp, counter, td) );
265 #ifdef __VERBOSE_PARALLEL 285 #ifdef __VERBOSE_PARALLEL 341 if ( !dof->isPrimaryDof() ) {
345 int jj = dof->__giveEquationNumber();
385 OOFEM_ERROR(
"effectiveStiffnessMatrix does not support asymmetric storage");
430 for (
int i = 1; i <= neq; i++ ) {
448 for (
int i = 1; i <= neq; i++ ) {
473 double loadLevel = 1.0;
488 for (
int i = 1; i <= neq; i++ ) {
523 a3 = 1. / ( 2. *
beta ) - 1.;
642 if ( !this->
giveDomain(1)->giveOutputManager()->testTimeStepOutput(tStep) ) {
646 fprintf(file,
"\n\nOutput for time %.3e, solution step number %d\n", tStep->
giveTargetTime(), tStep->
giveNumber() );
659 static char dofchar[] =
"dva";
661 VM_Total, VM_Velocity, VM_Acceleration
729 #ifdef __PARALLEL_MODE 752 static_cast< NLStructuralElement *
>( elem.get() )->addNonlocalStiffnessContributions(answer, s, tStep);
776 ctype = TangentStiffnessMatrix;
779 elem->showSparseMtrxStructure(ctype, gc, tStep);
783 elem->showExtendedSparseMtrxStructure(ctype, gc, tStep);
801 for (
int i = 1; i <= nelem; i++ ) {
825 for (
int j = 1; j <= n; j++ ) {
828 for (
int k = 1; k <= n; k++ ) {
831 answer.
at(jj) += charMtrx.
at(j, k) * vec.
at(kk);
845 int count = 0, pcount = 0;
848 if ( packUnpackType == 0 ) {
849 for (
int map: commMap ) {
851 for (
Dof *dof: *dman ) {
852 if ( dof->isPrimaryDof() && ( dof->__giveEquationNumber() ) ) {
861 }
else if ( packUnpackType == 1 ) {
862 for (
int map: commMap ) {
873 #ifdef __PARALLEL_MODE 912 for (
int idofman = 1; idofman <= ndofman; idofman++ ) {
914 for (
Dof *_dof: *_dm ) {
915 if ( _dof->isPrimaryDof() ) {
916 if ( ( _eq = _dof->__giveEquationNumber() ) ) {
937 for (
int idofman = 1; idofman <= ndofman; idofman++ ) {
939 for (
Dof *_dof: *_dm ) {
940 if ( _dof->isPrimaryDof() ) {
941 if ( ( _eq = _dof->__giveEquationNumber() ) ) {
947 fprintf(stderr,
"[%d] Shared: %d(%d) -> %d\n", myrank, idofman, idof, _eq);
949 fprintf(stderr,
"[%d] Local : %d(%d) -> %d\n", myrank, idofman, idof, _eq);
EngngModelTimer timer
E-model timer.
virtual void initializeYourself(TimeStep *tStep)
Provides the opportunity to initialize state variables stored in element integration points according...
virtual void updateAttributes(MetaStep *mStep)
Update receiver attributes according to step metaStep attributes.
LinSystSolverType
The values of this type should be related not to specific solvers, but more to specific packages that...
The representation of EngngModel default unknown numbering.
void subtract(const FloatArray &src)
Subtracts array src to receiver.
FloatArray totalDisplacement
#define NM_Success
Numerical method exited with success.
LoadBalancer * createLoadBalancer(const char *name, Domain *d)
std::unique_ptr< TimeStep > currentStep
Current time step.
int nonlocalStiffnessFlag
virtual int giveNumberOfDomainEquations(int di, const UnknownNumberingScheme &num)
Returns number of equations for given domain in active (current time step) time step.
LoadBalancerMonitor * lbm
FloatArray internalForces
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode)
Restores the state of model from output stream.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description in input reader.
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
Base class for all matrices stored in sparse format.
#define _IFT_NRSolver_manrmsteps
#define _IFT_NonLinearDynamic_ddtScheme
This class implements Newton-Raphson Method, derived from abstract NumericalMethod class for solving ...
SparseMtrx * createSparseMtrx(SparseMtrxType type)
Creates new instance of sparse matrix corresponding to given keyword.
Abstract base class for "structural" finite elements with geometrical nonlinearities.
The purpose of DataStream abstract class is to allow to store/restore context to different streams...
contextIOResultType storeYourself(DataStream &stream) const
std::unique_ptr< TimeStep > previousStep
Previous time step.
double & at(int i)
Coefficient access function.
int max(int i, int j)
Returns bigger value form two given decimals.
MetaStep * giveMetaStep(int i)
Returns the i-th meta step.
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
int nonlocalExt
Flag indicating if nonlocal extension active, which will cause data to be sent between shared element...
long StateCounterType
StateCounterType type used to indicate solution state.
virtual ~NonLinearDynamic()
This base class is an abstraction for numerical algorithm.
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]
std::unique_ptr< TimeStep > stepWhenIcApply
Solution step when IC (initial conditions) apply.
SparseMtrxType sparseMtrxType
double giveTargetTime()
Returns target time.
bool isParallel() const
Returns true if receiver in parallel mode.
FloatArray previousAccelerationVector
Abstract base class for all finite elements.
FloatArray previousIncrementOfDisplacement
Base class for dof managers.
int giveNumberOfProcesses() const
Returns the number of collaborating processes.
std::vector< std::unique_ptr< DofManager > > & giveDofManagers()
virtual void solveYourself()
Starts solution process.
Implementation for assembling the consistent mass matrix.
StateCounterType internalVarUpdateStamp
Contains last time stamp of internal variable update.
int giveNumber()
Returns domain number.
virtual int __giveEquationNumber() const =0
Returns equation number of receiver, usually assigned by emodel.
FloatArray accelerationVector
int giveNumberOfElements() const
Returns number of elements in domain.
virtual void giveCharacteristicMatrix(FloatMatrix &answer, CharType type, TimeStep *tStep)
Computes characteristic matrix of receiver of requested type in given time step.
virtual void printMultipleOutputAt(FILE *File, TimeStep *tStep, char *ch, ValueModeType *mode, int nite)
Prints Dof output (it prints value of unknown related to dof at given timeStep).
unsigned long NM_Status
Mask defining NumMetod Status; which can be asked after finishing computation by Numerical Method...
#define OOFEM_LOG_DEBUG(...)
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
virtual void giveInternalForces(FloatArray &answer, bool normFlag, int di, TimeStep *tStep)
Evaluates the nodal representation of internal forces by assembling contributions from individual ele...
std::unique_ptr< SparseMtrx > massMatrix
void printReactionForces(TimeStep *tStep, int id, FILE *out)
Computes and prints reaction forces, computed from nodal internal forces.
#define OOFEM_LOG_RELEVANT(...)
virtual void printStatistics() const
Prints the receiver statistics (one-line) to stdout.
virtual void updateComponent(TimeStep *tStep, NumericalCmpn, Domain *d)
Updates components mapped to numerical method if necessary during solution process.
virtual int estimateMaxPackSize(IntArray &commMap, DataStream &buff, int packUnpackType)
Determines the space necessary for send/receive buffer.
double giveTimeIncrement()
Returns solution step associated time increment.
bool isTheFirstStep()
Check if receiver is first step.
virtual void updateAttributes(MetaStep *mStep)
Update receiver attributes according to step metaStep attributes.
virtual void assemble(SparseMtrx &answer, TimeStep *tStep, const MatrixAssembler &ma, const UnknownNumberingScheme &s, Domain *domain)
Assembles characteristic matrix of required type into given sparse matrix.
void beScaled(double s, const FloatArray &b)
Sets receiver to be .
bool loadBalancingFlag
If set to true, load balancing is active.
MetaStep * giveCurrentMetaStep()
Returns current meta step.
std::unique_ptr< SparseMtrx > effectiveStiffnessMatrix
ProblemCommunicator * nonlocCommunicator
NonLocal Communicator. Necessary when nonlocal constitutive models are used.
TimeDiscretizationType
Time discretization used by transient solvers.
int giveNumber()
Returns receiver's number.
#define OOFEM_LOG_INFO(...)
Element * giveElement(int n)
Service for accessing particular domain fe element.
#define _IFT_NonLinearDynamic_eta
NumericalCmpn
Type representing numerical component.
#define _IFT_EngngModel_smtype
void doElementOutput(FILE *, TimeStep *)
Does the element output.
Callback class for assembling specific types of matrices.
#define _IFT_NonLinearDynamic_delta
int ndomains
Number of receiver domains.
int updateSharedDofManagers(FloatArray &answer, const UnknownNumberingScheme &s, int ExchangeTag)
Exchanges necessary remote DofManagers data.
SparseMtrxType
Enumerative type used to identify the sparse matrix type.
The reference incremental load vector is defined as totalLoadVector assembled at given time...
Implementation for assembling external forces vectors in standard monolithic FE-problems.
void giveLocationArray(IntArray &locationArray, const UnknownNumberingScheme &s, IntArray *dofIds=NULL) const
Returns the location array (array of code numbers) of receiver for given numbering scheme...
Abstract base class allowing to control the way, how equations are assigned to individual DOFs...
virtual TimeStep * giveNextStep()
Returns next time step (next to current step) of receiver.
contextIOResultType restoreYourself(DataStream &stream)
ProblemCommunicator * communicator
Communicator.
LinSystSolverType solverType
CommunicatorBuff * commBuff
Common Communicator buffer.
int nMetaSteps
Number of meta steps.
virtual int giveNumberOfFirstStep(bool force=false)
Returns number of first time step used by receiver.
#define _IFT_NonLinearDynamic_gamma
double at(int i, int j) const
Coefficient access function.
FloatArray incrementOfDisplacement
void timesMtrx(FloatArray &answer, FloatArray &vec, CharType type, Domain *domain, TimeStep *tStep)
Abstract base class representing general load balancer.
virtual void updateYourself(TimeStep *tStep)
Updates internal state after finishing time step.
virtual LoadBalancer * giveLoadBalancer()
Returns reference to receiver's load balancer.
#define _IFT_NonLinearDynamic_nonlocstiff
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode)
Stores the state of model to output stream.
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Prints output of receiver to output domain stream, for given time step.
Initializes the variable VERBOSE, in order to get a few intermediate messages on screen: beginning an...
virtual void packMigratingData(TimeStep *tStep)
Packs receiver data when rebalancing load.
TimeDiscretizationType giveTimeDiscretization()
Returns time discretization.
Class representing vector of real numbers.
int estimatePackSize(DataStream &buff)
Estimates the necessary pack size to hold all packed data of receiver.
elementParallelMode giveParallelMode() const
Return elementParallelMode of receiver.
TimeDiscretizationType initialTimeDiscretization
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description in input reader.
std::unique_ptr< SparseNonLinearSystemNM > nMethod
Numerical method used to solve the problem.
Implementation of matrix containing floating point numbers.
virtual void reinitialize()
#define _IFT_EngngModel_lstype
IRResultType
Type defining the return values of InputRecord reading operations.
virtual void unpackMigratingData(TimeStep *tStep)
Unpacks receiver data when rebalancing load.
virtual int givePackSizeOfDouble(int count)=0
virtual void updateDomainLinks()
Updates domain links after the domains of receiver have changed.
virtual void showSparseMtrxStructure(int type, oofegGraphicContext &gc, TimeStep *tStep)
Shows the sparse structure of required matrix, type == 1 stiffness.
FloatArray velocityVector
int giveNumberOfTimeStepWhenIcApply()
Returns the time step number, when initial conditions should apply.
virtual NumericalMethod * giveNumericalMethod(MetaStep *mStep)
Returns reference to receiver's numerical method.
FloatArray previousVelocityVector
void zero()
Zeroes all coefficients of receiver.
Class implementing single timer, providing wall clock and user time capabilities. ...
void assemble(SparseMtrx &answer, TimeStep *tStep, const MatrixAssembler &ma, const UnknownNumberingScheme &, Domain *domain)
Assembles characteristic matrix of required type into given sparse matrix.
int giveRank() const
Returns domain rank in a group of collaborating processes (0..groupSize-1)
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)
void proceedStep(int di, TimeStep *tStep)
FloatArray previousTotalDisplacement
LoadBalancer * lb
Load Balancer.
Element in active domain is only mirror of some remote element.
#define _IFT_NonLinearDynamic_nonlocalext
virtual ErrorEstimator * giveDomainErrorEstimator(int n)
Service for accessing ErrorEstimator corresponding to particular domain.
OutputManager * giveOutputManager()
Returns domain output manager.
This class implements extension of EngngModel for structural models.
FloatArray internalForcesEBENorm
Norm of nodal internal forces evaluated on element by element basis (squared)
The Communicator and corresponding buffers (represented by this class) are separated in order to allo...
std::vector< std::unique_ptr< Element > > & giveElements()
Two-point Backward Euler method.
virtual void setDomain(Domain *d)
sets associated Domain
virtual void updateYourself(TimeStep *tStep)
Updates internal state after finishing time step.
Abstract base class representing the "problem" under consideration.
virtual void setDomain(Domain *d)
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode)
Stores the state of model to output stream.
FloatArray previousInternalForces
void determineConstants(TimeStep *tStep)
virtual TimeStep * giveCurrentStep(bool force=false)
Returns current time step.
virtual void solveYourselfAt(TimeStep *tStep)
Solves problem for given time step.
virtual void updateDomainLinks()
Updates domain links after the domains of receiver have changed.
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode)
Restores the state of model from output stream.
the oofem namespace is to define a context or scope in which all oofem names are defined.
#define _IFT_NonLinearDynamic_deltat
Domain * giveDomain(int n)
Service for accessing particular problem domain.
problemScale pScale
Multiscale mode.
Abstract class Dof represents Degree Of Freedom in finite element mesh.
DofManager * giveDofManager(int n)
Service for accessing particular domain dof manager.
double deltaT
Intrinsic time increment.
void doDofManOutput(FILE *, TimeStep *)
Does the dofmanager output.
virtual double giveUnknownComponent(ValueModeType type, TimeStep *tStep, Domain *d, Dof *dof)
Returns requested unknown.
#define _IFT_NonLinearDynamic_beta
Three-point Backward Euler method.
Callback class for assembling effective tangents composed of stiffness and mass matrix.
int giveNumberOfRows() const
Returns number of rows of receiver.
double getUtime()
Returns total user time elapsed in seconds.
#define OOFEM_WARNING(...)
void assembleVector(FloatArray &answer, TimeStep *tStep, const VectorAssembler &va, ValueModeType mode, const UnknownNumberingScheme &s, Domain *domain, FloatArray *eNorms=NULL)
Assembles characteristic vector of required type from dofManagers, element, and active boundary condi...
Class representing solution step.
DofManager is shared by neighboring partitions, it is necessary to sum contributions from all contrib...
void add(const FloatArray &src)
Adds array src to receiver.
virtual LoadBalancerMonitor * giveLoadBalancerMonitor()
Returns reference to receiver's load balancer monitor.
Abstract base class representing general load balancer monitor.
virtual void printDofOutputAt(FILE *stream, Dof *iDof, TimeStep *tStep)
DOF printing routine.
virtual void solveYourself()
Starts solution process.
#define REGISTER_EngngModel(class)
void resize(int s)
Resizes receiver towards requested size.