dougshidong / PHiLiP

Parallel High-Order Library for PDEs through hp-adaptive Discontinuous Galerkin methods
Other
46 stars 37 forks source link

Non-finite mass matrix seen in Debug mode #178

Open dougshidong opened 2 years ago

dougshidong commented 2 years ago

@cyanmcg noticed the following assertion being triggered in Debug mode. This may prevent us from debugging further into the code with gdb since the assertion will simply terminate the code at this location without moving further.

@cyanmcg , could you please post the steps to replicate this?

https://github.com/dougshidong/PHiLiP/blob/master/src/dg/dg.cpp#L2336

image

cyanmcg commented 2 years ago

As my last check, this bug happened in a special situation. It can be reproduced in my branch eikonal_model, in the commit: eikonal physical source term with hessian components To reproduce it, few changes must be done: https://github.com/cyanmcg/PHiLiP/blob/5040456ecc2df602dfbdfdf28df987de747a5ee4/src/dg/dg.h#L625-L633

the above lines in dg.h, dealii::update_hessians must be removed.

https://github.com/cyanmcg/PHiLiP/blob/5040456ecc2df602dfbdfdf28df987de747a5ee4/src/physics/initial_conditions/initial_condition.cpp#L236-L237

the InitialConditionFunction_Zero should be used.

The bug can be detected in debug mode from gdb.

dougshidong commented 2 years ago

None of the changes you listed should affect the mass matrix calculation. My guess is that it would happen on master. What case were you running?

cyanmcg commented 2 years ago

You are right. When I tried to reproduce the bug, due to the changes I listed, it seems some other functions called first and the bug does not show up. Here is the .prm file that I used, may be easier to reproduce the error message.

Listing of Parameters

---------------------

Number of dimensions

set dimension = 2

set run_type = flow_simulation set pde_type = eikonal set use_weak_form = true

set conv_num_flux = lax_friedrichs set diss_num_flux = symm_internal_penalty

subsection ODE solver

Maximum nonlinear solver iterations

set nonlinear_max_iterations = 100

Nonlinear solver residual tolerance

set nonlinear_steady_residual_tolerance = 1e-14

set initial_time_step = 1000 set time_step_factor_residual = 20.0 set time_step_factor_residual_exp = 2.0

Print every print_iteration_modulo iterations of the nonlinear solver

set print_iteration_modulo = 1

Explicit or implicit solverChoices are <explicit|implicit>.

set ode_solver_type = implicit

set output_final_steady_state_solution_to_file = true

set output_solution_every_x_steps = 4

set output_solution_every_dt_time_intervals = 0.1

end

subsection linear solver subsection gmres options set max_iterations = 200 set linear_residual_tolerance = 1e-4 set restart_number = 60 end end

subsection flow_solver set flow_case_type = eikonal_wall set steady_state = true set steady_state_polynomial_ramping = false set poly_degree = 2 set max_poly_degree_for_adaptation = 7 subsection grid set grid_left_bound = 0.0 set grid_right_bound = 1.0 set number_of_grid_elements_per_dimension = 50 end end

cyanmcg commented 2 years ago

2d_eikonal_bounded_wall.txt

cyanmcg commented 2 years ago

sorry about the pasted version, the display format is not I want

cyanmcg commented 2 years ago

Also, I notice my test should in the family of integration_test but not flow_simulation, which I will fix later.