Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
weihuayi committed Jun 9, 2020
1 parent 6812c1c commit 6dfd64c
Show file tree
Hide file tree
Showing 15 changed files with 2,359 additions and 496 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ def matrix_A(self):
"""
"""
p = self.p # 空间次数
idof0 = (p+1)*p//2-1
idof0 = (p+1)*p//2-1 # k-1 次多项式空间的梯度空间
cell2dof = self.dof.cell2dof
cell2dofLocation = self.dof.cell2dofLocation
mesh = self.mesh
Expand Down Expand Up @@ -719,10 +719,11 @@ def f1(i):
return S + U.T@H0@U

A = list(map(f1, range(NC)))
idof = p*(p-1)
idof = p*(p-1) #
def f2(i):
s = slice(cell2dofLocation[i], cell2dofLocation[i+1])
cd = np.r_[cell2dof[s], NE*p + cell2dof[s], 2*NE*p + np.arange(i*idof, (i+1)*idof)]
print(cd)
return np.meshgrid(cd, cd)

idx = list(map(f2, range(NC)))
Expand Down
15 changes: 14 additions & 1 deletion fealpy/mesh/ATriMesher.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,20 @@ def __init__(self, domain):
domain : HalEdgeDomain
"""
self.domain = domain
self.mesh = domain.to_halfedgemesh()


self.maxNN = 100000
self.maxNE = 100000
self.maxNC = 100000
self.GD = 2
self.node = np.zeros((self.maxNN, self.GD), dtype=np.float)
self.halfedge = np.zeros((2*self.maxNE, ), dtype=np.int)

self.node = domain.vertices.copy()
self.halfedge = domain.halfedge.copy()
self.subdomain, _, j = np.unique(halfedge[:, 1],
return_index=True, return_inverse=True)
self.halfedge[:, 1] = j

def uniform_boundary_meshing(self, refine=4, maxh=0.1):
self.domain.boundary_uniform_refine(n=refine)
Expand Down
Loading

0 comments on commit 6dfd64c

Please sign in to comment.