From: Roy Stogner <roystgnr@ic...>  20090403 16:15:21

On Fri, 3 Apr 2009, John Peterson wrote: > On Fri, Apr 3, 2009 at 8:45 AM, Nasser Mohieddin Abukhdeir > <nasser.abukhdeir@...> wrote: >> Hi: >> I have a PDE system that has a dissipation term which involves time >> derivatives of all of the variables involves, for example, if q1/q2/q3 >> are my variables and q1t/q2t/q3t are their partial derivatives in time, >> each PDE has a term: >> >> q1*q1t+q2*q2t+q3*q3t >> >> Is there existing functionality to get access to these time derivatives >> using FEMSystem/AdaptiveTimeSolver similar to the interior_value >> function? Else would something have to be implemented in one of the >> instantiations of AdaptiveTimeSolver? > > You've got a nonlinear mass matrix, so you'll need to make > implementations of YourSystem::mass_residual(), where YourSystem is > derived from FEMSystem. > > If you want to do a theta method, the tricky bit is you'll probably > want to discretize the term as q3(\theta) * (q3^{n+1}  q3^n)/ Dt > which means you'll have to set DiffSystem::use_fixed_solution = true, > set the DiffContext::fixed_solution_derivative to theta (I think) and > use the FEMContext::fixed_interior_value functions in your > mass_residual() function. Roy could probably explain it better, Maybe some discussion this Sunday, when Roy has more time. You hit it on the nose, though. > and maybe he has an example using all the fixed_* stuff? Sadly, nothing simple. I added that to enable Vikram's NavierStokes stabilization, and IIRC tweaked it a bit when we were doing stabilized shallow water equations, but there's no simple application code out there to point to. I'm also not fully convinced we've got the best APIs yet. The fixed_* stuff should be correct for CrankNicholson and Backward Euler, but it was really designed for stabilization terms where you needed a solution that was constant from beginning to end of a timestep. In other cases you really would like to be able to integrate terms that include both a changing solution and a changing time derivative. My elem_rate_solution idea from the earlier thread might make codes with nonlinear mass matrix terms more natural to write in general. I just haven't had time yet to really think through the API, much less implement it.  Roy 