On Thu, Jul 7, 2011 at 10:26 AM, Ataollah Mesgarnejad
<[email protected]> wrote:
> Dear all,
>
> I have a TransientLinearImplicitSystem with 3 variables (u,v,w). I want to
> initialize it using attach_init_function. How can distinguish between
> variables in my init function which I pass to attach_init_function(), so to
> set the initial condition for each variable?
This is demonstrated in ex10.
Two different functions are used in ex10: init_cd() and exact_value().
init_cd() is attached to the system, and simply calls
system.project_solution(exact_value).
The exact_value() function takes 4 arguments, the last two of which
are not used in ex10, but which are the system name (in case you have
multiple systems) and the variable name (in case there are multiple
variables). So the generalization of the exact_value() function for
your case should be something like:
Number exact_value (const Point& p,
const Parameters& parameters,
const std::string& sys_name,
const std::string& var_name)
{
if (var_name == "u")
// Compute and return value for u
else if (var_name =="v")
// Compute and return value for v
// etc.
}
--
John
------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security
threats, fraudulent activity, and more. Splunk takes this data and makes
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users