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

Newton Raphson Output #4268

Open
RiccardoRossi opened this issue Feb 26, 2019 · 12 comments
Open

Newton Raphson Output #4268

RiccardoRossi opened this issue Feb 26, 2019 · 12 comments
Assignees
Labels
Discussion Implementation Committee Consensus The implementation committee has reached consensus on what to do next TODO

Comments

@RiccardoRossi
Copy link
Member

Dear All,
i am reporting here some comments that were made by Prof. Oliver when looking at the output of our NR strategy:

1 - it should be possible to have the convergence shown but not to show build and solve times
2 - output of convergence ratio should be in exponential format (1.5e-2) and not in the standard output of cout (@pooyan-dadvand here i tried to add std::precision to the logger input without success. Any suggestion?)
3 - absolute tolerance should be set to zero or very small number by default
4 - if absolute tolerance is set to zero, it would be good not to have this shown in the output

I definitely agree on this points, particularly about the points 1,2,3

could we agree exactly of what should be shown at the different echo levels?

@philbucher
Copy link
Member

  1. I think we can increase the echo-lvl of when the times are printed. Or we can select/filter messages through the logger but I am not sure if this is supported yet...
  2. I agree
  3. makes sense to me
  4. I am not sure if I understand correctly, could explain a bit more in detail?

@loumalouomega
Copy link
Member

Dear All,
i am reporting here some comments that were made by Prof. Oliver when looking at the output of our NR strategy:

1 - it should be possible to have the convergence shown but not to show build and solve times

The echo level of convergence criteria and strategy should be different. The build time is shows if the echo level of strategy is greater than 0. The convergences is shown if the echo level of the convergence criteria is set.

This is what I do in my fancy output in the contact structural mechanics. i still have pending to do something similar in the core.

2 - output of convergence ratio should be in exponential format (1.5e-2) and not in the standard output of cout (@pooyan-dadvand here i tried to add std::precision to the logger input without success. Any suggestion?)

I do that in my fancy output too

3 - absolute tolerance should be set to zero or very small number by default

Agree

4 - if absolute tolerance is set to zero, it would be good not to have this shown in the output

Agree

I definitely agree on this points, particularly about the points 1,2,3

could we agree exactly of what should be shown at the different echo levels?

This can be done easily if we advance with solving strategies factories...ping #3185

@loumalouomega
Copy link
Member

I got a scientific output, but it requires a lot o modification of the current logger interface, better to think a better idea (for now I can only think in specialize the template of the logger for doubles):

std::stringstream string_out;
string_out
<< " :: [ Obtained ratio = "
<< std::setiosflags(std::ios::scientific)
<< std::setprecision(3)
<< std::uppercase
<< ratio << "; Expected ratio = "
<< std::setiosflags(std::ios::scientific)
<< std::setprecision(3)
<< std::uppercase
<< mRatioTolerance << "; Absolute norm = "
<< std::setiosflags(std::ios::scientific)
<< std::setprecision(3)
<< std::uppercase
<< absolute_norm << "; Expected norm =  "
<< std::setiosflags(std::ios::scientific)
<< std::setprecision(3)
<< std::uppercase
<< mAlwaysConvergedNorm << "]" << std::endl;

std::string string_to_print = string_out.str();
KRATOS_INFO_IF("RESIDUAL CRITERION", this->GetEchoLevel() > 0 && rModelPart.GetCommunicator().MyPID() == 0) << string_to_print;

Result:

