35 #include "../sm/EngineeringModels/nldeidynamic.h" 49 #ifdef __PARALLEL_MODE 55 #define ZERO_REL_MASS 1.E-6 60 previousIncrementOfDisplacementVector(), displacementVector(),
61 velocityVector(), accelerationVector(), internalForces(),
103 #ifdef __PARALLEL_MODE 146 case VM_Acceleration:
150 OOFEM_ERROR(
"Unknown is of undefined type for this problem");
159 double totalTime = 0;
165 counter =
currentStep->giveSolutionStateCounter() + 1;
179 #ifdef __VERBOSE_PARALLEL 204 double coeff, maxDt, maxOm = 0.;
205 double prevIncrOfDisplacement, incrOfDisplacement;
224 #ifdef __PARALLEL_MODE 227 double my_pMp = 0.0, coeff = 1.0;
231 for (
int dm = 1; dm <= ndofman; dm++ ) {
244 for (
Dof *dof: *dman ) {
245 if ( dof->isPrimaryDof() && ( eqNum = dof->__giveEquationNumber() ) ) {
252 MPI_Allreduce(& my_pMp, &
pMp, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
255 for ( i = 1; i <= neq; i++ ) {
285 for ( j = 1; j <= nman; j++ ) {
288 for (
Dof *dof: *node ) {
292 if ( !dof->isPrimaryDof() ) {
296 jj = dof->__giveEquationNumber();
310 maxDt = 2.0 / sqrt(maxOm);
318 for ( j = 1; j <= neq; j++ ) {
354 #ifdef __PARALLEL_MODE 355 double my_pt = 0.0, coeff = 1.0;
359 for (
int dm = 1; dm <= ndofman; dm++ ) {
371 for (
Dof *dof: *dman ) {
372 if ( dof->isPrimaryDof() && ( eqNum = dof->__giveEquationNumber() ) ) {
379 MPI_Allreduce(& my_pt, &
pt, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
381 for ( k = 1; k <= neq; k++ ) {
394 for ( k = 1; k <= neq; k++ ) {
401 #ifdef __PARALLEL_MODE 404 for (
int dm = 1; dm <= ndofman; dm++ ) {
416 for (
Dof *dof: *dman ) {
417 if ( dof->isPrimaryDof() && ( eqNum = dof->__giveEquationNumber() ) ) {
424 MPI_Allreduce(& my_err, & err, 1, MPI_DOUBLE, MPI_SUM, MPI_COMM_WORLD);
427 for ( k = 1; k <= neq; k++ ) {
436 for ( j = 1; j <= neq; j++ ) {
463 for ( i = 1; i <= neq; i++ ) {
469 velocityVector.
at(i) = ( incrOfDisplacement + prevIncrOfDisplacement ) / ( 2. * deltaT );
512 double maxOmi, maxOmEl;
518 #ifndef LOCAL_ZERO_MASS_REPLACEMENT 525 for ( i = 1; i <= nelem; i++ ) {
544 #ifdef LOCAL_ZERO_MASS_REPLACEMENT 562 #ifdef LOCAL_ZERO_MASS_REPLACEMENT 565 double maxElmass = -1.0;
566 for ( j = 1; j <= n; j++ ) {
567 maxElmass =
max( maxElmass, charMtrx.
at(j, j) );
570 if ( maxElmass <= 0.0 ) {
571 OOFEM_WARNING(
"Element (%d) with zero (or negative) lumped mass encountered\n", i);
577 for ( j = 1; j <= n; j++ ) {
579 maxOmi = charMtrx2.
at(j, j) / charMtrx.
at(j, j);
580 maxOmEl = ( maxOmEl > maxOmi ) ? ( maxOmEl ) : ( maxOmi );
584 maxOm = ( maxOm > maxOmEl ) ? ( maxOm ) : ( maxOmEl );
586 for ( j = 1; j <= n; j++ ) {
589 charMtrx.
at(j, j) = charMtrx2.
at(j, j) / maxOmEl;
596 for ( j = 1; j <= n; j++ ) {
599 massMatrix.
at(jj) += charMtrx.
at(j, j);
604 #ifndef LOCAL_ZERO_MASS_REPLACEMENT 608 for ( i = 1; i <= nelem; i++ ) {
620 for ( j = 1; j <= n; j++ ) {
623 diagonalStiffMtrx.
at(jj) += charMtrx.
at(j, j);
629 double maxElmass = -1.0;
630 for ( j = 1; j <= n; j++ ) {
631 maxElmass =
max( maxElmass, charMtrx.
at(j, j) );
634 if ( maxElmass <= 0.0 ) {
635 OOFEM_ERROR(
"Element with zero (or negative) lumped mass encountered");
638 for ( j = 1; j <= neq; j++ ) {
640 maxOmi = diagonalStiffMtrx.
at(j) / massMatrix.
at(j);
641 maxOm = ( maxOm > maxOmi ) ? ( maxOm ) : ( maxOmi );
646 for ( i = 1; i <= neq; i++ ) {
648 massMatrix.
at(i) = diagonalStiffMtrx.
at(i) / maxOm;
655 #ifdef __PARALLEL_MODE 660 #ifdef __VERBOSE_PARALLEL 664 int result = MPI_Allreduce(& maxOm, & globalMaxOm, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
666 #ifdef __VERBOSE_PARALLEL 670 if ( result != MPI_SUCCESS ) {
676 WARNING: NOT SUPPORTED MESSAGE PARSING LIBRARY
685 int count = 0, pcount = 0;
688 if ( packUnpackType == 0 ) {
689 for (
int inod: commMap ) {
691 for (
Dof *dof: *dman ) {
692 if ( dof->isPrimaryDof() && ( dof->__giveEquationNumber() ) ) {
701 }
else if ( packUnpackType == 1 ) {
702 for (
int inod: commMap ) {
779 static char dofchar[] =
"dva";
781 VM_Total, VM_Velocity, VM_Acceleration
791 if ( !this->
giveDomain(1)->giveOutputManager()->testTimeStepOutput(tStep) ) {
795 fprintf(file,
"\n\nOutput for time %.3e, solution step number %d\n", tStep->
giveTargetTime(), tStep->
giveNumber() );
797 fprintf(file,
"Reached load level : %e\n\n", this->
pt);
#define _IFT_NlDEIDynamic_deltat
FloatArray loadRefVector
Reference load vector.
The representation of EngngModel default unknown numbering.
void computeMassMtrx(FloatArray &mass, double &maxOm, TimeStep *tStep)
Assembles the diagonal mass matrix of receiver.
void subtract(const FloatArray &src)
Subtracts array src to receiver.
virtual void solveYourself()
Starts solution process.
virtual void printOutputAt(FILE *file, TimeStep *tStep)
Prints output of receiver to output domain stream, for given time step.
FloatArray internalForces
Vector of real nodal forces.
virtual void updateYourself(TimeStep *tStep)
Updates internal state after finishing time step.
DofManager in active domain is shared only by remote elements (these are only introduced for nonlocal...
virtual void solveYourselfAt(TimeStep *tStep)
Solves problem for given time step.
std::unique_ptr< TimeStep > currentStep
Current time step.
virtual NumericalMethod * giveNumericalMethod(MetaStep *mStep)
Returns reference to receiver's numerical method.
virtual int giveNumberOfDomainEquations(int di, const UnknownNumberingScheme &num)
Returns number of equations for given domain in active (current time step) time step.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description in input reader.
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
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.
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 void printDofOutputAt(FILE *stream, Dof *iDof, TimeStep *tStep)
DOF printing routine.
This base class is an abstraction for numerical algorithm.
double giveTargetTime()
Returns target time.
bool isParallel() const
Returns true if receiver in parallel mode.
void incrementStateCounter()
Updates solution state counter.
void setTimeIncrement(double newDt)
Sets solution step time increment.
Abstract base class for all finite elements.
double c
Parameter determining rate of the loading process.
Base class for dof managers.
int giveNumberOfProcesses() const
Returns the number of collaborating processes.
virtual void solveYourself()
Starts solution process.
virtual int __giveEquationNumber() const =0
Returns equation number of receiver, usually assigned by emodel.
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).
REGISTER_EngngModel(ProblemSequence)
#define OOFEM_LOG_DEBUG(...)
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
virtual int read(int *data, int count)=0
Reads count integer values into array pointed by data.
#define _IFT_NlDEIDynamic_drflag
int givePartitionsConnectivitySize()
Returns number of partitions sharing given receiver (=number of shared partitions + local one)...
virtual void giveInternalForces(FloatArray &answer, bool normFlag, int di, TimeStep *tStep)
Evaluates the nodal representation of internal forces by assembling contributions from individual ele...
void printReactionForces(TimeStep *tStep, int id, FILE *out)
Computes and prints reaction forces, computed from nodal internal forces.
dofManagerParallelMode
In parallel mode, this type indicates the mode of DofManager.
#define OOFEM_LOG_RELEVANT(...)
FloatArray previousIncrementOfDisplacementVector
Vector storing displacement increments.
bool isTheFirstStep()
Check if receiver is first step.
virtual int write(const int *data, int count)=0
Writes count integer values from array pointed by data.
#define _IFT_NlDEIDynamic_py
bool isNotEmpty() const
Tests for empty matrix.
#define _IFT_NlDEIDynamic_dumpcoef
LinSystSolverType solverType
ProblemCommunicator * nonlocCommunicator
NonLocal Communicator. Necessary when nonlocal constitutive models are used.
int giveNumber()
Returns receiver's number.
#define OOFEM_LOG_INFO(...)
double pyEstimate
Estimate of loadRefVector^T*displacementVector(Tau).
Element * giveElement(int n)
Service for accessing particular domain fe element.
void doElementOutput(FILE *, TimeStep *)
Does the element output.
int ndomains
Number of receiver domains.
int updateSharedDofManagers(FloatArray &answer, const UnknownNumberingScheme &s, int ExchangeTag)
Exchanges necessary remote DofManagers data.
Implementation for assembling external forces vectors in standard monolithic FE-problems.
#define VERBOSEPARALLEL_PRINT(service, str, rank)
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...
void rotatedWith(const FloatMatrix &r, char mode= 'n')
Returns the receiver 'a' transformed using give transformation matrix r.
contextIOResultType restoreYourself(DataStream &stream)
#define _IFT_NlDEIDynamic_tau
ProblemCommunicator * communicator
Communicator.
FloatArray displacementVector
Displacement, velocity and acceleration vectors.
virtual bool giveRotationMatrix(FloatMatrix &answer)
Transformation matrices updates rotation matrix between element-local and primary DOFs...
CommunicatorBuff * commBuff
Common Communicator buffer.
SparseLinearSystemNM * nMethod
double at(int i, int j) const
Coefficient access function.
void computeLoadVector(FloatArray &answer, ValueModeType mode, TimeStep *tStep)
Assembles the load vector.
virtual IRResultType initializeFrom(InputRecord *ir)
Initializes receiver according to object description in input reader.
virtual void updateYourself(TimeStep *tStep)
Updates internal state after finishing time step.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode)
Stores the state of model to output stream.
virtual double giveUnknownComponent(ValueModeType type, TimeStep *tStep, Domain *d, Dof *dof)
Returns requested unknown.
Initializes the variable VERBOSE, in order to get a few intermediate messages on screen: beginning an...
FloatArray accelerationVector
Class representing vector of real numbers.
int estimatePackSize(DataStream &buff)
Estimates the necessary pack size to hold all packed data of receiver.
SparseLinearSystemNM * createSparseLinSolver(LinSystSolverType st, Domain *d, EngngModel *m)
Creates new instance of SparseLinearSystemNM corresponding to given type.
elementParallelMode giveParallelMode() const
Return elementParallelMode of receiver.
Implementation of matrix containing floating point numbers.
IRResultType
Type defining the return values of InputRecord reading operations.
virtual int givePackSizeOfDouble(int count)=0
virtual contextIOResultType restoreContext(DataStream &stream, ContextMode mode)
Restores the state of model from output stream.
double Tau
End of time interval.
FloatArray velocityVector
void zero()
Zeroes all coefficients of receiver.
virtual int estimateMaxPackSize(IntArray &commMap, DataStream &buff, int packUnpackType)
Determines the space necessary for send/receive buffer.
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.
Element in active domain is only mirror of some remote element.
FloatArray massMatrix
Mass matrix.
double dumpingCoef
Dumping coefficient (C = dumpingCoef * MassMtrx).
OutputManager * giveOutputManager()
Returns domain output manager.
This class implements extension of EngngModel for structural models.
The Communicator and corresponding buffers (represented by this class) are separated in order to allo...
NlDEIDynamic(int i, EngngModel *_master=NULL)
Abstract base class representing the "problem" under consideration.
DofManager in active domain is only mirror of some remote DofManager.
int initFlag
Flag indicating the need for initialization.
virtual TimeStep * giveCurrentStep(bool force=false)
Returns current time step.
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.
FloatArray loadVector
Load vector.
Domain * giveDomain(int n)
Service for accessing particular problem domain.
Abstract class Dof represents Degree Of Freedom in finite element mesh.
DofManager * giveDofManager(int n)
Service for accessing particular domain dof manager.
void doDofManOutput(FILE *, TimeStep *)
Does the dofmanager output.
#define _IFT_NlDEIDynamic_nonlocalext
int giveNumberOfRows() const
Returns number of rows of receiver.
#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.
virtual contextIOResultType saveContext(DataStream &stream, ContextMode mode)
Stores the state of model to output stream.
int drFlag
Flag indicating whether dynamic relaxation takes place.
DofManager is shared by neighboring partitions, it is necessary to sum contributions from all contrib...
dofManagerParallelMode giveParallelMode() const
Return dofManagerParallelMode of receiver.
double pMp
Product of p^tM^(-1)p; where p is reference load vector.
void add(const FloatArray &src)
Adds array src to receiver.
virtual TimeStep * giveNextStep()
Returns next time step (next to current step) of receiver.
void resize(int s)
Resizes receiver towards requested size.