[deal.II] Re: Periodic boundary conditions with AMR

2022-06-01 Thread Kristoffer Lindvall
Hi, Yes, I have found that the code works with periodic boundaries if I don't refine and it works if I use other boundary conditions with/without refinement. I can try periodic boundaries and then refine every cell and see what happens. I understand it is almost impossible to find the problem

[deal.II] Re: Periodic boundary conditions with AMR

2022-05-31 Thread Bruno Turcksin
Hi, There could be many reasons why your code is not working as expected. To find the problem, try to make the simplify the code as much as possible. For example, does the code fails if you don't use periodic boundaries? If it fails, try to simplify even more, for example, don't use periodic b

Re: [deal.II] Re: Periodic boundary conditions : Error using GridTools::collect_periodic_facepairs

2020-12-08 Thread Aaditya Lakshmanan
Hi Daniel, The serial implementation of the code was exiting with error in the function call to *GridTools::collect_periodic_faces()* so I was looking in documentation for details on specifically that function. I see now that the role of the '*direction*' argument is mentioned explicitly i

Re: [deal.II] Re: Periodic boundary conditions : Error using GridTools::collect_periodic_facepairs

2020-12-08 Thread Daniel Arndt
Aaditya, the documentation says "[...] More precisely, faces with coordinates only differing in the direction component are identified." Hence, it is crucial to choose this correctly. For a cube with standard coloring faces 2 and 3 share the x-coordinates so direction must be 1. Best, Daniel Am

[deal.II] Re: Periodic boundary conditions : Error using GridTools::collect_periodic_facepairs

2020-12-08 Thread Aaditya Lakshmanan
Hi Mark, Quick update. I tried running a simulation with an implementation using the 'Triangulation' object instead and I face the same issue as earlier. It returns the same error message as in the parallel case. Also, making the change in the *direction* argument from 0 to 1 for the constrai

[deal.II] Re: Periodic boundary conditions : Error using GridTools::collect_periodic_facepairs

2020-12-08 Thread Aaditya Lakshmanan
Hi Mark, Thank you for responding. I haven't tried using a standard 'Triangulation' object instead of its parallel counterpart. I will try another implementation with the appropriate substitutions. Based on some trials I ran since I posted the question, my code runs without issues(even on

[deal.II] Re: Periodic boundary conditions : Error using GridTools::collect_periodic_facepairs

2020-12-08 Thread Marc Fehling
Hi Aaditya, on first look your implementation looks good to me. Does the same error occur when you are using a standard `Triangulation` object instead of a `parallel::distributed::Triangulation`? As far as I know, the direction parameter does not matter for scalar fields (see also step-45). W

Re: [deal.II] Re: Periodic boundary conditions

2017-12-04 Thread Lukas Korous
Hello, I came across this old thread, and successfully used the provided code in my own code (https://github.com/l-korous/mhdeal) - thank you Andreas - and I want to share how I used it: - here are the (slightly changed) files provided by Andreas: https://github.com/l-korous/mhdeal/blob/mas

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

2016-12-12 Thread Hamed Babaei
Dear Daniel, I just resolved the problem. Because constraints.close function resolves chains of constraints, It interfered with set_inhomogeinity process. So I had to issue constraints.close before applying inhomogeinities. Thank you very much for your helpful hints. I appreciate it. Hamed

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

2016-12-12 Thread Hamed Babaei
Dear Daniel, > It seems that you are now constraining all the components, i.e. > u_x(0,y)=u_x(L,y) and u_y(0,y)=u_y(L,y). > Is this really what you want to do? Otherwise, you should have a > ComponentMask in your call to > DoFTools::make_periodicity_constraints as well, i.e. > > You are righ

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

2016-12-11 Thread Daniel Arndt
Hamed, [...] > >4,5___6,7 > | | > | | > | | > |

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

2016-12-11 Thread Hamed Babaei
Dear Daniel and Timo, Thank you very much for your advises. I have figured out the problem with the periodic constraints but I do not know where this problem comes from. Let me explain the issue more. As I mentioned earlier, I have applied periodic BC for displacement field and I want to apply

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

2016-12-09 Thread Timo Heister
You can use DoFTools::write_gnuplot_dof_support_point_info for visualizing the DoF locations. If you don't use a special mapping in other places in your code, you can use "MappingQ1()". On Fri, Dec 9, 2016 at 12:14 PM, Hamed Babaei wrote: > Dear Daniel, > >> >> I would suggest you to look at the

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

2016-12-09 Thread Hamed Babaei
Dear Daniel, > I would suggest you to look at the constraints in the ConstraintMatrix > using ConstraintMatrix::print[1] for a mesh consisting of has few cells as > possible. > Using DoFTools::map_dofs_to_support_points[2] you can then verify that > these are correct. > Issuing " constraints

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

2016-12-08 Thread Daniel Arndt
Hamed, It's difficult to judge these kinds of problems just looking at the graphical output after solving. I would suggest you to look at the constraints in the ConstraintMatrix using ConstraintMatrix::print[1] for a mesh consisting of has few cells as possible. Using DoFTools::map_dofs_to_supp

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

2016-12-08 Thread Hamed Babaei
I just realized that the problem comes from that part of the code that applies relative displacement between bottom and top faces, since there is not corner element distortion when having u_x (0,y)=u_x(L,y)+delta_x and I uncomment the second part of the code namely, { IndexSet

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

2016-12-08 Thread Hamed Babaei
Dear Daniel, I have applied periodic boundary condition on displacement field for a square 2D domain and in order to apply boundary displacement I want to consider relative displacement between pair faces, namely, u_x (0,y)=u_x(L,y)+delta_x and u_y (x,0)=u_y(x,L)+delta_y , using "cons

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

2016-11-20 Thread Hamed Babaei
Daniel, You are completely right. The problem was resolved applying your comment. Thank you very much, 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 y

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

2016-11-20 Thread Daniel Arndt
Hamed, [...] > 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 > dispac

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

[deal.II] Re: periodic boundary conditions

2016-09-23 Thread Juan Carlos Araujo Cabarcas
Hej, I found the issue ... I forgot the line constraints.distribute ( sol ); after the solution routine ... so it was just mainly a visualization issue. Thanks for the quick response! El jueves, 22 de septiembre de 2016, 19:26:28 (UTC+2), Daniel Arndt escribió: > > Juan, > > [...] >> 1) M

[deal.II] Re: periodic boundary conditions

2016-09-22 Thread Daniel Arndt
Juan, [...] > 1) My first question is about how the "direction" works, is it 1 > correspond to "x" and 2 corresponds to "y"? > No, direction 0/1/2 means that the support_points of the dofs to be identified just differ in the x-/y-/z-component. What you are doing should be perfectly fine. > 2)

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

