Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
phasefield
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dune-fem
phasefield
Commits
bcd8bb9d
Commit
bcd8bb9d
authored
5 years ago
by
Andreas Dedner
Browse files
Options
Downloads
Patches
Plain Diff
minor bug fix to convex/concave well
parent
a4575faf
Branches
feature/wellCleanUp
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
phasefield/auxfun.py
+8
-7
8 additions, 7 deletions
phasefield/auxfun.py
with
8 additions
and
7 deletions
phasefield/auxfun.py
+
8
−
7
View file @
bcd8bb9d
...
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment