Calcifer
Under construction
Calcifer is a Poisson-like PDE finite difference solver on 2-D structured I.J Grids. Grids are curvilinear.
- create a Geometry object.
- define the computational Domain, based upon this Geometry.
- Solve the problem. Heat conduction is solver in HeatSolve from Calcifer.
Thermal diffusion, solver by calcifer.
A thermal diffusion test with calcifer is done like this:
from calcifer_pde.domain import Domain
from calcifer_pde.geometry import Square
def heat_solve(dom, k_coeff=1.0):
init_field = np.random.random_sample(dom.shp1d)
sterm_l = np.zeros_like(dom.lapl)
sterm_r = np.zeros(dom.shp1d)
# Left Hand Side
lhs_csr = dom.lapl * k_coeff + sterm_l
# Right-Hand Side
rhs_csr = np.zeros(dom.shp1d) + sterm_r
lhs_csr_bc, rhs_csr_bc, grad_n_bc = apply_bc(dom, lhs_csr, rhs_csr)
out_1d, info = scp.linalg.bicgstab(lhs_csr_bc, rhs_csr_bc, x0=init_field)
if info == 0:
print(". ^_^ Resolution succesfull.")
elif info > 0:
print(". t(-_-t) Resolution failed.")
else:
print(". =_= Convergence not reached.")
temp = out_1d.reshape(dom.shp2d)
return temp
geo = Square(nx=80, ny=100, len_x=1.0, len_y=1.0)
dom = Domain(geo)
dom.switch_bc_vmax_neuman(0.0)
dom.switch_bc_vmin_neuman(0.0)
dom.switch_bc_umin_dirichlet(200.0)
dom.switch_bc_umax_dirichlet(100.0)
sol = heat_solve(dom, k_coeff=22.0)
One can solve an other PDE by creating a different problem than heat solve
Metadata
Release files for calcifer-pde 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| calcifer_pde-0.1.1.tar.gz | 9.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| calcifer_pde-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.7 kB
Release files / calcifer_pde-0.1.1.tar.gz
| Download URL | calcifer_pde-0.1.1.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b6513526347d213437ec348b3bd452564228321619590bb25a5b55e901d9db84
|
|
BLAKE2b-256 checksum How to use checksums |
3b18689bec49a34ed412655714fd944963ff4ca25d7564f5440b8f2349f07b5d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.5
|
Release files / calcifer_pde-0.1.1-py3-none-any.whl
| Download URL | calcifer_pde-0.1.1-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ce7496953616a1cb234307b43fb18390f5a13a8b16e541da1ae58c580f47b745
|
|
BLAKE2b-256 checksum How to use checksums |
d785b8df1796fe41266df5a0ac9d15555c59021eded6f9b2c288874d2b306105
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.45.0 CPython/3.6.5
|