KratosMultiphysics
KRATOS Multiphysics (Kratos) is a framework for building parallel, multi-disciplinary simulation software, aiming at modularity, extensibility, and high performance. Kratos is written in C++, and counts with an extensive Python interface.
time_discretization_process.hpp
Go to the documentation of this file.
1 //
2 // Project Name: KratosSolidMechanicsApplication $
3 // Created by: $Author: JMCarbonell $
4 // Last modified by: $Co-Author: $
5 // Date: $Date: September 2018 $
6 // Revision: $Revision: 0.0 $
7 //
8 //
9 
10 #if !defined(KRATOS_TIME_DISCRETIZATION_PROCESS_H_INCLUDED )
11 #define KRATOS_TIME_DISCRETIZATION_PROCESS_H_INCLUDED
12 
13 // System includes
14 
15 // External includes
16 
17 // Project includes
18 #include "includes/model_part.h"
19 #include "utilities/openmp_utils.h"
24 #include "processes/process.h"
25 
26 namespace Kratos
27 {
28 
31 
38 
39 typedef GlobalPointersVector<Node > NodeWeakPtrVectorType;
40 typedef GlobalPointersVector<Element> ElementWeakPtrVectorType;
41 typedef GlobalPointersVector<Condition> ConditionWeakPtrVectorType;
45 
49 
53 
55 
58  : public Process
59 {
60  public:
63 
66 
70 
73  : mrModelPart(rModelPart)
74  {
75  }
76 
79  Parameters rParameters) : Process(Flags()) , mrModelPart(rModelPart)
80  {
82 
83  Parameters default_parameters( R"(
84  {
85  "model_part_name":"MODEL_PART_NAME",
86  "start_time": 0,
87  "end_time": 1,
88  "time_step": 1,
89  "prediction_level": -1,
90  "increase_factor": 2,
91  "decrease_factor": 2,
92  "steps_update_delay": 4
93  } )" );
94 
95 
96  // Validate against defaults -- this ensures no type mismatch
97  rParameters.ValidateAndAssignDefaults(default_parameters);
98 
99  mTime.Initialize(rParameters["time_step"].GetDouble(), rParameters["start_time"].GetDouble(), rParameters["end_time"].GetDouble());
100 
101  mTime.SetFactors(rParameters["increase_factor"].GetDouble(), rParameters["decrease_factor"].GetDouble(), rParameters["steps_update_delay"]);
102 
103  mTime.PredictionLevel = rParameters["prediction_level"].GetInt();
104 
105  }
106 
109  {
110  }
111 
112  void operator()()
113  {
114  Execute();
115  }
116 
120 
121  void Execute() override
122  {
123 
124  KRATOS_TRY
125 
126  ProcessInfo& rCurrentProcessInfo = mrModelPart.GetProcessInfo();
127 
128  if(!rCurrentProcessInfo[CONVERGENCE_ACHIEVED])
129  {
130  this->ReduceTimeStep();
131  }
132  else{
133  this->UpdateTimeStep();
134  }
135 
136  rCurrentProcessInfo[TIME] += mTime.CurrentStep;
137  rCurrentProcessInfo[STEP] += 1;
138 
139  // it sets TIME and DELTA_TIME internally and Clones the SolutionStepData and ProcessInfo buffers
140  mrModelPart.CloneTimeStep(rCurrentProcessInfo[TIME]);
141 
142  // update total time
143  mTime.Total = rCurrentProcessInfo[TIME];
144 
145  KRATOS_CATCH("");
146  }
147 
148 
149  // Deprecated methods:
150 
151  // void PreExecute()
152  // {
153 
154  // KRATOS_TRY
155 
156  // const double initialTimeInterval = rCurrentProcessInfo[INITIAL_DELTA_TIME];
157  // const double currentTimeInterval = rCurrentProcessInfo[CURRENT_DELTA_TIME];
158 
159  // double updatedTime = rCurrentProcessInfo[TIME];
160  // double updatedTimeInterval = rCurrentProcessInfo[DELTA_TIME];
161 
162  // double deltaTimeToNewMilestone = initialTimeInterval;
163  // double minimumTimeInterval = initialTimeInterval*0.0001;
164 
165  // rCurrentProcessInfo.SetValue(PREVIOUS_DELTA_TIME,currentTimeInterval);
166  // rCurrentProcessInfo.SetValue(DELTA_TIME_CHANGED,false);
167 
168  // bool milestoneTimeReached=true;
169  // bool increaseTimeInterval=true;
170  // bool timeIntervalReduced=false;
171 
172  // double tolerance=0.0001;
173  // updatedTime -= initialTimeInterval;
174  // unsigned int previousMilestoneStep=updatedTime/initialTimeInterval;
175  // deltaTimeToNewMilestone=initialTimeInterval*(previousMilestoneStep+1)-updatedTime;
176 
177  // updatedTimeInterval =currentTimeInterval;
178 
179  // bool badVelocityConvergence=rCurrentProcessInfo[BAD_VELOCITY_CONVERGENCE];
180  // bool badPressureConvergence=rCurrentProcessInfo[BAD_PRESSURE_CONVERGENCE];
181 
182  // if(updatedTimeInterval<2.0*minimumTimeInterval && mEchoLevel > 0 && mrModelPart.GetCommunicator().MyPID() == 0){
183  // std::cout<<"ATTENTION! time step much smaller than initial time step, I'll not reduce it"<<std::endl;
184  // }
185 
186  // if((badPressureConvergence==true || badVelocityConvergence==true) && updatedTimeInterval>(2.0*minimumTimeInterval)){
187  // updatedTimeInterval *=0.5;
188  // /* std::cout<<"reducing time step (bad convergence at the previous step)"<<updatedTimeInterval<<std::endl; */
189  // rCurrentProcessInfo.SetValue(DELTA_TIME_CHANGED,true);
190  // timeIntervalReduced=true;
191  // }
192 
193  // if(deltaTimeToNewMilestone<(1.0+tolerance)*updatedTimeInterval && deltaTimeToNewMilestone>initialTimeInterval*tolerance){
194  // rCurrentProcessInfo.SetValue(DELTA_TIME,deltaTimeToNewMilestone);
195  // if(deltaTimeToNewMilestone<0.75*updatedTimeInterval){
196  // timeIntervalReduced=true;
197  // rCurrentProcessInfo.SetValue(DELTA_TIME_CHANGED,true);
198  // }
199  // updatedTimeInterval =deltaTimeToNewMilestone;
200  // milestoneTimeReached=true;
201  // }else{
202  // milestoneTimeReached=false;
203  // rCurrentProcessInfo.SetValue(DELTA_TIME,updatedTimeInterval);
204  // }
205 
206  // if(timeIntervalReduced==false){
207 
208  // if(updatedTimeInterval>(2.0*minimumTimeInterval)){
209 
210  // const unsigned int dimension = mrModelPart.ElementsBegin()->GetGeometry().WorkingSpaceDimension();
211  // if(dimension==2){
212  // CheckNodalConditionForTimeStepReduction(updatedTimeInterval,increaseTimeInterval,timeIntervalReduced);
213  // if(timeIntervalReduced==false){
214  // CheckElementalConditionForTimeStepReduction(increaseTimeInterval);
215  // }
216  // }
217  // }
218 
219  // // if(increaseTimeInterval==true && initialTimeInterval>(1.0+tolerance)*updatedTimeInterval && badPressureConvergence==false && badVelocityConvergence==false ){
220  // if(increaseTimeInterval==true && initialTimeInterval>(1.0+tolerance)*updatedTimeInterval && badVelocityConvergence==false ){
221  // IncreaseTimeInterval(updatedTimeInterval,deltaTimeToNewMilestone,tolerance,increaseTimeInterval);
222  // }
223  // else{
224  // increaseTimeInterval=false;
225  // }
226 
227  // }
228 
229  // double newTimeInterval = rCurrentProcessInfo[DELTA_TIME];
230  // double milestoneGap=fabs(newTimeInterval-deltaTimeToNewMilestone);
231 
232  // if(milestoneGap<0.49*newTimeInterval && milestoneTimeReached==false){
233  // /* std::cout<<"the milestone is very close, I add "<<milestoneGap<<" to "<<newTimeInterval<<std::endl;*/
234  // newTimeInterval+=milestoneGap;
235  // rCurrentProcessInfo.SetValue(DELTA_TIME,newTimeInterval);
236  // milestoneTimeReached=true;
237  // }
238 
239  // updatedTime+=newTimeInterval;
240  // rCurrentProcessInfo.SetValue(TIME,updatedTime);
241  // rCurrentProcessInfo.SetValue(CURRENT_DELTA_TIME,newTimeInterval);
242 
243  // /* if(newTimeInterval<(0.49*currentTimeInterval)){ */
244  // /* std::cout<<"ATTENTION! new time step is more than 2 times smaller than the previous one"<<std::endl; */
245  // /* } */
246 
247  // if(increaseTimeInterval==false && milestoneTimeReached==true && fabs(newTimeInterval-initialTimeInterval)>tolerance && !(deltaTimeToNewMilestone>newTimeInterval*(1.0+tolerance))){
248  // rCurrentProcessInfo.SetValue(CURRENT_DELTA_TIME,currentTimeInterval);
249  // }
250 
251 
252  // if (newTimeInterval<initialTimeInterval){
253  // std::cout<<"current time "<<updatedTime<<" time step: new "<<newTimeInterval<<" previous "<<currentTimeInterval<<" initial "<<initialTimeInterval<<"\n"<<std::endl;
254  // }
255 
256 
257  // KRATOS_CATCH("");
258 
259  // };
260 
261 
262 // void CheckNodalConditionForTimeStepReduction(double updatedTimeInterval,
263 // bool &increaseTimeInterval,
264 // bool &timeIntervalReduced)
265 // {
266 
267 // ProcessInfo& rCurrentProcessInfo = mrModelPart.GetProcessInfo();
268 
269 // #pragma omp parallel
270 // {
271 // ModelPart::NodeIterator NodeBegin;
272 // ModelPart::NodeIterator NodeEnd;
273 // OpenMPUtils::PartitionedIterators(mrModelPart.Nodes(),NodeBegin,NodeEnd);
274 // for (ModelPart::NodeIterator itNode = NodeBegin; itNode != NodeEnd; ++itNode)
275 // {
276 // if(itNode->IsNot(TO_ERASE) && itNode->IsNot(ISOLATED) && itNode->IsNot(SOLID)){
277 // const array_1d<double,3> &Vel = itNode->FastGetSolutionStepValue(VELOCITY);
278 // double NormVelNode=0;
279 // for (unsigned int d = 0; d < 3; ++d){
280 // NormVelNode+=Vel[d] * Vel[d];
281 // }
282 // double motionInStep=sqrt(NormVelNode)*updatedTimeInterval;
283 // double unsafetyFactor=0;
284 // NodeWeakPtrVectorType& neighb_nodes = itNode->GetValue(NEIGHBOUR_NODES);
285 // for (NodeWeakPtrVectorType::iterator nn = neighb_nodes.begin();nn != neighb_nodes.end(); ++nn)
286 // {
287 // array_1d<double,3> CoorNeighDifference=itNode->Coordinates()-nn->Coordinates();
288 // double squaredDistance=0;
289 // for (unsigned int d = 0; d < 3; ++d){
290 // squaredDistance+=CoorNeighDifference[d]*CoorNeighDifference[d];
291 // }
292 // double nodeDistance=sqrt(squaredDistance);
293 // double tempUnsafetyFactor=motionInStep/nodeDistance;
294 // if(tempUnsafetyFactor>unsafetyFactor){
295 // unsafetyFactor=tempUnsafetyFactor;
296 // }
297 // }
298 
299 // if(unsafetyFactor>0.35){
300 // increaseTimeInterval=false;
301 // if(unsafetyFactor>1.0){
302 // double temporaryTimeInterval = rCurrentProcessInfo[DELTA_TIME];
303 // double reducedTimeInterval=0.5*updatedTimeInterval;
304 // if(reducedTimeInterval<temporaryTimeInterval){
305 // rCurrentProcessInfo.SetValue(DELTA_TIME,reducedTimeInterval);
306 // /* std::cout<<"reducing time step (nodal criterion)"<<reducedTimeInterval<<std::endl; */
307 // rCurrentProcessInfo.SetValue(DELTA_TIME_CHANGED,true);
308 // timeIntervalReduced=true;
309 // break;
310 // }
311 // }
312 // }
313 // }
314 // }
315 // }
316 
317 // }
318 
319 
320 // void CheckElementalConditionForTimeStepReduction(bool &increaseTimeInterval)
321 // {
322 
323 // ProcessInfo& rCurrentProcessInfo = mrModelPart.GetProcessInfo();
324 
325 // #pragma omp parallel
326 // {
327 // ModelPart::ElementIterator ElemBegin;
328 // ModelPart::ElementIterator ElemEnd;
329 // OpenMPUtils::PartitionedIterators(mrModelPart.Elements(),ElemBegin,ElemEnd);
330 // for ( ModelPart::ElementIterator itElem = ElemBegin; itElem != ElemEnd; ++itElem )
331 // {
332 // double temporaryTimeInterval=rCurrentProcessInfo[DELTA_TIME];
333 // double currentElementalArea = 0;
334 // const unsigned int dimension = (itElem)->GetGeometry().WorkingSpaceDimension();
335 // if(dimension==2){
336 // currentElementalArea = (itElem)->GetGeometry().Area();
337 // Geometry<Node > updatedElementCoordinates;
338 // bool solidElement=false;
339 // for(unsigned int i=0; i<itElem->GetGeometry().size(); ++i)
340 // {
341 // if(itElem->GetGeometry()[i].Is(SOLID) || itElem->GetGeometry()[i].Is(TO_ERASE) || itElem->IsNot(ACTIVE)){
342 // solidElement=true;
343 // }
344 
345 // const array_1d<double,3> &Vel = itElem->GetGeometry()[i].FastGetSolutionStepValue(VELOCITY);
346 // Point updatedNodalCoordinates=itElem->GetGeometry()[i].Coordinates()+Vel*temporaryTimeInterval;
347 // updatedElementCoordinates.push_back(Kratos::make_shared<Node >(i,updatedNodalCoordinates.X(),updatedNodalCoordinates.Y(),updatedNodalCoordinates.Z()));
348 // }
349 
350 // double newArea=0;
351 // if(itElem->GetGeometry().size()==3){
352 // Triangle2D3<Node > myGeometry(updatedElementCoordinates);
353 // newArea=myGeometry.Area();
354 // }else if(itElem->GetGeometry().size()==6){
355 // Triangle2D6<Node > myGeometry(updatedElementCoordinates);
356 // newArea=myGeometry.Area();
357 // }else{
358 // std::cout<<"GEOMETRY NOT DEFINED"<<std::endl;
359 // }
360 
361 // if(solidElement==true){
362 // newArea=currentElementalArea;
363 // }
364 
365 // if(newArea<0.001*currentElementalArea && currentElementalArea>0){
366 // double reducedTimeInterval=0.5*temporaryTimeInterval;
367 
368 // if(reducedTimeInterval<temporaryTimeInterval){
369 // rCurrentProcessInfo.SetValue(DELTA_TIME,reducedTimeInterval);
370 // /* std::cout<<"reducing time step (elemental inversion)"<<reducedTimeInterval<<std::endl; */
371 // rCurrentProcessInfo.SetValue(DELTA_TIME_CHANGED,true);
372 // increaseTimeInterval=false;
373 // break;
374 // }
375 // }else{
376 // Geometry<Node > updatedEnlargedElementCoordinates;
377 
378 // for(unsigned int i=0; i<itElem->GetGeometry().size(); ++i)
379 // {
380 // const array_1d<double,3> &Vel = itElem->GetGeometry()[i].FastGetSolutionStepValue(VELOCITY);
381 // Point updatedNodalCoordinates=itElem->GetGeometry()[i].Coordinates()+Vel*temporaryTimeInterval*2.5;
382 // updatedEnlargedElementCoordinates.push_back(Kratos::make_shared<Node >(i,updatedNodalCoordinates.X(),updatedNodalCoordinates.Y(),updatedNodalCoordinates.Z()));
383 
384 // }
385 
386 // if(itElem->GetGeometry().size()==3){
387 // Triangle2D3<Node > myGeometry(updatedEnlargedElementCoordinates);
388 // newArea=myGeometry.Area();
389 // }else if(itElem->GetGeometry().size()==6){
390 // Triangle2D6<Node > myGeometry(updatedEnlargedElementCoordinates);
391 // newArea=myGeometry.Area();
392 // }else{
393 // std::cout<<"GEOMETRY NOT DEFINED"<<std::endl;
394 // }
395 
396 // if(newArea<0.001*currentElementalArea && currentElementalArea>0){
397 // increaseTimeInterval=false;
398 // /* std::cout<<"I'll not reduce the time step but I'll not allow to increase it"<<std::endl; */
399 // }
400 
401 // }
402 // }
403 // else if(dimension==3){
404 // double currentElementalVolume = (itElem)->GetGeometry().Volume();
405 // Geometry<Node > updatedElementCoordinates;
406 // bool solidElement=false;
407 // for(unsigned int i=0; i<itElem->GetGeometry().size(); ++i)
408 // {
409 // if(itElem->GetGeometry()[i].Is(SOLID) || itElem->IsNot(ACTIVE)){
410 // solidElement=true;
411 // }
412 // const array_1d<double,3> &Vel = itElem->GetGeometry()[i].FastGetSolutionStepValue(VELOCITY);
413 // Point updatedNodalCoordinates=itElem->GetGeometry()[i].Coordinates()+Vel*temporaryTimeInterval;
414 // updatedElementCoordinates.push_back(Kratos::make_shared<Node >(i,updatedNodalCoordinates.X(),updatedNodalCoordinates.Y(),updatedNodalCoordinates.Z()));
415 // }
416 
417 // double newVolume=0;
418 // if(itElem->GetGeometry().size()==4){
419 // Tetrahedra3D4<Node > myGeometry(updatedElementCoordinates);
420 // newVolume=myGeometry.Volume();
421 // }else if(itElem->GetGeometry().size()==10){
422 // Tetrahedra3D10<Node > myGeometry(updatedElementCoordinates);
423 // newVolume=myGeometry.Volume();
424 // }else{
425 // std::cout<<"GEOMETRY NOT DEFINED"<<std::endl;
426 // }
427 
428 // if(solidElement==true){
429 // newVolume=currentElementalVolume;
430 // }
431 
432 // if(newVolume<0.001*currentElementalVolume && currentElementalVolume>0){
433 // double reducedTimeInterval=0.5*temporaryTimeInterval;
434 
435 // if(reducedTimeInterval<temporaryTimeInterval){
436 // rCurrentProcessInfo.SetValue(DELTA_TIME,reducedTimeInterval);
437 // /* std::cout<<"reducing time step (elemental inversion)"<<reducedTimeInterval<<std::endl; */
438 // rCurrentProcessInfo.SetValue(DELTA_TIME_CHANGED,true);
439 // increaseTimeInterval=false;
440 // break;
441 // }
442 // }else{
443 // Geometry<Node > updatedEnlargedElementCoordinates;
444 
445 // for(unsigned int i=0; i<itElem->GetGeometry().size(); ++i)
446 // {
447 // const array_1d<double,3> &Vel = itElem->GetGeometry()[i].FastGetSolutionStepValue(VELOCITY);
448 // Point updatedNodalCoordinates=itElem->GetGeometry()[i].Coordinates()+Vel*temporaryTimeInterval*2.5;
449 // updatedEnlargedElementCoordinates.push_back(Kratos::make_shared<Node >(i,updatedNodalCoordinates.X(),updatedNodalCoordinates.Y(),updatedNodalCoordinates.Z()));
450 // }
451 
452 // if(itElem->GetGeometry().size()==4){
453 // Tetrahedra3D4<Node > myGeometry(updatedEnlargedElementCoordinates);
454 // newVolume=myGeometry.Volume();
455 // }else if(itElem->GetGeometry().size()==10){
456 // Tetrahedra3D10<Node > myGeometry(updatedEnlargedElementCoordinates);
457 // newVolume=myGeometry.Volume();
458 // }else{
459 // std::cout<<"GEOMETRY NOT DEFINED"<<std::endl;
460 // }
461 
462 // if(newVolume<0.001*currentElementalVolume && currentElementalVolume>0){
463 // increaseTimeInterval=false;
464 // /* std::cout<<"I'll not reduce the time step but I'll not allow to increase it"<<std::endl; */
465 // }
466 
467 
468 // }
469 
470 
471 
472 // }
473 
474 // }
475 
476 // }
477 // }
478 
479  // void IncreaseTimeInterval(double updatedTimeInterval,
480  // double deltaTimeToNewMilestone,
481  // double tolerance,
482  // bool &increaseTimeInterval)
483  // {
484  // ProcessInfo& rCurrentProcessInfo = mrModelPart.GetProcessInfo();
485 
486  // double increasedTimeInterval = 2.0 * updatedTimeInterval;
487 
488  // if(increasedTimeInterval<deltaTimeToNewMilestone*(1.0+tolerance))
489  // {
490  // rCurrentProcessInfo.SetValue(DELTA_TIME,increasedTimeInterval);
491  // rCurrentProcessInfo.SetValue(DELTA_TIME_CHANGED,true);
492  // }
493  // else{
494  // increaseTimeInterval=false;
495  // }
496 
497  // }
498 
511 
513  std::string Info() const override
514  {
515  return "TimeDiscretizationProcess";
516  }
517 
519  void PrintInfo(std::ostream& rOStream) const override
520  {
521  rOStream << "TimeDiscretizationProcess";
522  }
523 
524 
525  protected:
531 
532  struct TimeParameters {
533 
535 
536  double InitialStep;
537  double PreviousStep;
538  double CurrentStep;
539 
541 
542  double Total;
543 
544  double Start;
545  double End;
546  double MileStone;
547 
550 
553 
554  void Initialize(const double& rTimeStep, const double& rStartTime, const double& rEndTime)
555  {
556  Predict = false;
557  PredictionLevel = 0;
558  InitialStep = rTimeStep;
559  PreviousStep = rTimeStep;
560  CurrentStep = rTimeStep;
561  Start = rStartTime;
562  End = rEndTime;
563  MileStone = rTimeStep+rTimeStep;
564  }
565 
566  void SetFactors(const double& rIncreaseFactor, const double& rDecreaseFactor, const double& rDelay)
567  {
568  IncreaseFactor = rIncreaseFactor;
569  DecreaseFactor = rDecreaseFactor;
570  UpdateDelay = rDelay;
571  }
572 
573  bool Increase()
574  {
575  if( !ActiveDelay() ){
578  if( InitialStep <= CurrentStep )
580  if( Total+CurrentStep >= MileStone ){
583  }
584  }
586  }
587 
588  bool Decrease()
589  {
590  if( !ActiveDelay() ){
593  if( CurrentStep <= 1e-2*InitialStep )
595  }
597  }
598 
600  {
601  if( PredictionLevel >= 0)
602  {
603  if( PredictionLevel == 0 && Total > Start )
604  return false;
605  else
606  return true;
607  }
608  }
609 
610  bool Update()
611  {
612  if( PredictedStep > CurrentStep )
613  return Increase();
614  else
615  return Decrease();
616  }
617 
618  bool ActiveDelay()
619  {
620  if( DelayCounter == UpdateDelay )
621  {
622  DelayCounter = 0;
623  return false;
624  }
625  else{
626  ++DelayCounter;
627  return true;
628  }
629  }
630 
631  bool CheckSameTime(const double& rTime, const double& rNewTime)
632  {
633  double tolerance = Initial * 1e-5;
634  if( rNewTime > rTime-tolerance && rNewTime < rTime+tolerance )
635  return true;
636  else
637  return false;
638  }
639 
640  }
641 
648 
649  void ReduceTimeStep()
650  {
651  KRATOS_TRY
652 
653  rCurrentProcessInfo[TIME] -= mTime.CurrentStep;
654  rCurrentProcessInfo[STEP] -= 1;
655 
656  mrModelPart.ReduceTimeStep(rCurrentProcessInfo[TIME]);
657 
658  rCurrentProcessInfo.SetValue(DELTA_TIME_CHANGED, mTime.Decrease());
659 
660  KRATOS_CATCH("");
661  }
662 
664  {
665  KRATOS_TRY
666 
667  this->PredictTimeStep();
668 
669  rCurrentProcessInfo.SetValue(DELTA_TIME_CHANGED, mTime.Update());
670 
671  KRATOS_CATCH("");
672  }
673 
675  {
676  KRATOS_TRY
677 
678  if( mTime.PredictActive() ){
679  this->PredictTimeStep(mTime.PredictedStep);
680  }
681 
682  KRATOS_CATCH("");
683  }
684 
685  void PredictTimeStep(double& rTimeStep)
686  {
687  KRATOS_TRY
688 
689  KRATOS_CATCH("");
690  }
691 
693  {
694  KRATOS_TRY
695 
696  KRATOS_CATCH("");
697  }
698 
699 
710 
711  private:
714 
715  ModelPart& mrModelPart;
716 
717  TimeParameters mTime;
718 
737 
739  TimeDiscretizationProcess& operator=(TimeDiscretizationProcess const& rOther);
740 
742  //TimeDiscretizationProcess(TimeDiscretizationProcess const& rOther);
743 
744 
746 
747 }; // Class TimeDiscretizationProcess
748 
750 
753 
754 
758 
759 
761 inline std::istream& operator >> (std::istream& rIStream,
762  TimeDiscretizationProcess& rThis);
763 
765 inline std::ostream& operator << (std::ostream& rOStream,
766  const TimeDiscretizationProcess& rThis)
767 {
768  rThis.PrintInfo(rOStream);
769  rOStream << std::endl;
770  rThis.PrintData(rOStream);
771 
772  return rOStream;
773 }
775 
776 
777 } // namespace Kratos.
778 
779 #endif // KRATOS_TIME_DISCRETIZATION_PROCESS_H_INCLUDED defined
Definition: flags.h:58
PointerVector< TPointType > PointsArrayType
Definition: geometry.h:118
This class aims to manage meshes for multi-physics simulations.
Definition: model_part.h:77
IndexType CloneTimeStep()
Definition: model_part.cpp:143
MeshType::ElementsContainerType ElementsContainerType
Element container. A vector set of Elements with their Id's as key.
Definition: model_part.h:168
ProcessInfo & GetProcessInfo()
Definition: model_part.h:1746
void ReduceTimeStep(ModelPart &rModelPart, double NewTime)
Definition: model_part.cpp:191
MeshType::NodesContainerType NodesContainerType
Nodes container. Which is a vector set of nodes with their Id's as key.
Definition: model_part.h:128
This class provides to Kratos a data structure for I/O based on the standard of JSON.
Definition: kratos_parameters.h:59
int GetInt() const
This method returns the integer contained in the current Parameter.
Definition: kratos_parameters.cpp:666
void ValidateAndAssignDefaults(const Parameters &rDefaultParameters)
This function is designed to verify that the parameters under testing match the form prescribed by th...
Definition: kratos_parameters.cpp:1306
The base class for all processes in Kratos.
Definition: process.h:49
ProcessInfo holds the current value of different solution parameters.
Definition: process_info.h:59
Short class definition.
Definition: time_discretization_process.hpp:59
TimeDiscretizationProcess(ModelPart &rModelPart, Parameters rParameters)
Default constructor.
Definition: time_discretization_process.hpp:78
void operator()()
Definition: time_discretization_process.hpp:112
void CheckCriticalElement()
Definition: time_discretization_process.hpp:692
void Execute() override
Execute method is used to execute the Process algorithms.
Definition: time_discretization_process.hpp:121
std::string Info() const override
Turn back information as a string.
Definition: time_discretization_process.hpp:513
TimeDiscretizationProcess(ModelPart &rModelPart)
Default constructor.
Definition: time_discretization_process.hpp:72
void PredictTimeStep()
Definition: time_discretization_process.hpp:674
virtual ~TimeDiscretizationProcess()
Destructor.
Definition: time_discretization_process.hpp:108
void PredictTimeStep(double &rTimeStep)
Definition: time_discretization_process.hpp:685
KRATOS_CLASS_POINTER_DEFINITION(TimeDiscretizationProcess)
Pointer definition of TimeDiscretizationProcess.
void UpdateTimeStep()
Definition: time_discretization_process.hpp:663
void PrintInfo(std::ostream &rOStream) const override
Print information about this object.
Definition: time_discretization_process.hpp:519
ReduceTimeStep()
Definition: time_discretization_process.hpp:649
#define KRATOS_CATCH(MoreInfo)
Definition: define.h:110
#define KRATOS_TRY
Definition: define.h:109
GlobalPointersVector< Element > ElementWeakPtrVectorType
Definition: build_model_part_boundary_process.hpp:60
REF: G. R. Cowper, GAUSSIAN QUADRATURE FORMULAS FOR TRIANGLES.
Definition: mesh_condition.cpp:21
@ Initial
Definition: structural_mechanics_math_utilities.hpp:30
ModelPart::NodesContainerType NodesContainerType
Definition: find_conditions_neighbours_process.h:44
GlobalPointersVector< Node > NodeWeakPtrVectorType
Definition: build_model_part_boundary_process.hpp:59
std::istream & operator>>(std::istream &rIStream, LinearMasterSlaveConstraint &rThis)
input stream function
GlobalPointersVector< Condition > ConditionWeakPtrVectorType
Definition: build_model_part_boundary_process.hpp:61
ModelPart::ElementsContainerType ElementsContainerType
Definition: clear_contact_conditions_mesher_process.hpp:43
std::ostream & operator<<(std::ostream &rOStream, const LinearMasterSlaveConstraint &rThis)
output stream function
Definition: linear_master_slave_constraint.h:432
GeometryType::PointsArrayType PointsArrayType
Definition: settle_model_structure_process.hpp:48
e
Definition: run_cpp_mpi_tests.py:31
double PredictedStep
Definition: time_discretization_process.hpp:540
double Start
Definition: time_discretization_process.hpp:544
bool ActiveDelay()
Definition: time_discretization_process.hpp:618
bool PredictActive()
Definition: time_discretization_process.hpp:599
double PreviousStep
Definition: time_discretization_process.hpp:537
double CurrentStep
Definition: time_discretization_process.hpp:538
int DelayCounter
Definition: time_discretization_process.hpp:552
void SetFactors(const double &rIncreaseFactor, const double &rDecreaseFactor, const double &rDelay)
Definition: time_discretization_process.hpp:566
bool Update()
Definition: time_discretization_process.hpp:610
bool Decrease()
Definition: time_discretization_process.hpp:588
int UpdateDelay
Definition: time_discretization_process.hpp:551
double DecreaseFactor
Definition: time_discretization_process.hpp:549
void Initialize(const double &rTimeStep, const double &rStartTime, const double &rEndTime)
Definition: time_discretization_process.hpp:554
bool Increase()
Definition: time_discretization_process.hpp:573
double End
Definition: time_discretization_process.hpp:545
double IncreaseFactor
Definition: time_discretization_process.hpp:548
int PredictionLevel
Definition: time_discretization_process.hpp:534
bool CheckSameTime(const double &rTime, const double &rNewTime)
Definition: time_discretization_process.hpp:631
double Total
Definition: time_discretization_process.hpp:542
double MileStone
Definition: time_discretization_process.hpp:546
double InitialStep
Definition: time_discretization_process.hpp:536