Thanks Bruno.
By Vertex, I meant the geometric quantity only. As I have used first order
scalar basis functions i.e FE_Q<2> fe(1) to distribute the degrees of
freedom by dof_handler.distribute_dofs(fe);. I expect 'n_dofs = n_vertices'
and also the finite element nodes to be residing directly on the geometric
vertices. So when I use 'vertices = triangulation.get_vertices();' I
expect the number of elements(Points) in vertices array to be equal to the
number of nodes(geometric vertices) in my mesh. Also I expected these
elements (Points of vertices array) to be sorted(indexed) in the increasing
order of its global_dof_index (which is assigned by
'dof_handler.distribute_dofs(fe)' ). So I used 'Point<2> point1 =
vertices[local_dof_indices[i]];' to fetch the geometric vertex from the
array, pick the x-coordinate and assign it as scalar solution at that
vertex/node. I am doing all this as I have to solve a moving domain problem
in the future.
I have accomplished this by the following code, but I am looking for more
efficient ways and better understand dealii.
for (; cell!=endc; ++cell)
{
cell->get_dof_indices(local_dof_indices);
for (int v=0; v<dofs_per_cell; ++v)
{
point1 = (cell->vertex(v));
solution(local_dof_indices[v]) = point1(0);
}
}
<https://lh3.googleusercontent.com/-8Tou3ImtV2Q/WRVjhNHXWgI/AAAAAAAABtw/gJ5T7gbf2NgsM-QBQjzzuiL95uXdxICZgCLcB/s1600/Screenshot_20170512_130049.png>
Please suggest. Please correct if my understanding is wrong.
Thanks,
Bhanu
On Friday, May 12, 2017 at 1:03:12 AM UTC+5:30, Bruno Turcksin wrote:
>
> Bhanu,
>
> On Thursday, May 11, 2017 at 3:03:03 PM UTC-4, Bhanu Teja wrote:
>
>> What is the order these vertices are placed in the vector(does it
>> correspond to the node/vertex number/index as defined by the dof_handler?)?
>>
>> I think you misundertand what is a vertex in deal.II A vertex is only a
> geometric quantity that has nothing to do with your finite element space.
> There are not related to degrees of freedom. I think that the interpolate
> function
> http://dealii.org/8.5.0/doxygen/deal.II/namespaceVectorTools.html#a0d267850685f04deb2943076b3640b4f
>
> does what you want.
>
> Best,
>
> Bruno
>
--
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.