I see. Thank you very much. Xujun On Thu, Oct 30, 2014 at 4:58 PM, John Peterson <[email protected]> wrote:
> On Thu, Oct 30, 2014 at 3:40 PM, Xujun Zhao <[email protected]> wrote: > > In all the Libmesh examples, only scalar-field exact solutions are > attached > > to the ExactSolution by its member functions attach_exact_value() and > > attach_exact_deriv(), for example, poisson problem and > convection-diffusion > > problem. I am curious how to attach the exact solution for a vector field > > problem, such as elasticity and fluid flows? I noticed there are member > > functions attach_exact_values() and attach_exact_derivs(), but their > > arguments are std::vector<FunctionBase<Number> *>, which is a container > for > > multiple "system"s. If I only have one "system", but two variables: > > system.add_variable ("u", SECOND); > > system.add_variable ("v", SECOND); > > The function pointer prototype is: > > Number exact_solution(const Point& p, > const Parameters&, // EquationSystem > parameters, not needed > const std::string& sys_name, > const std::string& var_name); > > > var_name is an input parameter, so in the body of the function you > check what it is, i.e. "u", "v", "w", etc. and return the > corresponding exact solution for that component. > > -- > John > ------------------------------------------------------------------------------ _______________________________________________ Libmesh-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/libmesh-users
