Skip to content
Snippets Groups Projects
Commit bcd8bb9d authored by Andreas Dedner's avatar Andreas Dedner
Browse files

minor bug fix to convex/concave well

parent a4575faf
No related tags found
No related merge requests found
......@@ -32,22 +32,22 @@ def Implicit(phaseModel, phi, phiK):
assert phaseModel.inspectDict['numPhases'] > 1
if phaseModel.inspectDict['isotropic'] == True:
return Implicit3p(phaseModel.surfaceVec(), phi)
return Implicit3p(phaseModel.surfaceVec(), phi, phiK)
else:
return Implicit3p([1,1,-1], phi)
return Implicit3p([1,1,-1], phi, phiK)
def ConcaveConvex(phaseModel, phi, phiK):
assert phaseModel.inspectDict['numPhases'] > 1
if phaseModel.inspectDict['isotropic'] == True:
if phaseModel.inspectDict['numPhases'] == 2:
return ConcaveConvex3p(phaseModel.surfaceVec(), as_vector([phi[0],phi[1],0]),
as_vector([phiK[0],phiK[1],0]))
return ConcaveConvex3p(phaseModel.surfaceVec(), ufl.as_vector([phi[0],phi[1],0]),
ufl.as_vector([phiK[0],phiK[1],0]))
else:
return ConcaveConvex3p(phaseModel.surfaceVec(), phi, phiK)
else:
return ConcaveConvex3p([1,1,-1], as_vector([phi[0],phi[1],0]),
as_vector([phiK[0],phiK[1],0]))
return ConcaveConvex3p([1,1,-1], ufl.as_vector([phi[0],phi[1],0]),
ufl,as_vector([phiK[0],phiK[1],0]))
def ConcaveConvex3p(surfaceVec, phi, phiK):
def fplus(x):
......@@ -56,6 +56,7 @@ def ConcaveConvex3p(surfaceVec, phi, phiK):
def fminus(x):
return (1/16)*(1-2*(2*x-1)*(2*x-1))
surfaceVec += (3-len(surfaceVec))*[0] # we need surfaceVec to have exactly 3 components also in 2 phase case
sigmaPlus = np.maximum(surfaceVec, np.zeros(3))
sigmaMinus = -np.minimum(surfaceVec, np.zeros(3))
......@@ -69,7 +70,7 @@ def ConcaveConvex3p(surfaceVec, phi, phiK):
return 9*(convex+concave)
def Implicit3p(surfaceVec,phi):
def Implicit3p(surfaceVec,phi,phiK):
return 9/2*sum([ sv*quadratic(p) for sv,p in zip(surfaceVec,phi) ]) # (surfaceVec[0]*quadratic(phi[0])+surfaceVec[1]*quadratic(phi[1])+ surfaceVec()*quadratic(phi[2]))
def SmoothStep(phi, phiK, a):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment