-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchem.py
73 lines (35 loc) · 1.18 KB
/
chem.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# -*- coding: utf-8 -*-
"""
chemical.py
===========
"""
import numpy as np
__all__ = ["Chem"]
class Chem(object):
def __init__(self,n_sp,grid,XN):
self.num = n_sp
if self.num!=2 and len[XN]!=1:
raise ValueError(' currently,only two species are supported')
else:
self.XN=XN
print "Flory-Huggins param:",XN
self.__create_operator(grid)
def __create_operator(self,grid):
'''
'''
self.W=np.zeros((self.num,len(grid.x),len(grid.y),len(grid.z)))
self.R=np.zeros((self.num,len(grid.x),len(grid.y),len(grid.z)))
class Loop(object):
def __init__(self,n_sp,grid,XN):
self.num = n_sp
if self.num!=2 and len[XN]!=1:
raise ValueError(' currently,only two species are supported')
else:
self.XN=XN
print "Flory-Huggins param:",XN
self.__create_operator(grid)
def __create_operator(self,grid):
'''
'''
self.W=np.zeros((self.num,len(grid.x),len(grid.y),len(grid.z)))
self.R=np.zeros((self.num,len(grid.x),len(grid.y),len(grid.z)))