Commit 5e7f1df7 authored by Andreas Dedner's avatar Andreas Dedner
Browse files

small fix

parent fa805c8a
...@@ -71,11 +71,15 @@ class InspectSharp: ...@@ -71,11 +71,15 @@ class InspectSharp:
self.inspectDict['dimDomain'] = self.SharpDef.dimDomain self.inspectDict['dimDomain'] = self.SharpDef.dimDomain
except AttributeError: except AttributeError:
try: try:
assert len(self.SharpDef.omega)==2,\ if len(self.SharpDef.omega)==2:
"The definition of omega is not consistent, "\ self.inspectDict['dimDomain'] = self.SharpDef.omega[1]
+"either provide a `dimDomain` attribute or use, "\ if len(self.SharpDef.omega)==3:
+"or provide a (file name,dimDomain) pair" self.inspectDict['dimDomain'] = len(self.SharpDef.omega[0])
self.inspectDict['dimDomain'] = self.SharpDef.omega[1] else:
print("The definition of omega is not consistent, "\
+"either provide a `dimDomain` attribute, "\
+"use a [[p0],[p1],[N]] tripple or "\
+"provide a (file name,dimDomain) pair")
except TypeError: except TypeError:
raise ValueError("The definition of omega isn't consistent") raise ValueError("The definition of omega isn't consistent")
......
...@@ -4,7 +4,7 @@ with open("README.md", "r") as fh: ...@@ -4,7 +4,7 @@ with open("README.md", "r") as fh:
long_description = fh.read() long_description = fh.read()
setup(name="phasefield", setup(name="phasefield",
version="1.0", version="1.0.1",
author="Matthew Collins and Andreas Dedner", author="Matthew Collins and Andreas Dedner",
author_email="a.s.dedner@warwick.ac.uk", author_email="a.s.dedner@warwick.ac.uk",
description="Interface problem solver based on the phase-field methodology", description="Interface problem solver based on the phase-field methodology",
......
...@@ -9,7 +9,8 @@ from phasefield import PhaseModel ...@@ -9,7 +9,8 @@ from phasefield import PhaseModel
class Mcf: class Mcf:
"""Sharp definition for mean curvature flow.""" """Sharp definition for mean curvature flow."""
dimDomain = 2 # dimDomain = 2
omega = [[0,0],[2,2],[10,10]]
endTime = 0.125 endTime = 0.125
saveStep = 0.001 saveStep = 0.001
mobility = 1 mobility = 1
...@@ -44,4 +45,4 @@ if __name__ == "__main__": ...@@ -44,4 +45,4 @@ if __name__ == "__main__":
phi = Coefficient(space) phi = Coefficient(space)
phiN = Coefficient(space) phiN = Coefficient(space)
extend = lambda p: as_vector([p,1-p]) extend = lambda p: as_vector([p,1-p])
form = phaseField.setupPhase(extend(phi), extend(phiN), None, None, extend(vPhi), None) form = phaseField.setupPhase(extend(phi), extend(phiN), None, None, as_vector([vPhi,0]), None)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment