TimeStep * NonStationaryTransportProblem :: giveNextStep() { int istep = this->giveNumberOfFirstStep(); double totalTime = this->initT; double intrinsicTime; StateCounterType counter = 1; delete previousStep; if ( currentStep != NULL ) { istep = currentStep->giveNumber() + 1; totalTime = currentStep->giveTargetTime() + giveDeltaT(istep); counter = currentStep->giveSolutionStateCounter() + 1; } else { // first step -> generate initial step currentStep = new TimeStep( *giveSolutionStepWhenIcApply() ); } previousStep = currentStep; currentStep = new TimeStep(istep, this, 1, totalTime, this->giveDeltaT(istep), counter); //set intrinsic time to time of integration intrinsicTime = previousStep->giveTargetTime() + this->alpha *this->giveDeltaT(istep); currentStep->setIntrinsicTime(intrinsicTime); // time and dt variables are set eq to 0 for statics - has no meaning return currentStep; }
TimeStep * NonStationaryTransportProblem :: giveNextStep() { int istep = this->giveNumberOfFirstStep(); double totalTime = this->initT; double intrinsicTime; StateCounterType counter = 1; if ( currentStep ) { istep = currentStep->giveNumber() + 1; totalTime = currentStep->giveTargetTime() + giveDeltaT(istep); counter = currentStep->giveSolutionStateCounter() + 1; } else { // first step -> generate initial step currentStep.reset( new TimeStep( *giveSolutionStepWhenIcApply() ) ); } previousStep = std :: move(currentStep); currentStep.reset( new TimeStep(istep, this, 1, totalTime, this->giveDeltaT ( istep ), counter) ); //set intrinsic time to time of integration intrinsicTime = currentStep->giveTargetTime(); // intrinsicTime = previousStep->giveTargetTime() + this->alpha *this->giveDeltaT(istep); currentStep->setIntrinsicTime(intrinsicTime); return currentStep.get(); }
TimeStep * NonStationaryTransportProblem :: giveSolutionStepWhenIcApply() { if ( stepWhenIcApply == NULL ) { stepWhenIcApply = new TimeStep(giveNumberOfTimeStepWhenIcApply(), this, 0, this->initT-giveDeltaT(giveNumberOfFirstStep()), giveDeltaT(giveNumberOfFirstStep()), 0); //stepWhenIcApply = new TimeStep(giveNumberOfTimeStepWhenIcApply(), this, 0, -deltaT, deltaT, 0); } return stepWhenIcApply; }
TimeStep * NonStationaryTransportProblem :: giveSolutionStepWhenIcApply(bool force) { if ( master && (!force)) { return master->giveSolutionStepWhenIcApply(); } else { if ( !stepWhenIcApply ) { stepWhenIcApply.reset( new TimeStep(giveNumberOfTimeStepWhenIcApply(), this, 0, this->initT - giveDeltaT ( giveNumberOfFirstStep() ), giveDeltaT ( giveNumberOfFirstStep() ), 0) ); //stepWhenIcApply.reset( new TimeStep(giveNumberOfTimeStepWhenIcApply(), this, 0, -deltaT, deltaT, 0) ); } return stepWhenIcApply.get(); } }