Source: examples/poisson
Poisson examples¶
The upstream examples/poisson folder collects static scalar-field problems built around the "poisson" element. The shipped cases cover generated meshes, imported Gmsh meshes, analytic benchmark materials, mixed Dirichlet/Neumann boundary conditions, and nonlinear Poisson materials.
Files in this folder¶
poisson-1d.json: generated 1Dedge2mesh withconstpoissonmaterial and Dirichlet values on both ends.poisson-1d-benchmark.json: 1D benchmark case usingpoisson1d-benchmark, projection of"exactsolution", and the companion plotting scriptplot-poisson1dbenchmark.py.poisson-2d.json: generated 2Dquad4mesh with a constant source term.poisson-2d-quad8.json: the same problem on a higher-orderquad8mesh.poisson-2d-benchmark.json: generated 2D benchmark withpoisson2d-benchmarkmaterial and the dedicatedpoisson2dbenchmarkboundary condition.poisson-2d-cookmembrane.json: the same 2D benchmark on an imported Gmsh mesh fromcookmembrane2d.msh.poisson-2d-msh-neumann.json: imported mesh with mixed Dirichlet and Neumann boundary conditions.poisson-2d-nonlinear.json: nonlinear 2D Poisson case usingnonlinear-poisson2don an imported Gmsh cube slice.poisson-3d-nonlinear.json: nonlinear 3D Poisson case usingnonlinear-poisson3d.- Geometry helpers:
cookmembrane2d.geoandcubic.geo.
Representative input¶
The simplest generated-mesh case is poisson-2d.json:
json
{
"mesh": {
"type": "asfem",
"dim": 2,
"nx": 20,
"ny": 20,
"meshtype": "quad4",
"savemesh": true
},
"dofs": {
"names": ["phi"]
},
"elements": {
"elmt1": {
"type": "poisson",
"dofs": ["phi"],
"material": {
"type": "constpoisson",
"parameters": {
"sigma": 1.0,
"f": 0.1
}
}
}
},
"projection": {
"type": "default",
"vectormate": ["gradu"]
},
"bcs": {
"left": {
"type": "dirichlet",
"dofs": ["phi"],
"bcvalue": 0.0,
"side": ["left"]
}
},
"job": {
"type": "static",
"print": "dep"
}
}
Notes¶
- All Poisson examples use the single DoF name
"phi"and the"poisson"element type. - Benchmark inputs use the materials
poisson1d-benchmarkorpoisson2d-benchmark, and the 2D benchmark cases also use the special boundary condition"type":"poisson2dbenchmark". - Nonlinear cases switch the material to
nonlinear-poisson2dornonlinear-poisson3dand use"nlsolver":{"type":"newton"}. - Several upstream files still include
"restart": trueinside"job", but the currentReadJobBlock.cpponly reads"type"and"print".