On Fri, 23 Apr 2010, Liang wrote:

>> This is almost right.  Instead of adding an additional variable to
>> your system (which would then have to be taken into account in your
>> implicit solves), create a separate ExplicitSystem with a variable
>> there to store the data.  Then write a postprocessing loop that
>> computes the flux of your main system and sets it into those variables
>> in the secondary system.  If you're using FIRST order variables and
>> you want the same approximation for your fluxes look at
>> Zienkiewicz-Zhu.

> Can I use the add_vector function instead of add_variable to make the code 
> neat,  shown as below:
>
> // by add an "ExplicitSystem" to the EquationSystems object
> equation_systems.add_system<ExplicitSystem> ("Flux_System");
> equation_systems.get_system("Flux_System").add_vector ("gradT", FIRST);
>
> instead of
>
> equation_systems.add_system<ExplicitSystem> ("Flux_System");
> equation_systems.get_system("Flux_System").add_variable ("gradT_x", FIRST);
> equation_systems.get_system("Flux_System").add_variable ("gradT_y", FIRST);
> equation_systems.get_system("Flux_System").add_variable ("gradT_z", FIRST);
>
>
> If so, I found this "add_vector" function also is called at the element 
> assembly part, which usually goes like "force.add_vector (Fe, dof_indices)" 
> at the end of the element code. I don't know if the both "add_vector" are the 
> same?

There's two different add_vector functions here.  The one being called
like force.add_vector() just means that the element's DenseVector
called Fe is being summed into the global NumericVector called force.
You don't want that.

The System::add_vector() function stores another NumericVector in
System.  You might or might not want this.  It's less flexible but it
might be easier to use.  Here's the limitation: when you do a
System::add_vector(), the new vector has the exact same structure as
your solution vector.  So if your solution has one component T and you
need to store gradT_x, gradT_y, and gradT_z, you'd need to add three
vectors for that.  If your solution has a second component you and you
don't need to store gradu_x, gradu_y, and gradu_z, too bad, because
the vectors created by add_vector will all have space for u variables
anyway.
---
Roy

------------------------------------------------------------------------------
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to