## Re: [Libmesh-users] Time-dependent Natural BCs in Newmark System

 Re: [Libmesh-users] Time-dependent Natural BCs in Newmark System From: Andrew Davis - 2013-09-24 01:02:42 ```Hi, Thanks for getting back to me. Yes, I think you are right. The Newmark system doesn't seem to be compatible with what I wanted. It was appealing because it seemed like the easiest way to implement a time-dependent system with the benefit of not having to implement my own time integration. I have worked around the issue by writing Crank-Nicolson time-stepper (like one of the other examples). By "wrong magnitude" I meant that when I expected a specific solution (say linear in x and constant in y), the system evolved to the expected "shape" but the range was wrong. Specifically, I had something like u(x)=10x (x in [0,1]) rather than u(x)=x. The Crank-Nicolson time-stepper I have works the way I expect. I just couldn't figure out how to properly add the Neumann conditions into the the Newmark implementation. If anyone knows happens to know that would be helpful, but the method I have is working great for now. Thanks! Andrew On Mon, Sep 23, 2013 at 12:43 PM, John Peterson wrote: > Hi Andrew, > > Sorry for the lack of response. I don't think any of the active > developers are very familiar with the Newmark system, hence their silence. > > > On Wed, Sep 18, 2013 at 1:43 PM, Andrew Davis wrote: > >> Hi all, >> >> Apologies if this is somewhere in the documentation and I missed it. I am >> trying to update the "Newmark system and the Wave Equation" example. I >> have successfully updated the example to use time dependent Dirichlet >> (essential) boundary conditions and I am working on doing something >> similar >> in the Neumann (natural) case. >> >> The problem with just updating the assemble function to make the Neumann >> BCs time dependent in the example is the matrix is only assembled once so >> instead of having time dependent boundary conditions the initial >> evaluation >> is treated as constant Neumann BCs. Doing a reinit() and assemble() each >> timestep doesn't work for the Newmark case (and seems inefficient). >> > > It sounds like the Newmark system (as it's implemented in libmesh) may be > incompatible with what you are attempting to do? I think you'd be better > off with either implementing something more general (either with FEMSystem > or by following one of the other time-dependent examples) or generalizing > the existing Newmark system class so that it actually does what you want. > > >> Finally, I tried to change the "fill_dirichlet_bc" function to >> "fill_neumann_bc". The new version ingrates the Neumann BC over the >> boundary sides of each boundary element and adds the result to the RHS >> vector. This seems to make the BC time dependent but the wrong magnitude. >> > > Not sure what you mean by "wrong magnitude" exactly. Note that the > current fill_dirichlet_bc() function uses the penalty method to enforce a > Dirichlet boundary condition, which is not appropriate for Neumann... > > -- > John > ```

 [Libmesh-users] Time-dependent Natural BCs in Newmark System From: Andrew Davis - 2013-09-18 19:44:01 ```Hi all, Apologies if this is somewhere in the documentation and I missed it. I am trying to update the "Newmark system and the Wave Equation" example. I have successfully updated the example to use time dependent Dirichlet (essential) boundary conditions and I am working on doing something similar in the Neumann (natural) case. The problem with just updating the assemble function to make the Neumann BCs time dependent in the example is the matrix is only assembled once so instead of having time dependent boundary conditions the initial evaluation is treated as constant Neumann BCs. Doing a reinit() and assemble() each timestep doesn't work for the Newmark case (and seems inefficient). Finally, I tried to change the "fill_dirichlet_bc" function to "fill_neumann_bc". The new version ingrates the Neumann BC over the boundary sides of each boundary element and adds the result to the RHS vector. This seems to make the BC time dependent but the wrong magnitude. I am confident in the integration scheme (the same one is working perfectly in the constant BC and the non transient case). I thought maybe adding the result to the "force" vector (rather than rhs) would make the algorithm work properly but that seems to have the same effect. I haven't been able to back engineer from the code where to add the time dependent Neumann BCs to get the Newmark timestepper to work properly. Does anyone know? or is there an example I can look at? Again, sorry if this is described somewhere; I didn't see it in the examples or in my searches of the email list. Thanks again for your help! Andy ```
 Re: [Libmesh-users] Time-dependent Natural BCs in Newmark System From: John Peterson - 2013-09-23 16:43:34 ```Hi Andrew, Sorry for the lack of response. I don't think any of the active developers are very familiar with the Newmark system, hence their silence. On Wed, Sep 18, 2013 at 1:43 PM, Andrew Davis wrote: > Hi all, > > Apologies if this is somewhere in the documentation and I missed it. I am > trying to update the "Newmark system and the Wave Equation" example. I > have successfully updated the example to use time dependent Dirichlet > (essential) boundary conditions and I am working on doing something similar > in the Neumann (natural) case. > > The problem with just updating the assemble function to make the Neumann > BCs time dependent in the example is the matrix is only assembled once so > instead of having time dependent boundary conditions the initial evaluation > is treated as constant Neumann BCs. Doing a reinit() and assemble() each > timestep doesn't work for the Newmark case (and seems inefficient). > It sounds like the Newmark system (as it's implemented in libmesh) may be incompatible with what you are attempting to do? I think you'd be better off with either implementing something more general (either with FEMSystem or by following one of the other time-dependent examples) or generalizing the existing Newmark system class so that it actually does what you want. > Finally, I tried to change the "fill_dirichlet_bc" function to > "fill_neumann_bc". The new version ingrates the Neumann BC over the > boundary sides of each boundary element and adds the result to the RHS > vector. This seems to make the BC time dependent but the wrong magnitude. > Not sure what you mean by "wrong magnitude" exactly. Note that the current fill_dirichlet_bc() function uses the penalty method to enforce a Dirichlet boundary condition, which is not appropriate for Neumann... -- John ```
 Re: [Libmesh-users] Time-dependent Natural BCs in Newmark System From: Andrew Davis - 2013-09-24 01:02:42 ```Hi, Thanks for getting back to me. Yes, I think you are right. The Newmark system doesn't seem to be compatible with what I wanted. It was appealing because it seemed like the easiest way to implement a time-dependent system with the benefit of not having to implement my own time integration. I have worked around the issue by writing Crank-Nicolson time-stepper (like one of the other examples). By "wrong magnitude" I meant that when I expected a specific solution (say linear in x and constant in y), the system evolved to the expected "shape" but the range was wrong. Specifically, I had something like u(x)=10x (x in [0,1]) rather than u(x)=x. The Crank-Nicolson time-stepper I have works the way I expect. I just couldn't figure out how to properly add the Neumann conditions into the the Newmark implementation. If anyone knows happens to know that would be helpful, but the method I have is working great for now. Thanks! Andrew On Mon, Sep 23, 2013 at 12:43 PM, John Peterson wrote: > Hi Andrew, > > Sorry for the lack of response. I don't think any of the active > developers are very familiar with the Newmark system, hence their silence. > > > On Wed, Sep 18, 2013 at 1:43 PM, Andrew Davis wrote: > >> Hi all, >> >> Apologies if this is somewhere in the documentation and I missed it. I am >> trying to update the "Newmark system and the Wave Equation" example. I >> have successfully updated the example to use time dependent Dirichlet >> (essential) boundary conditions and I am working on doing something >> similar >> in the Neumann (natural) case. >> >> The problem with just updating the assemble function to make the Neumann >> BCs time dependent in the example is the matrix is only assembled once so >> instead of having time dependent boundary conditions the initial >> evaluation >> is treated as constant Neumann BCs. Doing a reinit() and assemble() each >> timestep doesn't work for the Newmark case (and seems inefficient). >> > > It sounds like the Newmark system (as it's implemented in libmesh) may be > incompatible with what you are attempting to do? I think you'd be better > off with either implementing something more general (either with FEMSystem > or by following one of the other time-dependent examples) or generalizing > the existing Newmark system class so that it actually does what you want. > > >> Finally, I tried to change the "fill_dirichlet_bc" function to >> "fill_neumann_bc". The new version ingrates the Neumann BC over the >> boundary sides of each boundary element and adds the result to the RHS >> vector. This seems to make the BC time dependent but the wrong magnitude. >> > > Not sure what you mean by "wrong magnitude" exactly. Note that the > current fill_dirichlet_bc() function uses the penalty method to enforce a > Dirichlet boundary condition, which is not appropriate for Neumann... > > -- > John > ```