Hi,

Ok, after reviewing it, I am going to impose a constraint of the form : 
u(0,y) = u(1,y) + lambda and v(0,y) = v(1,y) (lambda is the total 
compression of my square). If I'm not mistaken, that is what Jean-Paul was 
advicing.
I have to example, one is a 1D-beam on a linear elastic foundation. The 
only degree of freedom is the vertical displacement. So everything is in 
one dimension. I want to impose the constraint y(0) = y(1) (only vertical 
displacement y allowed).
Here is the declaration of my FESystem : 
fe(FE_Q<dim>(parameters.poly_degree), dim)

This needs to be changed to Hermitian cubic elements, but this is another 
topic. My triangulation is :
Triangulation<dim>               triangulation;
with dim = 1. I then construct it, refine it, and mark the "faces". But 
what are the faces in 1D?
    GridGenerator::hyper_cube(triangulation, 0.0, 1.0);
    triangulation.refine_global(std::max (1U, 
parameters.global_refinement));

    const double length = GridTools::volume(triangulation);
    std::cout << "Grid:\n\t Length: " << length << std::endl;

    // We mark the sides of the beam in order to apply the boundary 
conditions after
    typename Triangulation<dim>::active_cell_iterator cell =
      triangulation.begin_active(), endc = triangulation.end();
    for (; cell != endc; ++cell)
      for (unsigned int f = 0; f < GeometryInfo<dim>::faces_per_cell; ++f)
if (cell->face(f)->at_boundary())
 {
   const Point<dim> face_center = cell->face(f)->center();
            if (face_center[0] == 0) //Left
     cell->face(f)->set_boundary_id (1);
   else if (face_center[0] == 1) //Right
     cell->face(f)->set_boundary_id (2);
   else                          //No way
     cell->face(f)->set_boundary_id (3);
            // Is this working in 1D ?
 }

Then I make my sparsity pattern and all the like, and begin my timesteps, 
and so on, my Newton-Raphson iterations. The function make_constraints is 
as follows :
 template <int dim>
  void Solid<dim>::make_constraints(const int &it_nr)
  {
    // Since the constraints are different at different Newton iterations, 
we
    // need to clear the constraints matrix and completely rebuild
    // it. However, after the first iteration, the constraints remain the 
same
    // and we can simply skip the rebuilding step if we do not clear it.
    if (it_nr > 1)
      return;

    constraints.clear();
    std::vector<GridTools::PeriodicFacePair<typename 
DoFHandler<dim>::cell_iterator> >
    periodicity_vector;

    const int direction = 0;
    GridTools::collect_periodic_faces(dof_handler_ref, 1, 2, direction,
                                        periodicity_vector);

    const FEValuesExtractors::Scalar y_displacement(0);

    //DoFTools::make_periodicity_constraints<DoFHandler<dim> >
    //  (periodicity_vector, constraints/*, 
fe.component_mask(y_displacement)*/);
    DoFTools::make_periodicity_constraints (dof_handler_ref,1,2, direction,
                constraints,
                fe.component_mask(y_displacement));

    constraints.close();
  }







