Skip to content
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

Merged
merged 6 commits into from
Oct 5, 2018

Conversation

mlin865
Copy link
Contributor

@mlin865 mlin865 commented Oct 2, 2018

No description provided.

@@ -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'])
Copy link
Member

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):
Copy link
Member

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):
Copy link
Member

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:
Copy link
Member

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:
Copy link
Member

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:
Copy link
Member

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:
Copy link
Member

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.

@rchristie rchristie merged commit 77a0f33 into ABI-Software:master Oct 5, 2018
@mlin865 mlin865 deleted the bicubicSphereShell branch October 5, 2018 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants