60#ifdef __MPI_PARALLEL_MODE
80NonLinearDynamic :: ~NonLinearDynamic()
87 if ( mStep == NULL ) {
102NonLinearDynamic :: updateAttributes(
MetaStep *mStep)
106 StructuralEngngModel :: updateAttributes(mStep);
125 StructuralEngngModel :: initializeFrom(ir);
165#ifdef __MPI_PARALLEL_MODE
181double NonLinearDynamic :: giveUnknownComponent(ValueModeType mode,
TimeStep *tStep,
Domain *d,
Dof *dof)
204 case VM_Acceleration:
208 OOFEM_ERROR(
"Unknown is of undefined ValueModeType for this problem");
218 double deltaTtmp =
deltaT;
219 double totalTime =
deltaT;
228 totalTime =
currentStep->giveTargetTime() + deltaTtmp;
230 counter =
currentStep->giveSolutionStateCounter() + 1;
234 if ( !this->
giveMetaStep(mStepNum)->isStepValid(istep) ) {
243 currentStep = std::make_unique<TimeStep>(istep,
this, mStepNum, totalTime, deltaTtmp, counter, td);
249void NonLinearDynamic :: solveYourself()
252 #ifdef __VERBOSE_PARALLEL
264 StructuralEngngModel :: solveYourself();
269NonLinearDynamic :: solveYourselfAt(
TimeStep *tStep)
272 #ifdef __VERBOSE_PARALLEL
292NonLinearDynamic :: initializeYourself(
TimeStep *tStep)
325 for (
Dof *dof: *node ) {
328 if ( !dof->isPrimaryDof() ) {
332 int jj = dof->__giveEquationNumber();
345NonLinearDynamic :: proceedStep(
int di,
TimeStep *tStep)
372 OOFEM_ERROR(
"effectiveStiffnessMatrix does not support asymmetric storage");
417 for (
int i = 1; i <= neq; i++ ) {
435 for (
int i = 1; i <= neq; i++ ) {
460 double loadLevel = 1.0;
478 for (
int i = 1; i <= neq; i++ ) {
488NonLinearDynamic :: determineConstants(
TimeStep *tStep)
513 a3 = 1. / ( 2. *
beta ) - 1.;
537void NonLinearDynamic :: updateYourself(
TimeStep *tStep)
547 StructuralEngngModel :: updateYourself(tStep);
705NonLinearDynamic :: printOutputAt(FILE *file,
TimeStep *tStep)
707 if ( !this->
giveDomain(1)->giveOutputManager()->testTimeStepOutput(tStep) ) {
711 fprintf(file,
"\n\nOutput for time %.3e, solution step number %d\n", tStep->
giveTargetTime(), tStep->
giveNumber() );
716 this->
giveDomain(1)->giveOutputManager()->doDofManOutput(file, tStep);
717 this->
giveDomain(1)->giveOutputManager()->doElementOutput(file, tStep);
722NonLinearDynamic :: printDofOutputAt(FILE *stream,
Dof *iDof,
TimeStep *tStep)
724 static char dofchar[] =
"dva";
725 static ValueModeType dofmodes[] = {
726 VM_Total, VM_Velocity, VM_Acceleration
736 EngngModel :: saveContext(stream, mode);
760 EngngModel :: restoreContext(stream, mode);
781NonLinearDynamic :: updateDomainLinks()
783 EngngModel :: updateDomainLinks();
786#ifdef __MPI_PARALLEL_MODE
804 EngngModel :: assemble(answer, tStep, ma, s, domain);
818 OOFEM_LOG_DEBUG(
"NonLinearDynamic info: user time consumed by assembly: %.2fs\n",
timer.getUtime() );
833 ctype = TangentStiffnessMatrix;
836 elem->showSparseMtrxStructure(ctype,
gc, tStep);
840 elem->showExtendedSparseMtrxStructure(ctype,
gc, tStep);
858 for (
int i = 1; i <= nelem; i++ ) {
888 for (
int j = 1; j <= n; j++ ) {
891 for (
int k = 1; k <= n; k++ ) {
894 answer.
at(jj) += charMtrx.
at(j, k) * vec.
at(kk);
909 int count = 0, pcount = 0;
912 if ( packUnpackType == 0 ) {
913 for (
int map: commMap ) {
915 for (
Dof *dof: *dman ) {
916 if ( dof->isPrimaryDof() && ( dof->__giveEquationNumber() ) ) {
925 }
else if ( packUnpackType == 1 ) {
926 for (
int map: commMap ) {
937#ifdef __MPI_PARALLEL_MODE
939NonLinearDynamic :: giveLoadBalancer()
955NonLinearDynamic :: giveLoadBalancerMonitor()
971NonLinearDynamic :: packMigratingData(
TimeStep *tStep)
976 for (
int idofman = 1; idofman <= ndofman; idofman++ ) {
978 for (
Dof *_dof: *_dm ) {
979 if ( _dof->isPrimaryDof() ) {
980 if ( ( _eq = _dof->__giveEquationNumber() ) ) {
990NonLinearDynamic :: unpackMigratingData(
TimeStep *tStep)
1001 for (
int idofman = 1; idofman <= ndofman; idofman++ ) {
1003 for (
Dof *_dof: *_dm ) {
1004 if ( _dof->isPrimaryDof() ) {
1005 if ( ( _eq = _dof->__giveEquationNumber() ) ) {
1007 totalDisplacement.at(_eq) = _dof->giveUnknownsDictionaryValue( tStep, VM_Total );
1011 fprintf(stderr,
"[%d] Shared: %d(%d) -> %d\n", myrank, idofman, idof, _eq);
1013 fprintf(stderr,
"[%d] Local : %d(%d) -> %d\n", myrank, idofman, idof, _eq);
#define REGISTER_EngngModel(class)
virtual int givePackSizeOfDouble(std::size_t count)=0
dofManagerParallelMode giveParallelMode() const
virtual void printMultipleOutputAt(FILE *File, TimeStep *tStep, char *ch, ValueModeType *mode, int nite)
virtual int __giveEquationNumber() const =0
int giveNumber()
Returns domain number.
int giveNumberOfElements() const
Returns number of elements in domain.
std ::vector< std ::unique_ptr< DofManager > > & giveDofManagers()
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
DofManager * giveDofManager(int n)
Element * giveElement(int n)
std ::vector< std ::unique_ptr< Element > > & giveElements()
virtual bool giveRotationMatrix(FloatMatrix &answer)
virtual void giveCharacteristicMatrix(FloatMatrix &answer, CharType type, TimeStep *tStep)
void giveLocationArray(IntArray &locationArray, const UnknownNumberingScheme &s, IntArray *dofIds=NULL) const
int estimatePackSize(DataStream &buff)
elementParallelMode giveParallelMode() const
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.
std ::unique_ptr< TimeStep > previousStep
Previous time step.
MetaStep * giveCurrentMetaStep()
Returns current meta step.
int ndomains
Number of receiver domains.
ProblemCommunicator * nonlocCommunicator
NonLocal Communicator. Necessary when nonlocal constitutive models are used.
Domain * giveDomain(int n)
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.
EngngModelTimer timer
E-model timer.
int nMetaSteps
Number of meta steps.
CommunicatorBuff * commBuff
Common Communicator buffer.
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 rotatedWith(const FloatMatrix &r, char mode='n')
bool isNotEmpty() const
Tests for empty matrix.
int giveNumberOfRows() const
Returns number of rows of receiver.
double at(std::size_t i, std::size_t j) const
TimeDiscretizationType initialTimeDiscretization
FloatArray velocityVector
FloatArray accelerationVector
void updateInternalRHS(FloatArray &answer, TimeStep *tStep, Domain *d, FloatArray *eNorm) override
FloatArray incrementOfDisplacement
FloatArray previousAccelerationVector
FloatArray previousTotalDisplacement
void determineConstants(TimeStep *tStep)
FloatArray totalDisplacement
int nonlocalStiffnessFlag
LinSystSolverType solverType
void proceedStep(int di, TimeStep *tStep)
FloatArray previousIncrementOfDisplacement
double deltaT
Intrinsic time increment.
NumericalMethod * giveNumericalMethod(MetaStep *mStep) override
Returns reference to receiver's numerical method.
std ::unique_ptr< SparseMtrx > effectiveStiffnessMatrix
LoadBalancer * giveLoadBalancer() override
std ::unique_ptr< SparseMtrx > massMatrix
FloatArray previousVelocityVector
std ::unique_ptr< SparseNonLinearSystemNM > nMethod
Numerical method used to solve the problem.
FloatArray internalForces
FloatArray previousInternalForces
SparseMtrxType sparseMtrxType
void timesMtrx(FloatArray &answer, FloatArray &vec, CharType type, Domain *domain, TimeStep *tStep)
virtual void add(double x, SparseMtrx &m)
virtual void zero()=0
Zeroes the receiver.
virtual void times(const FloatArray &x, FloatArray &answer) const
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)
StructuralEngngModel(int i, EngngModel *master=nullptr)
Creates new StructuralEngngModel with number i, associated to domain d.
void updateInternalRHS(FloatArray &answer, TimeStep *tStep, Domain *d, FloatArray *eNorm) override
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.
TimeDiscretizationType giveTimeDiscretization()
Returns time discretization.
int giveNumber()
Returns receiver's number.
#define _IFT_EngngModel_lstype
#define _IFT_EngngModel_smtype
#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.
long StateCounterType
StateCounterType type used to indicate solution state.
FloatArrayF< N > max(const FloatArrayF< N > &a, const FloatArrayF< N > &b)
@ SMT_CompCol
Compressed column.
ClassFactory & classFactory
TimeDiscretizationType
Time discretization used by transient solvers.
@ TD_TwoPointBackward
Two-point Backward Euler method.
@ TD_Newmark
Newmark-beta method.
@ TD_ThreePointBackward
Three-point Backward Euler method.
#define _IFT_NonLinearDynamic_deltat
#define _IFT_NonLinearDynamic_ddtScheme
#define _IFT_NonLinearDynamic_delta
#define _IFT_NonLinearDynamic_eta
#define _IFT_NonLinearDynamic_nonlocalext
#define _IFT_NonLinearDynamic_gamma
#define _IFT_NonLinearDynamic_nonlocstiff
#define _IFT_NonLinearDynamic_beta
#define _IFT_NRSolver_manrmsteps
oofem::oofegGraphicContext gc[OOFEG_LAST_LAYER]