On Wednesday, June 1, 2016 at 11:55:31 AM UTC-5, Daniel Arndt wrote:
>
> It is quite difficult to say what is going wrong without seeing the code. 
> You probably want to check first if you really want to impose that kind of 
> boundary conditions and follow Jean-Paul's advice.
>
> If the problem persists, it would be really helpful if you can give us a 
> minimal compiling code that reproduces the problem.
>
> Best,
> Daniel
>
> Am Mittwoch, 1. Juni 2016 18:05:32 UTC+2 schrieb Bastien Lauras:
>>
>> Hi Daniel,
>>
>> So, I'm modelling a unit square, with an incompressible neo-hookean 
>> material. The formulation is (for the density of energy) : c_1 * (I_1 - 3) 
>> - p (I_3 - 1) where c_1 = mu / 2, p is a lagrangian parameter, and I_1 and 
>> I_3 are the first and third invariant of C = F^T * F.
>> For me to see that my periodic boundary conditions are not applied, I put 
>> a non-uniform mu aver the material (graded material). In the example 
>> attached, I blocked the horizontal displacement (x_displacement) over left 
>> and right faces, and blocked vertical displacement (y_displacement) over 
>> the bottom face. And I (try to) apply a periodic boundary condition for the 
>> vertical displacement over left and right faces.
>> Attached is the output given to me after the first timestep (all 
>> timesteps are the same since I'm not applying any displacement nor force 
>> constraint).
>>
>> We can obviously see that vertical displacement is not the same on the 
>> left and right faces. Any idea of where it could come from?
>>
>> Many thanks!
>> Best,
>>
>> Bastien
>>
>>
>> On Wednesday, June 1, 2016 at 5:43:48 AM UTC-5, Daniel Arndt wrote:
>>>
>>> Bastian,
>>>
>>> can you provide us with a minimal example that shows your problem? What 
>>> you are trying to do should be possible even if it might not be the right
>>> thing to do in your situation.
>>>
>>> Best,
>>> Daniel
>>>
>>> Am Mittwoch, 1. Juni 2016 02:10:36 UTC+2 schrieb Bastien Lauras:
>>>>
>>>> Hi,
>>>>
>>>> I am working on a 2D square, a incompressible neo-hookean material. 
>>>> I've used step 44 and modified it to work on a two field formulation (
>>>> *u* and p).
>>>> I am trying to implement periodic boundary conditions for the vertical 
>>>> displacement on lateral faces (right and left).
>>>> My left face has boundary indicator 1, and my right face has boundary 
>>>> indicator 3.
>>>>
>>>> In the make_constraints function, I've added, after constraints.clear() 
>>>> :
>>>>
>>>>    DoFTools::make_hanging_node_constraints (dof_handler_ref, 
>>>> constraints); // I have local refinement in my code
>>>>
>>>>       std::vector<GridTools::PeriodicFacePair<typename 
>>>> DoFHandler<dim>::cell_iterator> >
>>>>       periodicity_vector;
>>>>
>>>>       const unsigned int direction = 0; // I've tried 0 and 1, I didn't 
>>>> understan what it really was
>>>>
>>>>       GridTools::collect_periodic_faces(dof_handler_ref, 1, 3, 
>>>> direction,
>>>>                                         periodicity_vector);
>>>>
>>>>     const FEValuesExtractors::Scalar x_displacement(0);
>>>>     const FEValuesExtractors::Scalar y_displacement(1);
>>>>
>>>>      DoFTools::make_periodicity_constraints<DoFHandler<dim> >
>>>>       (periodicity_vector, constraints, 
>>>> fe.component_mask(y_displacement));
>>>>
>>>>
>>>> And then I apply Dirichlet boundary conditions on face 1 and 3 on the 
>>>> horizontal displacement (x_displacement).
>>>> I've also added the command :
>>>>
>>>> DoFTools::make_hanging_node_constraints (dof_handler_ref, constraints);
>>>>
>>>> before making my sparsity pattern.
>>>> My triangulation is not a parallel::distributed one. I'm working on 
>>>> multithreads with the workstream::run of step 44.
>>>>
>>>>
>>>> The problem is that my periodic boundary conditions are not enforced. 
>>>> The make_periodicity_constraints command does not change the number of 
>>>> constrained degrees of freedom (that I compute using a loop over the DOFs 
>>>> and calling constraints.is_constrained(i)).
>>>> And moreover, I can see on my outputs that there is definitely no 
>>>> periodicity on my vertical displacement.
>>>>
>>>> Where can the problem come from?
>>>>
>>>> Thanks a lot for your help beforehand!
>>>>
>>>> Bastien Lauras 
>>>>  
>>>>
>>>

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