Jie,

> I need to constrain all the support points on a Q2 element instead of 
only vertices. The constrained values (inhomogeneity) are obtained from 
(conceptually) a function, say f(\bold{x}).

The code below suggests that you want to constraint all degrees of freedom. 
Is this really what you intend? If so, it might be better to just 
interpolate the values using VectorTools::interpolate 
<https://www.dealii.org/8.5.0/doxygen/deal.II/namespaceVectorTools.html#a05db6c8cebf924b417dd92f525efe3db>.
 


> I already know how to query the coordinates of the support points, I also 
know how to query their global dof numbers, but I do not know how the dof 
numbers are ordered: for example, what is the global dof number of the ith 
component of velocity at support point v? 
> Especially my finite element consists of a 2nd order vector field 
(velocity) and a 1st order scalar field (pressure). Here is the code 
snippet: [...]

Don't rely on any particular order and use the whole finite element instead 
of just the first base element in your code! To find out if a degree of 
freedom corresponds to the velocity FiniteElement you can then call 
system_to_component_index 
<https://www.dealii.org/8.5.0/doxygen/deal.II/classFiniteElement.html#a27220a135402b96c7e6eecbb04acda56>
.
The problem with the approach above is that there (probably?) is no 
DoFHandler that is responsible for the velocity degrees of freedoms alone. 
Hence, a cell iterator (based on a DoFHandler) can only give you the global 
degrees of freedoms
for all the components at the same time. By using system_to_component_index 
you can then decide which to use.

> Another related question is that, my computational results are written in 
vtu format as Q1 elements, which makes the resolution very coarse. Is there 
a way to write the results as 2nd order elements (ParaView supports it)? 
> I suppose the pressure component then needs to be interpolated as it is 
1st order? 

No, as far as I know we don't support writing the results as 2nd order 
elements. The approach we take instead is to split a cell into several 
(most of the time degree^dim) using DataOut::build_patches(degree) to 
obtain a linear interpolation of the correct order.

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