Hi Daniel,

Thanks for your reply, 

the error i was getting was:

    void dealii::VectorTools::interpolate(const Mapping<dim, spacedim> &, 
const DoFHandlerType<dim, spacedim> &, const Function<spacedim, typename 
VectorType::value_type> &, VectorType &, const dealii::ComponentMask &) 
[dim = 2, spacedim = 2, VectorType = dealii::BlockVector<double>, 
DoFHandlerType = DoFHandler]

The violated condition was: 

    dof_handler.get_fe().n_components() == function.n_components

Additional information: 

    Dimension 3 not equal to 2.

I tried using project as well,         VectorTools::project (dof_handler, 
constraints, QGauss<dim>(3),
                              InitialFunction<dim>(), solution);
 and I get the error message (I'm not sure what within the constraint 
matrix I am not taking into account):

    void dealii::ConstraintMatrix::distribute(VectorType &) const 
[VectorType = dealii::Vector<double>]

The violated condition was: 

    sorted==true

If I isolate the solution to solution to solution.block(1), then I get a 
number of dofs violation error, and if i put in a 1d initial function with 
solution.block(1), I get the dimension mismatch again, but with dimension 3 
not equal to 1. These are all using project. 

On Monday, May 7, 2018 at 5:17:04 PM UTC+1, Daniel Arndt wrote:
>
> Jane,
>
> [...]
>>
>> Now, 
>> VectorTools::interpolate(dof_handler, exact_solution, solution);
>>
>> gives me a dimension mismatch error - I'm assuming that this is due to 
>> the fact that RT elements can't distinguish between the x and y components. 
>>
> I would expect that RT elements are not interpolatory and expect a 
> corresponding error message. What exactly is the error message you get in 
> debug mode?
>  
>
>>
>> I then tried adding a component mask in various ways to put the velocity 
>> and pressure solutions in separately, but I still get the same error. 
>> Doing a component mask with solution.block(0) separately also gives me a 
>> number of dofs mismatch error.
>>
>> Is there any way around this? The above interpolation works if i have 
>> Fe_Q elements (like in step-22) so I've narrowed it down to the fact that 
>> it is because of the function space, but I need the function spaces as they 
>> are. 
>>
>> I can't seem to find another way around this using the interpolation 
>> function, and hope that there is actually a simple way around this? 
>>
> Try to use VectorTools::project 
> <https://www.dealii.org/8.5.0/doxygen/deal.II/namespaceVectorTools.html#af282602c17b8eb6afe47ef56fc417ecb>
>  
> instead.
>
> Best,
> Daniel
>

-- 
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 dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to