## [Libmesh-users] Solving Poisson's equation in a fixed 2-d grid

 [Libmesh-users] Solving Poisson's equation in a fixed 2-d grid From: Paul Hilscher - 2010-11-20 09:18:23 ```Dear libmesh users, I would like to use libmesh to solve Poisson's equation which was previously done using the Fourier Method. I made myself familiar with this issue using the libmesh examples ex3.C and ex4.C. Unfortunately these are of limited help to me, because I need to solve for a 2-d array rho(x,y), with already fixed values for x_1, x_2, ...., x_n; y_1, .....y_n. [ I need to calculate the electric potential from a charge density for further using the potential in a Vlasov solver. ] Example ex3 uses MeshTools::Generation::build_square & QGauss for the mesh which uses somewhat arbitrary points in (x,y), which I cannot map onto my 2-d array rho(x,y). I guess I need to construct my "own" mesh for this case but as I am very new to FEM and libmesh I don't know exactly how. Could somebody provide my a reference how to do this or some clues ? I looked up the class documentation but couldn't find anything. Thank you very much for your help !! Paul Hilscher ```

 [Libmesh-users] Solving Poisson's equation in a fixed 2-d grid From: Paul Hilscher - 2010-11-20 09:18:23 ```Dear libmesh users, I would like to use libmesh to solve Poisson's equation which was previously done using the Fourier Method. I made myself familiar with this issue using the libmesh examples ex3.C and ex4.C. Unfortunately these are of limited help to me, because I need to solve for a 2-d array rho(x,y), with already fixed values for x_1, x_2, ...., x_n; y_1, .....y_n. [ I need to calculate the electric potential from a charge density for further using the potential in a Vlasov solver. ] Example ex3 uses MeshTools::Generation::build_square & QGauss for the mesh which uses somewhat arbitrary points in (x,y), which I cannot map onto my 2-d array rho(x,y). I guess I need to construct my "own" mesh for this case but as I am very new to FEM and libmesh I don't know exactly how. Could somebody provide my a reference how to do this or some clues ? I looked up the class documentation but couldn't find anything. Thank you very much for your help !! Paul Hilscher ```
 Re: [Libmesh-users] Solving Poisson's equation in a fixed 2-d grid From: Roy Stogner - 2010-11-20 10:53:28 ```On Sat, 20 Nov 2010, Paul Hilscher wrote: > Example ex3 uses MeshTools::Generation::build_square & QGauss for the mesh > which uses somewhat arbitrary points in (x,y), which > I cannot map onto my 2-d array rho(x,y). I guess I need to construct my > "own" mesh for this case but as I am very new to FEM > and libmesh I don't know exactly how. Could somebody provide my a reference > how to do this or some clues ? To generate a rectilinear mesh with points at just the x(i) and y(i) locations you want, your best bet is to probably use build_square with temporary locations, then loop over all nodes moving each from its temporary to its permanent location. Just make sure the two don't overlap. --- Roy ```