2016-06-09 Thread Bastien Lauras
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_

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

2016-06-08 Thread Daniel Arndt
Bastien, Unfortunately, you won't be able to achieve what you want directly with make_periodicity_constraints. The offset vector would help you with something like u(0,y)=u(1,y+lambda). For what you want to do you would first create the constraints for u(0,y)=u(1,y) and modify the corresponding

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

2016-06-08 Thread Bastien Lauras
Hi, Thanks a lot, it works well now! I don't know if I misread step-45, but I don't think it is written in it that boundary_ids should be setup before any refinement. And if you take something like step-44, boundry_ids are setup after refining the mesh. So maybe it would be wise to detail it in

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

2016-06-07 Thread Jean-Paul Pelteret
I agree with Daniel. So in this case, you probably just need to change your order of operations and set the boundary_id's before doing any refinement. On Wednesday, June 8, 2016 at 2:07:09 AM UTC+2, Daniel Arndt wrote: > > Bastien, > > GridTools::collect_periodic_faces stores only the periodic fa

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

2016-06-07 Thread Daniel Arndt
Bastien, GridTools::collect_periodic_faces stores only the periodic faces on the coarsest level. This information is used in DoFTools::make_periodicity_constraints to create the corresponding constraints on the active set of DoFs. My best guess would be that you don't set the boundary_ids on the

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

2016-06-07 Thread Bastien Lauras
Hi Jean-Paul, Concerning the problem you've pointed out : 1. Ok, I'll take it into account. From now on, let's try to solve this problem without local refinement. I do not do it anymore here. 2. Thanks for the advice, I've changed my checks. 3. I understand. However, I am almost sure that an offe

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

2016-06-07 Thread Jean-Paul Pelteret
Hi Bastien, There are a few potential problems here. 1. You're only refining cells along the top edge of your domain. Periodic boundaries can only have a difference of 1 refinement level between pairs of faces. 2. You may not be colouring any of your boundaries. This should be a

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

2016-06-07 Thread Bastien Lauras
Hi Daniel. Thank you for your answer, it worked well to enforce my periodic boundary conditions on the 1D beam. Thus, I'm back to the 2D neo-hookean case. Here is the code of my *make_grid()* function : template void Solid::make_grid() { GridGenerator::hyper_cube(triangulation, 0.0,

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

2016-06-03 Thread Daniel Arndt
You are right, Bastien. The function is not implemented in 1d. However, you can just ask for the boundary dofs using DoFTools::extract_boundary_dofs [1]. This gives you two DoFs and you can just set the constraint using constraint_matrix.add_line(dof_1) constraint_matrix.add_entry(dof_1,dof_2,-1.)

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

2016-06-02 Thread Bastien Lauras
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 two example, the first one is the 2D incompressible neo-hooke

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

2016-06-02 Thread Bastien Lauras
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.

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

2016-06-01 Thread Daniel Arndt
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

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

2016-06-01 Thread Jean-Paul Pelteret
Ah, sorry, I misread what you said. So no, you don't need to use the add_periodicity() function that I suggested. But I would highly recommend that you take a look at Miehe's paper (or some equivalent, maybe from Prof Wrigger's, Prof Steinmann's or Prof Schroder's groups for example) before sp

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

2016-06-01 Thread 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 se

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

2016-06-01 Thread Bastien Lauras
Hi Jean-Paul, Thank you for your answer. I am using deal.II 8.4.0. I've seen this add_periodicity() function, but it appears to me, in step-45

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

2016-06-01 Thread Daniel Arndt
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 2

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

2016-05-31 Thread Jean-Paul Pelteret
Hi Bastien, Which version of deal.II are you using? There is the recently added add_periodicity() function that helps join otherwise unrelated faces for distribut