<div dir="ltr"><div><div><div>Dear all,<br></div>I would like to know if some of the petsc objects that I have not used so far (IS, DMPlex, PetscSection) could be useful in the following case (of irregular domains): <br><br>
</div>Let's say that I have a 3D binary image (a cube).<br>The binary information of the image partitions the cube into a computational domain and non-computational domain. <br>I must solve a pde (say a Poisson equation) only on the computational domains (e.g: two isolated spheres within the cube). I'm using finite difference and say a dirichlet boundary condition<br>
</div><div><br>I know that I can create a dmda that will let me access the information from this 3D binary image, get all the coefficients, rhs values etc using the natural indexing (i,j,k).<br><br>Now, I would like to create a matrix corresponding to the laplace 
operator (e.g. with standard 7 pt. stencil), and the corresponding RHS 
that takes care of the dirchlet values too. <br></div><div>But in this matrix it should have the rows corresponding to the nodes only on the computational domain. It would be nice if I can easily (using (i,j,k) indexing) put on the rhs dirichlet values corresponding to the boundary points. <br>
Then, once the system is solved, put the values of the solution back to the corresponding positions in the binary image.<br></div><div>Later, I might have to extend this for the staggered grid case too.<br></div><div>So is petscsection or dmplex suitable for this so that I can set up the matrix with something like DMCreateMatrix ? Or what would you suggest as a suitable approach to this problem ?<br>
</div><div><br></div><div>I have looked at the manual and that led me to search for a simpler examples in petsc src directories. But most of the ones I encountered are with FEM (and I'm not familiar at all with FEM, so these examples serve more as a distraction with FEM jargon!) <br>
<br></div>Thanks,<br>Bishesh<br></div>