[deal.II] Re: Neumann condtitions in the mixed space setting

2016-08-31 Thread Daniel Arndt
Eldar,

As you already found out, interpolate_boundary_values can only be used with 
a ComponentMask if the element you are using is primitive.
Therefore, the workaround you are using seems to be suitable for the moment.

Since BDM1 is div-conforming, project_boundary_values and 
project_boundary_values should have the same effect.

Best,
Daniel

Am Mittwoch, 31. August 2016 00:55:33 UTC+2 schrieb Eldar Khattatov:
>
> I managed to imply the Neumann conditions on stress only by first 
> projecting the boundary values to the entire mixed space (affecting 
> rotations), and then manually removing the constraints associated with 
> rotations. The code is below if someone is interested.
> VectorTools::project_boundary_values (dof_handler,
>   stress_boundary_functions,
>   QGauss(2),
>   boundary_values_stress);
>
> FEValuesExtractors::Scalar rotation(dim*dim + dim);
> VectorTools::interpolate_boundary_values (dof_handler,
>   0,
>   ZeroFunction(dim*dim + dim 
> + 0.5*dim*(dim-1)),
>   boundary_values_rotation,
>   fe.component_mask(rotation));
> 
> for (std::map::iterator it_r=
> boundary_values_rotation.begin();
>  it_r!=boundary_values_rotation.end();
>  ++it_r)
>boundary_values_stress.erase(it_r->first);
>
> MatrixTools::apply_boundary_values (boundary_values_stress,
> system_matrix,
> solution,
> system_rhs);
>
>
> I still wonder, though, if there is a nicer way to do it.
>

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


[deal.II] Re: Neumann condtitions in the mixed space setting

2016-08-30 Thread Eldar Khattatov
I managed to imply the Neumann conditions on stress only by first 
projecting the boundary values to the entire mixed space (affecting 
rotations), and then manually removing the constraints associated with 
rotations. The code is below if someone is interested.
VectorTools::project_boundary_values (dof_handler,
  stress_boundary_functions,
  QGauss(2),
  boundary_values_stress);

FEValuesExtractors::Scalar rotation(dim*dim + dim);
VectorTools::interpolate_boundary_values (dof_handler,
  0,
  ZeroFunction(dim*dim + dim + 
0.5*dim*(dim-1)),
  boundary_values_rotation,
  fe.component_mask(rotation));

for (std::map::iterator it_r=
boundary_values_rotation.begin();
 it_r!=boundary_values_rotation.end();
 ++it_r)
   boundary_values_stress.erase(it_r->first);

MatrixTools::apply_boundary_values (boundary_values_stress,
system_matrix,
solution,
system_rhs);


I still wonder, though, if there is a nicer way to do it.

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