replace flatten() by ravel(), and minor changes

Status Name Job ID Coverage
  Static Checks
canceled check_no_asserts #1368684

 
  Build Docker
canceled build_docker_from_cache #1368685

 
  Test
canceled test_mpi #1368687

canceled test_serial #1368686

 
  Demo Runs
canceled run_bernoulli #1368695

canceled run_curve_fitting #1368696

canceled run_getting_density #1368694

canceled run_getting_started_1 #1368690

canceled run_getting_started_2 #1368691

canceled run_getting_started_3 #1368692

canceled run_getting_started_mf #1368693

canceled run_ipynb0 #1368688

canceled run_ipynb1 #1368689

canceled run_meanfield #1368698

canceled run_nonlinearity_guide #1368699

canceled run_visual_vi #1368697