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

Set maximum and minimum in GLVis for time-dependent problem #277

Open
Wayne901 opened this issue Mar 13, 2024 · 2 comments
Open

Set maximum and minimum in GLVis for time-dependent problem #277

Wayne901 opened this issue Mar 13, 2024 · 2 comments
Assignees
Labels

Comments

@Wayne901
Copy link

Hello, can I set GLVis options in a mfem's cpp file? I try to set the max and min value for a time dependent problem, but F7 only keep the limit for one frame.

@termi-official
Copy link
Contributor

I handle this case as follows:

  char vishost[] = "localhost";
  int visport = 19916;
  socketstream sol_sock(vishost, visport);
  sol_sock.precision(8);
  sol_sock << "solution\n"
           << mesh << mygf << std::endl
           << "window_title 'my field name'" << std::endl
           << "valuerange -1.0 1.0\n"
           << "autoscale off\n"
           << "plot_caption 't= " << 0.0 << "ms'" << std::flush;
  sol_sock << "pause\n";

@v-dobrev
Copy link
Member

v-dobrev commented Jul 9, 2024

There is a separate setting that controls how the "valuerange" is updated when the solution is updated (e.g. in a time-dependent simulation). This setting is the "autoscale" option that can be toggled using ctrl+a in the GLVis window -- to keep the "valuerange" fixed you want "autoscale off" (neither "valuerange" nor mesh bounds are updated) or "autoscale mesh" (only mesh bounds are updated) -- the current state, after ctrl+a is pressed, is printed in the terminal where GLVis was started from.

Of course, the suggestion by @termi-official is generally a better solution since you won't need to press any keys.

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

No branches or pull requests

4 participants