-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Linear basis through wall for sphere shell #23
Conversation
@@ -98,6 +102,7 @@ def generateBaseMesh(region, options): | |||
elementsCountUp = options['Number of elements up'] | |||
elementsCountThroughWall = options['Number of elements through wall'] | |||
useCrossDerivatives = options['Use cross derivatives'] | |||
useCubicHermite = not(options['Use linear through wall']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename this useCubicThroughWall
, since cubic still applies elsewhere even if linear through wall.
@@ -100,21 +100,21 @@ def createEftShellPole90(self, quadrant): | |||
assert eft.validate(), 'eftfactory_tricubichermite.createEftShellPole90: Failed to validate eft' | |||
return eft | |||
|
|||
def createEftShellApexBottom(self, nodeScaleFactorOffset0, nodeScaleFactorOffset1): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very good that you changed the name... please search through other mesh types to ensure they use the new name. I'm sure there are a couple.
return eft | ||
|
||
def createEftShellApexTop(self, nodeScaleFactorOffset0, nodeScaleFactorOffset1): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above... very good that you changed the name... please search through other mesh types to ensure they use the new name. I'm sure there are a couple.
@@ -311,7 +324,10 @@ def generateBaseMesh(region, options): | |||
for e1 in range(elementsCountAround): | |||
va = e1 | |||
vb = (e1 + 1)%elementsCountAround | |||
eft1 = tricubichermite.createEftShellApexBottom(va*100, vb*100) | |||
if useCubicHermite: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per previous comment, with eftfactory, using duck typing can replace this with just:
eft1 = eftfactory.createEftShellPoleBottom(va*100, vb*100)
eft = tricubichermite.createEftBasic() | ||
|
||
tricubicHermiteBasis = fm.createElementbasis(3, Elementbasis.FUNCTION_TYPE_CUBIC_HERMITE) | ||
if useCubicHermite: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can use 'duck typing' feature of Python:
if useCubicThroughWall:
eftfactory = eftfactory_tricubichermite(mesh, useCrossDerivatives)
else:
eftfactory = eftfactory_bicubichermitelinear(mesh, useCrossDerivatives)
eft = eftfactory.createEftBasic()
As per the last line above, then use eftfactory
throughout the script without needing to check. 'duck typing' means it will call the appropriate method on eftfactory
provided it has the same name and signature.
@@ -311,7 +323,10 @@ def generateBaseMesh(region, options): | |||
for e1 in range(elementsCountAround): | |||
va = e1 | |||
vb = (e1 + 1)%elementsCountAround | |||
eft1 = tricubichermite.createEftShellApexBottom(va*100, vb*100) | |||
if useCubicHermiteThroughWall: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 4 lines should just be:
eft1 = eftfactory.createEftShellPoleBottom(va*100, vb*100)
as the same code is called in both cases.
@@ -357,7 +372,10 @@ def generateBaseMesh(region, options): | |||
for e1 in range(elementsCountAround): | |||
va = e1 | |||
vb = (e1 + 1)%elementsCountAround | |||
eft1 = tricubichermite.createEftShellApexTop(va*100, vb*100) | |||
if useCubicHermiteThroughWall: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These 4 lines should just be:
eft1 = eftfactory.createEftShellPoleTop(va*100, vb*100)
as the same code is called in both cases.
No description provided.