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

Print parameters (lethe-fluid-matrix-free) #1255

Merged
merged 3 commits into from
Aug 23, 2024
Merged

Conversation

peterrum
Copy link
Collaborator

The output is like this:

set dimension = 3
subsection simulation control
  set time step                    = 0.05
  set adapt                        = true
  set max cfl                      = 1000
  set stop tolerance               = 1e-5
  set adaptative time step scaling = 1.2
  set output path                  = output/
  set output frequency             = 0
end
subsection physical properties
  subsection fluid 0
    set kinematic viscosity = 0.006666667
  end
end
subsection mesh
  set type               = gmsh
  set file name          = ./sphere.msh
  set initial refinement = 1
end
subsection boundary conditions
  subsection bc 0
    set type = noslip
  end
  subsection bc 1
    set type = function
    subsection u
      set Function expression = 1
    end
  end
  subsection bc 2
    set type = slip
  end
  subsection bc 3
    set type = outlet
  end
end
subsection initial conditions
  set type = ramp
  subsection ramp
    subsection kinematic viscosity
      set initial kinematic viscosity = 0.1
      set iterations                  = 6
    end
  end
end
subsection FEM
  set velocity order = 3
  set pressure order = 3
end
subsection timer
  set type = end
end
subsection forces
  set verbosity       = verbose
  set calculate force = true
end
subsection linear solver
  subsection fluid dynamics
    set verbosity                                 = extra verbose
    set relative residual                         = 1e-4
    set minimum residual                          = 1e-5
    set max iters                                 = 200
    set max krylov vectors                        = 200
    set preconditioner                            = gcmg
    set ilu preconditioner fill                   = 1
    set ilu preconditioner absolute tolerance     = 1e-6
    set ilu preconditioner relative tolerance     = 1
    set amg preconditioner ilu fill               = 1.00
    set amg preconditioner ilu absolute tolerance = 1e-6
    set mg smoother iterations                    = 2
    set mg smoother relaxation                    = 0.15
    set mg smoother preconditioner type           = additive schwarz method
    set mg smoother eig estimation                = true
    set eig estimation smoothing range            = 5
    set eig estimation cg n iterations            = 4
    set mg coarse grid solver                     = direct
    set mg coarsening type                        = hp
    set mg gmres max iterations                   = 500
    set mg gmres tolerance                        = 1e-5
    set mg gmres max krylov vectors               = 500
    set mg gmres preconditioner                   = ilu
    set mg verbosity                              = extra verbose
  end
end
subsection non-linear solver
  subsection fluid dynamics
    set tolerance = 1e-4
  end
end
subsection manifolds
  set number = 1
  subsection manifold 0
    set type              = spherical
    set id                = 0
    set point coordinates = 0, 0, 0
  end
end
subsection source term
  subsection fluid dynamics
    set enable = false
  end
end

Only the changed parameters are printed (Lethe just has too many parameters).

depends on dealii/dealii#17593

@blaisb
Copy link
Contributor

blaisb commented Aug 22, 2024

I am not sure what is your goal here. All the parameters in Lethe are documented in the following webpage
https://chaos-polymtl.github.io/lethe/documentation/parameters/parameters.html

I would refrain from duplicating information sources / locations. I don,t want to get to a point where we print the prm file whenever we are launching a job. There is already a parameter template generator executable. I know there are many parameters, but there is no way around this.

@peterrum
Copy link
Collaborator Author

The idea is to print all relevant parameters at the end of the simulation. We can add a parameter to enable/disable this, but having the simulation output and the chosen parameters next to each other/in the same file is quite useful in my opinion. If you run too many parameter studies you loose the overview of the modified parameters.

@blaisb
Copy link
Contributor

blaisb commented Aug 22, 2024

The idea is to print all relevant parameters at the end of the simulation. We can add a parameter to enable/disable this, but having the simulation output and the chosen parameters next to each other/in the same file is quite useful in my opinion. If you run too many parameter studies you loose the overview of the modified parameters.

The idea is to print all relevant parameters at the end of the simulation. We can add a parameter to enable/disable this, but having the simulation output and the chosen parameters next to each other/in the same file is quite useful in my opinion. If you run too many parameter studies you loose the overview of the modified parameters.

Sure that's a good idea. However it would be relevant to add the switch right now, otherwise all tests will explode for the moment being.

Maybe add a runtime option --print-parameters to the executable. In that case it would print the parameters, otherwise it would be the regular behavior. Then we could implement the same behavior for all solvers because I think it would be very useful. It's a cool feature

@peterrum
Copy link
Collaborator Author

@blaisb What do you think about the last commit?

@blaisb
Copy link
Contributor

blaisb commented Aug 22, 2024

@blaisb What do you think about the last commit?

I love the last commit. That's a very nice way to do it.
Could you just put include guards around it to ensure we can still compile under 9.6? I think this is a very nice way to do this. I will port this feature to the other solvers. btw the deal.II PR for this feature has also been merged.

@peterrum
Copy link
Collaborator Author

Could you just put include guards around it to ensure we can still compile under 9.6?

@blaisb Done!

@peterrum peterrum mentioned this pull request Aug 23, 2024
@blaisb blaisb merged commit 4f256b3 into master Aug 23, 2024
10 of 11 checks passed
@blaisb blaisb deleted the mf_print_parameters branch August 23, 2024 14:20
M-Badri pushed a commit to M-Badri/lethe that referenced this pull request Sep 29, 2024
Print all relevant parameters at the end of the simulation. We can add a parameter to enable/disable this, but having the simulation output and the chosen parameters next to each other/in the same file is quite useful in my opinion. If you run too many parameter studies you loose the overview of the modified parameters.

Former-commit-id: 4f256b3
blaisb pushed a commit that referenced this pull request Sep 30, 2024
Print all relevant parameters at the end of the simulation. We can add a parameter to enable/disable this, but having the simulation output and the chosen parameters next to each other/in the same file is quite useful in my opinion. If you run too many parameter studies you loose the overview of the modified parameters.

Former-commit-id: 4f256b3
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.

2 participants