Skip to main content

Python Library for Finite Difference Calculation

Project description

MPGrid

Python Library for Finite Difference Calculation

Install

> pip install MPGrid

References

  • DATA
    • True = 1
    • False = 0
    • BoundInsulate = 0
    • BoundPeriodic = 1
    • InterCond = 0
    • InterTrans = 1

Class clone(...), copy(...), new(...), read(...)

  • clone(grid) : clone grid
    • grid : grid data
  • copy(grid, (x0, y0, z0), (x1, y1, z1)) : copy grid
    • grid : grid data
    • x0, y0, z0 : start point of region
    • x1, y1, z1 : end point of region
  • new(nx, ny, nz, ntype, [local_coef=FALSE]) : create new grid
    • nx, ny, nz : number of elements in x, y, z direction
    • ntype : number of types
    • local_coef : local coefficient mode if true
  • read(fname, [version=2]) : read grid from file
    • fname : file name
    • version : version of data format
  • CLASS METHODS
    • ave_val((x0, y0, z0), (x1, y1, z1)) : average values of region
    • count_type(type, (x0, y0, z0), (x1, y1, z1)) : count type in region
    • cylinder_type(type, (x0, y0, z0), (x1, y1, z1), dir, [margin=0.33]) : fill type in cylinder shape
    • cylinder_update(update, (x0, y0, z0), (x1, y1, z1), dir, [margin=0.33]) : fill update in cylinder
    • cylinder_val(val, (x0, y0, z0), (x1, y1, z1), dir, [margin=0.33]) : fill value in cylinder shape
    • ellipsoid_type(type, (x0, y0, z0), (x1, y1, z1), [margin=0.33]) : fill type in ellipsoid shape
    • ellipsoid_update(update, (x0, y0, z0), (x1, y1, z1), [margin=0.33]) : fill update in ellipsoid shape
    • ellipsoid_val(val, (x0, y0, z0), (x1, y1, z1), [margin=0.33]) : fill value in ellipsoid shape
    • estimate_dt([ratio=1.0]) : estimate dt
    • fill_local_coef((cx, cy, cz), (x0, y0, z0), (x1, y1, z1)) : fill value
    • fill_type(type, (x0, y0, z0), (x1, y1, z1)) : fill type
    • fill_update(update, (x0, y0, z0), (x1, y1, z1)) : fill update
    • fill_val(val, (x0, y0, z0), (x1, y1, z1)) : fill value
    • gauss_random(type, num, spdis, (x0, y0, z0), (x1, y1, z1)) : set type by gauss random
    • get_coef(i, j) : get coefficient
    • get_inter(i, j) : get interface type
    • get_inter_coef(i, j) : get interface type and coefficient
    • get_local_coef((x, y, z)) : get local coefficient
    • get_rhoc(i) : get coefficient, rhoc x c
    • get_type((x, y, z)) : get type
    • get_update((x, y, z)) : get update
    • get_val((x, y, z)) : get value
    • ref_local_coef() : reflect local coefficient with coefficient table
    • set_coef1(coef, i, j) : set coefficient
    • set_coef3((coef_x, coef_y, coef_z), i, j) : set coefficient
    • set_inter1(inter, i, j) : set interface type
    • set_inter3((inter_x, inter_y, inter_z), i, j) : set interface type
    • set_inter_coef1(inter, coef, i, j) : set interface type and coefficient
    • set_inter_coef3((inter_x, inter_y, inter_z), (coef_x, coef_y, coef_z), i, j) : set interface type and coefficient
    • set_local_coef((cx, cy, cz), (x, y, z)) : set local coefficient
    • set_local_coef1(c, type0, type1) : set local coefficient by type
    • set_local_coef3((cx, cy, cz), type0, type1) : set local coefficient by type
    • set_rhoc(rhoc, i) : set coefficient, rhoc x c
    • set_type(type, (x, y, z)) : set type
    • set_update(update, (x, y, z)) : set update
    • set_val(val, (x, y, z)) : set value
    • solve(dt, nloop) : solve
    • uniform_random(type, num, (x0, y0, z0), (x1, y1, z1)) : set type by uniform random
    • write(fname, comp) : write grid data
  • CLASS DATA
    • bound = (xl, yl, zl, xu, yu , zu) : boundary condition (Updateable)
    • element = (ex, ey, ez) : size of element (Updateable)
    • local_coef : flag of local coefficient mode
    • ntot : total number of allocated elements
    • ntype : number of type
    • rand_seed = seed : seed of random number (Updateable)
    • size : cell size
    • step : calculated step

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

MPGrid-0.0.5.tar.gz (292.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

MPGrid-0.0.5-cp311-cp311-win_amd64.whl (62.0 kB view details)

Uploaded CPython 3.11Windows x86-64

File details

Details for the file MPGrid-0.0.5.tar.gz.

File metadata

  • Download URL: MPGrid-0.0.5.tar.gz
  • Upload date:
  • Size: 292.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for MPGrid-0.0.5.tar.gz
Algorithm Hash digest
SHA256 36f4dba71c73754efbcb34e76fd4d647d5df50bc7c036ea79f1c847643a68fd2
MD5 684fc495322d864c227e8790c2740bcd
BLAKE2b-256 037988efb7cb3b52c7701561e4b870def437ecd2e997e083acdeec5b860d4dbe

See more details on using hashes here.

File details

Details for the file MPGrid-0.0.5-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: MPGrid-0.0.5-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 62.0 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for MPGrid-0.0.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 6f900bd44cb09867a6eadcb9fdb667c174c1ad893e26a853979517f6be35cf5a
MD5 4e3b82f7f4d2a62d6c8b0ba1c7e0180e
BLAKE2b-256 59fd03423ea2a5317dd66ae3e367f817ae61f726c8a779f13a1166edd428eb3d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page