SolvingStrategy:  MESH MOVED 
ResidualBasedBlockBuilderAndSolver: Build time: 0.00270605
ResidualBasedBlockBuilderAndSolver: System solve time: 0.1167
SolvingStrategy:  MESH MOVED 
RESIDUAL CRITERION:  :: [ Obtained ratio = 1.000E+00; Expected ratio = 1.000E-06; Absolute norm = 9.722E-01; Expected norm =  1.000E-09]
ResidualBasedBlockBuilderAndSolver: Build time: 0.0030179
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00258398
SolvingStrategy:  MESH MOVED 
RESIDUAL CRITERION:  :: [ Obtained ratio = 7.332E+03; Expected ratio = 1.000E-06; Absolute norm = 7.129E+03; Expected norm =  1.000E-09]
ResidualBasedBlockBuilderAndSolver: Build time: 0.00380111
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00679779
SolvingStrategy:  MESH MOVED 
RESIDUAL CRITERION:  :: [ Obtained ratio = 3.394E+00; Expected ratio = 1.000E-06; Absolute norm = 3.300E+00; Expected norm =  1.000E-09]
ResidualBasedBlockBuilderAndSolver: Build time: 0.00286198
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00655317
SolvingStrategy:  MESH MOVED 
RESIDUAL CRITERION:  :: [ Obtained ratio = 6.148E-05; Expected ratio = 1.000E-06; Absolute norm = 5.978E-05; Expected norm =  1.000E-09]
ResidualBasedBlockBuilderAndSolver: Build time: 0.002738
ResidualBasedBlockBuilderAndSolver: System solve time: 0.00742292

@RiccardoRossi
Copy link
Member Author

RiccardoRossi commented Feb 27, 2019

+1 for the idea of having a different echo level for convergence criteria and for the timings. We may well want to have

RESIDUAL CRITERION:  :: [ Obtained ratio = 1.000E+00; Expected ratio = 1.000E-06; Absolute norm = 9.722E-01; Expected norm =  1.000E-09]
RESIDUAL CRITERION:  :: [ Obtained ratio = 7.332E+03; Expected ratio = 1.000E-06; Absolute norm = 7.129E+03; Expected norm =  1.000E-09]
RESIDUAL CRITERION:  :: [ Obtained ratio = 3.394E+00; Expected ratio = 1.000E-06; Absolute norm = 3.300E+00; Expected norm =  1.000E-09]
RESIDUAL CRITERION:  :: [ Obtained ratio = 6.148E-05; Expected ratio = 1.000E-06; Absolute norm = 5.978E-05; Expected norm =  1.000E-09]

instead of the output you posted. also nice the formatting
why the "upper case"?

I am not sure if we want to show the expected ratios and norm at each iteration

@philbucher
Copy link
Member

It would be more comprehensive if we show it only at the beginning of the time-step 👍

@loumalouomega
Copy link
Member

loumalouomega commented Feb 27, 2019 via email

@RiccardoRossi
Copy link
Member Author

in yesterday's meeting the @KratosMultiphysics/technical-committee was suggesting to ask @KratosMultiphysics/implementation-committee for a suggestion on this.

@loumalouomega
Copy link
Member

in yesterday's meeting the @KratosMultiphysics/technical-committee was suggesting to ask @KratosMultiphysics/implementation-committee for a suggestion on this.

I gave my suggestions, but I am not longer a member of @KratosMultiphysics/implementation-committee

@GuillermoCasas
Copy link
Member

  1. OK: the build times should go to a higher echo_level
  2. Agree
  3. 0? 0 cannot work. And what is a small number? I would again resort to [Core] Tolerances #4305
  4. I do not see a use for such an exception. It is always good to know the tolerance.

@GuillermoCasas
Copy link
Member

On behalf of the @KratosMultiphysics/implementation-committee, since we see that the issue has been taken up by the @KratosMultiphysics/technical-committee , we agree with 1,2,3,4 with the original proposal by @RiccardoRossi, except for requiring that the build times should go to a higher echo level.

@GuillermoCasas GuillermoCasas added the Implementation Committee Consensus The implementation committee has reached consensus on what to do next label Feb 20, 2020
@pooyan-dadvand
Copy link
Member

@KratosMultiphysics/technical-committee agrees with @KratosMultiphysics/implementation-committee.

The only comment is the fact that the number 3 is changing the behavior of the strategy.

@RiccardoRossi
Copy link
Member Author

guys, what is the status of this? anyone taking over the TODOs? @marandra ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Implementation Committee Consensus The implementation committee has reached consensus on what to do next TODO
Projects
Status: 🏗 In progress
Development

No branches or pull requests

6 participants