## Re: [Libmesh-users] [libmesh-users] inhomogeneous Dirichlet boundary condition

 Re: [Libmesh-users] [libmesh-users] inhomogeneous Dirichlet boundary condition From: Roy Stogner - 2013-01-22 04:06:30 ```On Mon, 21 Jan 2013, David Knezevic wrote: > You have to make sure you call > heterogenously_constrain_element_matrix_and_vector (instead of > constrain_element_matrix_and_vector) as in introduction_ex4. Well, wait - this is actually a little more subtle than that. Some systems may still need to be constrained homogeneously (e.g. if you're solving for (du := u_{n+1} - u_{n}) rather than directly for u_{n+1} in a time step or a newton step. It depends on how you do your solver. --- Roy ```

 [Libmesh-users] [libmesh-users] inhomogeneous Dirichlet boundary condition From: Kyunghoon Lee - 2013-01-21 02:28:28 ```Hello all, I have a question about dealing with inhomogeneous Dirichlet boundary conditions. I have a simple 2D steady state heat conduction model with a rectangular domain. I'd like to apply heat flux on the left side (mesh boundary id = 1), and set an inhomogeneous Dirichlet boundary condition on the rest of slides (mesh boundary id = 2). Among the examples, introduction_ex3 shows how to deal with Dirichlet boundary conditions, but it doesn't show how to apply Dirichlet boundary conditions on a specific mesh ID. I'd appreciate if someone could show me how to do with Libmesh. K. Lee. ```
 Re: [Libmesh-users] [libmesh-users] inhomogeneous Dirichlet boundary condition From: Vikram Garg - 2013-01-21 14:45:34 ```Hey Kyunghon, Please see adjoints example 3 (examples/adjoints/adjoints_ex3/). There we solve a Stokes + Convection-Diffusion system in an H-shaped channel. The file adjoints_ex3.C contains a description of the type of boundary conditions we are setting at the different boundary ids, and the file coupled_system.C actually sets these boundary conditions using the Dirichlet boundary system. Regards. On Sun, Jan 20, 2013 at 9:28 PM, Kyunghoon Lee wrote: > Hello all, > > I have a question about dealing with inhomogeneous Dirichlet boundary > conditions. I have a simple 2D steady state heat conduction model with a > rectangular domain. I'd like to apply heat flux on the left side (mesh > boundary id = 1), and set an inhomogeneous Dirichlet boundary condition on > the rest of slides (mesh boundary id = 2). Among the examples, > introduction_ex3 shows how to deal with Dirichlet boundary conditions, but > it doesn't show how to apply Dirichlet boundary conditions on a specific > mesh ID. I'd appreciate if someone could show me how to do with Libmesh. > > K. Lee. > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. SALE \$99.99 this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122412 > _______________________________________________ > Libmesh-users mailing list > Libmesh-users@... > https://lists.sourceforge.net/lists/listinfo/libmesh-users > -- Vikram Garg Postdoctoral Associate Center for Computational Engineering Massachusetts Institute of Technology http://www.runforindia.org/runners/vikramg ```
 Re: [Libmesh-users] [libmesh-users] inhomogeneous Dirichlet boundary condition From: Kyunghoon Lee - 2013-01-21 23:41:30 ```Thank you for the reply. I wonder if there are other examples about Dirichlet boundary conditions since I'm not familiar with them. Can you suggest some, please? Regards, K. Lee. On Mon, Jan 21, 2013 at 10:44 PM, Vikram Garg wrote: > Hey Kyunghon, > Please see adjoints example 3 > (examples/adjoints/adjoints_ex3/). There we solve a Stokes + > Convection-Diffusion system in an H-shaped channel. The file adjoints_ex3.C > contains a description of the type of boundary conditions we are setting at > the different boundary ids, and the file coupled_system.C actually sets > these boundary conditions using the Dirichlet boundary system. > > Regards. > > On Sun, Jan 20, 2013 at 9:28 PM, Kyunghoon Lee > wrote: > >> Hello all, >> >> I have a question about dealing with inhomogeneous Dirichlet boundary >> conditions. I have a simple 2D steady state heat conduction model with a >> rectangular domain. I'd like to apply heat flux on the left side (mesh >> boundary id = 1), and set an inhomogeneous Dirichlet boundary condition on >> the rest of slides (mesh boundary id = 2). Among the examples, >> introduction_ex3 shows how to deal with Dirichlet boundary conditions, but >> it doesn't show how to apply Dirichlet boundary conditions on a specific >> mesh ID. I'd appreciate if someone could show me how to do with Libmesh. >> >> K. Lee. >> >> ------------------------------------------------------------------------------ >> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >> MVPs and experts. SALE \$99.99 this month only -- learn more at: >> http://p.sf.net/sfu/learnmore_122412 >> _______________________________________________ >> Libmesh-users mailing list >> Libmesh-users@... >> https://lists.sourceforge.net/lists/listinfo/libmesh-users >> > > > > -- > Vikram Garg > Postdoctoral Associate > Center for Computational Engineering > Massachusetts Institute of Technology > > http://www.runforindia.org/runners/vikramg > ```
 Re: [Libmesh-users] [libmesh-users] inhomogeneous Dirichlet boundary condition From: Vikram Garg - 2013-01-21 23:45:42 ```The only other one I know of is examples/fem_system/fem_system_ex_1 The file naviersystem.C shows how to set Dirichlet boundary conditions. Thanks. On Mon, Jan 21, 2013 at 6:41 PM, Kyunghoon Lee wrote: > Thank you for the reply. I wonder if there are other examples about > Dirichlet boundary conditions since I'm not familiar with them. Can you > suggest some, please? > > Regards, > K. Lee. > > On Mon, Jan 21, 2013 at 10:44 PM, Vikram Garg >wrote: > > > Hey Kyunghon, > > Please see adjoints example 3 > > (examples/adjoints/adjoints_ex3/). There we solve a Stokes + > > Convection-Diffusion system in an H-shaped channel. The file > adjoints_ex3.C > > contains a description of the type of boundary conditions we are setting > at > > the different boundary ids, and the file coupled_system.C actually sets > > these boundary conditions using the Dirichlet boundary system. > > > > Regards. > > > > On Sun, Jan 20, 2013 at 9:28 PM, Kyunghoon Lee < > aeronova.mailing@... > > > wrote: > > > >> Hello all, > >> > >> I have a question about dealing with inhomogeneous Dirichlet boundary > >> conditions. I have a simple 2D steady state heat conduction model with > a > >> rectangular domain. I'd like to apply heat flux on the left side (mesh > >> boundary id = 1), and set an inhomogeneous Dirichlet boundary condition > on > >> the rest of slides (mesh boundary id = 2). Among the examples, > >> introduction_ex3 shows how to deal with Dirichlet boundary conditions, > but > >> it doesn't show how to apply Dirichlet boundary conditions on a specific > >> mesh ID. I'd appreciate if someone could show me how to do with > Libmesh. > >> > >> K. Lee. > >> > >> > ------------------------------------------------------------------------------ > >> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > >> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > >> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > >> MVPs and experts. SALE \$99.99 this month only -- learn more at: > >> http://p.sf.net/sfu/learnmore_122412 > >> _______________________________________________ > >> Libmesh-users mailing list > >> Libmesh-users@... > >> https://lists.sourceforge.net/lists/listinfo/libmesh-users > >> > > > > > > > > -- > > Vikram Garg > > Postdoctoral Associate > > Center for Computational Engineering > > Massachusetts Institute of Technology > > > > http://www.runforindia.org/runners/vikramg > > > > ------------------------------------------------------------------------------ > Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, > MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current > with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft > MVPs and experts. SALE \$99.99 this month only -- learn more at: > http://p.sf.net/sfu/learnmore_122412 > _______________________________________________ > Libmesh-users mailing list > Libmesh-users@... > https://lists.sourceforge.net/lists/listinfo/libmesh-users > -- Vikram Garg Postdoctoral Associate Center for Computational Engineering Massachusetts Institute of Technology http://www.runforindia.org/runners/vikramg ```
 Re: [Libmesh-users] [libmesh-users] inhomogeneous Dirichlet boundary condition From: Kyunghoon Lee - 2013-01-22 00:56:33 ```I tried setting up an inhomogeneous Dirichlet BC as follows: std::set bc_surface; bc_surface.insert(BOUNDARY_ID1); std::vector u_only(1, u_var); ConstFunction bc_value1(-1.0); get_dof_map().add_dirichlet_boundary(DirichletBoundary (bc_surface, u_only, &bc_value1)); , but I found u values are always zero no matter what constant values I use. Could you suggest some tips to fix this problem, please? Regards, K. Lee. On Tue, Jan 22, 2013 at 7:45 AM, Vikram Garg wrote: > The only other one I know of is examples/fem_system/fem_system_ex_1 The > file naviersystem.C shows how to set Dirichlet boundary conditions. > > Thanks. > > > On Mon, Jan 21, 2013 at 6:41 PM, Kyunghoon Lee > wrote: > >> Thank you for the reply. I wonder if there are other examples about >> Dirichlet boundary conditions since I'm not familiar with them. Can you >> suggest some, please? >> >> Regards, >> K. Lee. >> >> On Mon, Jan 21, 2013 at 10:44 PM, Vikram Garg > >wrote: >> >> > Hey Kyunghon, >> > Please see adjoints example 3 >> > (examples/adjoints/adjoints_ex3/). There we solve a Stokes + >> > Convection-Diffusion system in an H-shaped channel. The file >> adjoints_ex3.C >> > contains a description of the type of boundary conditions we are >> setting at >> > the different boundary ids, and the file coupled_system.C actually sets >> > these boundary conditions using the Dirichlet boundary system. >> > >> > Regards. >> > >> > On Sun, Jan 20, 2013 at 9:28 PM, Kyunghoon Lee < >> aeronova.mailing@... >> > > wrote: >> > >> >> Hello all, >> >> >> >> I have a question about dealing with inhomogeneous Dirichlet boundary >> >> conditions. I have a simple 2D steady state heat conduction model >> with a >> >> rectangular domain. I'd like to apply heat flux on the left side (mesh >> >> boundary id = 1), and set an inhomogeneous Dirichlet boundary >> condition on >> >> the rest of slides (mesh boundary id = 2). Among the examples, >> >> introduction_ex3 shows how to deal with Dirichlet boundary conditions, >> but >> >> it doesn't show how to apply Dirichlet boundary conditions on a >> specific >> >> mesh ID. I'd appreciate if someone could show me how to do with >> Libmesh. >> >> >> >> K. Lee. >> >> >> >> >> ------------------------------------------------------------------------------ >> >> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >> >> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >> >> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >> >> MVPs and experts. SALE \$99.99 this month only -- learn more at: >> >> http://p.sf.net/sfu/learnmore_122412 >> >> _______________________________________________ >> >> Libmesh-users mailing list >> >> Libmesh-users@... >> >> https://lists.sourceforge.net/lists/listinfo/libmesh-users >> >> >> > >> > >> > >> > -- >> > Vikram Garg >> > Postdoctoral Associate >> > Center for Computational Engineering >> > Massachusetts Institute of Technology >> > >> > http://www.runforindia.org/runners/vikramg >> > >> >> ------------------------------------------------------------------------------ >> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >> MVPs and experts. SALE \$99.99 this month only -- learn more at: >> http://p.sf.net/sfu/learnmore_122412 >> _______________________________________________ >> Libmesh-users mailing list >> Libmesh-users@... >> https://lists.sourceforge.net/lists/listinfo/libmesh-users >> > > > > -- > Vikram Garg > Postdoctoral Associate > Center for Computational Engineering > Massachusetts Institute of Technology > > http://www.runforindia.org/runners/vikramg > ```
 Re: [Libmesh-users] [libmesh-users] inhomogeneous Dirichlet boundary condition From: David Knezevic - 2013-01-22 03:48:35 ```You have to make sure you call heterogenously_constrain_element_matrix_and_vector (instead of constrain_element_matrix_and_vector) as in introduction_ex4. David On 01/21/2013 07:56 PM, Kyunghoon Lee wrote: > I tried setting up an inhomogeneous Dirichlet BC as follows: > > std::set bc_surface; > bc_surface.insert(BOUNDARY_ID1); > > std::vector u_only(1, u_var); > ConstFunction bc_value1(-1.0); > get_dof_map().add_dirichlet_boundary(DirichletBoundary > (bc_surface, u_only, &bc_value1)); > > , but I found u values are always zero no matter what constant values I > use. Could you suggest some tips to fix this problem, please? > > Regards, > K. Lee. > > On Tue, Jan 22, 2013 at 7:45 AM, Vikram Garg wrote: > >> The only other one I know of is examples/fem_system/fem_system_ex_1 The >> file naviersystem.C shows how to set Dirichlet boundary conditions. >> >> Thanks. >> >> >> On Mon, Jan 21, 2013 at 6:41 PM, Kyunghoon Lee >> wrote: >>> Thank you for the reply. I wonder if there are other examples about >>> Dirichlet boundary conditions since I'm not familiar with them. Can you >>> suggest some, please? >>> >>> Regards, >>> K. Lee. >>> >>> On Mon, Jan 21, 2013 at 10:44 PM, Vikram Garg >>> wrote: >>>> Hey Kyunghon, >>>> Please see adjoints example 3 >>>> (examples/adjoints/adjoints_ex3/). There we solve a Stokes + >>>> Convection-Diffusion system in an H-shaped channel. The file >>> adjoints_ex3.C >>>> contains a description of the type of boundary conditions we are >>> setting at >>>> the different boundary ids, and the file coupled_system.C actually sets >>>> these boundary conditions using the Dirichlet boundary system. >>>> >>>> Regards. >>>> >>>> On Sun, Jan 20, 2013 at 9:28 PM, Kyunghoon Lee < >>> aeronova.mailing@... >>>>> wrote: >>>>> Hello all, >>>>> >>>>> I have a question about dealing with inhomogeneous Dirichlet boundary >>>>> conditions. I have a simple 2D steady state heat conduction model >>> with a >>>>> rectangular domain. I'd like to apply heat flux on the left side (mesh >>>>> boundary id = 1), and set an inhomogeneous Dirichlet boundary >>> condition on >>>>> the rest of slides (mesh boundary id = 2). Among the examples, >>>>> introduction_ex3 shows how to deal with Dirichlet boundary conditions, >>> but >>>>> it doesn't show how to apply Dirichlet boundary conditions on a >>> specific >>>>> mesh ID. I'd appreciate if someone could show me how to do with >>> Libmesh. >>>>> K. Lee. >>>>> >>>>> >>> ------------------------------------------------------------------------------ >>>>> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >>>>> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >>>>> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >>>>> MVPs and experts. SALE \$99.99 this month only -- learn more at: >>>>> http://p.sf.net/sfu/learnmore_122412 >>>>> _______________________________________________ >>>>> Libmesh-users mailing list >>>>> Libmesh-users@... >>>>> https://lists.sourceforge.net/lists/listinfo/libmesh-users >>>>> >>>> >>>> >>>> -- >>>> Vikram Garg >>>> Postdoctoral Associate >>>> Center for Computational Engineering >>>> Massachusetts Institute of Technology >>>> >>>> http://www.runforindia.org/runners/vikramg >>>> >>> ------------------------------------------------------------------------------ >>> Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS, >>> MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current >>> with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft >>> MVPs and experts. SALE \$99.99 this month only -- learn more at: >>> http://p.sf.net/sfu/learnmore_122412 >>> _______________________________________________ >>> Libmesh-users mailing list >>> Libmesh-users@... >>> https://lists.sourceforge.net/lists/listinfo/libmesh-users >>> >> >> >> -- >> Vikram Garg >> Postdoctoral Associate >> Center for Computational Engineering >> Massachusetts Institute of Technology >> >> http://www.runforindia.org/runners/vikramg >> > ------------------------------------------------------------------------------ > Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS > and more. Get SQL Server skills now (including 2012) with LearnDevNow - > 200+ hours of step-by-step video tutorials by Microsoft MVPs and experts. > SALE \$99.99 this month only - learn more at: > http://p.sf.net/sfu/learnmore_122512 > _______________________________________________ > Libmesh-users mailing list > Libmesh-users@... > https://lists.sourceforge.net/lists/listinfo/libmesh-users ```
 Re: [Libmesh-users] [libmesh-users] inhomogeneous Dirichlet boundary condition From: Roy Stogner - 2013-01-22 04:06:30 ```On Mon, 21 Jan 2013, David Knezevic wrote: > You have to make sure you call > heterogenously_constrain_element_matrix_and_vector (instead of > constrain_element_matrix_and_vector) as in introduction_ex4. Well, wait - this is actually a little more subtle than that. Some systems may still need to be constrained homogeneously (e.g. if you're solving for (du := u_{n+1} - u_{n}) rather than directly for u_{n+1} in a time step or a newton step. It depends on how you do your solver. --- Roy ```
 Re: [Libmesh-users] [libmesh-users] inhomogeneous Dirichlet boundary condition From: David Knezevic - 2013-01-22 04:19:58 ```On 01/21/2013 11:06 PM, Roy Stogner wrote: > > On Mon, 21 Jan 2013, David Knezevic wrote: > >> You have to make sure you call >> heterogenously_constrain_element_matrix_and_vector (instead of >> constrain_element_matrix_and_vector) as in introduction_ex4. > > Well, wait - this is actually a little more subtle than that. Some > systems may still need to be constrained homogeneously (e.g. if you're > solving for (du := u_{n+1} - u_{n}) rather than directly for u_{n+1} > in a time step or a newton step. It depends on how you do your > solver. Yes, certainly, it depends what he's doing in the problem... I thought not calling heterogenously_constrain_element_matrix_and_vector might be the issue in K's case though, based on what he described, but I shouldn't have implied that heterogenously_constrain_element_matrix_and_vector is always relevant! David ```
 Re: [Libmesh-users] [libmesh-users] inhomogeneous Dirichlet boundary condition From: Roy Stogner - 2013-01-22 04:24:15 ```On Mon, 21 Jan 2013, David Knezevic wrote: > On 01/21/2013 11:06 PM, Roy Stogner wrote: >> >> On Mon, 21 Jan 2013, David Knezevic wrote: >> >>> You have to make sure you call >>> heterogenously_constrain_element_matrix_and_vector (instead of >>> constrain_element_matrix_and_vector) as in introduction_ex4. >> >> Well, wait - this is actually a little more subtle than that. Some >> systems may still need to be constrained homogeneously (e.g. if you're >> solving for (du := u_{n+1} - u_{n}) rather than directly for u_{n+1} >> in a time step or a newton step. It depends on how you do your >> solver. > > Yes, certainly, it depends what he's doing in the problem... I thought not > calling heterogenously_constrain_element_matrix_and_vector might be the issue > in K's case though, based on what he described, but I shouldn't have implied > that heterogenously_constrain_element_matrix_and_vector is always relevant! And I shouldn't have implied that you didn't figure out the solution to his problem - that's most likely exactly what he needs to fix. I just don't want to accidentally mislead others who come across this thread via Google later. --- Roy ```