Dear all,

Its been a week since my latest post, I was just wondering if you could 
help me.

Best,
Joel

On Tuesday, September 20, 2016 at 9:12:23 AM UTC+2, Joel Davidsson wrote:
>
> Dear Daniel,
>
> To clarify what I am searching for, I would like to get the vector-valued 
> solution into a format that matches a scalar. Either as a 
> std::vector<Tensor<1,dim>> or a std::vector<Point<dim>>, the format doesn't 
> matter as long as it matches a scalar dofs. So I can manipulate the vector 
> components and for example get the size.
>
> I made a test program that I have attached, that takes the gradient of a 
> gaussian function. At line 354, I do the convergence from a vector valued 
> solution to get the size of the vector (as I posted before). This was wrong 
> and you guys said that I shouldn't assume any particular order of the dofs. 
> Then I tried to this conversion the correct way, see line 365, but I do not 
> know how to do this conversion the correct way.
>
> The code I have sent you, produces the correct result for fe1 and fe2, 
> i.e. when I set fe_scalar (2), fe(FE_Q<dim>(2),dim) at line 100. But failed 
> for fe3. I have attached the result I got for fe2 and fe3 as well as the 
> plot script I have used to generate these plots.
>
> I would be really grateful if you could help me figure out how to solve 
> this.
>
> Best,
> Joel
>
> On Monday, September 19, 2016 at 11:56:51 AM UTC+2, Daniel Arndt wrote:
>>
>> Joel,
>>
>>> [...]
>>>      for (unsigned int q_index=0; q_index<n_q_points; ++q_index)
>>>        for (unsigned int i=0; i<dofs_per_cell; ++i)
>>>          {
>>>         velocity[local_dof_indices[i]] = local_velocity_values[q_index];
>>>          }
>>>
>>> Here you assign the same Tensor<1,dim> at all DoFs multiple times and 
>> you end with velocity[*]=local_velocity_values[n_q_points]-1.
>> I don't think that this is what you want to do, is it? If I understand 
>> you correctly, you try to assign the magnitude of the velocity in each 
>> degree of freedom
>> to a different scalar Vector that represents a scalar FiniteElement 
>> Vector.
>> In this case, you need to use a Quadrature object that uses the 
>> unit_support_points of the scalar FE [1] and your assignment would read
>>
>> for (unsigned int i=0; i<dofs_per_cell; ++i)
>>   velocity[local_dof[indices[i]] = local_velocity_values(i).norm_sqr();
>>
>> where velocity is a Vector that is related to fe_scalar and 
>> local_velocity_values has the type  std::vector<Vector<double> >.
>>
>> Best,
>> Daniel
>>
>> [1] 
>> https://github.com/dealii/dealii/wiki/Frequently-Asked-Questions#how-to-get-the-mapped-position-of-support-points-of-my-element
>>
>

-- 
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