Hi Thomas and Timo

I have corrected my code and I still have trouble in my code. Am not using 
get_function_values but incorporated the suggestions.

My systems (matrices and vectors ) are in block form and when I run the 
code I get the error:




*The violated condition was:     vec.size() == dof.n_dofs()The name and 
call sequence of the exception was:    ExcDimensionMismatch (vec.size(), 
dof.n_dofs())*

I know the source of the error, it is because of the block systems and 
therefore it outputs solution vectors having twice the size of dofs. The 
code breaks at the point of initial conditions. Am not really sure how to 
deal with this. Kindly let me have your suggestions on this.

Benard

On Monday, December 5, 2016 at 3:06:01 PM UTC, thomas stephens wrote:
>
> Benard, (sorry for misspelling your name earlier)
>
> It's not clear to me whether or not you've solved your problem at this 
> point.  Timo's reply above is the precise reply to your original question:
>  
>
>> I want to use fe_function_values to get values for the entire of degrees 
>> and am using 
>> fe_values.get_function_values (Velocity_solution.block(0),x_value); 
>> where size of (Velocity_solution.block(0) is supposed to be 
>> dof_handler.n_dofs()    but because x_value is defined only for a 
>> particular cell, I get the error Dimension 0 not equal to 1.
>> How do I get function values for the entire degrees of freedom?
>
>  
> Your second question: 
>
>> My interest is to move the vertices by some velocity and would therefore 
>> first ask for the vertex coordinates of each cell using  cell->vertex(i) 
>> and then displace them by velocity. Is this the best approach?
>
> should be answered by looking at step 18 
> <https://www.dealii.org/8.4.1/doxygen/deal.II/step_18.html>
>
> And for 
>
>>  How can i get the vertices at once?
>
> you may look at the get_vertices() 
> <https://www.dealii.org/8.4.1/doxygen/deal.II/classTriangulation.html#a6fcee3caf27bb54c53ddb279cf6b8f5a>
>  
> function in the Triangulation class.  I would caution against collecting a 
> std::vector<Point(spacedim)> of vertices and then moving them based on a 
> dealii::Vector of displacement data because there is the better approach 
> laid out in step 18, accompanied by a lengthy discussion as to why that's 
> probably the 'best approach' you are looking for. 
>
> Please indicate if you are still having trouble.
>
>

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