Jiaqi,

what you really want is that
(u_n_plus_1, v_h) = (u_stat-dt*dp)
holds for all v_h in your velocity ansatz space. This means inverting a 
mass matrix for the velocity
and may come down to just assigning function values depending on what your 
ansatz spaces are.

In that case, you can loop over all cells and get on each of them via 
fe_values.get_function_values
and fe_values.get_function_gradients all the information you need at all 
the velocity support points.
See [1] for how to setup an appropriate quadrature rule.

Otherwise you have to assemble the mass matrix and the right-hand side.

In any case, you want to use two FEValues objects and two cell iterators 
for velocity and pressure.
In particular, use fe_values_pressure.get_function gradients for the 
FEValues object initialized with the pressure cell_iterator
and fe_values_velocity.get_function_values for the FEValues obect 
initialized with the velocity cell_iterator.
The error (probably) tells you that you are trying to reinitialize an a 
FEValues object with a cell_iterator that does notr correspnd to the 
FiniteElement
it has originally been set up with.

Best,
Daniel

[1] 
https://github.com/dealii/dealii/wiki/Frequently-Asked-Questions#how-to-get-the-mapped-position-of-support-points-of-my-element

Am Montag, 25. Juli 2016 19:33:48 UTC+2 schrieb Jiaqi ZHANG:
>
> Dear all,
>
> I am trying to solve the NS equation using project methods, and follow the 
> idea of Step-35 to treat velocity and pressure separately,
>
> but when I am not sure how to implement the correction of the velocity 
> "u_n_plus_1 = u_star - dt * dp",
>
> where "u_star" and  "dp" are from the diffusion step and the projection 
> step respectively, 
>
> since velocity and pressure belong to different finite element spaces. 
>
> I tried "get_function_gradients", but end up with 
> The violated condition was: 
>     static_cast<const FiniteElementData<dim>&>(*this->fe) == 
> static_cast<const FiniteElementData<dim>&>(cell->get_fe())
>
> Thanks in advance.
>
>
> Best,
> Jiaqi
>

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to