49#ifdef __MPI_PARALLEL_MODE
55#define ZERO_REL_MASS 1.E-6
68NlDEIDynamic :: ~NlDEIDynamic()
84 StructuralEngngModel :: initializeFrom(ir);
99#ifdef __MPI_PARALLEL_MODE
114double NlDEIDynamic :: giveUnknownComponent(ValueModeType mode,
TimeStep *tStep,
Domain *d,
Dof *dof)
139 case VM_Acceleration:
143 OOFEM_ERROR(
"Unknown is of undefined type for this problem");
153 double totalTime = 0;
159 counter =
currentStep->giveSolutionStateCounter() + 1;
163 currentStep = std::make_unique<TimeStep>(istep,
this, 1, totalTime,
deltaT, counter);
169void NlDEIDynamic :: solveYourself()
172 #ifdef __VERBOSE_PARALLEL
181 StructuralEngngModel :: solveYourself();
184void NlDEIDynamic :: solveYourselfAt(
TimeStep *tStep)
211#ifdef __MPI_PARALLEL_MODE
223 coeff = 1. / dman->givePartitionsConnectivitySize();
227 for (
auto &dof: *dman ) {
229 if ( dof->isPrimaryDof() && ( eqNum = dof->__giveEquationNumber() ) ) {
236 MPI_Allreduce(& my_pMp, &
pMp, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
239 for (
int i = 1; i <= neq; i++ ) {
270 for (
Dof *dof: *node ) {
274 if ( !dof->isPrimaryDof() ) {
278 int jj = dof->__giveEquationNumber();
294 double newDeltaT = 0;
300 this->
giveMetaStep(1)->setNumberOfSteps(newNumberOfSteps);
308 for (
int j = 1; j <= neq; j++ ) {
344#ifdef __MPI_PARALLEL_MODE
353 coeff = 1. / dman->givePartitionsConnectivitySize();
357 for (
auto &dof: *dman ) {
359 if ( dof->isPrimaryDof() && ( eqNum = dof->__giveEquationNumber() ) ) {
366 MPI_Allreduce(& my_pt, &
pt, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
368 for (
int k = 1; k <= neq; k++ ) {
381 for (
int k = 1; k <= neq; k++ ) {
388#ifdef __MPI_PARALLEL_MODE
392 auto dofmanmode = dman->giveParallelMode();
398 coeff = 1. / dman->givePartitionsConnectivitySize();
402 for (
auto &dof: *dman ) {
404 if ( dof->isPrimaryDof() && ( eqNum = dof->__giveEquationNumber() ) ) {
411 MPI_Allreduce(& my_err, & err, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
414 for (
int k = 1; k <= neq; k++ ) {
423 for (
int j = 1; j <= neq; j++ ) {
449 for (
int i = 1; i <= neq; i++ ) {
451 double incrOfDisplacement =
loadVector.at(i) /
461void NlDEIDynamic :: updateYourself(
TimeStep *tStep)
468 StructuralEngngModel :: updateYourself(tStep);
501#ifndef LOCAL_ZERO_MASS_REPLACEMENT
508 for (
int i = 1; i <= nelem; i++ ) {
527#ifdef LOCAL_ZERO_MASS_REPLACEMENT
545#ifdef LOCAL_ZERO_MASS_REPLACEMENT
547 double maxElmass = -1.0;
548 for (
int j = 1; j <= n; j++ ) {
549 maxElmass =
max( maxElmass, charMtrx.
at(j, j) );
552 if ( maxElmass <= 0.0 ) {
553 OOFEM_WARNING(
"Element (%d) with zero (or negative) lumped mass encountered\n", i);
560 for (
int j = 1; j <= n; j++ ) {
562 double maxOmi = charMtrx2.
at(j, j) / charMtrx.
at(j, j);
563 maxOmEl = ( maxOmEl > maxOmi ) ? ( maxOmEl ) : ( maxOmi );
567 maxOm = ( maxOm > maxOmEl ) ? ( maxOm ) : ( maxOmEl );
569 for (
int j = 1; j <= n; j++ ) {
572 charMtrx.
at(j, j) = charMtrx2.
at(j, j) / maxOmEl;
579 for (
int j = 1; j <= n; j++ ) {
587#ifndef LOCAL_ZERO_MASS_REPLACEMENT
592 element->giveLocationArray(loc, en);
593 element->giveCharacteristicMatrix(charMtrx, TangentStiffnessMatrix, tStep);
596 if ( element->giveRotationMatrix(R) ) {
602 for (
int j = 1; j <= n; j++ ) {
605 diagonalStiffMtrx.
at(jj) += charMtrx.
at(j, j);
611 double maxElmass = -1.0;
612 for (
int j = 1; j <= n; j++ ) {
613 maxElmass =
max( maxElmass, charMtrx.
at(j, j) );
616 if ( maxElmass <= 0.0 ) {
617 OOFEM_ERROR(
"Element with zero (or negative) lumped mass encountered");
620 for (
int j = 1; j <= neq; j++ ) {
622 double maxOmi = diagonalStiffMtrx.
at(j) /
massMatrix.at(j);
623 maxOm = ( maxOm > maxOmi ) ? ( maxOm ) : ( maxOmi );
628 for (
int i = 1; i <= neq; i++ ) {
637#ifdef __MPI_PARALLEL_MODE
642 #ifdef __VERBOSE_PARALLEL
646 int result = MPI_Allreduce(& maxOm, & globalMaxOm, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
648 #ifdef __VERBOSE_PARALLEL
652 if ( result != MPI_SUCCESS ) {
658WARNING: NOT SUPPORTED MESSAGE PARSING LIBRARY
667 int count = 0, pcount = 0;
670 if ( packUnpackType == 0 ) {
671 for (
int inod: commMap ) {
673 for (
Dof *dof: *dman ) {
674 if ( dof->isPrimaryDof() && ( dof->__giveEquationNumber() ) ) {
683 }
else if ( packUnpackType == 1 ) {
684 for (
int inod: commMap ) {
698 StructuralEngngModel :: saveContext(stream, mode);
726 StructuralEngngModel :: restoreContext(stream, mode);
751NlDEIDynamic :: printDofOutputAt(FILE *stream,
Dof *iDof,
TimeStep *tStep)
753 static char dofchar[] =
"dva";
754 static ValueModeType dofmodes[] = {
755 VM_Total, VM_Velocity, VM_Acceleration
763NlDEIDynamic :: printOutputAt(FILE *file,
TimeStep *tStep)
765 if ( !this->
giveDomain(1)->giveOutputManager()->testTimeStepOutput(tStep) ) {
769 fprintf(file,
"\n\nOutput for time %.3e, solution step number %d\n", tStep->
giveTargetTime(), tStep->
giveNumber() );
771 fprintf(file,
"Reached load level : %e\n\n", this->
pt);
774 this->
giveDomain(1)->giveOutputManager()->doDofManOutput(file, tStep);
775 this->
giveDomain(1)->giveOutputManager()->doElementOutput(file, tStep);
#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.
virtual void printMultipleOutputAt(FILE *File, TimeStep *tStep, char *ch, ValueModeType *mode, int nite)
virtual int __giveEquationNumber() const =0
int giveNumberOfElements() const
Returns number of elements in domain.
std ::vector< std ::unique_ptr< DofManager > > & giveDofManagers()
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
void initializeCommMaps(bool forceInit=false)
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.
int ndomains
Number of receiver domains.
ProblemCommunicator * nonlocCommunicator
NonLocal Communicator. Necessary when nonlocal constitutive models are used.
int numberOfSteps
Total number of time steps.
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...
MetaStep * giveMetaStep(int i)
Returns the i-th meta step.
CommunicatorBuff * commBuff
Common Communicator buffer.
bool isParallel() const
Returns true if receiver in parallel mode.
int updateSharedDofManagers(FloatArray &answer, const UnknownNumberingScheme &s, int ExchangeTag)
void assembleVector(FloatArray &answer, TimeStep *tStep, const VectorAssembler &va, ValueModeType mode, const UnknownNumberingScheme &s, Domain *domain, FloatArray *eNorms=NULL)
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
FloatArray internalForces
Vector of real nodal forces.
FloatArray massMatrix
Mass matrix.
double pMp
Product of p^tM^(-1)p; where p is reference load vector.
FloatArray accelerationVector
double dumpingCoef
Dumping coefficient (C = dumpingCoef * MassMtrx).
double reductionFactor
Optional reduction factor for time step deltaT.
FloatArray loadRefVector
Reference load vector.
FloatArray velocityVector
void computeMassMtrx(FloatArray &mass, double &maxOm, TimeStep *tStep)
double Tau
End of time interval.
FloatArray loadVector
Load vector.
double pyEstimate
Estimate of loadRefVector^T*displacementVector(Tau).
LinSystSolverType solverType
FloatArray previousIncrementOfDisplacementVector
Vector storing displacement increments.
FloatArray displacementVector
Displacement, velocity and acceleration vectors.
std::unique_ptr< SparseLinearSystemNM > nMethod
int initFlag
Flag indicating the need for initialization.
double c
Parameter determining rate of the loading process.
void computeLoadVector(FloatArray &answer, ValueModeType mode, TimeStep *tStep)
int drFlag
Flag indicating whether dynamic relaxation takes place.
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
void incrementStateCounter()
Updates solution state counter.
double giveTargetTime()
Returns target time.
void setTimeIncrement(double newDt)
Sets solution step time increment.
int giveNumber()
Returns receiver's number.
#define OOFEM_WARNING(...)
#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.
long StateCounterType
StateCounterType type used to indicate solution state.
FloatArrayF< N > max(const FloatArrayF< N > &a, const FloatArrayF< N > &b)
dofManagerParallelMode
In parallel mode, this type indicates the mode of DofManager.
ClassFactory & classFactory
@ CIO_IOERR
General IO error.
#define _IFT_NlDEIDynamic_reduct
#define _IFT_NlDEIDynamic_dumpcoef
#define _IFT_NlDEIDynamic_deltat
#define _IFT_NlDEIDynamic_nonlocalext
#define _IFT_NlDEIDynamic_tau
#define _IFT_NlDEIDynamic_py
#define _IFT_NlDEIDynamic_drflag
#define VERBOSEPARALLEL_PRINT(service, str, rank)