From: <tim@ce...>  20060929 08:08:17

Dear all, On Fri, 29 Sep 2006, li pan wrote: > I'm also thinking about this. Are you sure that you > only need to zero all the enties of rows? I read > somewhere that columes should also be zeroed. Could > somebody confirm this? If you zero only the row entries, the matrix will no longer be symmetric. This is often considered as a drawback (provided that the matrix was symmetric before) because certain solvers (e.g. CG) cannot be used then any more. On the other hand, if the column entries are also zeroed, the solution of the system will be wrong  except for the case of *homogeneous* Dirichlet conditions. For this reason, some people transform their problems to homogeneous boundary conditions, i.e. they do in practice the same thing that is usually done theoretically anyway, i.e. they subtract a function that fulfills all Dirichlet boundary conditions but not the PDE. Note that in the discrete case, such a function is trivial to find. Because I find this all quite unsatisfactory, I was glad to see that libMesh uses the penalty method (which I did not know before) because it is easy to implement, works in all cases, and does not destroy symmetry or positivity of the matrix. Best Regards, Tim 
From: HaeWon Choi <haewon@uc...>  20060928 18:07:04

Hi, all: I'm wondering why libmesh does not implement MatZeroRows option given in PetSc. In fact this B.C. treatment is more appropriate since you only need to set diagonal entities as 1.0 for all Dirichlet boundary rows. Of course, in this case you need to add RHS with additional boundary contributions from LHS. So implementation is exactly same when you deal with reduced matrix boundary implementation but instead of physically remove boundary nodes you need to add MatZeroRows option after MatAssembly. I would like to have this option in libmesh. Thanks. 
From: John Peterson <peterson@cf...>  20060928 18:37:36

HaeWon Choi writes: > Hi, all: > I'm wondering why libmesh does not implement MatZeroRows option > given in PetSc. > In fact this B.C. treatment is more appropriate since you only need > to set > diagonal entities as 1.0 for all Dirichlet boundary rows. > Of course, in this case you need to add RHS > with additional boundary contributions from LHS. > So implementation is exactly same when you deal with reduced matrix > boundary implementation but instead of physically remove boundary > nodes you need to add MatZeroRows option after MatAssembly. > I would like to have this option in libmesh. I guess you should get coding then. John 
From: John Peterson <peterson@cf...>  20060928 19:54:14

The array of global node IDs is something you will build in your application code. The BoundaryInfo class may be able to help with this. The library code for petsc_matrix.C would then take a reference to this array (probably an std::vector) and place it into the proper format for calling MatZeroRows. John HaeWon Choi writes: > In order to contribute, I need your help. > In fact I need to tag global boundary nodes and save > them into 1D array and then import this array > to petsc_matrix.C. > But I'm not sure where I can create this 1D array. > Can you give me any suggestions? > Thanks. > > HaeWon > > On Sep 28, 2006, at 12:37 PM, John Peterson wrote: > > > HaeWon Choi writes: > >> Hi, all: > >> I'm wondering why libmesh does not implement MatZeroRows option > >> given in PetSc. > >> In fact this B.C. treatment is more appropriate since you only need > >> to set > >> diagonal entities as 1.0 for all Dirichlet boundary rows. > >> Of course, in this case you need to add RHS > >> with additional boundary contributions from LHS. > >> So implementation is exactly same when you deal with reduced matrix > >> boundary implementation but instead of physically remove boundary > >> nodes you need to add MatZeroRows option after MatAssembly. > > > > > >> I would like to have this option in libmesh. > > > > I guess you should get coding then. > > > > John > > 
From: John Peterson <peterson@cf...>  20060928 21:46:07

There is a BoundaryInfo object in every Mesh. mesh.boundary_info>build_node_list (...) is the function you need to use to get the list of node ids on the boundary. John HaeWon Choi writes: > Hi, BoundayInfo class seems to be private. > How can I use this? > > HaeWon > > On Sep 28, 2006, at 1:54 PM, John Peterson wrote: > > > The array of global node IDs is something you will build in > > your application code. The BoundaryInfo class may be able > > to help with this. > > > > The library code for petsc_matrix.C would then take a reference to > > this array (probably an std::vector) and place it into the proper > > format for calling MatZeroRows. > > > > John > > > > > > HaeWon Choi writes: > >> In order to contribute, I need your help. > >> In fact I need to tag global boundary nodes and save > >> them into 1D array and then import this array > >> to petsc_matrix.C. > >> But I'm not sure where I can create this 1D array. > >> Can you give me any suggestions? > >> Thanks. > >> > >> HaeWon > >> > >> On Sep 28, 2006, at 12:37 PM, John Peterson wrote: > >> > >>> HaeWon Choi writes: > >>>> Hi, all: > >>>> I'm wondering why libmesh does not implement MatZeroRows option > >>>> given in PetSc. > >>>> In fact this B.C. treatment is more appropriate since you only need > >>>> to set > >>>> diagonal entities as 1.0 for all Dirichlet boundary rows. > >>>> Of course, in this case you need to add RHS > >>>> with additional boundary contributions from LHS. > >>>> So implementation is exactly same when you deal with reduced matrix > >>>> boundary implementation but instead of physically remove boundary > >>>> nodes you need to add MatZeroRows option after MatAssembly. > >>> > >>> > >>>> I would like to have this option in libmesh. > >>> > >>> I guess you should get coding then. > >>> > >>> John > >>> 
From: li pan <li76pan@ya...>  20060929 07:45:27

hi, I'm also thinking about this. Are you sure that you only need to zero all the enties of rows? I read somewhere that columes should also be zeroed. Could somebody confirm this? pan  HaeWon Choi <haewon@...> wrote: > Hi, all: > I'm wondering why libmesh does not implement > MatZeroRows option > given in PetSc. > In fact this B.C. treatment is more appropriate > since you only need > to set > diagonal entities as 1.0 for all Dirichlet boundary > rows. > Of course, in this case you need to add RHS > with additional boundary contributions from LHS. > So implementation is exactly same when you deal with > reduced matrix > boundary implementation but instead of physically > remove boundary > nodes you need to add MatZeroRows option after > MatAssembly. > I would like to have this option in libmesh. > > Thanks. > > >  > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get > the chance to share your > opinions on IT & business topics through brief > surveys  and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Libmeshusers mailing list > Libmeshusers@... > https://lists.sourceforge.net/lists/listinfo/libmeshusers > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com 
From: <tim@ce...>  20060929 08:08:17

Dear all, On Fri, 29 Sep 2006, li pan wrote: > I'm also thinking about this. Are you sure that you > only need to zero all the enties of rows? I read > somewhere that columes should also be zeroed. Could > somebody confirm this? If you zero only the row entries, the matrix will no longer be symmetric. This is often considered as a drawback (provided that the matrix was symmetric before) because certain solvers (e.g. CG) cannot be used then any more. On the other hand, if the column entries are also zeroed, the solution of the system will be wrong  except for the case of *homogeneous* Dirichlet conditions. For this reason, some people transform their problems to homogeneous boundary conditions, i.e. they do in practice the same thing that is usually done theoretically anyway, i.e. they subtract a function that fulfills all Dirichlet boundary conditions but not the PDE. Note that in the discrete case, such a function is trivial to find. Because I find this all quite unsatisfactory, I was glad to see that libMesh uses the penalty method (which I did not know before) because it is easy to implement, works in all cases, and does not destroy symmetry or positivity of the matrix. Best Regards, Tim 
From: John Peterson <peterson@cf...>  20060929 11:45:34

Just as an addendum to Tim's note, you can maintain any symmetry originally present in the problem by "subtracting" the column entries multiplied by the Dirichlet value from the right hand side vector. If Au=3Db, where [a_11 a_12 a_13] [u1] =3D [b1] [a_21 a_22 a_23] [u2] =3D [b2] [a_31 a_32 a_33] [u3] =3D [b3] and u1 =3D g1, a nonhomogeneous BC val, we can modify Au=3Db as: [ 1 0 0 ] [u1] =3D [g1] [ 0 a_22 a_23] [u2] =3D [b2  g1*a21] [ 0 a_32 a_33] [u3] =3D [b3  g1*a31] This imposes u1=3Dg1, and maintains any original symmetry of A. John Tim Kr=F6ger writes: > Dear all, >=20 > On Fri, 29 Sep 2006, li pan wrote: >=20 > > I'm also thinking about this. Are you sure that you > > only need to zero all the enties of rows? I read > > somewhere that columes should also be zeroed. Could > > somebody confirm this? >=20 > If you zero only the row entries, the matrix will no longer be=20 > symmetric. This is often considered as a drawback (provided that th= e=20 > matrix was symmetric before) because certain solvers (e.g. CG) canno= t=20 > be used then any more. >=20 > On the other hand, if the column entries are also zeroed, the soluti= on=20 > of the system will be wrong  except for the case of *homogeneous*=20= > Dirichlet conditions. For this reason, some people transform their=20= > problems to homogeneous boundary conditions, i.e. they do in practic= e=20 > the same thing that is usually done theoretically anyway, i.e. they=20= > subtract a function that fulfills all Dirichlet boundary conditions=20= > but not the PDE. Note that in the discrete case, such a function is= =20 > trivial to find. >=20 > Because I find this all quite unsatisfactory, I was glad to see that= =20 > libMesh uses the penalty method (which I did not know before) becaus= e=20 > it is easy to implement, works in all cases, and does not destroy=20= > symmetry or positivity of the matrix. >=20 > Best Regards, >=20 > Tim 
From: HaeWon Choi <haewon@uc...>  20060929 14:53:48

Hi, actually John clarify what I exactly want. Thank you John, For PetSc, MatZeroRows set 1 for all diagonal entities of all Dirichlet boundary rows (other entities will be zero) as I =20 mentioned last time. In fact you can find examples using this approach from PetSc since I =20 have learned this from PetSc. What you have to do is modify RHS as John's example shows. I have used this method for my other codes using PetSc (but not for =20 libMesh yet). This approach gives same results as reduced matrix method. HaeWon On Sep 29, 2006, at 5:45 AM, John Peterson wrote: > Just as an addendum to Tim's note, you can maintain any > symmetry originally present in the problem by "subtracting" > the column entries multiplied by the Dirichlet value from > the right hand side vector. > > If Au=3Db, where > > [a_11 a_12 a_13] [u1] =3D [b1] > [a_21 a_22 a_23] [u2] =3D [b2] > [a_31 a_32 a_33] [u3] =3D [b3] > > and u1 =3D g1, a nonhomogeneous BC val, we can modify Au=3Db as: > > [ 1 0 0 ] [u1] =3D [g1] > [ 0 a_22 a_23] [u2] =3D [b2  g1*a21] > [ 0 a_32 a_33] [u3] =3D [b3  g1*a31] > > > This imposes u1=3Dg1, and maintains any original symmetry of A. > > > John > > > > Tim Kr=F6ger writes: >> Dear all, >> >> On Fri, 29 Sep 2006, li pan wrote: >> >>> I'm also thinking about this. Are you sure that you >>> only need to zero all the enties of rows? I read >>> somewhere that columes should also be zeroed. Could >>> somebody confirm this? >> >> If you zero only the row entries, the matrix will no longer be >> symmetric. This is often considered as a drawback (provided that the >> matrix was symmetric before) because certain solvers (e.g. CG) cannot >> be used then any more. >> >> On the other hand, if the column entries are also zeroed, the =20 >> solution >> of the system will be wrong  except for the case of *homogeneous* >> Dirichlet conditions. For this reason, some people transform their >> problems to homogeneous boundary conditions, i.e. they do in practice >> the same thing that is usually done theoretically anyway, i.e. they >> subtract a function that fulfills all Dirichlet boundary conditions >> but not the PDE. Note that in the discrete case, such a function is >> trivial to find. >> >> Because I find this all quite unsatisfactory, I was glad to see that >> libMesh uses the penalty method (which I did not know before) because >> it is easy to implement, works in all cases, and does not destroy >> symmetry or positivity of the matrix. >> >> Best Regards, >> >> Tim > > =20= >  > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to =20 > share your > opinions on IT & business topics through brief surveys  and earn =20 > cash > http://www.techsay.com/default.php?=20 > page=3Djoin.php&p=3Dsourceforge&CID=3DDEVDEV____________________________= ____=20 > _______________ > Libmeshusers mailing list > Libmeshusers@... > https://lists.sourceforge.net/lists/listinfo/libmeshusers 
From: li pan <li76pan@ya...>  20061004 08:26:01

