On Fri, 18 Jan 2008, David Knezevic wrote: > I'm using FEMSystem to solve Navier-Stokes (based on example 18), but in > the case I'm looking at there's a forcing term that comes from the > solution of another system, call the external system tau_system. I was > thinking of adding a pointer to tau_system to NavierSystem and then > implementing a tau_interior_value function in NavierSystem, analogous to > FEMSystem's interior_value. Does this sound like a sensible approach?
You could just call tau_system->interior_value(), if the tau_system had been initialized at the same elem that your Navier Stokes system was currently using. If you'd like, you can factor this initialization code out from FEMSystem::assembly (everything from "elem = *el" up to but not including time_solver->element_residual()) into a separate function to make this initialization easier. The question is when to call that separate function... the only reliable way I can see to do so is right before you use a tau value, but that's inefficient (unless you cache the value of the Elem that was last used to initialize tau, and test to see if it's changed before repeating initialization) and it's awkward. Hmm... even if you did it that way, you'd also have to mess around with the quadrature rule in tau_system, to ensure that you were getting values at the integration points you're using in your Navier Stokes system. Perhaps refactoring FEMSystem code is more trouble than it's worth and writing your own function really is the way to go. I'd still make it two functions - a tau_elem_init(Elem &) to handle the dof_indices(), FE::reinit(), etc. calls, so that you do batch calculations rather than trying to evaluate one point at a time. --- Roy ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Libmesh-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-users
