Screenshot instructions:
Windows
Mac
Red Hat Linux
Ubuntu
Click URL instructions:
Rightclick on ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)
From: <tim@ce...>  20070704 06:04:03

Dear all, In my application, I want to assemble and solve one of the systems only on a part of the computational domain. Say, I want to solve only where subdomain_id==0. I can't remove the other cells from the mesh since the other systems have to be solved everywhere. Also, I can't easily set up some dummy equation on those cells where subdomain_id!=0 since it is important to handle the boundary correctly; for a given node in a subdomain_id!=0 cell, it is hard to find out whether this node also belongs to some subdomain_id==0 cell or not. (Note that I'm using Tet10 cells in this case.) I tried to assemble some dummy equation, multiplied with some small eps. Using eps=1e10 does not suffice (spoils the equation too much). Using eps=1e20 causes PETSc to often fail because the matrix is very illconditioned. However, in those rare cases where PETSc manages to solve this, the result for eps=1e20 looks fine. Best Regards, Tim  Dr. Tim Kroeger Phone +494212187710 tim@..., tim@... Fax +494212184236 MeVis Research GmbH, Universitaetsallee 29, D28359 Bremen, Germany Amtsgericht Bremen HRB 16222 Geschaeftsfuehrer: Prof. Dr. H.O. Peitgen 
From: Roy Stogner <roystgnr@ic...>  20070704 14:00:27

On Wed, 4 Jul 2007, Tim Kröger wrote: > In my application, I want to assemble and solve one of the systems > only on a part of the computational domain. Say, I want to solve only > where subdomain_id==0. I can't remove the other cells from the mesh > since the other systems have to be solved everywhere. Also, I can't > easily set up some dummy equation on those cells where subdomain_id!=0 > since it is important to handle the boundary correctly; for a given > node in a subdomain_id!=0 cell, it is hard to find out whether this > node also belongs to some subdomain_id==0 cell or not. (Note that I'm > using Tet10 cells in this case.) What's your definition of "handling the boundary correctly"? Dirichlet internal boundary conditions? You might be able to apply a penalty method to not only the internal boundary nodes but to all subdomain_id!=0 cells.  Roy 
From: <tim@ce...>  20070704 14:49:58

Dear Roy, On Wed, 4 Jul 2007, Roy Stogner wrote: > On Wed, 4 Jul 2007, Tim Kr=F6ger wrote: > >> In my application, I want to assemble and solve one of the systems >> only on a part of the computational domain. Say, I want to solve only >> where subdomain_id=3D=3D0. I can't remove the other cells from the mesh >> since the other systems have to be solved everywhere. Also, I can't >> easily set up some dummy equation on those cells where subdomain_id!=3D0 >> since it is important to handle the boundary correctly; > > What's your definition of "handling the boundary correctly"? > Dirichlet internal boundary conditions? You might be able to apply a > penalty method to not only the internal boundary nodes but to all > subdomain_id!=3D0 cells. Sure, but how about Neumann conditions? Actually, my equation is NavierStokes, and the boundary conditions=20 (on those boundaries we're talking about) are noslip. I.e., I have=20 to set a Dirichlet condition for u (that's easy) and nothing for p. If I don't assemble anything for p in all the subsomain_id!=3D0 cells,=20 then the system becomes highly underdetermined and PETSc crashes. If=20 I assemble something for p (e.g. p=3D0) on those cells, I spoil the=20 divergencezero condition for u on those subdomain_id=3D=3D0 cells which=20 have nodes in common with any subdomain_id!=3D0 cell. I hesitate to try Michael's suggestion because it seems to be a strong=20 abuse and I wonder whether I can be sure whether that will still work=20 in future versions of libMesh. I just got the idea to keep track of all matrix rows in which I write=20 any entries and then set the diagonal entries of the remaining matrix=20 rows to 1. I.e., after the element loop, I do: for(unsigned int i=3D0; i<matrixRowNeqZero.size(); i++) { =09if(matrixRowNeqZero[i]=3D=3D0) =09 { =09 if((i>=3Dsystem.matrix>row_start()) && (i<system.matrix>row_stop(= ))) =09 { =09=09system.matrix>set(i,i,1.0); =09 } =09 } } (where matrixRowNeqZero is a std::vector<unsigned char> that has been=20 filled accordingly). But PETSc complains: [1]PETSC ERROR: MatSetValues() line 691 in src/mat/interface/matrix.c [1]PETSC ERROR: Object is in wrong state! [1]PETSC ERROR: Cannot mix add values and insert values! I'll try to find out what that means. Best Regards, Tim =20 Dr. Tim Kroeger Phone +494212187710 tim@..., tim@... Fax +494212184236 MeVis Research GmbH, Universitaetsallee 29, D28359 Bremen, Germany Amtsgericht Bremen HRB 16222 Geschaeftsfuehrer: Prof. Dr. H.O. Peitgen 
Sign up for the SourceForge newsletter:
No, thanks