-
Notifications
You must be signed in to change notification settings - Fork 240
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
Added ansys calculator functions #76
Conversation
Two functions that return vectors tangent and normal to a surface. I used it to calculate surface participation ratios, e.g.: p_metal = t* (E_surface_metal / UE) print(f'Metal-Air/Metal-Substrate participation ratio, p_MA = p_MS = {p_metal:.3}') #SA participation ratio vecE_normal = vecE.normal2surface('chip_holder1').__div__(epsilon_r) #Complex Vector vecE_tangent = vecE.tangent2surface('chip_holder1').__mul__(epsilon_r) #Complex Vector vec_E_total = vecE_normal.__add__(vecE_tangent) E_squared = vec_E_total.dot(vecE).__abs__().real().__pow__(2) E_surface = E_squared.integrate_surf(name='chip_holder1').evaluate() E_surface -= E_surface_metal p_SA = t* (E_surface / UE) print(f'Air-Substrate participation ratio, p_SA = {p_SA:.3}')
Also one change where an error is raised when `pint` is not properly imported.
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.
Thank you! Great job!
pyEPR/ansys.py
Outdated
@@ -41,21 +41,22 @@ | |||
try: | |||
import pythoncom | |||
except (ImportError, ModuleNotFoundError): | |||
pass | |||
raise NameError ("pythoncom module not installed. Please install.") |
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.
We need to make sure this can load on mac and other platforms without a warning, so we don't want it to crash in Metal and other dependencies :)
@@ -2936,6 +2937,30 @@ def getQty(self, name): | |||
def integrate_line(self, name): | |||
return self._integrate(name, "EnterLine") | |||
|
|||
def normal2surface(self, name): |
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.
Great!
@@ -445,7 +445,7 @@ def analyze_all_variations(self, | |||
|
|||
Specific params: | |||
-------------------- | |||
variations : None returns all_variations otherwis this is a list with number | |||
variations : None returns all_variations otherwise this is a list with number |
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.
Great!!
Two functions that return vectors tangent and normal to a surface.
I used it to calculate surface participation ratios: