Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chimera remove strategy solve #7845

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

adityaghantasala
Copy link
Member

Description
Following the issue #6748 and the recommendation of the technical committee, the following PR removes the explicit Solve() function calls from the fs strategy of the chimera application.

Changelog
Adds a local SolveStrategy function to the fs_strategy of the chimera app. And uses it to solve the momentum and pressure strategies. This function calls the Initialize, InitializeSolutionStep, SolveSolutionStep and FinializeSolutionStep in that sequence and returns the norm of the solution vector back.

Comment on lines +709 to +718
double SolveStrategy(StrategyPointerType& pStrategy)
{
pStrategy->Initialize();
pStrategy->InitializeSolutionStep();
pStrategy->Predict();
pStrategy->SolveSolutionStep();
const double norm_dx = TSparseSpace::TwoNorm(pStrategy->GetSolutionVector());
pStrategy->FinalizeSolutionStep();
return norm_dx;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is exactly what one should NOT do
=> those calls come from the AnalysisStage and shouldn't be done internally

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For fractional step strategy, this is not possible as there are two (momentum and pressure) internal strategies which should be called at different places. That is why it is done like this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check how and where this function is called and used.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I guess the FractionalStep Strategy hasn't been refactored yet
@rubenzorrilla can you comment?

Copy link
Member Author

@adityaghantasala adityaghantasala Nov 20, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe that for fractional step solver, this is inevitable !
Each "Solve" of the fractional step looks something as follows

SolveSoltuionStep() # Of complete fractional step solver 
    SetFractionalStep(1)
    TillConvergence :
        SolveMomentumStrategy() # HERE : SolveStrategy() is used

    ComputeOSSProjections()
    Compute/Update/Backup Pressure()
    SetFractionalStep(2)
    .... BunchOfOtherOpps()
    SolvePressureStrategy()  # HERE : SolveStrategy() is used
    UpdateEndOfStepVelocity()

So I am not sure if this would fit in the AnalysisStage. Also AnalysisStage does not have access to all those intermediate steps and functions !

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think instead of SolveStrategy only SolveSolutionStep should be called

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't have time to remove the Solve from the base FSStrategy. In any case, I think it would be better to first take care of that and then update the Chimera one accordingly.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rubenzorrilla Thank you for the comment. If you have gone through my changes here and you say this is the way to go , I can do it in the fluid dynamics application.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants