[deal.II] Re: Periodic boundary conditions seem to be not applied

2016-11-18 Thread Hamed Babaei

Dear Bastian and Daniel,
 

> That's what I was assuming. So yesterday I did it with this code :
>   // This block add to the periodicity constraint the little 
> compression we want
>   {
> IndexSet selected_dofs_left;
> std::set< types::boundary_id > boundary_ids_left= 
> std::set();
> boundary_ids_left.insert(1);
> DoFTools::extract_boundary_dofs(dof_handler_ref,
>   fe.component_mask(x_displacement), selected_dofs_left, 
> boundary_ids_left);
> unsigned int nb_dofs_face_left = selected_dofs_left.n_elements();
> IndexSet::ElementIterator dofs_left = selected_dofs_left.begin();
> for(unsigned int i = 0; i < nb_dofs_face_left; i++)
> {
> //constraints.add_line(*dofs_left );
> constraints.set_inhomogeneity(*dofs_left, apply_dirichlet_bc ? 
> displacement_side_1 : 0.0);
> dofs_left++;
> }
>   }
> And it works well. Thanks a lot for your help.I think this topic can be 
> set to *Answered*!
>


I am going to do the same as Bastian, namely periodic boundary condition 
for displacement  such that u( 0, y ) = u( 1, y ) + *lambda ,*
* so I used the recommended above code by Bastian for applying inhomogenity 
to predefined periodicity, in order to have reletive dispacement between 
right and left faces,*
*but my results shows that both left and right faces are moving equally to 
the same direction, not relative to each other.*

*In addition, I activated the uncommented line, " *
 //constraints.add_line(*dofs_left );" otherwise I got this error: "call 
add_line() before calling set_inhomogeneity()"

This is my periodic constraints( left side boundry_id = 0  and right 
side boundry_id = 1)  :

 {
 std::vector >
 periodicity_vector_x;

GridTools::collect_periodic_faces(dof_handler,
/*b_id1*/ 0,
/*b_id2*/ 1,
/*direction*/ 0,
  periodicity_vector_x);
 DoFTools::make_periodicity_constraints 
(periodicity_vector_x,
   constraints,
   fe.component_mask(x_displacement));
  }

  {
  IndexSet selected_dofs_right;
  std::set< types::boundary_id > boundary_ids_right= 
std::set();
  boundary_ids_right.insert(1);

  DoFTools::extract_boundary_dofs(dof_handler,
  
 fe.component_mask(x_displacement),
selected_dofs_right,
boundary_ids_right);
  unsigned int nb_dofs_face_right = 
selected_dofs_right.n_elements();
  IndexSet::ElementIterator dofs_right = 
selected_dofs_right.begin();
  for(unsigned int i = 0; i < nb_dofs_face_right; i++)
  {
// constraints.add_line(*dofs_right );
 constraints.set_inhomogeneity(*dofs_right, (apply_dirichlet_bc 
? 0.01e-9 : 0.0));
  dofs_right++;
  }
  }

Any hint would be appreciated.

Thanks,
Hamed

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

2016-11-18 Thread Sudarshan Kumar
Dear   Daniel,

  When I am at the face  I need the solution at the interior  quadrature  
points as well.  However from  dinfo1.indices   we could get the  the dof 
indices for the cell1. But  is it possible to get the shape value at the 
interior quadrature points ?

Thanks a lot

On Friday, November 18, 2016 at 6:58:47 AM UTC-3, Daniel Arndt wrote:
>
> Sudarshan,
>
> template 
>> void Step12::integrate_face_term (DoFInfo& dinfo1, DoFInfo& dinfo2,
>>CellInfo& info1, CellInfo& 
>> info2)
>> {
>>const FEValuesBase& fe_v  = info1.fe_values();
>>const FEValuesBase& fe_v_neighbor = info2.fe_values();
>>
>>const std::vector& sol1 = info1.values[0][0];
>>const std::vector& sol2 = info2.values[0][0];
>>
>> }  
>>
>> In the above  call,  sol1 and sol2  reference to the solution values only 
>> at the face of cell1 and cell2. 
>>
> More precisely, sol1 and sol2 contain the values at the quadrature points 
> which happen to be on a face when you want to integrate a face term.
>
> Is it possible to extract the solution values  in the interior of cell1 
>> and cell2 in the above function ??
>>
> No that easily. Why do you need this? How does the face term you are 
> interested in look like?
>
> 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.


Re: [dealii-developers] Re: Python bindings

2016-11-18 Thread Denis Davydov
Hi Rene,

> On 18 Nov 2016, at 09:43, rene.m...@gmail.com wrote:

> Hi Denis,
> 
> thanks for the info. Those bindings cover a different subset than what I did, 
> so I'll be keeping mine for the time being. If anybody wants to take a look 
> and talk about integrating them upstream at some point it'd be very open to 
> that.

I guess nobody will mind if you contribute them upstream ;-) 
It does not have to be all-at-once, maybe just start with a small part of what 
you did, create a PR and then we can discuss it within a PR interface 
https://github.com/dealii/dealii/pulls .

Regards,
Denis.

-- 
You received this message because you are subscribed to the Google Groups 
"deal.II developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii-developers+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.