hi, there are too many elements need to set. It's too expensive. So what's the advantage to do it in comparison with penalty method in libmesh? regards pan  HaeWon Choi <haewon@...> wrote: > Hi, actually John clarify what I exactly want. Thank > you John, > For PetSc, MatZeroRows set 1 for all diagonal > entities > of all Dirichlet boundary rows (other entities will > be zero) as I > mentioned last time. > In fact you can find examples using this approach > from PetSc since I > have learned > this from PetSc. > What you have to do is modify RHS as John's example > shows. > I have used this method for my other codes using > PetSc (but not for > libMesh yet). > This approach gives same results as reduced matrix > method. > > HaeWon > > On Sep 29, 2006, at 5:45 AM, John Peterson wrote: > > > Just as an addendum to Tim's note, you can > maintain any > > symmetry originally present in the problem by > "subtracting" > > the column entries multiplied by the Dirichlet > value from > > the right hand side vector. > > > > If Au=b, where > > > > [a_11 a_12 a_13] [u1] = [b1] > > [a_21 a_22 a_23] [u2] = [b2] > > [a_31 a_32 a_33] [u3] = [b3] > > > > and u1 = g1, a nonhomogeneous BC val, we can > modify Au=b as: > > > > [ 1 0 0 ] [u1] = [g1] > > [ 0 a_22 a_23] [u2] = [b2  g1*a21] > > [ 0 a_32 a_33] [u3] = [b3  g1*a31] > > > > > > This imposes u1=g1, and maintains any original > symmetry of A. > > > > > > John > > > > > > > > Tim Kröger writes: > >> Dear all, > >> > >> On Fri, 29 Sep 2006, li pan wrote: > >> > >>> I'm also thinking about this. Are you sure that > you > >>> only need to zero all the enties of rows? I read > >>> somewhere that columes should also be zeroed. > Could > >>> somebody confirm this? > >> > >> If you zero only the row entries, the matrix will > no longer be > >> symmetric. This is often considered as a > drawback (provided that the > >> matrix was symmetric before) because certain > solvers (e.g. CG) cannot > >> be used then any more. > >> > >> On the other hand, if the column entries are also > zeroed, the > >> solution > >> of the system will be wrong  except for the > case of *homogeneous* > >> Dirichlet conditions. For this reason, some > people transform their > >> problems to homogeneous boundary conditions, i.e. > they do in practice > >> the same thing that is usually done theoretically > anyway, i.e. they > >> subtract a function that fulfills all Dirichlet > boundary conditions > >> but not the PDE. Note that in the discrete case, > such a function is > >> trivial to find. > >> > >> Because I find this all quite unsatisfactory, I > was glad to see that > >> libMesh uses the penalty method (which I did not > know before) because > >> it is easy to implement, works in all cases, and > does not destroy > >> symmetry or positivity of the matrix. > >> > >> Best Regards, > >> > >> Tim > > > > >  > > >  > > Take Surveys. Earn Cash. Influence the Future of > IT > > Join SourceForge.net's Techsay panel and you'll > get the chance to > > share your > > opinions on IT & business topics through brief > surveys  and earn > > cash > > http://www.techsay.com/default.php? > > > page=join.php&p=sourceforge&CID=DEVDEV________________________________ > > > _______________ > > Libmeshusers mailing list > > Libmeshusers@... > > > https://lists.sourceforge.net/lists/listinfo/libmeshusers > > >  > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get > the chance to share your > opinions on IT & business topics through brief > surveys  and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > Libmeshusers mailing list > Libmeshusers@... > https://lists.sourceforge.net/lists/listinfo/libmeshusers > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com 